支出合同计量 当前单价变更提醒

This commit is contained in:
程小伟 2025-04-23 18:23:26 +08:00
parent 5447c0109c
commit 8d13c5bf87
2 changed files with 36 additions and 11 deletions

View File

@ -139,12 +139,24 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin
doLockFieldWithPriceAdjustMode((PriceAdjustModeEnum)null);
} else if (StringUtils.equals(propName,"currentprice")) {
BigDecimal oldValue = (BigDecimal)changeData.getOldValue();
if(oldValue.compareTo(new BigDecimal(0)) == 0){return;}
if(oldValue.compareTo(new BigDecimal(0)) == 0){
BigDecimal initialValue = (BigDecimal) changeData.getNewValue();
this.getView().getPageCache().put("currentprice", initialValue.toString());
return;
}
String initialValue = this.getView().getPageCache().get("currentprice");
BigDecimal initialvalue = new BigDecimal(initialValue);
BigDecimal newValue = (BigDecimal)changeData.getNewValue();
PriceChangedWarn(oldValue,newValue,rowIndex,parentRowIndex);
PriceChangedWarn(initialvalue,newValue,rowIndex,parentRowIndex);
} else if (StringUtils.equals(propName, "thisqty") || StringUtils.equals(propName, "thisoftaxmount")) {
BigDecimal oldValue = (BigDecimal)changeData.getOldValue();
if(oldValue.compareTo(new BigDecimal(0)) == 0){return;}
if(oldValue.compareTo(new BigDecimal(0)) == 0){
BigDecimal initialValue = (BigDecimal) changeData.getNewValue();
this.getView().getPageCache().put("currentprice", initialValue.toString());
return;
}
String initialValue = this.getView().getPageCache().get("currentprice");
BigDecimal initialvalue = new BigDecimal(initialValue);
BigDecimal thisqty = (BigDecimal)this.getModel().getValue("thisqty", rowIndex, parentRowIndex);
BigDecimal thisoftaxmount =(BigDecimal) this.getModel().getValue("thisoftaxmount", rowIndex, parentRowIndex);
BigDecimal totalqty =(BigDecimal) this.getModel().getValue("totalqty", rowIndex, parentRowIndex);
@ -165,8 +177,9 @@ public class ContractEeasurementBillPlugin extends ContractMeasureBillEditPlugin
listentry.set("currenttaxamt",curtaxprice.multiply(totalqty).subtract(currentprice.multiply(totalqty)));
listentry.set("currentoftax",curtaxprice.multiply(totalqty));
this.getView().updateView("listentry");
PriceChangedWarn(initialvalue,currentprice,rowIndex, parentRowIndex);
}
PriceChangedWarn(oldPrice,currentprice,rowIndex, parentRowIndex);
}
}

View File

@ -188,16 +188,28 @@ public class InContractMeasurementBillEditPlugin extends InContractMeasureBillEd
if (StringUtils.equals(propName, "zcgj_hsjell")) {
doLockFieldWithPriceAdjustMode((PriceAdjustModeEnum)null);
} else if (StringUtils.equals(propName,"currentprice")) {
// 获取初始单价
BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex);
BigDecimal oldValue = (BigDecimal)changeData.getOldValue();
if(oldValue.compareTo(new BigDecimal(0)) == 0){return;}
if(oldValue.compareTo(new BigDecimal(0)) == 0){
BigDecimal initialValue = (BigDecimal) changeData.getNewValue();
this.getView().getPageCache().put("currentprice", initialValue.toString());
return;
}
String initialValue = this.getView().getPageCache().get("currentprice");
BigDecimal initialvalue = new BigDecimal(initialValue);
BigDecimal newValue = (BigDecimal)changeData.getNewValue();
PriceChangedWarn(oldValue,newValue,rowIndex,parentRowIndex);
PriceChangedWarn(initialvalue,newValue,rowIndex,parentRowIndex);
} else if ( StringUtils.equals(propName, "thisoftaxmount")) {//StringUtils.equals(propName, "thisqty") ||
BigDecimal initialPrice = (BigDecimal) this.getModel().getValue("currentprice", rowIndex, parentRowIndex);
BigDecimal oldValue = (BigDecimal)changeData.getOldValue();
if(oldValue.compareTo(new BigDecimal(0)) == 0){return;}
if(oldValue.compareTo(new BigDecimal(0)) == 0){
BigDecimal initialValue = (BigDecimal) changeData.getNewValue();
this.getView().getPageCache().put("currentprice", initialValue.toString());
return;
}
String initialValue = this.getView().getPageCache().get("currentprice");
BigDecimal initialvalue = new BigDecimal(initialValue);
BigDecimal thisqty = (BigDecimal)this.getModel().getValue("thisqty", rowIndex, parentRowIndex);//本期计量数量
BigDecimal thisoftaxmount =(BigDecimal) this.getModel().getValue("thisoftaxmount", rowIndex, parentRowIndex);//本期计量含税金额
@ -226,7 +238,7 @@ public class InContractMeasurementBillEditPlugin extends InContractMeasureBillEd
// this.getModel().setValue("currenttaxamt",curtaxprice.multiply(totalqty).subtract(currentprice.multiply(totalqty)),rowIndex, parentRowIndex);
// this.getModel().setValue("currentoftax",curtaxprice.multiply(totalqty),rowIndex, parentRowIndex);
this.getView().updateView();
PriceChangedWarn(oldPrice,currentprice,rowIndex, parentRowIndex);
PriceChangedWarn(initialvalue,currentprice,rowIndex, parentRowIndex);
}
// String resname = (String)this.getModel().getValue("resname", rowIndex, parentRowIndex);
// PriceChangedWarn(oldPrice,currentprice,rowIndex, parentRowIndex);