凭证抬头文本

This commit is contained in:
yuxueliang0813 2025-05-13 11:33:01 +08:00
parent a1c177b1af
commit ccb3e0316c
5 changed files with 27 additions and 12 deletions

View File

@ -106,6 +106,7 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements
boolean isClearBillCancelled = false;
if (isToBeCleared) {
//根据当前单据查找对应下游单据记录
Map<String, HashSet<Long>> recBillMap = BFTrackerServiceHelper.findSourceBills("cas_recbill", new Long[]{(Long) recBill.getPkValue()});
if (recBillMap.containsKey("shjh_clear_account")) {
Set<Long> billIds = recBillMap.get("shjh_clear_account");
@ -139,7 +140,7 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements
// SAP 清账状态校验
String billNumber = recBill.getString("billno");
String companyCode = recBill.getString("org.number");
String sapFiscalYear = recBill.getString("shjh_sapfiscalyear");
String sapFiscalYear = recBill.getString("shjh_sapfiscalyear");//SAP收款凭证会计年度
// String sapLineNumber = recBill.getString("shjh_sapline");
//此时不传行号给sapsap返回这个凭证下的所有行清账标识我方解析只要有一行是已清账就提示
String response = SapUtils.querySapClearAccountsState(billNumber, companyCode, voucherNum, sapFiscalYear);
@ -182,14 +183,15 @@ public class RecBillChangeListExtendPlugin extends AbstractListPlugin implements
return;
}
// 是否存在付款申请
// 是否存在付款申请
QFilter[] filters = new QFilter[]{
new QFilter("applyorg.number", QCP.equals, companyCode),
new QFilter("shjh_vouchernum", QCP.equals, voucherNum)
new QFilter("shjh_vouchernum", QCP.equals, voucherNum),//sap应付凭证号
new QFilter("shjh_voucheryear", QCP.equals, sapFiscalYear)//sap应付凭证会计年度
};
DynamicObject payApply = BusinessDataServiceHelper.loadSingle("ap_payapply", filters);
DynamicObject payApply = BusinessDataServiceHelper.loadSingle("ap_payapply", "id,billno", filters);
if (payApply != null) {
this.getView().showTipNotification("所选单据不满足变更条件存在关联SAP付款申请:" + payApply.getString("billno") + ",不允许变更。");
this.getView().showTipNotification("所选单据不满足变更条件存在关联SAP付款申请" + payApply.getString("billno") + ",不允许变更。");
evt.setCancel(true);
}
}

View File

@ -216,11 +216,14 @@ public class PaybillPushSapOperation extends AbstractOperationServicePlugIn impl
QFilter q1 = new QFilter("sourcebill", QCP.equals, bill.getPkValue());
QFilter q2 = new QFilter("billstatus",QCP.equals,"C");
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle("gl_voucher",
"id,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
"id,description,sourcebill,entries,entries.account,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
new QFilter[]{q1, q2});
if (null != gl_voucher) {
//todo:对header 凭证类型重新赋值
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//凭证类型
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//凭证类型-从金蝶凭证中获取
if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){
IS_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取
}
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
if (!entries.isEmpty()) {
for (DynamicObject entry : entries) {

View File

@ -43,6 +43,7 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
private final static Log logger = LogFactory.getLog(RecPushVoucherOperation.class);
private static final String glbdName = "gl_assist_bd";//核算项目组合纵表
private static final String customerName = "bd_customer";//客户标识
private static final String voucherName = "gl_voucher";//凭证标识
/**
@ -338,8 +339,8 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
// 5. 查询关联的凭证信息凭证必传
QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, recBill.getPkValue());
voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//已审核
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle("gl_voucher",
"id,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle(voucherName,
"id,description,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
voucherFilters.toArray());
if (gl_voucher != null) {
@ -347,7 +348,10 @@ public class RecPushVoucherOperation extends AbstractOperationServicePlugIn impl
String asstype;
DynamicObject glassistbd;
DynamicObject hsxminfo;
json_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//凭证类型
json_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//凭证类型-从金蝶凭证中获取
if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){
json_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取
}
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
if (entries != null && !entries.isEmpty()) {
//如果是客户拆分则从凭证上获取客户编号

View File

@ -126,10 +126,13 @@ public class RevenueBillOperation extends AbstractOperationServicePlugIn impleme
QFilter voucherFilters = new QFilter("sourcebill", QCP.equals, prinfo.getPkValue());//凭证源单ID为预提单
voucherFilters.and(new QFilter("billstatus",QCP.equals,"C"));//凭证状态已审核
DynamicObject gl_voucher = BusinessDataServiceHelper.loadSingle(voucherName,
"id,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
"id,description,sourcebill,entries,entries.account,entries.assgrp,entries.debitlocal,entries.creditlocal,entries.entrydc,vouchertype",
voucherFilters.toArray());
if (null != gl_voucher) {
IS_HEADER.put("BLART", gl_voucher.getString("vouchertype.number"));//根据金蝶凭证类型设置
if(!JhzjUtils.isEmpty(gl_voucher.getString("description"))){
IS_HEADER.put("BKTXT", gl_voucher.getString("description"));//凭证抬头文本-从金蝶凭证中获取
}
DynamicObjectCollection entries = gl_voucher.getDynamicObjectCollection("entries");
JSONObject item;
DynamicObject account;

View File

@ -5,6 +5,7 @@ import com.alibaba.fastjson.JSONException;
import com.alibaba.fastjson.JSONObject;
import com.sap.db.jdbc.packet.ErrorLevel;
import kd.bos.context.RequestContext;
import kd.bos.dataentity.OperateOption;
import kd.bos.dataentity.entity.DynamicObject;
import kd.bos.dataentity.entity.DynamicObjectCollection;
import kd.bos.entity.operate.result.OperateErrorInfo;
@ -15,6 +16,7 @@ import kd.bos.logging.Log;
import kd.bos.logging.LogFactory;
import kd.bos.orm.query.QFilter;
import kd.bos.servicehelper.BusinessDataServiceHelper;
import kd.bos.servicehelper.operation.OperationServiceHelper;
import kd.bos.servicehelper.operation.SaveServiceHelper;
import kd.sdk.plugin.Plugin;
import shjh.jhzj7.fi.fi.utils.EsbUtils;
@ -180,7 +182,8 @@ public class SupplierInitOperation extends AbstractOperationServicePlugIn implem
//处理 sap公司信息 结算方式 统驭科目
handleSAPCompany(companysJson,currentSup.getDynamicObjectCollection("shjh_entry_sap"),supnumber);
//保存供应商
SaveServiceHelper.save(new DynamicObject[]{currentSup});
// SaveServiceHelper.save(new DynamicObject[]{currentSup});
OperationServiceHelper.executeOperate("save", entityName, new DynamicObject[]{currentSup}, OperateOption.create());
cusids.put(supnumber,currentSup.getLong("id"));
}