Commit a5fbad31d1054501f99d14badbe323c7d921d8cb

Authored by YunaiV
1 parent 90ea7b95

【修复】ERP:采购金额计算逻辑错误

yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseInServiceImpl.java
... ... @@ -140,7 +140,7 @@ public class ErpPurchaseInServiceImpl implements ErpPurchaseInService {
140 140 purchaseIn.setDiscountPercent(BigDecimal.ZERO);
141 141 }
142 142 purchaseIn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseIn.getTotalPrice(), purchaseIn.getDiscountPercent()));
143   - purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice().add(purchaseIn.getOtherPrice())));
  143 + purchaseIn.setTotalPrice(purchaseIn.getTotalPrice().subtract(purchaseIn.getDiscountPrice()).add(purchaseIn.getOtherPrice()));
144 144 }
145 145  
146 146 private void updatePurchaseOrderInCount(Long orderId) {
... ...
yudao-module-erp/yudao-module-erp-biz/src/main/java/cn/iocoder/yudao/module/erp/service/purchase/ErpPurchaseReturnServiceImpl.java
... ... @@ -136,7 +136,7 @@ public class ErpPurchaseReturnServiceImpl implements ErpPurchaseReturnService {
136 136 purchaseReturn.setDiscountPercent(BigDecimal.ZERO);
137 137 }
138 138 purchaseReturn.setDiscountPrice(MoneyUtils.priceMultiplyPercent(purchaseReturn.getTotalPrice(), purchaseReturn.getDiscountPercent()));
139   - purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice().add(purchaseReturn.getOtherPrice())));
  139 + purchaseReturn.setTotalPrice(purchaseReturn.getTotalPrice().subtract(purchaseReturn.getDiscountPrice()).add(purchaseReturn.getOtherPrice()));
140 140 }
141 141  
142 142 private void updatePurchaseOrderReturnCount(Long orderId) {
... ...