diff --git a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInBillEditPluginExt.java b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInBillEditPluginExt.java index 1164ff1..99f5644 100644 --- a/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInBillEditPluginExt.java +++ b/code/zcdev/zcgj-zcdev-zcdev-pr/src/main/java/zcgj/zcdev/zcdev/pr/plugin/form/MaterialInBillEditPluginExt.java @@ -467,7 +467,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen protected void initFormPage(int rowIndex) { /* this.getView().setEnable(true, rowIndex, new String[]{"lot", "lotid", "measureunit", "entrytaxrate", "price", "ismainmaterial"}); this.getView().setEnable(false, rowIndex, new String[]{"taxprice", "taxamount", "contprice", "oftaxamount", "notaxamount"});//系统源码*/ - this.getView().setEnable(true, rowIndex, new String[]{"lot", "lotid", "measureunit", "entrytaxrate", "price","ismainmaterial", "notaxamount"});//二开修改添加金额字段 + this.getView().setEnable(true, rowIndex, new String[]{"lot", "lotid", "measureunit", "entrytaxrate", "price", "ismainmaterial", "notaxamount"});//二开修改添加金额字段 this.getView().setEnable(false, rowIndex, new String[]{"taxprice", "taxamount", "contprice", "oftaxamount"});//二开修改去除金额字段 Boolean poundIn = (Boolean) this.getModel().getValue("poundin"); this.getView().setEnable(!poundIn, rowIndex, new String[]{"material", "modelnum", "qty"}); @@ -588,6 +588,9 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen // BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getModel().getValue("notaxamount"), i);//源码 BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getModel().getValue("notaxamount", i));//金额 //二开修改 BigDecimal qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", i));// 数量 + if (qty.compareTo(BigDecimal.ZERO) == 0) { + return; + } BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP);//金额 ÷ 数量 this.getModel().setValue("price", price, i);//"入库单价" = 金额 ÷ 数量