Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
H
hg-smart
Overview
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
platform
hg-smart
Commits
9573dd18
Commit
9573dd18
authored
Aug 06, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-08-05 销售开票本次开票金额加累计开票金额不能超出销售合同金额20%,如果要超出20%需要提示业务新增补充协议
parent
90b1b389
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
19 additions
and
6 deletions
+19
-6
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+19
-6
No files found.
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
9573dd18
...
...
@@ -320,20 +320,28 @@ public class HGCWTools {
List
<
HGCW002
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW002
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"contractNumber"
,
contractNumber
);}
});
BigDecimal
totalAmount
=
HgCw011
.
sumSettlementNumber
(
contractNumber
);
if
(
CollectionUtils
.
isEmpty
(
results
))
{
throw
new
PlatException
(
"找不到对应的合同!"
);
}
BigDecimal
totalAmount
=
HgCw011
.
sumSettlementNumber
(
contractNumber
);
//获取累计开票金额
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
HGCW002
hgcw002
=
results
.
get
(
0
);
List
<
HGCW002
>
hgcw002List
=
DaoBase
.
getInstance
().
query
(
"HGCW010D.sumContractPrice"
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"contractNumberStr"
,
contractNumber
);}
});
BigDecimal
remaining
=
hgcw002List
.
get
(
0
).
getTotalContractPriceIncluding
().
add
(
hgcw002List
.
get
(
0
).
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(
"0.2"
)));
BigDecimal
remaining
=
hgcw002
.
getTotalContractPriceIncluding
();
if
(
hgcw002
.
getContractType
()
==
1
||
hgcw002
.
getContractType
()
==
5
){
//获取销售合同金额和补充协议金额
List
<
HGCW002
>
hgcw002List
=
DaoBase
.
getInstance
().
query
(
"HGCW010D.sumContractPrice"
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"contractNumberStr"
,
contractNumber
);}
});
//计算销售合同金额的20%的总金额 总金额=合同金额+合同金额的20%
remaining
=
hgcw002List
.
get
(
0
).
getTotalContractPriceIncluding
().
add
(
hgcw002List
.
get
(
0
).
getTotalContractPriceIncluding
().
multiply
(
new
BigDecimal
(
"0.2"
)));
}
//合同总金额-(累计开票金额+本次来票金额)
BigDecimal
remainingAmount
=
new
BigDecimal
(
decimalFormat
.
format
(
remaining
.
subtract
(
deductionAmount
.
add
(
totalAmount
))));
if
(
remainingAmount
.
compareTo
(
new
BigDecimal
(
BigInteger
.
ZERO
))
<
0
)
{
throw
new
PlatException
(
"本次开票金额加累计开票金额超出销售合同金额20%,超出20%需要业务新增补充协议"
);
throw
new
PlatException
(
"本次开票金额加累计开票金额超出销售合同金额20%,超出20%需要业务新增补充协议
!
"
);
}
BigDecimal
remainingCount
=
new
BigDecimal
(
decimalFormat
.
format
(
hgcw002
.
getRemainingAmount
().
subtract
(
deductionAmount
)));
hgcw002
.
setRemainingAmount
(
remainingCount
);
DaoUtils
.
update
(
"HGCW002.updateDeductionAmount"
,
hgcw002
);
...
...
@@ -723,6 +731,11 @@ public class HGCWTools {
return
results
;
}
/**
* 根据来源单号获取总金额
* @param settlementNumber 来源单号
* @return
*/
public
static
BigDecimal
sumSettlementNumber
(
String
settlementNumber
)
{
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
List
<
HGCW011
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW011
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
...
...
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