Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
Kivii.Biz.Finances.V2.0
Project
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
陶然
Kivii.Biz.Finances.V2.0
Commits
44122079
Commit
44122079
authored
Jul 29, 2022
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化
parent
64a26bb1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
2 deletions
+2
-2
RestfulInvoice.cs
Src/Transforms/RestfulInvoice.cs
+2
-2
No files found.
Src/Transforms/RestfulInvoice.cs
View file @
44122079
...
...
@@ -265,7 +265,7 @@ namespace Kivii.Finances.Transforms
(
Payments
.
Sum
(
o
=>
o
.
Amount
)
!=
Items
.
Sum
(
o
=>
o
.
Amount
)).
ThrowIfTrue
(
"到账开票金额和发票金额不一致!"
);
}
var
conn
=
KiviiContext
.
GetOpenedDbConnection
<
Invoice
>();
var
exists
=
conn
.
Select
<
Invoice
>(
o
=>
Sql
.
In
(
o
.
SerialNumber
,
Items
.
ConvertAll
(
p
=>
p
.
SerialNumber
)));
//
var exists = conn.Select<Invoice>(o => Sql.In(o.SerialNumber, Items.ConvertAll(p => p.SerialNumber)));
//(conn.Exists<Invoice>(o => Sql.In(o.SerialNumber, Items.ConvertAll(p => p.SerialNumber)))).ThrowIfTrue("存在重复录入的发票信息");
List
<
Payment
>
preCorrelatingPayments
=
new
List
<
Payment
>();
...
...
@@ -299,7 +299,7 @@ namespace Kivii.Finances.Transforms
foreach
(
var
info
in
Items
)
{
//重复的发票,如果传了对应到账,那重复的发票就要抛异常,否则跳过
if
(!
exists
.
IsNullOrEmpty
()
&&
exists
.
Exists
(
o
=>
o
.
SerialNumber
==
info
.
SerialNumber
))
if
(
conn
.
Exists
<
Invoice
>
(
o
=>
o
.
SerialNumber
==
info
.
SerialNumber
))
{
if
(!
Payments
.
IsNullOrEmpty
())
throw
new
Exception
(
$"存在重复录入的发票信息:
{
info
.
SerialNumber
}
"
);
else
continue
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment