(1)如果结算币别=美元:
① 扣减后金额(美元)=上次美元金额(实际)+ 配件资金池增加金额-配件资金池扣减金额; ② 扣减后金额(人民币)= 上次人民币金额(实际); (2)如果结算币别=人民币: ① 扣减后金额(美元)=上次美元金额(实际); ② 扣减后金额(人民币)= 上次人民币金额(实际)+ 配件资金池增加金额-配件资金池扣减金额;
This commit is contained in:
parent
5f6138f504
commit
eaf2a22776
@ -9,7 +9,6 @@ import kd.bos.entity.plugin.AbstractOperationServicePlugIn;
|
||||
import kd.bos.entity.plugin.AddValidatorsEventArgs;
|
||||
import kd.bos.entity.plugin.PreparePropertysEventArgs;
|
||||
import kd.bos.entity.plugin.args.BeforeOperationArgs;
|
||||
import kd.bos.entity.plugin.args.BeginOperationTransactionArgs;
|
||||
import kd.bos.entity.plugin.args.EndOperationTransactionArgs;
|
||||
import kd.bos.orm.query.QCP;
|
||||
import kd.bos.orm.query.QFilter;
|
||||
@ -19,7 +18,6 @@ import kd.bos.servicehelper.operation.SaveServiceHelper;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
@ -54,8 +52,32 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
|
||||
public void beforeExecuteOperationTransaction(BeforeOperationArgs e) {
|
||||
super.beforeExecuteOperationTransaction(e);
|
||||
for (ExtendedDataEntity dataEntity : e.getSelectedRows()) {
|
||||
DynamicObject billObj = dataEntity.getDataEntity();
|
||||
getlast(billObj);
|
||||
DynamicObject dynamicObject = dataEntity.getDataEntity();
|
||||
DynamicObject billObj = BusinessDataServiceHelper.loadSingle(dynamicObject.getPkValue(), dynamicObject.getDynamicObjectType().getName());
|
||||
DynamicObject yemCurrency = billObj.getDynamicObject("yem_currency");
|
||||
if (yemCurrency!=null){
|
||||
/*
|
||||
(1)如果结算币别=美元:
|
||||
① 扣减后金额(美元)=上次美元金额(实际)+ 配件资金池增加金额-配件资金池扣减金额;
|
||||
② 扣减后金额(人民币)= 上次人民币金额(实际);
|
||||
(2)如果结算币别=人民币:
|
||||
① 扣减后金额(美元)=上次美元金额(实际);
|
||||
② 扣减后金额(人民币)= 上次人民币金额(实际)+ 配件资金池增加金额-配件资金池扣减金额;
|
||||
*/
|
||||
String number = yemCurrency.getString("number");
|
||||
BigDecimal yemCreditusdamt = billObj.getBigDecimal("yem_creditusdamt");//上次美元金额(实际)
|
||||
BigDecimal yemCreditrmbamt = billObj.getBigDecimal("yem_creditrmbamt");//上次人民币金额(实际)
|
||||
BigDecimal yemAmount = billObj.getBigDecimal("yem_amount");//配件资金池增加金额
|
||||
BigDecimal yemAmountSub = billObj.getBigDecimal("yem_amount_sub");//配件资金池扣减金额
|
||||
if ("CNY".equals(number)){
|
||||
dynamicObject.set("yem_afterdeductionusd",yemCreditusdamt);
|
||||
dynamicObject.set("yem_afterdeductionrmb",yemCreditrmbamt.add(yemAmount.subtract(yemAmountSub)));
|
||||
}else if ("USD".equals(number)){
|
||||
dynamicObject.set("yem_afterdeductionusd",yemCreditusdamt.add(yemAmount.subtract(yemAmountSub)));
|
||||
dynamicObject.set("yem_afterdeductionrmb",yemCreditrmbamt);
|
||||
}
|
||||
}
|
||||
getlast(dynamicObject);
|
||||
}
|
||||
}
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user