给应收应付的计算里面增加订金字段,解决计算逻辑bug

This commit is contained in:
季圣华
2022-06-03 00:31:30 +08:00
parent abdf93a7b7
commit 9ff1d99abf
3 changed files with 17 additions and 0 deletions

View File

@@ -580,11 +580,13 @@ public class DepotHeadService {
public BigDecimal findAllMoney(Integer supplierId, String type, String subType, String mode, String endTime)throws Exception {
String modeName = "";
BigDecimal allOtherMoney = BigDecimal.ZERO;
BigDecimal allDepositMoney = BigDecimal.ZERO;
if (mode.equals("实际")) {
modeName = "change_amount";
} else if (mode.equals("合计")) {
modeName = "discount_last_money";
allOtherMoney = depotHeadMapperEx.findAllOtherMoney(supplierId, type, subType, endTime);
allDepositMoney = depotHeadMapperEx.findDepositMoney(supplierId, type, subType, endTime);
}
BigDecimal result = BigDecimal.ZERO;
try{
@@ -595,6 +597,9 @@ public class DepotHeadService {
if(allOtherMoney!=null) {
result = result.add(allOtherMoney);
}
if(allDepositMoney!=null) {
result = result.subtract(allDepositMoney);
}
return result;
}