--收款业务变更后生成的红、蓝字收款单携带变更前收款单的sap凭证号,应该重新推送sap

s
This commit is contained in:
weiyunlong 2025-05-12 17:25:19 +08:00
parent fe1f7e1445
commit 02589371e6
1 changed files with 18 additions and 0 deletions

View File

@ -13,6 +13,7 @@ import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import java.math.BigDecimal;
import java.util.*;
/**
@ -47,6 +48,23 @@ public class RecBillSaveOperation extends AbstractOperationServicePlugIn impleme
//携带生单规则分录的业务大类,业务小类,成本中心,利润中心到收款处理单头,原因码到分录
carryCustomer(bill);
SaveServiceHelper.save(new DynamicObject[]{bill});
//若源单为收款处理,清空单据头.SAP凭证号;单据头.是否已推送SAP;单据头.SAP会计年度 cas_recbill
String sourcebilltype = bill.getString("sourcebilltype");
if ("cas_recbill".equals(sourcebilltype) || "收款单".equals(sourcebilltype)) {
BigDecimal sourcebillid = bill.getBigDecimal("sourcebillid");
QFilter q1 = new QFilter("id", QCP.equals, sourcebillid);
DynamicObject[] load = BusinessDataServiceHelper.load("cas_recbill",
"id,billno,shjh_vouchernum,shjh_sapfiscalyear,shjh_ispushsap,shjh_issourceblue", q1.toArray());
for (DynamicObject dynamicObject : load) {
boolean shjhIssourceblue = dynamicObject.getBoolean("shjh_issourceblue");
if (!shjhIssourceblue) {
dynamicObject.set("shjh_ispushsap", false);
dynamicObject.set("shjh_issourceblue", true);
SaveServiceHelper.save(new DynamicObject[]{dynamicObject});
}
}
}
}
}