fix:
贷记单提交计算扣减后金额
This commit is contained in:
parent
17ab848a24
commit
c97d5df2c4
@ -65,34 +65,29 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
|
|||||||
① 扣减后金额(美元)=上次美元金额(实际);
|
① 扣减后金额(美元)=上次美元金额(实际);
|
||||||
② 扣减后金额(人民币)= 上次人民币金额(实际)+ 配件资金池增加金额-配件资金池扣减金额;
|
② 扣减后金额(人民币)= 上次人民币金额(实际)+ 配件资金池增加金额-配件资金池扣减金额;
|
||||||
*/
|
*/
|
||||||
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_koujianusd",yemCreditusdamt);
|
|
||||||
dynamicObject.set("yem_koujiancny",yemCreditrmbamt.add(yemAmount.subtract(yemAmountSub)));
|
|
||||||
}else if ("USD".equals(number)){
|
|
||||||
dynamicObject.set("yem_koujianusd",yemCreditusdamt.add(yemAmount.subtract(yemAmountSub)));
|
|
||||||
dynamicObject.set("yem_koujiancny",yemCreditrmbamt);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
SaveServiceHelper.update(dynamicObject);
|
SaveServiceHelper.update(dynamicObject);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 计算上次美元金额(实际) 上次人民币金额(实际)
|
* 计算上次美元金额(实际) 上次人民币金额(实际)
|
||||||
|
*
|
||||||
* @param temp
|
* @param temp
|
||||||
*/
|
*/
|
||||||
public void getlast(DynamicObject temp) {
|
public void getlast(DynamicObject temp) {
|
||||||
temp = BusinessDataServiceHelper.loadSingle(temp.getPkValue(), temp.getDynamicObjectType().getName());
|
temp = BusinessDataServiceHelper.loadSingle(temp.getPkValue(), temp.getDynamicObjectType().getName());
|
||||||
|
DynamicObject yemCurrency = temp.getDynamicObject("yem_currency");
|
||||||
//借贷业务类型
|
//借贷业务类型
|
||||||
DynamicObject yem_credittype = temp.getDynamicObject("yem_credittype");
|
DynamicObject yem_credittype = temp.getDynamicObject("yem_credittype");
|
||||||
//集团客户
|
//集团客户
|
||||||
DynamicObject yem_customer = temp.getDynamicObject("yem_groupcusfields");
|
DynamicObject yem_customer = temp.getDynamicObject("yem_groupcusfields");
|
||||||
//产品类型
|
//产品类型
|
||||||
DynamicObject yem_bd_products = temp.getDynamicObject("yem_bd_products");
|
DynamicObject yem_bd_products = temp.getDynamicObject("yem_bd_products");
|
||||||
|
|
||||||
|
BigDecimal yemAmount = temp.getBigDecimal("yem_amount");//配件资金池增加金额
|
||||||
|
BigDecimal yemAmountSub = temp.getBigDecimal("yem_amount_sub");//配件资金池扣减金额
|
||||||
QFilter qFilter1 = new QFilter("billstatus", QCP.equals, "C");
|
QFilter qFilter1 = new QFilter("billstatus", QCP.equals, "C");
|
||||||
qFilter1.and(new QFilter("yem_credittype.id", QCP.equals, yem_credittype.getLong("id")));
|
qFilter1.and(new QFilter("yem_credittype.id", QCP.equals, yem_credittype.getLong("id")));
|
||||||
qFilter1.and(new QFilter("yem_groupcusfields.id", QCP.equals, yem_customer.getLong("id")));
|
qFilter1.and(new QFilter("yem_groupcusfields.id", QCP.equals, yem_customer.getLong("id")));
|
||||||
@ -157,9 +152,11 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
|
|||||||
String number = yem_em_replace.getString("number");
|
String number = yem_em_replace.getString("number");
|
||||||
if (number.equals("CNY")) {
|
if (number.equals("CNY")) {
|
||||||
temp.set("yem_creditrmbamt", bigDecimal);
|
temp.set("yem_creditrmbamt", bigDecimal);
|
||||||
|
temp.set("yem_koujiancny", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
|
||||||
}
|
}
|
||||||
if (number.equals("USD")) {
|
if (number.equals("USD")) {
|
||||||
temp.set("yem_creditusdamt", bigDecimal);
|
temp.set("yem_creditusdamt", bigDecimal);
|
||||||
|
temp.set("yem_koujianusd", bigDecimal.add(yemAmount.subtract(yemAmountSub)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,7 +177,6 @@ public class DebCredNewSubmitOp extends AbstractOperationServicePlugIn {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
SaveServiceHelper.update(temp);
|
SaveServiceHelper.update(temp);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user