优化入库单系统代码,1总运费变化逻辑添加;2材料总金额赋值逻辑修改
This commit is contained in:
parent
3baa766603
commit
f0464df02d
|
@ -275,7 +275,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
case "measureunit":
|
||||
this.entryMeasureunitChanged((DynamicObject) propValue, curIndex);
|
||||
break;
|
||||
case "purchaseorder":
|
||||
case "purchaseorder"://采购订单
|
||||
this.purchaseOrderChanged((DynamicObject) propValue, curIndex);
|
||||
break;
|
||||
case "transtype":
|
||||
|
@ -491,10 +491,10 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
}
|
||||
|
||||
protected void entrymataxrateChanged(DynamicObject propValue, int i) {
|
||||
boolean isAdjustamount = this.getModel().getDataEntity().getBoolean("adjustamount");
|
||||
boolean isAdjustoftax = this.getModel().getDataEntity().getBoolean("adjustoftax");
|
||||
boolean isInputtaxprice = this.getModel().getDataEntity().getBoolean("inputtaxprice");
|
||||
boolean isInputtotalprice = this.getModel().getDataEntity().getBoolean("inputtotalprice");
|
||||
boolean isAdjustamount = this.getModel().getDataEntity().getBoolean("adjustamount");//微调金额
|
||||
boolean isAdjustoftax = this.getModel().getDataEntity().getBoolean("adjustoftax");//微调含税金额
|
||||
boolean isInputtaxprice = this.getModel().getDataEntity().getBoolean("inputtaxprice");//录入含税价
|
||||
boolean isInputtotalprice = this.getModel().getDataEntity().getBoolean("inputtotalprice");//录入总价
|
||||
BigDecimal taxrate = new BigDecimal(0);
|
||||
if (propValue != null) {
|
||||
taxrate = BigDecimal.valueOf((long) propValue.getInt("taxrate"));
|
||||
|
@ -845,6 +845,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
this.getModel().setValue("amount", ftransAmount.add(notaxAmount), curIndex);
|
||||
EntryGrid grid2 = (EntryGrid) this.getControl("entryentity");
|
||||
BigDecimal sum2 = grid2.getSum("ftransamount");
|
||||
this.getModel().setValue("transamount", sum2);
|
||||
}
|
||||
|
||||
private void transtaxamountChanged(BigDecimal propValue) {
|
||||
|
@ -1099,9 +1100,21 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
}
|
||||
|
||||
private void sumMaAmount() {
|
||||
EntryGrid grid = (EntryGrid) this.getControl("entryentity");
|
||||
/* EntryGrid grid = (EntryGrid) this.getControl("entryentity");
|
||||
BigDecimal sum = grid.getSum("notaxamount");
|
||||
this.getModel().setValue("matamount", sum);
|
||||
this.getModel().setValue("matamount", sum);*///源码
|
||||
//以下为二开修改添加
|
||||
BigDecimal sum = BigDecimal.ZERO;
|
||||
DynamicObjectCollection entryEntityCollection = this.getModel().getDataEntity(true).getDynamicObjectCollection("entryentity");//入库单分录
|
||||
for (DynamicObject entryEntity : entryEntityCollection) {
|
||||
BigDecimal notaxAmount = entryEntity.getBigDecimal("notaxamount");//金额
|
||||
if (notaxAmount != null) {
|
||||
notaxAmount = notaxAmount.setScale(2, RoundingMode.HALF_UP);
|
||||
sum = sum.add(notaxAmount);
|
||||
}
|
||||
}
|
||||
sum = sum.setScale(2, RoundingMode.HALF_UP);
|
||||
this.getModel().setValue("matamount", sum);//材料总金额
|
||||
}
|
||||
|
||||
private void lotF7Changed(DynamicObject propValue, int curIndex) {
|
||||
|
@ -1737,6 +1750,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
this.sumMaTaxAmount();
|
||||
EntryGrid grid = (EntryGrid) this.getControl("entryentity");
|
||||
BigDecimal sum = grid.getSum("ftransamount");
|
||||
this.getModel().setValue("transamount", sum);
|
||||
this.getView().updateView("matamount");
|
||||
this.getView().updateView("matoftaxamount");
|
||||
this.getView().updateView("mataxamount");
|
||||
|
@ -1747,6 +1761,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
|
|||
this.getView().updateView("totalamount");
|
||||
this.getView().updateView("totaloftaxamount");
|
||||
this.getView().updateView("totaltaxamount");
|
||||
this.getView().updateView("transamount");
|
||||
break;
|
||||
case "unaudit":
|
||||
this.getView().invokeOperation("refresh");
|
||||
|
|
Loading…
Reference in New Issue