入库单添加入库总金额计算逻辑

This commit is contained in:
xuhaihui 2025-10-15 15:50:43 +08:00
parent a4fe6fb0f0
commit c6730121bb
2 changed files with 13 additions and 3 deletions

View File

@ -326,7 +326,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
case "matoftaxamount"://材料含税总金额
this.matoftaxamountChanged((BigDecimal) propValue);
break;
case "matamount":
case "matamount"://材料总金额
this.matamountChanged((BigDecimal) propValue);
break;
case "proboq":
@ -811,8 +811,8 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
private void matamountChanged(BigDecimal propValue) {
this.getModel().beginInit();
BigDecimal exchangerate = (BigDecimal) this.getModel().getValue("exchangerate");
this.getModel().setValue("stdmateamount", propValue.multiply(exchangerate));
BigDecimal exchangerate = (BigDecimal) this.getModel().getValue("exchangerate");//汇率
this.getModel().setValue("stdmateamount", propValue.multiply(exchangerate));//材料不含税金额本位币
this.getModel().endInit();
this.getView().updateView("stdmateamount");
this.summaryTotalAmount();

View File

@ -192,6 +192,16 @@ public class MaterialInbPurchaseApplyPlugin extends AbstractBillPlugIn implement
this.getView().updateView("transoftaxamount");
this.getView().updateView("totaloftaxamount");
this.getModel().endInit();
} else if ("oftaxamount".equals(key)) {
//入库单明细-含税金额
boolean inputtaxprice = (boolean) this.getModel().getValue("inputtaxprice");//录入含税价
boolean inputtotalprice = (boolean) this.getModel().getValue("inputtotalprice");//录入总价
if (inputtaxprice && inputtotalprice) {
BigDecimal matAmount = (BigDecimal) this.getModel().getValue("matamount");//材料总金额
BigDecimal transAmount = (BigDecimal) this.getModel().getValue("transamount");//总运费
BigDecimal totalAmount = matAmount.add(transAmount);
this.getModel().setValue("totalamount", totalAmount);//入库总金额
}
}
}