付款处理单反写资金计划申请实际付款增加类型反写
This commit is contained in:
parent
542322f4bf
commit
6f5da58861
|
|
@ -63,27 +63,7 @@ public class CasPaybillToEcFundPlanApplyOp extends AbstractOperationServicePlugI
|
|||
int zcgjZjjhhdseq = paybill.getInt("zcgj_zjjhhdseq");
|
||||
long zcgjZjjhhdid = paybill.getLong("zcgj_zjjhhdid");
|
||||
String billstatus = paybill.getString("billstatus");
|
||||
if(zcgjZjjhhdid !=0 && zcgjZjjhhdseq!=0 && "D".equals(billstatus)){
|
||||
// String typeString = "";
|
||||
/*if(settletype!=null){
|
||||
String type = settletype.getString("number");
|
||||
if("002".equals(type) || "JSFS01".equals(type) || "JSFS04".equals(type)){ //司库-对公/电汇
|
||||
//现金
|
||||
typeString = "XJ";
|
||||
}else if("JSFS07".equals(type)){ //银行承兑汇票
|
||||
//银行承兑
|
||||
typeString = "YHCD";
|
||||
}else if("JSFS06".equals(type)){ //商业承兑汇票
|
||||
//商业承兑
|
||||
typeString = "SYCD";
|
||||
}else if("JSFS26".equals(type)){ //供应链
|
||||
//供应链
|
||||
typeString = "GYL";
|
||||
}else if("JSFS27".equals(type)){ //其他金融产品
|
||||
//其他金融产品
|
||||
typeString = "QTJRCP";
|
||||
}
|
||||
}*/
|
||||
if(zcgjZjjhhdid !=0 && zcgjZjjhhdseq!=0 && "D".equals(billstatus)){//按行id进行反写
|
||||
DynamicObjectCollection entryCpllection = paybill.getDynamicObjectCollection("entry");
|
||||
BigDecimal allActamt = BigDecimal.ZERO;
|
||||
for (DynamicObject entry : entryCpllection) {
|
||||
|
|
@ -124,6 +104,65 @@ public class CasPaybillToEcFundPlanApplyOp extends AbstractOperationServicePlugI
|
|||
}
|
||||
}
|
||||
updateData.add(fundingplanapply);
|
||||
}else if((zcgjZjjhhdid ==0 || zcgjZjjhhdseq ==0) && "D".equals(billstatus)){ //按付款类型进行反写
|
||||
String typeString = "";
|
||||
if(settletype!=null){
|
||||
String type = settletype.getString("number");
|
||||
if("002".equals(type) || "JSFS04".equals(type)){ //司库-对公/电汇
|
||||
//现金
|
||||
typeString = "XJ";
|
||||
}else if("JSFS07".equals(type)){ //银行承兑汇票
|
||||
//银行承兑
|
||||
typeString = "YHCD";
|
||||
}else if("JSFS06".equals(type)){ //商业承兑汇票
|
||||
//商业承兑
|
||||
typeString = "SYCD";
|
||||
}else if("JSFS26".equals(type)){ //供应链
|
||||
//供应链
|
||||
typeString = "GYL";
|
||||
}else if("JSFS27".equals(type)){ //其他金融产品
|
||||
//其他金融产品
|
||||
typeString = "QTJRCP";
|
||||
}
|
||||
}
|
||||
DynamicObjectCollection entryCpllection = paybill.getDynamicObjectCollection("entry");
|
||||
BigDecimal allActamt = BigDecimal.ZERO;
|
||||
for (DynamicObject entry : entryCpllection) {
|
||||
BigDecimal val = entry.getBigDecimal("e_actamt");
|
||||
BigDecimal eActamt = val !=null ?val:BigDecimal.ZERO;//获取实付金额
|
||||
allActamt = allActamt.add(eActamt);
|
||||
}
|
||||
|
||||
//读取资金计划申请
|
||||
DynamicObject fundingplanapply = BusinessDataServiceHelper.loadSingle(dataId, "zcgj_ec_fundingplanapply");
|
||||
DynamicObjectCollection zcgjFinApprovedAmount = fundingplanapply.getDynamicObjectCollection("zcgj_fin_approved_amount");
|
||||
for (DynamicObject dynamicObject : zcgjFinApprovedAmount) {
|
||||
String zcgjSetttype = dynamicObject.getString("zcgj_setttype");
|
||||
if(typeString.equals(zcgjSetttype)){
|
||||
BigDecimal zcgjAmountpaid = dynamicObject.getBigDecimal("zcgj_amountpaid");
|
||||
BigDecimal zcgjAmountRecommended = zcgjAmountpaid !=null ? zcgjAmountpaid:BigDecimal.ZERO;//实际付款金额
|
||||
BigDecimal amountrecommended = BigDecimal.ZERO;
|
||||
if(!isPay){
|
||||
amountrecommended = allActamt;
|
||||
allActamt = allActamt.multiply(BigDecimal.ZERO.subtract(BigDecimal.ONE));//取相反数
|
||||
}
|
||||
allActamt = allActamt.add(zcgjAmountRecommended);
|
||||
dynamicObject.set("zcgj_amountpaid", allActamt);//实付金额
|
||||
dynamicObject.set("zcgj_amount_inpayment",amountrecommended);//
|
||||
|
||||
//zcgj_amount_remaining = zcgj_hdamount - zcgj_amount_inpayment - zcgj_amountpaid
|
||||
//剩余待拨付金额 = 财务核定金额 - 付款处理中金额 - 实付金额
|
||||
BigDecimal hdamount = dynamicObject.getBigDecimal("zcgj_hdamount");
|
||||
if(hdamount !=null && isPay){
|
||||
BigDecimal subtract = hdamount.subtract(amountrecommended).subtract(allActamt);
|
||||
dynamicObject.set("zcgj_amount_remaining",subtract);
|
||||
}else if(hdamount != null){
|
||||
BigDecimal subtract = hdamount.add(amountrecommended).subtract(allActamt);//实付金额已经成为相反数
|
||||
dynamicObject.set("zcgj_amount_remaining",subtract);
|
||||
}
|
||||
}
|
||||
}
|
||||
updateData.add(fundingplanapply);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue