parent
ff67ce423c
commit
8e01522525
|
|
@ -97,7 +97,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
DynamicObjectCollection shjhEntryentity = this.getModel().getEntryEntity("shjh_entryentity");
|
||||
shjhEntryentity.clear();
|
||||
//todo:根据查询条件,调用SAP查询凭证接口,生成分录行
|
||||
//根据查询条件,调用SAP查询凭证接口,生成分录行
|
||||
JSONObject result = vouchers_payable(IT_LIST, payablevouchernumber);
|
||||
if (null != result && result.containsKey("data")) {
|
||||
// 处理查询结果
|
||||
|
|
@ -155,13 +155,46 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
this.getModel().setValue("shjh_payeebanknum", lifnr, i);//往来户名称
|
||||
}
|
||||
this.getModel().setValue("shjh_description", it_list.getString("BVTYP"), i);//合作银行类型.合作银行类型
|
||||
this.getModel().setValue("shjh_reasoncode", "014", i);//todo:原因码
|
||||
this.getModel().setValue("shjh_classificationoffund", payablevouchernumber, i);//todo:资金计划分类
|
||||
this.getModel().setValue("shjh_reasoncode", it_list.getString("RSTGR"), i);//原因码
|
||||
this.getModel().setValue("shjh_classificationoffund", "", i);//资金计划分类
|
||||
this.getModel().setValue("shjh_secondarydept", it_list.getString("ZREQ_DEPT"), i);//二级部门,需求部门
|
||||
this.getModel().setValue("shjh_procurementeam", it_list.getString("EKGRP"), i);//采购组
|
||||
this.getModel().setValue("shjh_isselfprocurment", it_list.getString("ZZXCG_FLAG"), i);//是否自行采购
|
||||
this.getModel().setValue("shjh_paymentcurrency", it_list.getString("WAERS"), i);//付款币别编号CNY,货币码
|
||||
this.getModel().setValue("shjh_settlementcurrency", it_list.getString("WAERS"), i);//结算币别编号,货币码
|
||||
this.getModel().setValue("shjh_paymenttypenumber", it_list.getString("ZLSCH"), i);//付款方式
|
||||
switch (it_list.getString("ZLSCH")) {
|
||||
case "B":
|
||||
this.getModel().setValue("shjh_paymenttype", "汇票", i);//付款方式
|
||||
break;
|
||||
case "C":
|
||||
this.getModel().setValue("shjh_paymenttype", "支票", i);//付款方式
|
||||
break;
|
||||
case "D":
|
||||
this.getModel().setValue("shjh_paymenttype", "贷记凭证", i);//付款方式
|
||||
break;
|
||||
case "E":
|
||||
this.getModel().setValue("shjh_paymenttype", "现金", i);//付款方式
|
||||
break;
|
||||
case "F":
|
||||
this.getModel().setValue("shjh_paymenttype", "EPIC-中信银行", i);//付款方式
|
||||
break;
|
||||
case "G":
|
||||
this.getModel().setValue("shjh_paymenttype", "EPIC_线下付款方式", i);//付款方式
|
||||
break;
|
||||
case "P":
|
||||
this.getModel().setValue("shjh_paymenttype", "POS机", i);//付款方式
|
||||
break;
|
||||
case "T":
|
||||
this.getModel().setValue("shjh_paymenttype", "银企直连", i);//付款方式
|
||||
break;
|
||||
case "U":
|
||||
this.getModel().setValue("shjh_paymenttype", "网银及柜台付款", i);//付款方式
|
||||
break;
|
||||
case "Y":
|
||||
this.getModel().setValue("shjh_paymenttype", "自动扣款", i);//付款方式
|
||||
break;
|
||||
}
|
||||
|
||||
}
|
||||
this.getView().updateView("shjh_entryentity");
|
||||
|
|
@ -172,8 +205,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
break;
|
||||
case "confirm":
|
||||
//todo:(字段待确认)遍历选中的分录行,生成付款申请单 7.1.3
|
||||
// 日志中入参根据分录中存入的存储
|
||||
//(字段待确认)遍历选中的分录行,生成付款申请单 7.1.3
|
||||
EntryGrid entryentitys = (EntryGrid) this.getView().getControl("shjh_entryentity");
|
||||
int[] selectRows = entryentitys.getSelectRows();
|
||||
if (selectRows.length == 0) {
|
||||
|
|
@ -268,7 +300,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
this.getView().showMessage("同步失败,凭证号:" + fkBillNum + "的费控单据已锁定");
|
||||
return;
|
||||
} else {
|
||||
//todo:存在且单据中SAP锁定状态为未锁定,更新数据
|
||||
//存在且单据中SAP锁定状态为未锁定,更新数据
|
||||
ap_payapply = ap_payapplys;
|
||||
}
|
||||
}
|
||||
|
|
@ -336,6 +368,8 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
ap_payapply.set(currencyType, currency);
|
||||
}
|
||||
|
||||
|
||||
|
||||
//汇率
|
||||
BigDecimal exchangerate = (BigDecimal) this.getModel().getValue("shjh_exchangerate", selectRow);//汇率
|
||||
try {
|
||||
|
|
@ -368,6 +402,14 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
// 往来户
|
||||
ap_payapply_entry.set("e_asstact", party);
|
||||
|
||||
// 结算方式(付款方式)
|
||||
String shjhPaymenttypenumber = (String)this.getModel().getValue("shjh_paymenttypenumber", selectRow);
|
||||
DynamicObject settlementtype = BusinessDataServiceHelper.loadSingle("bd_settlementtype",
|
||||
new QFilter[]{new QFilter("number", QCP.equals, shjhPaymenttypenumber)});
|
||||
if (null != settlementtype) {
|
||||
ap_payapply_entry.set("e_settlementtype", settlementtype);
|
||||
}
|
||||
|
||||
//如果往来户为供应商,才会有往来账户和银行,根据供应商银行分录里面的合作银行类型来确定往来账户和银行
|
||||
//往来账户 && 往来银行
|
||||
if ("供应商".equals(asstacttype)) {
|
||||
|
|
@ -390,7 +432,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
//表头申请金额
|
||||
ap_payapply.set("applyamount", amount);
|
||||
|
||||
//todo:结算方式
|
||||
//结算方式
|
||||
|
||||
//付款类型:取值范围:对公付款、对私付款;SAP:科目编号1221020200 对私付款。费控:劳务人员报销单 对私付款。其他均赋值为对公付款。
|
||||
if ("1221020200".equals(accountingsubject)) {
|
||||
|
|
@ -487,7 +529,7 @@ public class SappzFormPlugin extends AbstractFormPlugin {
|
|||
}
|
||||
ap_payapply.set("shjh_yym", cause);
|
||||
}
|
||||
//todo:汇率日期,支付渠道 文档20-36(7.1.3)
|
||||
//汇率日期,支付渠道 文档20-36(7.1.3)
|
||||
//过账日期(记账)
|
||||
Date bookkeepingdate = (Date) this.getModel().getValue("shjh_bookkeepingdate", selectRow);
|
||||
if (null != bookkeepingdate) {
|
||||
|
|
|
|||
|
|
@ -422,6 +422,7 @@ public class ApplyAdjustBillControler {
|
|||
String accountingsubject = it_list.getString("SAKNR");//会计科目:1001,总帐科目编号
|
||||
BigDecimal outstandingamount = new BigDecimal(it_list.getString("WRBTR"));//未清金额,凭证货币金额
|
||||
BigDecimal KURSF = new BigDecimal(it_list.getString("KURSF"));
|
||||
String zlsch = it_list.getString("ZLSCH");//付款方式
|
||||
if (KURSF.compareTo(BigDecimal.ZERO) == 0) {
|
||||
KURSF = BigDecimal.ONE;
|
||||
}
|
||||
|
|
@ -542,7 +543,7 @@ public class ApplyAdjustBillControler {
|
|||
}
|
||||
|
||||
// 设置明细信息
|
||||
String s1 = setEntryInfo(ap_payapply, asstacttype, asstact, assacct, duedate, outstandingamount, fkBillNum);
|
||||
String s1 = setEntryInfo(ap_payapply, asstacttype, asstact, assacct, duedate, outstandingamount, fkBillNum,zlsch);
|
||||
if (StringUtils.isNotEmpty(s1)) {
|
||||
return s1;
|
||||
}
|
||||
|
|
@ -613,9 +614,11 @@ public class ApplyAdjustBillControler {
|
|||
* @param assacct 合作银行类型
|
||||
* @param duedate 到期日
|
||||
* @param outstandingamount 未清金额
|
||||
* @param fkBillNum 费控调整单号
|
||||
* 付款方式 _结算
|
||||
* @return 操作是否成功
|
||||
*/
|
||||
private String setEntryInfo(DynamicObject ap_payapply, String asstacttype, String asstact, String assacct, Date duedate, BigDecimal outstandingamount, String fkBillNum) {
|
||||
private String setEntryInfo(DynamicObject ap_payapply, String asstacttype, String asstact, String assacct, Date duedate, BigDecimal outstandingamount, String fkBillNum,String zlsch) {
|
||||
DynamicObjectCollection entry = ap_payapply.getDynamicObjectCollection("entry");
|
||||
entry.clear();
|
||||
DynamicObject ap_payapply_entry = entry.addNew();
|
||||
|
|
@ -675,6 +678,13 @@ public class ApplyAdjustBillControler {
|
|||
}
|
||||
}
|
||||
|
||||
// 结算方式(付款方式)
|
||||
DynamicObject settlementtype = BusinessDataServiceHelper.loadSingle("bd_settlementtype",
|
||||
new QFilter[]{new QFilter("number", QCP.equals, zlsch)});
|
||||
if (null != settlementtype) {
|
||||
ap_payapply_entry.set("e_settlementtype", settlementtype);
|
||||
}
|
||||
|
||||
//到期日
|
||||
ap_payapply_entry.set("e_duedate", duedate);
|
||||
//分录申请金额
|
||||
|
|
|
|||
Loading…
Reference in New Issue