Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
JSH ERP
Commits
9f2be3b8
Commit
9f2be3b8
authored
May 29, 2022
by
季圣华
Browse files
解决bug:会员的预付款能扣成负的
parent
b201858e
Changes
1
Hide whitespace changes
Inline
Side-by-side
jshERP-boot/src/main/java/com/jsh/erp/service/depotHead/DepotHeadService.java
View file @
9f2be3b8
...
...
@@ -132,6 +132,9 @@ public class DepotHeadService {
if
(
dh
.
getTotalPrice
()
!=
null
)
{
dh
.
setTotalPrice
(
dh
.
getTotalPrice
().
abs
());
}
if
(
dh
.
getDeposit
()
==
null
)
{
dh
.
setDeposit
(
BigDecimal
.
ZERO
);
}
if
(
StringUtil
.
isNotEmpty
(
dh
.
getSalesMan
()))
{
dh
.
setSalesManStr
(
personService
.
getPersonByMapAndIds
(
personMap
,
dh
.
getSalesMan
()));
}
...
...
@@ -750,7 +753,13 @@ public class DepotHeadService {
/**入库和出库处理预付款信息*/
if
(
BusinessConstants
.
PAY_TYPE_PREPAID
.
equals
(
depotHead
.
getPayType
())){
if
(
depotHead
.
getOrganId
()!=
null
)
{
supplierService
.
updateAdvanceIn
(
depotHead
.
getOrganId
(),
BigDecimal
.
ZERO
.
subtract
(
depotHead
.
getTotalPrice
()));
BigDecimal
currentAdvanceIn
=
supplierService
.
getSupplier
(
depotHead
.
getOrganId
()).
getAdvanceIn
();
if
(
currentAdvanceIn
.
compareTo
(
depotHead
.
getTotalPrice
())>=
0
)
{
supplierService
.
updateAdvanceIn
(
depotHead
.
getOrganId
(),
BigDecimal
.
ZERO
.
subtract
(
depotHead
.
getTotalPrice
()));
}
else
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_MEMBER_PAY_LACK_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_MEMBER_PAY_LACK_MSG
));
}
}
}
//根据单据编号查询单据id
...
...
@@ -817,7 +826,13 @@ public class DepotHeadService {
/**入库和出库处理预付款信息*/
if
(
BusinessConstants
.
PAY_TYPE_PREPAID
.
equals
(
depotHead
.
getPayType
())){
if
(
depotHead
.
getOrganId
()!=
null
){
supplierService
.
updateAdvanceIn
(
depotHead
.
getOrganId
(),
BigDecimal
.
ZERO
.
subtract
(
depotHead
.
getTotalPrice
().
subtract
(
preTotalPrice
)));
BigDecimal
currentAdvanceIn
=
supplierService
.
getSupplier
(
depotHead
.
getOrganId
()).
getAdvanceIn
();
if
(
currentAdvanceIn
.
compareTo
(
depotHead
.
getTotalPrice
())>=
0
)
{
supplierService
.
updateAdvanceIn
(
depotHead
.
getOrganId
(),
BigDecimal
.
ZERO
.
subtract
(
depotHead
.
getTotalPrice
().
subtract
(
preTotalPrice
)));
}
else
{
throw
new
BusinessRunTimeException
(
ExceptionConstants
.
DEPOT_HEAD_MEMBER_PAY_LACK_CODE
,
String
.
format
(
ExceptionConstants
.
DEPOT_HEAD_MEMBER_PAY_LACK_MSG
));
}
}
}
/**入库和出库处理单据子表信息*/
...
...
@@ -937,6 +952,9 @@ public class DepotHeadService {
if
(
dh
.
getTotalPrice
()
!=
null
)
{
dh
.
setTotalPrice
(
dh
.
getTotalPrice
().
abs
());
}
if
(
dh
.
getDeposit
()
==
null
)
{
dh
.
setDeposit
(
BigDecimal
.
ZERO
);
}
if
(
dh
.
getOperTime
()
!=
null
)
{
dh
.
setOperTimeStr
(
getCenternTime
(
dh
.
getOperTime
()));
}
...
...
Write
Preview
Supports
Markdown
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