入库单优化

This commit is contained in:
xuhaihui 2025-09-17 11:00:44 +08:00
parent 3335dd590f
commit 464e820287
1 changed files with 117 additions and 83 deletions

View File

@ -285,13 +285,13 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
case "warehouse": case "warehouse":
this.warehouseChanged((DynamicObject) propValue); this.warehouseChanged((DynamicObject) propValue);
break; break;
case "price": case "price"://入库单价
this.priceChanged((BigDecimal) propValue, curIndex); this.priceChanged((BigDecimal) propValue, curIndex);
break; break;
case "taxprice": case "taxprice"://入库含税单价
this.taxPriceChanged((BigDecimal) propValue, curIndex); this.taxPriceChanged((BigDecimal) propValue, curIndex);
break; break;
case "qty": case "qty"://数量
this.entryQtyChanged((BigDecimal) propValue, curIndex); this.entryQtyChanged((BigDecimal) propValue, curIndex);
case "mataxrate": case "mataxrate":
case "transamount": case "transamount":
@ -299,25 +299,25 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
case "transtaxamount": case "transtaxamount":
default: default:
break; break;
case "entrytaxrate": case "entrytaxrate"://税率名称
this.entrymataxrateChanged((DynamicObject) propValue, curIndex); this.entrymataxrateChanged((DynamicObject) propValue, curIndex);
break; break;
case "lotid": case "lotid":
this.lotF7Changed((DynamicObject) propValue, curIndex); this.lotF7Changed((DynamicObject) propValue, curIndex);
break; break;
case "oftaxamount": case "oftaxamount"://含税金额
this.oftaxamountChanged((BigDecimal) propValue, curIndex); this.oftaxamountChanged((BigDecimal) propValue, curIndex);
break; break;
case "taxamount": case "taxamount"://税额
this.entryTaxamountChanged(); this.entryTaxamountChanged();
break; break;
case "notaxamount": case "notaxamount"://金额
this.entryAmountChanged((BigDecimal) propValue, curIndex); this.entryAmountChanged((BigDecimal) propValue, curIndex);
break; break;
case "ftransamount": case "ftransamount"://运费
this.entryFtransamountChanged((BigDecimal) propValue, curIndex); this.entryFtransamountChanged((BigDecimal) propValue, curIndex);
break; break;
case "project": case "project"://项目
this.projectChanged(); this.projectChanged();
break; break;
case "mataxamount": case "mataxamount":
@ -465,8 +465,10 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
} }
protected void initFormPage(int rowIndex) { protected void initFormPage(int rowIndex) {
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"});
this.getView().setEnable(false, rowIndex, new String[]{"taxprice", "taxamount", "contprice", "oftaxamount"}); 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(false, rowIndex, new String[]{"taxprice", "taxamount", "contprice", "oftaxamount"});//二开修改去除金额字段*/
Boolean poundIn = (Boolean) this.getModel().getValue("poundin"); Boolean poundIn = (Boolean) this.getModel().getValue("poundin");
this.getView().setEnable(!poundIn, rowIndex, new String[]{"material", "modelnum", "qty"}); this.getView().setEnable(!poundIn, rowIndex, new String[]{"material", "modelnum", "qty"});
} }
@ -514,17 +516,20 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
this.getModel().beginInit(); this.getModel().beginInit();
BigDecimal price = (BigDecimal) this.getModel().getValue("price", i); BigDecimal price = (BigDecimal) this.getModel().getValue("price", i);
BigDecimal taxprice = price.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L)))); BigDecimal taxprice = price.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))));
// this.getModel().setValue("taxprice", taxprice, i);//入库含税单价 this.getModel().setValue("taxprice", taxprice, i);//入库含税单价
BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", i); BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", i);
BigDecimal notaxamount = price.multiply(qty); BigDecimal notaxamount = price.multiply(qty);
BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L)))); BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))));//源码
// BigDecimal taxamount = notaxamount.multiply(taxrate.divide(BigDecimal.valueOf(100L), 10, RoundingMode.HALF_UP));// 税额 = 金额 * 税率 //二开修改
// BigDecimal oftaxamount = taxamount.add(notaxamount);// 含税金额 = 税额 + 金额 //二开修改
int amtPrecision = this.getAmtPrecision(); int amtPrecision = this.getAmtPrecision();
notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
BigDecimal taxamount = oftaxamount.subtract(notaxamount); BigDecimal taxamount = oftaxamount.subtract(notaxamount);//源码
// this.getModel().setValue("notaxamount", notaxamount, i); // taxamount = taxamount.setScale(amtPrecision, RoundingMode.HALF_UP);//二开修改
// this.getModel().setValue("oftaxamount", oftaxamount, i); this.getModel().setValue("notaxamount", notaxamount, i);//金额
// this.getModel().setValue("taxamount", taxamount, i); this.getModel().setValue("oftaxamount", oftaxamount, i);//含税金额
this.getModel().setValue("taxamount", taxamount, i);//税额
this.getModel().endInit(); this.getModel().endInit();
this.getView().updateView("taxprice", i); this.getView().updateView("taxprice", i);
this.getView().updateView("notaxamount", i); this.getView().updateView("notaxamount", i);
@ -538,11 +543,11 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
public int getAmtPrecision() { public int getAmtPrecision() {
int amtPrecision = 10; int amtPrecision = 10;
AmountProp ofTaxAmountProp = (AmountProp) this.getModel().getDataEntityType().findProperty("oftaxamount"); AmountProp ofTaxAmountProp = (AmountProp) this.getModel().getDataEntityType().findProperty("oftaxamount");//含税金额
String controlPropName = ofTaxAmountProp.getControlPropName(); String controlPropName = ofTaxAmountProp.getControlPropName();
DynamicObject currency = this.getModel().getDataEntity().getDynamicObject(controlPropName); DynamicObject currency = this.getModel().getDataEntity().getDynamicObject(controlPropName);//币别
if (currency != null) { if (currency != null) {
amtPrecision = currency.getInt("amtprecision"); amtPrecision = currency.getInt("amtprecision");//币别-金额精度
} }
return amtPrecision; return amtPrecision;
@ -554,15 +559,18 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
BigDecimal notaxamount = oftaxamount.divide(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))), 10, RoundingMode.HALF_UP); BigDecimal notaxamount = oftaxamount.divide(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))), 10, RoundingMode.HALF_UP);
BigDecimal qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", i)); BigDecimal qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", i));
BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP); BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP);
// this.getModel().setValue("price", price, i); this.getModel().setValue("price", price, i);//入库单价
BigDecimal taxprice = oftaxamount.divide(qty, 10, RoundingMode.HALF_UP); BigDecimal taxprice = oftaxamount.divide(qty, 10, RoundingMode.HALF_UP);
// this.getModel().setValue("taxprice", taxprice, i); this.getModel().setValue("taxprice", taxprice, i);//入库含税单价
// BigDecimal taxamount = notaxamount.multiply(taxrate.divide(BigDecimal.valueOf(100L), 10, RoundingMode.HALF_UP));// 税额 = 金额 * 税率 //二开修改
// oftaxamount = taxamount.add(notaxamount);// 含税金额 = 税额 + 金额 //二开修改
int amtPrecision = this.getAmtPrecision(); int amtPrecision = this.getAmtPrecision();
notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
BigDecimal taxamount = oftaxamount.subtract(notaxamount); BigDecimal taxamount = oftaxamount.subtract(notaxamount);//源码
// this.getModel().setValue("notaxamount", notaxamount, i); // taxamount = taxamount.setScale(amtPrecision, RoundingMode.HALF_UP);//二开修改
// this.getModel().setValue("taxamount", taxamount, i); this.getModel().setValue("notaxamount", notaxamount, i);//金额
this.getModel().setValue("taxamount", taxamount, i);//税额
this.getModel().endInit(); this.getModel().endInit();
this.getView().updateView("notaxamount", i); this.getView().updateView("notaxamount", i);
this.getView().updateView("price", i); this.getView().updateView("price", i);
@ -575,21 +583,44 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
} }
protected void updateNewDataBytotalPrice(int i, BigDecimal taxrate) { protected void updateNewDataBytotalPrice(int i, BigDecimal taxrate) {
//int为行数taxrate为税率-
this.getModel().beginInit(); this.getModel().beginInit();
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)); BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getModel().getValue("notaxamount", i));//金额 //二开修改
BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP); BigDecimal qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", i));// 数量
// this.getModel().setValue("price", price, i); BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP);//金额 ÷ 数量
BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L)))); this.getModel().setValue("price", price, i);//"入库单价" = 金额 ÷ 数量
BigDecimal taxprice = oftaxamount.divide(qty, 10, RoundingMode.HALF_UP);
// this.getModel().setValue("taxprice", taxprice, i); BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))));//含税金额 = 金额 × (1 + 税率值/100)
int amtPrecision = this.getAmtPrecision(); BigDecimal taxprice = oftaxamount.divide(qty, 10, RoundingMode.HALF_UP);//入库含税单价 = 含税金额 ÷ 数量
this.getModel().setValue("taxprice", taxprice, i);//"入库含税单价" = 含税金额 ÷ 数量
int amtPrecision = this.getAmtPrecision();//含税金额-币别-金额精度
notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
BigDecimal taxamount = oftaxamount.subtract(notaxamount); BigDecimal taxamount = oftaxamount.subtract(notaxamount);//税额 = 含税金额 - 金额
// this.getModel().setValue("oftaxamount", oftaxamount, i); this.getModel().setValue("oftaxamount", oftaxamount, i);//"含税金额" = 金额 × (1 + 税率值/100)
// this.getModel().setValue("taxamount", taxamount, i); this.getModel().setValue("taxamount", taxamount, i);//"税额"
this.getModel().endInit(); this.getModel().endInit();
/* this.getModel().beginInit();
BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getModel().getValue("notaxamount", i));//金额
BigDecimal qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", i));// 数量
BigDecimal taxamount = notaxamount.multiply(taxrate.divide(BigDecimal.valueOf(100L), 10, RoundingMode.HALF_UP));// 税额 = 金额 * 税率
BigDecimal oftaxamount = taxamount.add(notaxamount);// 含税金额 = 税额 + 金额
BigDecimal price = notaxamount.divide(qty, 10, RoundingMode.HALF_UP);// 入库单价 = 金额 / 数量
BigDecimal taxprice = oftaxamount.divide(qty, 10, RoundingMode.HALF_UP);// 入库含税单价 = 含税金额 / 数量
int amtPrecision = this.getAmtPrecision();//含税金额-币别-金额精度
notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
taxamount = taxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
this.getModel().setValue("price", price, i);//入库单价
this.getModel().setValue("taxprice", taxprice, i);//入库含税单价
this.getModel().setValue("oftaxamount", oftaxamount, i);//含税金额
this.getModel().setValue("taxamount", taxamount, i);//税额
this.getModel().endInit();*///二开代码暂废弃
this.getView().updateView("price", i); this.getView().updateView("price", i);
this.getView().updateView("oftaxamount", i); this.getView().updateView("oftaxamount", i);
this.getView().updateView("taxprice", i); this.getView().updateView("taxprice", i);
@ -603,17 +634,20 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
this.getModel().beginInit(); this.getModel().beginInit();
BigDecimal taxprice = (BigDecimal) this.getModel().getValue("taxprice", i); BigDecimal taxprice = (BigDecimal) this.getModel().getValue("taxprice", i);
BigDecimal price = taxprice.divide(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))), 10, RoundingMode.HALF_UP); BigDecimal price = taxprice.divide(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))), 10, RoundingMode.HALF_UP);
// this.getModel().setValue("price", price, i); this.getModel().setValue("price", price, i);//入库单价
BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", i); BigDecimal qty = (BigDecimal) this.getModel().getValue("qty", i);
BigDecimal notaxamount = price.multiply(qty); BigDecimal notaxamount = price.multiply(qty);
BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L)))); BigDecimal oftaxamount = notaxamount.multiply(BigDecimal.ONE.add(taxrate.divide(BigDecimal.valueOf(100L))));//源码
// BigDecimal taxamount = notaxamount.multiply(taxrate.divide(BigDecimal.valueOf(100L), 10, RoundingMode.HALF_UP));// 税额 = 金额 * 税率 //二开修改
// BigDecimal oftaxamount = taxamount.add(notaxamount);// 含税金额 = 税额 + 金额 //二开修改
int amtPrecision = this.getAmtPrecision(); int amtPrecision = this.getAmtPrecision();
notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); notaxamount = notaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP); oftaxamount = oftaxamount.setScale(amtPrecision, RoundingMode.HALF_UP);
BigDecimal taxamount = oftaxamount.subtract(notaxamount); BigDecimal taxamount = oftaxamount.subtract(notaxamount);//源码
// this.getModel().setValue("notaxamount", notaxamount, i); // taxamount = taxamount.setScale(amtPrecision, RoundingMode.HALF_UP);//二开修改
// this.getModel().setValue("oftaxamount", oftaxamount, i); this.getModel().setValue("notaxamount", notaxamount, i);//金额
// this.getModel().setValue("taxamount", taxamount, i); this.getModel().setValue("oftaxamount", oftaxamount, i);//含税金额
this.getModel().setValue("taxamount", taxamount, i);//税额
this.getModel().endInit(); this.getModel().endInit();
this.getView().updateView("price", i); this.getView().updateView("price", i);
this.getView().updateView("notaxamount", i); this.getView().updateView("notaxamount", i);
@ -949,23 +983,23 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
} }
private void entryAmountChanged(BigDecimal propValue, int curIndex) { private void entryAmountChanged(BigDecimal propValue, int curIndex) {
boolean isAdjustamount = this.getModel().getDataEntity().getBoolean("adjustamount"); boolean isAdjustamount = this.getModel().getDataEntity().getBoolean("adjustamount");//微调金额
boolean isAdjustoftax = this.getModel().getDataEntity().getBoolean("adjustoftax"); boolean isAdjustoftax = this.getModel().getDataEntity().getBoolean("adjustoftax");//微调含税金额
boolean isInputtaxprice = this.getModel().getDataEntity().getBoolean("inputtaxprice"); boolean isInputtaxprice = this.getModel().getDataEntity().getBoolean("inputtaxprice");//录入含税价
boolean isInputtotalprice = this.getModel().getDataEntity().getBoolean("inputtotalprice"); boolean isInputtotalprice = this.getModel().getDataEntity().getBoolean("inputtotalprice");//录入总价
int rowIndex = this.getModel().getEntryCurrentRowIndex("entryentity"); int rowIndex = this.getModel().getEntryCurrentRowIndex("entryentity");
BigDecimal taxrate; BigDecimal taxrate;
if (isAdjustamount) { if (isAdjustamount) {
BigDecimal oftaxamount = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex); BigDecimal oftaxamount = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex);//含税金额
taxrate = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex); taxrate = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex);//金额
BigDecimal taxamount = oftaxamount.subtract(taxrate); BigDecimal taxamount = oftaxamount.subtract(taxrate);
// this.getView().getModel().setValue("taxamount", taxamount, rowIndex); this.getView().getModel().setValue("taxamount", taxamount, rowIndex);//税额
this.sumMaTaxAmount(); this.sumMaTaxAmount();
} else if (isInputtotalprice && !isInputtaxprice && !isAdjustamount && !isAdjustoftax) { } else if (isInputtotalprice && !isInputtaxprice && !isAdjustamount && !isAdjustoftax) {
DynamicObject mattaxrateObj = ((DynamicObject) this.getModel().getEntryEntity("entryentity").get(curIndex)).getDynamicObject("entrytaxrate"); DynamicObject mattaxrateObj = ((DynamicObject) this.getModel().getEntryEntity("entryentity").get(curIndex)).getDynamicObject("entrytaxrate");//税率
taxrate = new BigDecimal(0); taxrate = new BigDecimal(0);
if (mattaxrateObj != null) { if (mattaxrateObj != null) {
taxrate = mattaxrateObj.getBigDecimal("taxrate"); taxrate = mattaxrateObj.getBigDecimal("taxrate");//税率-
} }
this.updateNewDataBytotalPrice(curIndex, taxrate); this.updateNewDataBytotalPrice(curIndex, taxrate);
@ -975,10 +1009,10 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
} }
private void countAmount(int rowIndex) { private void countAmount(int rowIndex) {
BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getView().getModel().getValue("notaxamount", rowIndex)); BigDecimal notaxamount = EcNumberHelper.toBigDecimal(this.getView().getModel().getValue("notaxamount", rowIndex));//金额
BigDecimal transamount = EcNumberHelper.toBigDecimal(this.getView().getModel().getValue("ftransamount", rowIndex)); BigDecimal transamount = EcNumberHelper.toBigDecimal(this.getView().getModel().getValue("ftransamount", rowIndex));//运费
BigDecimal amount = notaxamount.add(transamount); BigDecimal amount = notaxamount.add(transamount);
this.getModel().setValue("amount", amount, rowIndex); this.getModel().setValue("amount", amount, rowIndex);//含运费金额不含税
} }
private void entryTaxamountChanged() { private void entryTaxamountChanged() {
@ -995,14 +1029,14 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
notaxamount = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex); notaxamount = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex);
taxamount = (BigDecimal) this.getView().getModel().getValue("taxamount", rowIndex); taxamount = (BigDecimal) this.getView().getModel().getValue("taxamount", rowIndex);
oftaxamount = notaxamount.subtract(taxamount); oftaxamount = notaxamount.subtract(taxamount);
// this.getView().getModel().setValue("notaxamount", oftaxamount, rowIndex); this.getView().getModel().setValue("notaxamount", oftaxamount, rowIndex);//金额
BigDecimal sum = grid1.getSum("notaxamount"); BigDecimal sum = grid1.getSum("notaxamount");
this.getModel().setValue("matamount", sum); this.getModel().setValue("matamount", sum);
} else if (isAdjustoftax) { } else if (isAdjustoftax) {
notaxamount = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex); notaxamount = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex);
taxamount = (BigDecimal) this.getView().getModel().getValue("taxamount", rowIndex); taxamount = (BigDecimal) this.getView().getModel().getValue("taxamount", rowIndex);
oftaxamount = notaxamount.add(taxamount); oftaxamount = notaxamount.add(taxamount);
// this.getView().getModel().setValue("oftaxamount", oftaxamount, rowIndex); this.getView().getModel().setValue("oftaxamount", oftaxamount, rowIndex);//含税金额
this.sumMaoftaxAmount(); this.sumMaoftaxAmount();
} }
@ -1021,7 +1055,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
taxPrice = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex); taxPrice = (BigDecimal) this.getView().getModel().getValue("oftaxamount", rowIndex);
ofTaxAmount = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex); ofTaxAmount = (BigDecimal) this.getView().getModel().getValue("notaxamount", rowIndex);
qty = taxPrice.subtract(ofTaxAmount); qty = taxPrice.subtract(ofTaxAmount);
// this.getView().getModel().setValue("taxamount", qty, rowIndex); this.getView().getModel().setValue("taxamount", qty, rowIndex);//税额
this.sumMaTaxAmount(); this.sumMaTaxAmount();
} else { } else {
if (isInputtaxprice && isInputtotalprice && !isAdjustamount && !isAdjustoftax) { if (isInputtaxprice && isInputtotalprice && !isAdjustamount && !isAdjustoftax) {
@ -1040,12 +1074,12 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", curIndex)); qty = EcNumberHelper.toBigDecimal(this.getModel().getValue("qty", curIndex));
BigDecimal taxRateNum = this.getTaxRateNum(); BigDecimal taxRateNum = this.getTaxRateNum();
if (taxRateNum.compareTo(BigDecimal.ZERO) == 0) { if (taxRateNum.compareTo(BigDecimal.ZERO) == 0) {
// this.getModel().setValue("notaxamount", ofTaxAmount, curIndex); this.getModel().setValue("notaxamount", ofTaxAmount, curIndex);//金额
} }
if (taxPrice.compareTo(BigDecimal.ZERO) == 0 && ofTaxAmount.compareTo(BigDecimal.ZERO) != 0 && qty.compareTo(BigDecimal.ZERO) != 0) { if (taxPrice.compareTo(BigDecimal.ZERO) == 0 && ofTaxAmount.compareTo(BigDecimal.ZERO) != 0 && qty.compareTo(BigDecimal.ZERO) != 0) {
taxPrice = ofTaxAmount.divide(qty, 10, RoundingMode.HALF_UP); taxPrice = ofTaxAmount.divide(qty, 10, RoundingMode.HALF_UP);
// this.getModel().setValue("taxprice", taxPrice, curIndex); this.getModel().setValue("taxprice", taxPrice, curIndex);//入库含税单价
} }
} }
@ -1326,16 +1360,16 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
String matinSourceName = (String) this.getModel().getValue("matinsource"); String matinSourceName = (String) this.getModel().getValue("matinsource");
if ("4".equals(matinSourceName)) { if ("4".equals(matinSourceName)) {
BigDecimal priceValue = propValue.getBigDecimal("price"); BigDecimal priceValue = propValue.getBigDecimal("price");
// this.getModel().setValue("price", priceValue, curIndex); this.getModel().setValue("price", priceValue, curIndex);//入库单价
} }
} else { } else {
this.getModel().setValue("measureunit", (Object) null, curIndex); this.getModel().setValue("measureunit", (Object) null, curIndex);
this.getModel().setValue("modelnum", (Object) null, curIndex); this.getModel().setValue("modelnum", (Object) null, curIndex);
this.getModel().setValue("qty", (Object) null, curIndex); this.getModel().setValue("qty", (Object) null, curIndex);//数量
this.getModel().setValue("contprice", (Object) null, curIndex); this.getModel().setValue("contprice", (Object) null, curIndex);
this.getModel().setValue("price", (Object) null, curIndex); this.getModel().setValue("price", (Object) null, curIndex);//入库单价
this.getModel().setValue("taxprice", (Object) null, curIndex); this.getModel().setValue("taxprice", (Object) null, curIndex);//入库含税单价
this.getModel().setValue("notaxamount", (Object) null, curIndex); this.getModel().setValue("notaxamount", (Object) null, curIndex);//金额
this.getModel().setValue("amount", (Object) null, curIndex); this.getModel().setValue("amount", (Object) null, curIndex);
this.getModel().setValue("procbs", (Object) null, curIndex); this.getModel().setValue("procbs", (Object) null, curIndex);
this.getModel().setValue("ca", (Object) null, curIndex); this.getModel().setValue("ca", (Object) null, curIndex);
@ -1343,8 +1377,8 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
this.getModel().setValue("ismainmaterial", (Object) null, curIndex); this.getModel().setValue("ismainmaterial", (Object) null, curIndex);
this.getModel().setValue("lot", (Object) null, curIndex); this.getModel().setValue("lot", (Object) null, curIndex);
this.getModel().setValue("lotid", (Object) null, curIndex); this.getModel().setValue("lotid", (Object) null, curIndex);
this.getModel().setValue("oftaxamount", (Object) null, curIndex); this.getModel().setValue("oftaxamount", (Object) null, curIndex);//含税金额
this.getModel().setValue("taxamount", (Object) null, curIndex); this.getModel().setValue("taxamount", (Object) null, curIndex);//税额
} }
this.changValueInitPage(curIndex); this.changValueInitPage(curIndex);
@ -1766,7 +1800,7 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
for (int var7 = 0; var7 < var6; ++var7) { for (int var7 = 0; var7 < var6; ++var7) {
RowDataEntity rowDataEntity = var5[var7]; RowDataEntity rowDataEntity = var5[var7];
this.getModel().setValue("entrytaxrate", rate.getPkValue(), rowDataEntity.getRowIndex()); this.getModel().setValue("entrytaxrate", rate.getPkValue(), rowDataEntity.getRowIndex());//税率名称
} }
} }
@ -1877,20 +1911,20 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
this.getModel().setValue("measureunit", (Object) null, row); this.getModel().setValue("measureunit", (Object) null, row);
} }
this.getModel().setValue("entrytaxrate", o.get("entrytaxrate"), row); this.getModel().setValue("entrytaxrate", o.get("entrytaxrate"), row);//税率名称
this.getModel().beginInit(); this.getModel().beginInit();
this.getModel().setValue("qty", o.get("surplusqty"), row); this.getModel().setValue("qty", o.get("surplusqty"), row);//数量
this.getModel().setValue("contprice", o.get("price"), row); this.getModel().setValue("contprice", o.get("price"), row);
this.getModel().setValue("taxprice", o.get("price"), row); this.getModel().setValue("taxprice", o.get("price"), row);//入库含税单价
this.getModel().setValue("price", o.get("oftaxprice"), row); this.getModel().setValue("price", o.get("oftaxprice"), row);//入库单价
this.getModel().setValue("notaxamount", o.get("oftaxamount"), row); this.getModel().setValue("notaxamount", o.get("oftaxamount"), row);//金额
this.getModel().setValue("oftaxamount", o.get("oftaxamt"), row); this.getModel().setValue("oftaxamount", o.get("oftaxamt"), row);//含税金额
this.getModel().setValue("taxamount", o.get("taxamount"), row); this.getModel().setValue("taxamount", o.get("taxamount"), row);//税额
this.getModel().endInit(); this.getModel().endInit();
this.getView().updateView("qty", row); this.getView().updateView("qty", row);
this.getView().updateView("taxprice", row); this.getView().updateView("taxprice", row);
this.getView().updateView("contprice", row); this.getView().updateView("contprice", row);
this.getView().updateView("entrytaxrate", row); this.getView().updateView("entrytaxrate", row);//税率名称
this.getView().updateView("price", row); this.getView().updateView("price", row);
this.getView().updateView("notaxamount", row); this.getView().updateView("notaxamount", row);
this.getView().updateView("oftaxamount", row); this.getView().updateView("oftaxamount", row);
@ -1936,16 +1970,16 @@ public class MaterialInBillEditPluginExt extends AbstractEcmaBillPlugin implemen
QFilter filter = new QFilter("listmodelentry.sublistentry.id", QCP.equals, pkValue); QFilter filter = new QFilter("listmodelentry.sublistentry.id", QCP.equals, pkValue);
DynamicObjectCollection ec_out_contract = QueryServiceHelper.query("ec_out_contract", "listmodelentry.sublistentry.zcgj_treeresitemmodel2", new QFilter[]{filter}); DynamicObjectCollection ec_out_contract = QueryServiceHelper.query("ec_out_contract", "listmodelentry.sublistentry.zcgj_treeresitemmodel2", new QFilter[]{filter});
this.getModel().setValue("modelnum", ec_out_contract.get(0).get("listmodelentry.sublistentry.zcgj_treeresitemmodel2"), curIndex);//资源规格型号(二开添加 this.getModel().setValue("modelnum", ec_out_contract.get(0).get("listmodelentry.sublistentry.zcgj_treeresitemmodel2"), curIndex);//资源规格型号(二开添加
this.getModel().setValue("entrytaxrate", listings[i].get("rateobj"), curIndex); this.getModel().setValue("entrytaxrate", listings[i].get("rateobj"), curIndex);//税率名称
this.getModel().beginInit(); this.getModel().beginInit();
this.getModel().setValue("qty", listings[i].get("totalqty"), curIndex); this.getModel().setValue("qty", listings[i].get("totalqty"), curIndex);//数量
this.getModel().setValue("taxprice", listings[i].get("curtaxprice"), curIndex); this.getModel().setValue("taxprice", listings[i].get("curtaxprice"), curIndex);//入库含税单价
this.getModel().setValue("contprice", listings[i].get("curtaxprice"), curIndex); this.getModel().setValue("contprice", listings[i].get("curtaxprice"), curIndex);
this.getModel().setValue("oftaxamount", listings[i].get("lstoftaxamount"), curIndex); this.getModel().setValue("oftaxamount", listings[i].get("lstoftaxamount"), curIndex);//含税金额
this.getModel().setValue("price", listings[i].get("currentprice"), curIndex); this.getModel().setValue("price", listings[i].get("currentprice"), curIndex);//入库单价
this.getModel().setValue("notaxamount", listings[i].get("lasttotalamt"), curIndex); this.getModel().setValue("notaxamount", listings[i].get("lasttotalamt"), curIndex);//金额
this.getModel().setValue("oftaxamount", listings[i].get("lstoftaxamount"), curIndex); this.getModel().setValue("oftaxamount", listings[i].get("lstoftaxamount"), curIndex);//含税金额
this.getModel().setValue("taxamount", listings[i].getBigDecimal("lstoftaxamount").subtract(listings[i].getBigDecimal("lasttotalamt")), curIndex); this.getModel().setValue("taxamount", listings[i].getBigDecimal("lstoftaxamount").subtract(listings[i].getBigDecimal("lasttotalamt")), curIndex);//税额
this.getModel().endInit(); this.getModel().endInit();
this.getView().updateView("qty", curIndex); this.getView().updateView("qty", curIndex);
this.getView().updateView("taxprice", curIndex); this.getView().updateView("taxprice", curIndex);