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
63b31c12
Commit
63b31c12
authored
Mar 11, 2024
by
陶然
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
优化核算日期计算算法
parent
ba0e6587
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
42 additions
and
10 deletions
+42
-10
InvoiceApplyExtension.cs
Src/Extensions/InvoiceApplyExtension.cs
+7
-3
PaymentExtension.cs
Src/Extensions/PaymentExtension.cs
+14
-6
RestfulPayment.cs
Src/Transforms/RestfulPayment.cs
+21
-1
No files found.
Src/Extensions/InvoiceApplyExtension.cs
View file @
63b31c12
...
...
@@ -99,11 +99,15 @@ namespace Kivii.Finances
}
}
}
if
(
payment
.
Metadata
==
null
)
payment
.
Metadata
=
new
Dictionary
<
string
,
string
>();
if
(
payment
.
InvoiceTime
!=
null
)
{
if
(
payment
.
InvoiceTime
.
Value
>
payment
.
OperateTime
)
payment
.
AuditTime
=
payment
.
InvoiceTime
;
else
payment
.
AuditTime
=
payment
.
OperateTime
;
payment
.
AddOnlyProperties
(
o
=>
o
.
AuditTime
);
if
(!
payment
.
Metadata
.
ContainsKey
(
"ManualAuditTime"
))
{
if
(
payment
.
InvoiceTime
.
Value
>
payment
.
OperateTime
)
payment
.
AuditTime
=
payment
.
InvoiceTime
;
else
payment
.
AuditTime
=
payment
.
OperateTime
;
payment
.
AddOnlyProperties
(
o
=>
o
.
AuditTime
);
}
//if (payment.AuditTime == null)
//{
...
...
Src/Extensions/PaymentExtension.cs
View file @
63b31c12
...
...
@@ -339,11 +339,15 @@ namespace Kivii.Finances
{
payment
.
InvoiceTime
=
invoiceTime
;
payment
.
AddOnlyProperties
(
o
=>
o
.
InvoiceTime
);
if
(
payment
.
Metadata
==
null
)
payment
.
Metadata
=
new
Dictionary
<
string
,
string
>();
if
(
payment
.
InvoiceTime
!=
null
)
{
if
(
payment
.
InvoiceTime
.
Value
>
payment
.
OperateTime
)
payment
.
AuditTime
=
payment
.
InvoiceTime
;
else
payment
.
AuditTime
=
payment
.
OperateTime
;
payment
.
AddOnlyProperties
(
o
=>
o
.
AuditTime
);
if
(!
payment
.
Metadata
.
ContainsKey
(
"ManualAuditTime"
))
{
if
(
payment
.
InvoiceTime
.
Value
>
payment
.
OperateTime
)
payment
.
AuditTime
=
payment
.
InvoiceTime
;
else
payment
.
AuditTime
=
payment
.
OperateTime
;
payment
.
AddOnlyProperties
(
o
=>
o
.
AuditTime
);
}
}
//if (payment.AuditTime == null)
//{
...
...
@@ -735,10 +739,14 @@ namespace Kivii.Finances
//splitPayment.Summary = string.Empty;
if
(!
remark
.
IsNullOrEmpty
())
splitPayment
.
Remark
+=
$"[认领备注:
{
remark
}
]"
;
splitPayment
.
OperateTime
=
payment
.
OperateTime
;
if
(
splitPayment
.
Metadata
==
null
)
splitPayment
.
Metadata
=
new
Dictionary
<
string
,
string
>();
if
(
splitPayment
.
InvoiceTime
!=
null
)
{
if
(
splitPayment
.
InvoiceTime
.
Value
>
splitPayment
.
OperateTime
)
splitPayment
.
AuditTime
=
payment
.
InvoiceTime
;
else
splitPayment
.
AuditTime
=
payment
.
OperateTime
;
if
(!
splitPayment
.
Metadata
.
ContainsKey
(
"ManualAuditTime"
))
{
if
(
splitPayment
.
InvoiceTime
.
Value
>
splitPayment
.
OperateTime
)
splitPayment
.
AuditTime
=
payment
.
InvoiceTime
;
else
splitPayment
.
AuditTime
=
payment
.
OperateTime
;
}
}
if
(
operatorKvid
!=
null
&&
operatorKvid
.
Value
!=
Guid
.
Empty
)
...
...
@@ -814,7 +822,7 @@ namespace Kivii.Finances
splitPayment
.
Type
=
paymentType
;
//金额设置
splitPayment
.
AuditorName
=
splitPayment
.
OperateTime
.
Year
.
ToString
();
splitPayment
.
AuditTime
=
payment
.
OperateTime
;
//
splitPayment.AuditTime = payment.OperateTime;
splitPayment
.
Amount
=
amountSplit
;
splitPayment
.
AmountSplited
=
0
;
splitPayment
.
AmountUsed
=
0
;
...
...
Src/Transforms/RestfulPayment.cs
View file @
63b31c12
...
...
@@ -3,6 +3,7 @@ using Kivii.Linq;
using
Kivii.Web
;
using
System
;
using
System.Collections.Generic
;
using
System.Data
;
using
System.Globalization
;
using
System.Linq
;
using
System.Text
;
...
...
@@ -13,7 +14,26 @@ namespace Kivii.Finances.Transforms
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
public
class
PaymentUpdate
:
RestfulUpdate
<
Payment
>
{
public
override
bool
OnPreRestfulUpdate
(
IRequest
req
,
IResponse
res
,
IDbConnection
dbConnection
,
IRestfulUpdateResponse
<
Payment
>
rtns
)
{
if
(
Item
.
OnlyPropertiesIsExist
(
o
=>
o
.
AuditTime
))
{
if
(
Item
.
Metadata
.
IsNullOrEmpty
())
{
Item
.
Metadata
=
new
Dictionary
<
string
,
string
>();
if
(
Item
.
AuditTime
!=
null
)
{
Item
.
Metadata
[
"ManualAuditTime"
]
=
true
.
ToString
();
}
else
{
Item
.
Metadata
[
"ManualAuditTime"
]
=
string
.
Empty
;
}
Item
.
AddOnlyProperties
(
o
=>
o
.
Metadata
);
}
}
return
base
.
OnPreRestfulUpdate
(
req
,
res
,
dbConnection
,
rtns
);
}
}
[
RequiresAnyRole
(
SystemRoles
.
Everyone
)]
...
...
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