SAP应付凭证清单SAP应收凭证清单 SAP应收已清收款(拆分品牌)数据(输入日期格式定义:yyyyMMdd)

This commit is contained in:
yuxueliang0813 2025-04-29 10:19:08 +08:00
parent 8d6cec7570
commit 327e7e8e3e
4 changed files with 34 additions and 11 deletions

View File

@ -153,7 +153,7 @@ public class ASParbillFormPlugin extends AbstractFormPlugin {
FormShowParameter showParameter = this.getView().getFormShowParameter();
String billNumber = showParameter.getCustomParam("billNumber");
//组装查询入参 日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
String shjh_pzh = (String) this.getModel().getValue("shjh_pzh");//SAP应收凭证号
String shjh_kmbh = (String) this.getModel().getValue("shjh_kmbh");//会计科目编号
String shjh_year = (String) this.getModel().getValue("shjh_year");//会计年度

View File

@ -140,7 +140,8 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
if (null != recBill) {
JSONObject data = new JSONObject();
//抬头参考IS_HEADER
data.put("IS_HEADER", getIS_HEADER(recBill));
JSONObject json_HEADER = getIS_HEADER(recBill);
data.put("IS_HEADER", json_HEADER);
//详细参考IT_ITEM
JSONArray itItem = getIT_ITEM(recBill);
if (itItem == null){
@ -154,8 +155,30 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
String receivingType = recBill.getString("receivingtype.number");
if ("103".equals(receivingType) || "109".equals(receivingType)) {
//清账数据参考IT_CLEAR仅清账需要输入且此时清账不需要传入行号
data.put("IT_CLEAR", getIT_CLEAR(recBill));
JSONArray json_clear = getIT_CLEAR(recBill);
data.put("IT_CLEAR", json_clear);
data.put("I_WHXMH", "X");//是否传入行号为否
//如果是员工还款 109 则将入参中的客户字段值更改为分录上的员工工号
if("109".equals(receivingType)){
String personNumber = null;
if(!recBill.getDynamicObjectCollection("entry").isEmpty()){
personNumber = recBill.getDynamicObjectCollection("entry").get(0).getString("shjh_usercode");
}
if(!JhzjUtils.isEmpty(personNumber)){
json_HEADER.put("KUNNR", personNumber);//修改header
//修改ITEM
for (int i = 0; i < itItem.size(); i++) {
if(!JhzjUtils.isEmpty(itItem.getJSONObject(i).getString("KUNNR"))){
itItem.getJSONObject(i).put("KUNNR",personNumber);
}
}
//修改CLEAR
for (int i = 0; i < json_clear.size(); i++) {
json_clear.getJSONObject(i).put("KUNNR",personNumber);
}
}
}
}
String type = recBill.getString(RecFieldsInfo.PAYER_TYPE);//付款人类型
long id = recBill.getLong("payer");//付款人id

View File

@ -35,7 +35,7 @@ import java.util.Map;
public class FundPlanCollectionTask extends AbstractTask implements Plugin {
private static final String entityName = "fpm_report";//资金计划编制 t_fpm_report
private static final String payReceName = "shjh_pay_account";//收付款资金计划科目配置表
private static final String ppsybName = "shjh_pp_syb";//品牌和事业部对应关系 tk_shjh_pp_syb
// private static final String ppsybName = "shjh_pp_syb";//品牌和事业部对应关系 tk_shjh_pp_syb
private static final String custName = "bd_customer";//系统库 表名 T_BD_Customer
@ -46,7 +46,7 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
//查询当月已审核收款类资金计划收款不区分公司当月应只有一个
QFilter qFilter = new QFilter("billstatus", QCP.equals, "C");//单据状态
qFilter.and("name", QCP.equals, " 编制表");//报表名称
// qFilter.and("name", QCP.equals, " 编制表");//报表名称--非报表类型名称注释此过滤条件
qFilter.and("enable", QCP.equals, "1");//是否可用
qFilter.and("reportplantype", QCP.equals, "reportplan");//报表类型-计划编制
DynamicObject[] collection = BusinessDataServiceHelper.load(entityName, "id", qFilter.toArray());
@ -134,12 +134,12 @@ public class FundPlanCollectionTask extends AbstractTask implements Plugin {
//获取上月1号的日期
Date lastMonthFirstDay = cal.getTime();
//日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
JSONArray IT_LIST = new JSONArray();
String duedate_starts = sdf.format(lastMonthFirstDay);//TODO 上月1号-取出纳模块的当前期间的1号
String duedate_ends = sdf.format(new Date());//系统当前日期
// addFilterCondition(IT_LIST, "BUDAT", duedate_starts, duedate_ends);//过账日期-上月和当前月
addFilterCondition(IT_LIST, "BUDAT", "2024-01-01", "2024-12-31");//TODO 测试指定日期
addFilterCondition(IT_LIST, "BUDAT", "20240101", "20241231");//TODO 测试指定日期
JSONObject sapresult = SapUtils.sapARClearedDataAPI(IT_LIST, "FundPlanCollectionTask");
if(sapresult != null){
JSONObject data = sapresult.getJSONObject("data");

View File

@ -34,7 +34,7 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
private static final String entityName = "fpm_report";//资金计划编制 t_fpm_report
private static final String payReceName = "shjh_request_account";//付款申请单_资金计划科目配置表
private static final String ppsybName = "shjh_ejbm_syb";//二级部门和事业部对应关系 tk_shjh_pg
// private static final String ppsybName = "shjh_ejbm_syb";//二级部门和事业部对应关系 tk_shjh_pg
private static final Log logger = LogFactory.getLog(FundPlanPaymentTask.class);
@ -44,7 +44,7 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
public void execute(RequestContext requestContext, Map<String, Object> map) throws KDException {
//查询当月暂存付款类资金计划付款不区分公司当月应只有一个
QFilter qFilter = new QFilter("billstatus", QCP.equals, "A");//单据状态
// qFilter.and("name", QCP.equals, " 编制表");//报表名称
// qFilter.and("name", QCP.equals, " 编制表");//报表名称--非报表类型名称注释此过滤条件
qFilter.and("enable", QCP.equals, "1");//是否可用
qFilter.and("reportplantype", QCP.equals, "reportplan");//报表类型-计划编制
DynamicObject[] collection = BusinessDataServiceHelper.load(entityName, "id", qFilter.toArray());
@ -130,14 +130,14 @@ public class FundPlanPaymentTask extends AbstractTask implements Plugin {
//将日期加一月份得到下月1号
cal.add(Calendar.MONTH, 1);
//日期格式
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd");
SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd");
JSONArray IT_LIST = new JSONArray();
String duedate_starts = sdf.format(cal.getTime());//下月1号为开始日期
//将日期加三月份得到一个季度后的1号
cal.add(Calendar.MONTH, 3);
String duedate_ends = sdf.format(cal.getTime());
// addFilterCondition(IT_LIST, "FAEDT", duedate_starts, duedate_ends);//到期日
addFilterCondition(IT_LIST, "FAEDT", "2024-01-01", duedate_ends);//到期日
addFilterCondition(IT_LIST, "FAEDT", "20241101", duedate_ends);//到期日
JSONObject sapresult = SapUtils.vouchers_payable(IT_LIST, "FundPlanPaymentTask");
if(sapresult != null){
JSONObject data = sapresult.getJSONObject("data");