fix:变更单的折扣金额 不需要触发值更新
This commit is contained in:
parent
881b8073eb
commit
839e6308b7
@ -318,13 +318,11 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
case "yem_sapriceclausebase"://销售单价(价格条款)本位币
|
case "yem_sapriceclausebase"://销售单价(价格条款)本位币
|
||||||
break;
|
break;
|
||||||
case "yem_disamt"://折扣金额
|
case "yem_disamt"://折扣金额
|
||||||
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
ClientUtils.countFrontDisAmt(model, rowIndex);//折扣前金额
|
||||||
ClientUtils.countFrontDisAmt(model, rowIndex);//折扣前金额
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
||||||
ClientUtils.calculateDiscountRate(view, model, rowIndex);//计算折扣率
|
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
||||||
ClientUtils.addSaAmountTk(model, rowIndex);//销售金额(价格条款)结算币别
|
ClientUtils.countPoolAmt(view, model, "yem_es_materialinfo");//汇总折扣金额使用金额
|
||||||
ClientUtils.countPoolAmt(view, model, "yem_es_materialinfo");//汇总折扣金额使用金额
|
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case "yem_fundusetype"://资金使用类型
|
case "yem_fundusetype"://资金使用类型
|
||||||
model.setValue("yem_fundpoolamt", BigDecimal.ZERO);
|
model.setValue("yem_fundpoolamt", BigDecimal.ZERO);
|
||||||
@ -342,11 +340,13 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
// useDebcChange(rowIndex);
|
// useDebcChange(rowIndex);
|
||||||
// break;
|
// break;
|
||||||
case "yem_ifgift":
|
case "yem_ifgift":
|
||||||
ClientUtils.empty(model, rowIndex, "yem_es_materialinfo", view);
|
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
ClientUtils.empty(model, rowIndex, "yem_es_materialinfo", view);
|
||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
||||||
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
||||||
// ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_onecarsum", "yem_sumcost");//单车总费用 汇总表头 总费用
|
// ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_onecarsum", "yem_sumcost");//单车总费用 汇总表头 总费用
|
||||||
ClientUtils.clearRelevantPrice(model, view, rowIndex, "yem_es_materialinfo");
|
ClientUtils.clearRelevantPrice(model, view, rowIndex, "yem_es_materialinfo");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "yem_transportstyle":
|
case "yem_transportstyle":
|
||||||
// setInsuranceFeeRate();
|
// setInsuranceFeeRate();
|
||||||
@ -357,9 +357,11 @@ public class SalesOrderPJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
case "yem_afterfrontdisprice"://折扣后销售单价
|
case "yem_afterfrontdisprice"://折扣后销售单价
|
||||||
break;
|
break;
|
||||||
case "yem_accamtusetype"://配件资金使用方式
|
case "yem_accamtusetype"://配件资金使用方式
|
||||||
ClientUtils.delValue(model, "yem_es_materialinfo");
|
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
ClientUtils.delValue(model, "yem_es_materialinfo");
|
||||||
// ClientUtils.countDisAmt(model,"yem_es_materialinfo",rowIndex);//计算折扣金额
|
// ClientUtils.countDisAmt(model,"yem_es_materialinfo",rowIndex);//计算折扣金额
|
||||||
ClientUtils.calculateDiscountRate(view, model, -1);//计算折扣率
|
ClientUtils.calculateDiscountRate(view, model, -1);//计算折扣率
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "yem_fundpoolamt"://使用额度
|
case "yem_fundpoolamt"://使用额度
|
||||||
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
ClientUtils.countDisAmt(model, "yem_es_materialinfo", rowIndex, view);//计算折扣金额
|
||||||
|
@ -36,17 +36,24 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
|||||||
import kd.sdk.plugin.Plugin;
|
import kd.sdk.plugin.Plugin;
|
||||||
import org.apache.commons.lang3.ArrayUtils;
|
import org.apache.commons.lang3.ArrayUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
import java.math.BigDecimal;
|
import java.math.BigDecimal;
|
||||||
import java.math.RoundingMode;
|
import java.math.RoundingMode;
|
||||||
import java.util.*;
|
import java.util.*;
|
||||||
import java.util.stream.Collectors;
|
import java.util.stream.Collectors;
|
||||||
|
|
||||||
|
import static com.yem.wm.im.clientdemand.utils.ClientUtils.bringProductModelTons;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 外销合同 表单插件
|
* 外销合同 表单插件
|
||||||
*/
|
*/
|
||||||
public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener, HyperLinkClickListener {
|
public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, BeforeF7SelectListener, HyperLinkClickListener {
|
||||||
|
|
||||||
|
private static final Logger log = LoggerFactory.getLogger(SalesOrderZJEdit.class);
|
||||||
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void afterLoadData(EventObject e) {
|
public void afterLoadData(EventObject e) {
|
||||||
super.afterLoadData(e);
|
super.afterLoadData(e);
|
||||||
@ -85,7 +92,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
OperationStatus status = fsp.getStatus();
|
OperationStatus status = fsp.getStatus();
|
||||||
String formId = fsp.getFormId();
|
String formId = fsp.getFormId();
|
||||||
String appId = fsp.getAppId();
|
String appId = fsp.getAppId();
|
||||||
if (OperationStatus.ADDNEW == status&&appId.equals("yem_es")) {
|
if (OperationStatus.ADDNEW == status && appId.equals("yem_es")) {
|
||||||
SplitContainer splitContainer = this.getControl("yem_splitcontainerap");
|
SplitContainer splitContainer = this.getControl("yem_splitcontainerap");
|
||||||
splitContainer.setCollapse("yem_splitpanelap1", true);
|
splitContainer.setCollapse("yem_splitpanelap1", true);
|
||||||
QFilter qFilter = null;
|
QFilter qFilter = null;
|
||||||
@ -191,10 +198,15 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
String name = e.getProperty().getName();
|
String name = e.getProperty().getName();
|
||||||
ChangeData changeData = e.getChangeSet()[0];
|
ChangeData changeData = e.getChangeSet()[0];
|
||||||
Object oldValue = changeData.getOldValue();
|
Object oldValue = changeData.getOldValue();
|
||||||
|
Object newValue = changeData.getNewValue();
|
||||||
int rowIndex = changeData.getRowIndex();
|
int rowIndex = changeData.getRowIndex();
|
||||||
int ParentRow = changeData.getParentRowIndex();
|
int ParentRow = changeData.getParentRowIndex();
|
||||||
DynamicObject dataEntity = model.getDataEntity();
|
DynamicObject dataEntity = model.getDataEntity();
|
||||||
DynamicObjectCollection materialInfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
DynamicObjectCollection materialInfo = dataEntity.getDynamicObjectCollection("yem_es_materialinfo");
|
||||||
|
// log.info("before__当前计算:{}", name);
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 0));
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 1));
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 2));
|
||||||
switch (name) {
|
switch (name) {
|
||||||
case "yem_countexpense":
|
case "yem_countexpense":
|
||||||
countExpense();//选择装箱核算运输费用 携带费用信息分录
|
countExpense();//选择装箱核算运输费用 携带费用信息分录
|
||||||
@ -231,20 +243,24 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
syncDeductionGifts(model, rowIndex);
|
syncDeductionGifts(model, rowIndex);
|
||||||
break;
|
break;
|
||||||
case "yem_ifgift":
|
case "yem_ifgift":
|
||||||
ZJUtils.countOrderSumNumberZJ(model);
|
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
ClientUtils.resourceNogLock(view, model, rowIndex);
|
|
||||||
ClientUtils.empty(model, rowIndex, "yem_es_materialinfo", view);
|
ZJUtils.countOrderSumNumberZJ(model);
|
||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
ClientUtils.resourceNogLock(view, model, rowIndex);
|
||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
ClientUtils.empty(model, rowIndex, "yem_es_materialinfo", view);
|
||||||
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_safobamount", "yem_amount");//销售fob金额 汇总表头 fob金额
|
||||||
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
||||||
// ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_onecarsum", "yem_sumcost");//单车总费用 汇总表头 总费用
|
// ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_onecarsum", "yem_sumcost");//单车总费用 汇总表头 总费用
|
||||||
syncDeductionGifts(model, rowIndex);
|
syncDeductionGifts(model, rowIndex);
|
||||||
ClientUtils.clearRelevantPrice(model, view, rowIndex, "yem_es_materialinfo");
|
ClientUtils.clearRelevantPrice(model, view, rowIndex, "yem_es_materialinfo");
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case "yem_productmodel":
|
case "yem_productmodel":
|
||||||
setRandomDataTools();//
|
setRandomDataTools();//
|
||||||
FunctionalCommon.multiConfig(model, rowIndex);
|
FunctionalCommon.multiConfig(model, rowIndex);
|
||||||
setGiftGiving();
|
setGiftGiving();
|
||||||
bringAssemblyAmount(rowIndex, model, "yem_es_materialinfo");
|
bringAssemblyAmount(rowIndex, model, "yem_es_materialinfo");
|
||||||
|
bringProductModelTons(model, rowIndex);
|
||||||
break;
|
break;
|
||||||
case "yem_isnewagent":
|
case "yem_isnewagent":
|
||||||
setGiftGiving();
|
setGiftGiving();
|
||||||
@ -285,6 +301,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
countCalculationAmt();
|
countCalculationAmt();
|
||||||
ClientUtils.changeRate(model, "yem_es_materialinfo");
|
ClientUtils.changeRate(model, "yem_es_materialinfo");
|
||||||
ClientUtils.clearSalePrice(this.getModel());
|
ClientUtils.clearSalePrice(this.getModel());
|
||||||
|
ClientUtils.calculateSalesFCAStandardQingdaoUnitPrice(model, rowIndex);//销售FCA标配青岛单价
|
||||||
break;
|
break;
|
||||||
case "yem_qty":
|
case "yem_qty":
|
||||||
setRandomDataTools();
|
setRandomDataTools();
|
||||||
@ -301,6 +318,9 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
syncDeductionGifts(model, rowIndex);
|
syncDeductionGifts(model, rowIndex);
|
||||||
ClientUtils.addSaAmountTkZJ(model, rowIndex);//整机合同整机非赠品行销售单价(价格条款)
|
ClientUtils.addSaAmountTkZJ(model, rowIndex);//整机合同整机非赠品行销售单价(价格条款)
|
||||||
ClientUtils.countRealCatAmountZJ(model, rowIndex);//整机合同整机非赠品行实际整车金额
|
ClientUtils.countRealCatAmountZJ(model, rowIndex);//整机合同整机非赠品行实际整车金额
|
||||||
|
// ClientUtils.calculateSalesFCAStandardQingdaoUnitAmount(model, rowIndex);//销售FCA标配青岛金额
|
||||||
|
ClientUtils.calculatePortAmt(model, rowIndex);//计算港杂费
|
||||||
|
ClientUtils.calcInlandTransportationAmt(model, rowIndex);//计算内陆运费
|
||||||
break;
|
break;
|
||||||
case "yem_saamtpriceclause"://销售金额(价格条款)
|
case "yem_saamtpriceclause"://销售金额(价格条款)
|
||||||
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
ClientUtils.totalSaFobAmount(model, "yem_es_materialinfo", "yem_ifgift", "yem_saamtpriceclause", "yem_offeramount");//销售金额(价格条款)汇总表头 金额价格条款
|
||||||
@ -311,6 +331,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
case "yem_standardprice"://标配FOB(青岛价)
|
case "yem_standardprice"://标配FOB(青岛价)
|
||||||
ClientUtils.fobPriceAdd(model, materialInfo);//FOB单价
|
ClientUtils.fobPriceAdd(model, materialInfo);//FOB单价
|
||||||
ClientUtils.countFobAmtSale(model, rowIndex);//销售FOB标配青岛单价
|
ClientUtils.countFobAmtSale(model, rowIndex);//销售FOB标配青岛单价
|
||||||
|
// ClientUtils.calculateSalesFCAStandardQingdaoUnitPrice(model, rowIndex);//销售FCA标配青岛单价
|
||||||
break;
|
break;
|
||||||
case "yem_truecarpriceba":
|
case "yem_truecarpriceba":
|
||||||
ClientUtils.countRealCatAmountRMB(model, rowIndex);
|
ClientUtils.countRealCatAmountRMB(model, rowIndex);
|
||||||
@ -358,6 +379,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
break;
|
break;
|
||||||
case "yem_unitsetamount"://单台加价金额
|
case "yem_unitsetamount"://单台加价金额
|
||||||
ClientUtils.addSaPrice(model, materialInfo);//销售FOB单价(结算币别)
|
ClientUtils.addSaPrice(model, materialInfo);//销售FOB单价(结算币别)
|
||||||
|
ClientUtils.calculateSalesFOBUnitPrice(model, -1);//计算销售FOB单价
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case "yem_sapricepriceclause"://销售单价(价格条款)结算币别
|
case "yem_sapricepriceclause"://销售单价(价格条款)结算币别
|
||||||
@ -410,6 +432,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
break;
|
break;
|
||||||
case "yem_transportstyle":
|
case "yem_transportstyle":
|
||||||
// setInsuranceFeeRate();
|
// setInsuranceFeeRate();
|
||||||
|
// ClientUtils.calcInlandTransportationAmt(model, rowIndex);//计算内陆运费
|
||||||
break;
|
break;
|
||||||
case "yem_clientcountry":
|
case "yem_clientcountry":
|
||||||
case "yem_rapstyle":
|
case "yem_rapstyle":
|
||||||
@ -508,7 +531,53 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
case "yem_interestdays":
|
case "yem_interestdays":
|
||||||
ClientUtils.calculateBankInterestCharges(-1, model);//银行利息费
|
ClientUtils.calculateBankInterestCharges(-1, model);//银行利息费
|
||||||
break;
|
break;
|
||||||
|
case "yem_sastandardfcaprice":
|
||||||
|
// ClientUtils.calculateSalesFCAStandardQingdaoUnitAmount(model, rowIndex);//销售FCA标配青岛金额
|
||||||
|
ClientUtils.calculateSalesFOBUnitPrice(model, rowIndex);//计算销售FOB单价
|
||||||
|
break;
|
||||||
|
case "yem_fobsubfcaamt":
|
||||||
|
ClientUtils.calculateSalesFOBUnitPrice(model, rowIndex);//计算销售FOB单价
|
||||||
|
break;
|
||||||
|
case "yem_tonsqty":
|
||||||
|
case "yem_port":
|
||||||
|
case "yem_shippingmethod":
|
||||||
|
ClientUtils.calcInlandTransportationAmt(model, rowIndex);//计算内陆运费
|
||||||
|
ClientUtils.calculatePortAmt(model, rowIndex);//计算港杂费
|
||||||
|
break;
|
||||||
|
case "yem_padexpense":
|
||||||
|
DynamicObject padexpense = (DynamicObject) newValue;
|
||||||
|
if (padexpense != null) {
|
||||||
|
String number = padexpense.getString("number");
|
||||||
|
//内陆运输费
|
||||||
|
if ("FYXM0023.11".equals(number)) {
|
||||||
|
DynamicObjectCollection entryRows = this.getModel().getEntryEntity("yem_es_materialinfo");
|
||||||
|
for (int i = 0; i < entryRows.size(); i++) {
|
||||||
|
ClientUtils.calcInlandTransportationAmt(model, i);//计算内陆运费
|
||||||
|
}
|
||||||
|
}
|
||||||
|
//港杂费
|
||||||
|
else if ("FYXM0023.6".equals(number)) {
|
||||||
|
DynamicObjectCollection entryRows = this.getModel().getEntryEntity("yem_es_materialinfo");
|
||||||
|
for (int i = 0; i < entryRows.size(); i++) {
|
||||||
|
ClientUtils.calculatePortAmt(model, i);//计算内陆运费
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
case "yem_squareqty":
|
||||||
|
ClientUtils.calculatePortAmt(model, rowIndex);//计算港杂费
|
||||||
|
break;
|
||||||
|
case "yem_priceitemsp":
|
||||||
|
ClientUtils.countAfterFrontAmt(model, rowIndex);//计算折扣后销售金额
|
||||||
|
ClientUtils.calculateSalesFCAStandardQingdaoUnitPrice(model, rowIndex);//销售FCA标配青岛单价
|
||||||
|
ClientUtils.calculateSalesFOBUnitPrice(model, -1);//计算销售FOB单价
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// log.info("after__当前计算:{}", name);
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 0));
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 1));
|
||||||
|
// log.info("yem_safobprice:{}", model.getValue("yem_safobprice", 2));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -540,6 +609,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 选择赠送配件-产品机型,汇总明细信息中相同机型的数量
|
* 选择赠送配件-产品机型,汇总明细信息中相同机型的数量
|
||||||
|
*
|
||||||
* @param rowIndex
|
* @param rowIndex
|
||||||
*/
|
*/
|
||||||
private void summarizeModules(int rowIndex) {
|
private void summarizeModules(int rowIndex) {
|
||||||
@ -568,6 +638,7 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* 修改商品明细中数量,同步修改礼品赠送中数量
|
* 修改商品明细中数量,同步修改礼品赠送中数量
|
||||||
|
*
|
||||||
* @param model
|
* @param model
|
||||||
* @param rowIndex
|
* @param rowIndex
|
||||||
*/
|
*/
|
||||||
@ -864,11 +935,15 @@ public class SalesOrderZJEdit extends AbstractBillPlugIn implements Plugin, Befo
|
|||||||
for (int i = 0; i < materialInfoRows; i++) {
|
for (int i = 0; i < materialInfoRows; i++) {
|
||||||
BigDecimal amt = (BigDecimal) model.getValue("yem_amt", i);
|
BigDecimal amt = (BigDecimal) model.getValue("yem_amt", i);
|
||||||
if (total.compareTo(BigDecimal.ZERO) > 0) {
|
if (total.compareTo(BigDecimal.ZERO) > 0) {
|
||||||
model.setValue("yem_disamt", amt.divide(total, 2).multiply(fundPoolAmt), i);
|
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", amt.divide(total, 2).multiply(fundPoolAmt), i);
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
model.setValue("yem_disamt", BigDecimal.ZERO, i);
|
if (!this.getModel().getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
}
|
|
||||||
|
|
||||||
|
model.setValue("yem_disamt", BigDecimal.ZERO, i);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1182,7 +1182,9 @@ public class ClientUtils {
|
|||||||
model.setValue("yem_truecaramtba", null, row);//实际整车金额(人民币)
|
model.setValue("yem_truecaramtba", null, row);//实际整车金额(人民币)
|
||||||
model.setValue("yem_pricefieldaccba", null, row);//资源配件单价
|
model.setValue("yem_pricefieldaccba", null, row);//资源配件单价
|
||||||
model.setValue("yem_pricefieldaccamt", null, row);//资源配件金额
|
model.setValue("yem_pricefieldaccamt", null, row);//资源配件金额
|
||||||
model.setValue("yem_disamt", null, row);//折扣金额
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", null, row);//折扣金额
|
||||||
|
}
|
||||||
model.setValue("yem_frontrateentry", null, row);//折扣率%
|
model.setValue("yem_frontrateentry", null, row);//折扣率%
|
||||||
model.setValue("yem_frontdisprice", null, row);//折扣前销售单价
|
model.setValue("yem_frontdisprice", null, row);//折扣前销售单价
|
||||||
model.setValue("yem_frontdisamt", null, row);//折扣前销售金额
|
model.setValue("yem_frontdisamt", null, row);//折扣前销售金额
|
||||||
@ -1515,14 +1517,18 @@ public class ClientUtils {
|
|||||||
model.setValue("yem_fundpoolamt", null);
|
model.setValue("yem_fundpoolamt", null);
|
||||||
model.setValue("yem_frontrate", null);
|
model.setValue("yem_frontrate", null);
|
||||||
for (int i = 0; i < entryRowCount; i++) {
|
for (int i = 0; i < entryRowCount; i++) {
|
||||||
model.setValue("yem_disamt", null, i);
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", null, i);
|
||||||
|
}
|
||||||
model.setValue("yem_frontrateentry", null, i);
|
model.setValue("yem_frontrateentry", null, i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case "B":
|
case "B":
|
||||||
model.setValue("yem_fundpoolamt", null);
|
model.setValue("yem_fundpoolamt", null);
|
||||||
for (int i = 0; i < entryRowCount; i++) {
|
for (int i = 0; i < entryRowCount; i++) {
|
||||||
model.setValue("yem_disamt", null, i);
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", null, i);
|
||||||
|
}
|
||||||
model.setValue("yem_frontrateentry", null, i);
|
model.setValue("yem_frontrateentry", null, i);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -1531,7 +1537,9 @@ public class ClientUtils {
|
|||||||
model.setValue("yem_fundpoolamt", null);
|
model.setValue("yem_fundpoolamt", null);
|
||||||
model.setValue("yem_frontrate", null);
|
model.setValue("yem_frontrate", null);
|
||||||
for (int i = 0; i < entryRowCount; i++) {
|
for (int i = 0; i < entryRowCount; i++) {
|
||||||
model.setValue("yem_disamt", null, i);
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", null, i);
|
||||||
|
}
|
||||||
model.setValue("yem_frontrateentry", null, i);
|
model.setValue("yem_frontrateentry", null, i);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1548,19 +1556,20 @@ public class ClientUtils {
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
public static void countDisAmt(IDataModel model, String entryKey, int row, IFormView view) {
|
public static void countDisAmt(IDataModel model, String entryKey, int row, IFormView view) {
|
||||||
String accAmtUseType = (String) model.getValue("yem_accamtusetype");
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
int entryRow = model.getEntryRowCount(entryKey);
|
String accAmtUseType = (String) model.getValue("yem_accamtusetype");
|
||||||
if (YEM.isNotEmpty(accAmtUseType)) {
|
int entryRow = model.getEntryRowCount(entryKey);
|
||||||
switch (accAmtUseType) {
|
if (YEM.isNotEmpty(accAmtUseType)) {
|
||||||
case "A":
|
switch (accAmtUseType) {
|
||||||
countAmtDisAmt(model, entryKey, view);
|
case "A":
|
||||||
break;
|
countAmtDisAmt(model, entryKey, view);
|
||||||
case "B":
|
break;
|
||||||
countRateDisAmt(model, row);
|
case "B":
|
||||||
break;
|
countRateDisAmt(model, row);
|
||||||
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -1594,22 +1603,28 @@ public class ClientUtils {
|
|||||||
BigDecimal diaAmt = saFobAmount.divide(amount, RoundingMode.HALF_UP).multiply(fundPoolAmt).setScale(2, RoundingMode.HALF_UP);
|
BigDecimal diaAmt = saFobAmount.divide(amount, RoundingMode.HALF_UP).multiply(fundPoolAmt).setScale(2, RoundingMode.HALF_UP);
|
||||||
if (i == seq) {
|
if (i == seq) {
|
||||||
model.beginInit();
|
model.beginInit();
|
||||||
model.setValue("yem_disamt", fundPoolAmt.subtract(fundPoolAmtSum), i);
|
|
||||||
model.endInit();
|
|
||||||
view.updateView("yem_disamt", i);
|
view.updateView("yem_disamt", i);
|
||||||
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", fundPoolAmt.subtract(fundPoolAmtSum), i);
|
||||||
|
}
|
||||||
|
model.endInit();
|
||||||
} else {
|
} else {
|
||||||
fundPoolAmtSum = fundPoolAmtSum.add(diaAmt);
|
fundPoolAmtSum = fundPoolAmtSum.add(diaAmt);
|
||||||
model.beginInit();
|
model.beginInit();
|
||||||
model.setValue("yem_disamt", diaAmt, i);
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", diaAmt, i);
|
||||||
|
view.updateView("yem_disamt", i);
|
||||||
|
}
|
||||||
model.endInit();
|
model.endInit();
|
||||||
view.updateView("yem_disamt", i);
|
|
||||||
}
|
}
|
||||||
// System.out.printf("++++++++-- i = %s -- seq = %s -- yem_disamt = %s%n", i, seq, model.getValue("yem_disamt", i));
|
// System.out.printf("++++++++-- i = %s -- seq = %s -- yem_disamt = %s%n", i, seq, model.getValue("yem_disamt", i));
|
||||||
} else {
|
} else {
|
||||||
model.beginInit();
|
model.beginInit();
|
||||||
model.setValue("yem_disamt", null, i);
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
|
model.setValue("yem_disamt", null, i);
|
||||||
|
view.updateView("yem_disamt", i);
|
||||||
|
}
|
||||||
model.endInit();
|
model.endInit();
|
||||||
view.updateView("yem_disamt", i);
|
|
||||||
}
|
}
|
||||||
ClientUtils.countAfterFrontAmt(model, i);//计算折扣后销售金额
|
ClientUtils.countAfterFrontAmt(model, i);//计算折扣后销售金额
|
||||||
ClientUtils.addSaAmountTk(model, i);//销售金额(价格条款)结算币别
|
ClientUtils.addSaAmountTk(model, i);//销售金额(价格条款)结算币别
|
||||||
@ -1631,12 +1646,14 @@ public class ClientUtils {
|
|||||||
private static void countRateDisAmt(IDataModel model, int row) {
|
private static void countRateDisAmt(IDataModel model, int row) {
|
||||||
if (row >= 0) {
|
if (row >= 0) {
|
||||||
Boolean ifGift = (Boolean) model.getValue("yem_ifgift", row);
|
Boolean ifGift = (Boolean) model.getValue("yem_ifgift", row);
|
||||||
if (!ifGift) {
|
if (!model.getDataEntityType().getName().equals("yem_es_xsalesorder")) {
|
||||||
BigDecimal frontRateEntry = (BigDecimal) model.getValue("yem_frontrateentry", row);
|
if (!ifGift) {
|
||||||
BigDecimal saFobAmount = (BigDecimal) model.getValue("yem_safobamount", row);
|
BigDecimal frontRateEntry = (BigDecimal) model.getValue("yem_frontrateentry", row);
|
||||||
model.setValue("yem_disamt", saFobAmount.multiply(BigDecimal.ONE.subtract(frontRateEntry.divide(new BigDecimal(100)))).setScale(2, RoundingMode.UP), row);
|
BigDecimal saFobAmount = (BigDecimal) model.getValue("yem_safobamount", row);
|
||||||
} else {
|
model.setValue("yem_disamt", saFobAmount.multiply(BigDecimal.ONE.subtract(frontRateEntry.divide(new BigDecimal(100)))).setScale(2, RoundingMode.UP), row);
|
||||||
model.setValue("yem_disamt", null, row);
|
} else {
|
||||||
|
model.setValue("yem_disamt", null, row);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user