浏览代码

fix:结算单修改

CAYK\miaosen.zhao 2 天之前
父节点
当前提交
fd5177c21a

+ 3 - 2
src/main/java/com/sunxung/factoring/service/settlement/impl/SettlementManagementServiceImpl.java

@@ -1014,7 +1014,8 @@ public class SettlementManagementServiceImpl implements SettlementManagementServ
             AcceptanceGoodsInfo acceptanceGoodsInfo = acceptanceGoodsInfoService.getById(settlementGoodsInfo.getAcceptanceGoodsInfoId());
             number = number + 1;
             sum = sum.add(acceptanceGoodsInfo.getGoodsQuantity());
-            sumPrice = sumPrice.add(settlementGoodsInfo.getPurchaseTotalPrice().setScale(2, RoundingMode.HALF_UP));
+            BigDecimal purchasePrice = acceptanceGoodsInfo.getPurchasePrice() == null ? BigDecimal.ZERO : acceptanceGoodsInfo.getPurchasePrice();
+            sumPrice = sumPrice.add(purchasePrice.multiply(acceptanceGoodsInfo.getGoodsQuantity()));
 
             RowRenderData data = Rows.of(indexNumber + "", acceptanceGoodsInfo.getGoodsName(), acceptanceGoodsInfo.getGoodsFactory()
                             , acceptanceGoodsInfo.getGoodsType(), acceptanceGoodsInfo.getGoodsMaterial(), acceptanceGoodsInfo.getGoodsUnit()
@@ -1028,7 +1029,7 @@ public class SettlementManagementServiceImpl implements SettlementManagementServ
             indexNumber++;
         }
 
-        RowRenderData foot = Rows.of("合计", null, null, null, null, null, sum.toString(), null, sumPrice.toString())
+        RowRenderData foot = Rows.of("合计", null, null, null, null, null, sum.toString(), null, sumPrice.setScale(2, RoundingMode.HALF_UP).toString())
                 .center()
                 .textFontFamily("宋体")
                 .textFontSize(10)