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
508d4c0e
Commit
508d4c0e
authored
Jul 17, 2024
by
liuyang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
2024-07-17 修复收款单录入收款金额,保存提示生成收款单失败,原因:扣款金额不能大于销售开票剩余金额bug
parent
ddefd6b2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
30 additions
and
5 deletions
+30
-5
ServiceHGCW014.java
.../java/com/baosight/hggp/hg/cw/service/ServiceHGCW014.java
+2
-2
HGCWTools.java
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
+28
-3
No files found.
src/main/java/com/baosight/hggp/hg/cw/service/ServiceHGCW014.java
View file @
508d4c0e
...
@@ -198,7 +198,7 @@ public class ServiceHGCW014 extends ServiceBase {
...
@@ -198,7 +198,7 @@ public class ServiceHGCW014 extends ServiceBase {
contractNumber
.
append
(
hgcw015
.
getContractNumber
()).
append
(
","
);
contractNumber
.
append
(
hgcw015
.
getContractNumber
()).
append
(
","
);
}
}
for
(
Map
m
:
resultRows
)
{
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlement
Number"
).
toString
();
String
c
=
m
.
get
(
"
bill
Number"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
rowMap
.
put
(
c
,
remainingAmount
);
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
remainingAmount
);
totalContractPriceIncluding
=
totalContractPriceIncluding
.
add
(
remainingAmount
);
...
@@ -222,7 +222,7 @@ public class ServiceHGCW014 extends ServiceBase {
...
@@ -222,7 +222,7 @@ public class ServiceHGCW014 extends ServiceBase {
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
Map
<
String
,
BigDecimal
>
rowMap
=
new
HashMap
<>();
for
(
Map
m
:
resultRows
)
{
for
(
Map
m
:
resultRows
)
{
String
c
=
m
.
get
(
"
settlement
Number"
).
toString
();
String
c
=
m
.
get
(
"
bill
Number"
).
toString
();
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
BigDecimal
remainingAmount
=
new
BigDecimal
(
m
.
get
(
"thisAmount"
).
toString
());
rowMap
.
put
(
c
,
remainingAmount
);
rowMap
.
put
(
c
,
remainingAmount
);
}
}
...
...
src/main/java/com/baosight/hggp/hg/cw/tools/HGCWTools.java
View file @
508d4c0e
...
@@ -596,13 +596,38 @@ public class HGCWTools {
...
@@ -596,13 +596,38 @@ public class HGCWTools {
DaoUtils
.
update
(
"HGCW010.update"
,
hgcw010
);
DaoUtils
.
update
(
"HGCW010.update"
,
hgcw010
);
}
}
}
}
public
static
void
cutAmount
(
String
settlementNumber
,
BigDecimal
cutAmount
)
{
public
static
void
cutAmount
(
String
billNumber
,
BigDecimal
cutAmount
)
{
AssertUtils
.
isNull
(
billNumber
,
"来源单号不能为空!"
);
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// }
List
<
HGCW010
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW010
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"billNumber"
,
billNumber
);}
});
if
(
CollectionUtils
.
isEmpty
(
results
))
{
throw
new
PlatException
(
"找不到对应的销售开票记录!"
);
}
DecimalFormat
decimalFormat
=
new
DecimalFormat
(
"#.000"
);
HGCW010
HGCW010
=
results
.
get
(
0
);
BigDecimal
remainingAmount
=
new
BigDecimal
(
decimalFormat
.
format
(
HGCW010
.
getRemainingAmount
().
subtract
(
cutAmount
)));
if
(
remainingAmount
.
compareTo
(
new
BigDecimal
(
BigInteger
.
ZERO
))
<
0
)
{
throw
new
PlatException
(
"扣款金额不能大于销售开票剩余金额!"
);
}
HGCW010
.
setRemainingAmount
(
remainingAmount
);
DaoUtils
.
update
(
"HGCW010.updateDeductionAmount"
,
HGCW010
);
}
public
static
void
cutAmount
(
String
settlementNumber
,
String
billNumber
,
BigDecimal
cutAmount
)
{
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
AssertUtils
.
isNull
(
settlementNumber
,
"来源单号不能为空!"
);
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// if (cutAmount.compareTo(new BigDecimal(BigInteger.ZERO)) <= 0) {
// throw new PlatException("扣款金额不能小于等于0!");
// throw new PlatException("扣款金额不能小于等于0!");
// }
// }
List
<
HGCW010
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW010
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
List
<
HGCW010
>
results
=
DaoBase
.
getInstance
().
query
(
HGCW010
.
QUERY
,
new
HashMap
<
String
,
Object
>(){
{
put
(
"settlementNumber"
,
settlementNumber
);}
{
put
(
"billNumber"
,
settlementNumber
);
put
(
"billNumber"
,
billNumber
);
}
});
});
if
(
CollectionUtils
.
isEmpty
(
results
))
{
if
(
CollectionUtils
.
isEmpty
(
results
))
{
throw
new
PlatException
(
"找不到对应的销售开票记录!"
);
throw
new
PlatException
(
"找不到对应的销售开票记录!"
);
...
@@ -882,7 +907,7 @@ public class HGCWTools {
...
@@ -882,7 +907,7 @@ public class HGCWTools {
rows
.
forEach
(
row
->
{
rows
.
forEach
(
row
->
{
HGCW015
hgcw015
=
new
HGCW015
();
HGCW015
hgcw015
=
new
HGCW015
();
hgcw015
.
fromMap
(
row
);
hgcw015
.
fromMap
(
row
);
String
contractNumber
=
row
.
get
(
"
settlement
Number"
).
toString
();
String
contractNumber
=
row
.
get
(
"
bill
Number"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
String
remainingAmount
=
row
.
get
(
"thisAmount"
).
toString
();
hgcw015
.
setContractNumber
(
contractNumber
);
hgcw015
.
setContractNumber
(
contractNumber
);
hgcw015
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
hgcw015
.
setTotalContractPriceIncluding
(
new
BigDecimal
(
remainingAmount
));
...
...
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