Quellcode durchsuchen

Merge branch 'master' of http://git.dongkesoft.com:9001/iBOSS-2.0-Mini/iboss-server-mdm

zhoux vor 1 Jahr
Ursprung
Commit
2a9f3cdcec

+ 1 - 1
src/main/java/com/dk/mdm/service/ivt/inventory/InventoryService.java

@@ -804,7 +804,7 @@ public class InventoryService extends BaseService<Inventory> {
         //存货资产
         inventory.setCostAmt(costAmt);
         //存货单价
-        inventory.setCostPrice(costAmt.compareTo(BigDecimal.ZERO) > 0 ?
+        inventory.setCostPrice(costAmt.compareTo(BigDecimal.ZERO) > 0 &&  inventory.getInvQty().compareTo(BigDecimal.ZERO) > 0 ?
                costAmt.divide(inventory.getInvQty(),BigDecimal.ROUND_HALF_UP) : BigDecimal.ZERO);
         inventoryMapper.updateAmtAndQty(inventory);
         //endregion