Commit afd5ee79 authored by 1650842865's avatar 1650842865

付款申请无PO流程调整:在BPM付款流程中非PO付款改造。

            1.按照目前流程节点将付款信息传到SAP生成付款凭证;
            2.重新经过申请人提交(费用类型代码、发票号码、税码、不含税金额(自动计算)、税额(自动计算)),费用会计审核传到SAP后生成费用凭证。
parent de687e9a
...@@ -4,331 +4,7 @@ var tableArray = [ ...@@ -4,331 +4,7 @@ var tableArray = [
node: "reimbursementApplierGrid", node: "reimbursementApplierGrid",
gridManager: null, gridManager: null,
data: null, data: null,
columns: [ columns: getColumns(),
{display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},
{display: "研发项目", name: "zzyl01", width: 150, minwidth: 80, type: "string", align: "left",
editor: {
required: false, type: "text",
}
},
{display: "", name: "reimbursementDetailId", width: 80, minwidth: 80, type: "string", align: "left", hide: true},
{display: "", name: "reimbursementBaseInfoId", width: 80, minwidth: 80, type: "string", align: "left", hide: true},
{display: "", name: "mwskz", width: 80, minwidth: 80, type: "string", align: "left", hide: true},
{
display: "计划内外付款标识", name: "zepPlan", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
ZEP_PLANNAME: "zepPlanname"
}
},
}
},
{
display: "计划内外标识名称",
name: "zepPlanname",
width: 120,
minwidth: 120,
type: "string",
align: "left",
},
{
display: "BP标识", name: "zepBptype", width: 80, minwidth: 60, type: "string", align: "left"
/* ,editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "ZEP_BPTYPE"}
},
back: {
ZEP_BPTYPE: "zepBptype",
ZEP_BPTYPENAME: "zepBptypename"
}
},
}*/
},
{
display: "BP标识描述", name: "zepBptypename", width: 100, minwidth: 80, type: "string", align: "left"
/*,editor: {
type: 'text'
}*/
},
{
display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "getCusAndSuppliers",
getParam: function (item) {
return {
ZEP_BPTYPE: item.zepBptype,
BUKRS:$("#bukrs").val()
}
},
back: {
PARTNER: "partner",
NAME_ORG1: "koinh",
BANKN: "bankn",
BANKL: "bankl",
SWIFT: "swift",
}
},
}
},
{
display: "BP账号名称", name: "koinh", width: 120, minwidth: 120, type: "string", align: "left",
},
{
display: "BP银行账号", name: "bankn", width: 200, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "getCusAndBanks",
getParam: function (item) {
return {
ZEP_BPTYPE: item.zepBptype,
PARTNER:item.partner
}
},
back: {
BANKN: "bankn",
BANKL: "bankl",
SWIFT: "swift",
}
},
}
},
{
display: "BP联行号", name: "bankl", width: 200, minwidth: 120, type: "string", align: "left",
},
{
display: "SWIFT/BIC", name: "swift", width: 120, minwidth: 120, type: "string", align: "left",
},
{
display: "费用类型代码", name: "zepExtype", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "SPKZL"}
},
back: {
SPKZL: "zepExtype",
SPTXT: "zepExtypename",
SAKNR: "hkont",
TXT50_SKAT: "txt50"
}
},
}
},
{
display: "费用类型名称",
name: "zepExtypename",
width: 120,
minwidth: 120,
type: "string",
align: "left",
},
{
display: "费用会计科目", name: "hkont", width: 120, minwidth: 120, type: "string", align: "left",
},
{
display: "总账科目描述", name: "txt50", width: 120, minwidth: 120, type: "string", align: "left",
},
{
display: "计划付款日期", name: "zepFpldate", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'date'
}
},
{
display: "成本中心", name: "kostl", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "KOSTL"}
},
back: {
KOSTL: "kostl",
LTEXT: "ktext1"
}
},
}
},
{
display: "成本中心名称", name: "ktext1", width: 120, minwidth: 120, type: "string", align: "left",
},
{
display: "内部订单", name: "aufnr", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "getCompanyOrders",
getParam: function (item) {
return {
BUKRS: $("#bukrs").val()
}
},
back: {
AUFNR: "aufnr",
KTEXT: "ktext"
}
},
}
},
{
display: "内部订单描述", name: "ktext", width: 200, minwidth: 120, type: "string", align: "left",
},
{
display: "发票号码", name: "zyl06", width: 200, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}
},
{
display: "币别", name: "waers", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "WAERS"}
},
back: {
WAERS: "waers",
}
},
}*/
editor: {
type: 'text'
}
},
{
display: "汇率", name: "kursf", width: 120, minwidth: 120, type: "string", align: "left",
/*editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "KURSF"}
},
back: {
KURSF: "kursf",
}
},
}*/
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
},
{
display: "含税金额", name: "kzwi1", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
},
{
display: "税码", name: "mwskzTextView", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'dictionary',
data: {name: 'mwskz'},
textField: 'mwskzTextView',
valueField: 'mwskz',
required: false,
render: function (item) {
return item.mwskzTextView;
}
},
},
{
display: "税额", name: "kwetr", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
},
//等于含税金额/(1+税码对应的税率)*税码对应税率,可手工修改
// render:function(item){
// if (Public.isBlank(item.kwetr) || MathUtil.compare(item.kwetr,0)===0){
// var value = MathUtil.div(item.kzwi1,(1+item.mwskz)).mul(item.mwskz).toFixed(2)
// return item.kwetr = value;
// }else {
// return item.kwetr
// }
//
// }
},
{
display: "不含税金额", name: "netwr", width: 120, minwidth: 120, type: "money", align: "left",
//等于含税金额减去税额
render:function(item){
return item.netwr = MathUtil.sub(item.kzwi1,item.kwetr);
}
},
{
display: "含税金额(本位币)", name: "kzwi11", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
},
//"公司代码等于1000币别等于CNY时,默认等于含税金额;
// 公司代码等于1000币别不等于CNY时,等于含税金额*币别对应的汇率"
// render:function(item){
// var money = 0;
// if (item.waers === "CNY"){
// money=item.kzwi1;
// }else {
// money = MathUtil.mul(item.kzwi1,item.kursf)
// }
// return item.kzwi11 = money;
// }
},
{
display: "税额(本位币)", name: "kwetr1", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
},
//等于(含税金额-本位币)/(1+税码对应的税率)*税码对应税率,可手工修改
// render:function(item){
// if (Public.isBlank(item.kwetr1) || MathUtil.compare(item.kwetr1,0)===0){
// var value = MathUtil.div(item.kzwi11,MathUtil.add(1,item.mwskz)).mul(item.mwskz).toFixed(2)
// return item.kwetr1 = value;
// }else {
// return item.kwetr1
// }
// }
},
{
display: "不含税金额(本位币)", name: "netwr1", width: 120, minwidth: 120, type: "money", align: "left",
//等于含税金额(本位币)减去税额(本位币)
render:function(item){
return item.netwr1 = MathUtil.sub(item.kzwi11,item.kwetr1);
}
},
]
}, },
{ {
parms: {}, parms: {},
...@@ -501,6 +177,196 @@ var tableArray = [ ...@@ -501,6 +177,196 @@ var tableArray = [
] ]
} }
]; ];
function getColumns() {
var columns =[]
//columns push reimbursementApplierGrid的字段
columns.push({display: "EP流程子序号", name: "zepItemno", width: 80, minwidth: 80, type: "string", align: "left"},);
columns.push({display: "研发项目", name: "zzyl01", width: 150, minwidth: 80, type: "string", align: "left",});
columns.push({display: "", name: "reimbursementDetailId", width: 80, minwidth: 80, type: "string", align: "left", hide: true},);
columns.push({display: "", name: "reimbursementBaseInfoId", width: 80, minwidth: 80, type: "string", align: "left", hide: true},);
columns.push({display: "", name: "mwskz", width: 80, minwidth: 80, type: "string", align: "left", hide: true},);
columns.push({display: "计划内外付款标识", name: "zepPlan", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "ZEP_PLAN"}
},
back: {
ZEP_PLAN: "zepPlan",
ZEP_PLANNAME: "zepPlanname"
}
},
}
});
columns.push({display: "计划内外标识名称", name: "zepPlanname", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "BP标识", name: "zepBptype", width: 80, minwidth: 60, type: "string", align: "left",});
columns.push({display: "BP标识描述", name: "zepBptypename", width: 100, minwidth: 80, type: "string", align: "left",});
columns.push({display: "BP(合作伙伴)", name: "partner", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type:'system',
name: "getCusAndSuppliers",
getParam: function (item) {
return {
ZEP_BPTYPE: item.zepBptype,
BUKRS:$("#bukrs").val()
}
},
back: {
PARTNER: "partner",
NAME_ORG1: "koinh",
BANKN: "bankn",
BANKL: "bankl",
SWIFT: "swift",
}
}
}});
columns.push({display: "BP账号名称", name: "koinh", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "BP银行账号", name: "bankn", width: 200, minwidth: 120, type: "string", align: "left",
editor: {
required: true, type: "select",
data: {
type: 'system',
name: "getCusAndBanks",
getParam: function (item) {
return {
ZEP_BPTYPE: item.zepBptype,
PARTNER:item.partner
}
},
back: {
BANKN: "bankn",
BANKL: "bankl",
SWIFT: "swift",
}
},
}
});
columns.push({display: "BP联行号", name: "bankl", width: 200, minwidth: 120, type: "string", align: "left",});
columns.push({display: "SWIFT/BIC", name: "swift", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "计划付款日期", name: "zepFpldate", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: "date"
}
});
columns.push({display: "成本中心", name: "kostl", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "KOSTL"}
},
back: {
KOSTL: "kostl",
LTEXT: "ktext1"
}
},
}});
columns.push({display: "成本中心名称", name: "ktext1", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "内部订单", name: "aufnr", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "getCompanyOrders",
getParam: function (item) {
return {
BUKRS: $("#bukrs").val()
}
},
back: {
AUFNR: "aufnr",
KTEXT: "ktext"
}
},
}
});
columns.push({display: "内部订单描述", name: "ktext", width: 200, minwidth: 120, type: "string", align: "left",});
var statusId = $("#statusId").val();
if (statusId != 0){
columns.push({display: "费用类型代码", name: "zepExtype", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "dictionary",
getParam: function (item) {
return {fieldName: "SPKZL"}
},
back: {
SPKZL: "zepExtype",
SPTXT: "zepExtypename",
SAKNR: "hkont",
TXT50_SKAT: "txt50"
}
},
}});
columns.push({display: "费用类型名称", name: "zepExtypename", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "费用会计科目", name: "hkont", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "总账科目描述", name: "txt50", width: 120, minwidth: 120, type: "string", align: "left",});
columns.push({display: "发票号码", name: "zyl06", width: 200, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}});
columns.push({display: "不含税金额", name: "netwr", width: 120, minwidth: 120, type: "money", align: "left",
//等于含税金额减去税额
render:function(item){
return item.netwr = MathUtil.sub(item.kzwi1,item.kwetr);
}
});
columns.push({display: "税码", name: "mwskzTextView", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'dictionary',
data: {name:'mwskz'},
textField:'mwskzTextView',
valueField:'mwskz',
required: false,
render: function (item) {
return item.mwskzTextView;
}
}});
columns.push({display: "税额", name: "kwetr", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}});
}
columns.push({display: "币别", name: "waers", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: 'text'
}});
columns.push({display: "汇率", name: "kursf", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}});
columns.push({display: "含税金额", name: "kzwi1", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
required: true,
mask: 'nnnnnnnnn.nn',
type: 'text'
}});
columns.push({display: "含税金额(本位币)", name: "kzwi11", width: 120, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}});
columns.push({display: "税额(本位币)", name: "kwetr1", width: 120, minwidth: 120, type: "money", align: "left",
//等于含税金额(本位币)减去税额(本位币)
render:function(item){
return item.netwr1 = MathUtil.sub(item.kzwi11,item.kwetr1);
}});
return columns;
}
var isAllData = true; var isAllData = true;
...@@ -536,9 +402,20 @@ function loadGrid(obj) { ...@@ -536,9 +402,20 @@ function loadGrid(obj) {
}) })
obj.columns = columns; obj.columns = columns;
} }
// else if (obj.node==="capitalPostGrid"){ }
// canDelay = true;
// } //申请人审核
if ("applyPerson" === subProcUnitId){
if (obj.node==="reimbursementApplierGrid"){
canEdit = true;
var columns = obj.columns;
columns.some(column => {
if (column.name == "zepExtype"){
column.editor.required = true;
}
})
obj.columns = columns;
}
} }
//资金岗 //资金岗
...@@ -1035,6 +912,28 @@ function checkConstraints() { ...@@ -1035,6 +912,28 @@ function checkConstraints() {
} }
} }
//申请人审批阶段,SAP付款回执必须有值
if ("applyPerson" == subProcUnitId){
var _grid = UICtrl.getGridManager('#paymentAccomplish_sapReturnGrid');
var datas = DataUtil.getGridData({
gridManager: _grid,
isAllData: isAllData,
onCheck: function () {
return true;
}
});
var checked4 = false
$.each(datas, function (i, o) {
if (Public.isBlank(o.belnr1)){
checked4 = true
}
});
if (checked4) {
Public.tip("SAP付款回执未完成,请稍后再试!")
return false
}
}
return true; return true;
} }
......
...@@ -4,7 +4,6 @@ ...@@ -4,7 +4,6 @@
<html> <html>
<head> <head>
<x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/> <x:base include="layout,dialog,grid,tree,combox,commonTree,date,attachment"/>
<x:script src='/biz/topsun/sap/costReimbursement/payApplyNoPO.js'/>
</head> </head>
<body> <body>
...@@ -23,6 +22,7 @@ ...@@ -23,6 +22,7 @@
<x:hidden name="positionName"/> <x:hidden name="positionName"/>
<x:hidden name="personMemberId"/> <x:hidden name="personMemberId"/>
<x:hidden name="personMemberName"/> <x:hidden name="personMemberName"/>
<x:hidden name="statusId"/>
<div class="hg-form-cols"> <div class="hg-form-cols">
<div class="hg-form-row"> <div class="hg-form-row">
<x:inputC name="zepNo" required="false" readonly="true" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/> <x:inputC name="zepNo" required="false" readonly="true" label="EP流程单号" labelCol="2" maxLength="64" fieldCol="2"/>
...@@ -104,5 +104,7 @@ ...@@ -104,5 +104,7 @@
</div> </div>
</div> </div>
</form> </form>
<x:script src='/biz/topsun/sap/costReimbursement/payApplyNoPO.js'/>
</body> </body>
</html> </html>
...@@ -79,19 +79,12 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S ...@@ -79,19 +79,12 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
} }
sapCostReimbursement = costReimbursementRepository.save(sapCostReimbursement); sapCostReimbursement = costReimbursementRepository.save(sapCostReimbursement);
// String CRDetailJSON = sdo.getString("CRDetail");
// ObjectMapper objectMapper = new ObjectMapper();
// List<SapCostReimbursementDetail> CRDetailAll = costReimbursementDetailRepository.findAllByReimbursementBaseInfoId(sapCostReimbursement.getId());
// if (!CRDetailAll.isEmpty()) {
// costReimbursementDetailRepository.delete(CRDetailAll);
// }
// List<SapCostReimbursementDetail> CRDetailList = objectMapper.readValue(CRDetailJSON, new TypeReference<List<SapCostReimbursementDetail>>() {
// });
List<SapCostReimbursementDetail> CRDetailAll = getBizEntities(SapCostReimbursementDetail.class, "CRDetail"); List<SapCostReimbursementDetail> CRDetailAll = getBizEntities(SapCostReimbursementDetail.class, "CRDetail");
for (SapCostReimbursementDetail item : CRDetailAll) { for (SapCostReimbursementDetail item : CRDetailAll) {
item.setReimbursementBaseInfoId(sapCostReimbursement.getId()); item.setReimbursementBaseInfoId(sapCostReimbursement.getId());
item.setZpayStaus("未支付"); if (StringUtil.isBlank(item.getZpayStaus())){
item.setZpayStaus("未支付");
}
costReimbursementDetailRepository.save(item); costReimbursementDetailRepository.save(item);
} }
return sapCostReimbursement.getId(); return sapCostReimbursement.getId();
...@@ -150,7 +143,7 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S ...@@ -150,7 +143,7 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
// 获取流程任务对应的审批环节信息 // 获取流程任务对应的审批环节信息
ProcUnitHandler procUnitHandler = procUnitHandlerApplication.loadProcUnitHandler(te.getProcUnitHandlerId()); ProcUnitHandler procUnitHandler = procUnitHandlerApplication.loadProcUnitHandler(te.getProcUnitHandlerId());
String subProcUnitId = procUnitHandler.getSubProcUnitId(); String subProcUnitId = procUnitHandler.getSubProcUnitId();
if ("fundNode".equals(subProcUnitId)){ if ("fundNode".equals(subProcUnitId) || "applyPerson".equals(subProcUnitId)) {
//在资产节点传到SAP //在资产节点传到SAP
this.sendSapDate(this.costReimbursementRepository.findOne(bizId)); this.sendSapDate(this.costReimbursementRepository.findOne(bizId));
} }
...@@ -278,7 +271,11 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S ...@@ -278,7 +271,11 @@ public class SapCostReimbursementApplicationImpl extends FlowBroker implements S
for (SapCostReimbursementDetail costReimbursementDetail : all) { for (SapCostReimbursementDetail costReimbursementDetail : all) {
Map<String, Object> detailMap = MyBaseUtil.convertToMap(costReimbursementDetail, true); Map<String, Object> detailMap = MyBaseUtil.convertToMap(costReimbursementDetail, true);
detailMap.remove("ZPAY_STAUS"); //已付款,传S
String zpayStaus = (String) detailMap.get("ZPAY_STAUS");
if ("已支付".equals(zpayStaus)){
detailMap.put("ZPAY_STAUS","S");
}
if (costReimbursementDetail.getZepFpldate() != null){ if (costReimbursementDetail.getZepFpldate() != null){
String dateFormat = DateUtil.getDateFormat(costReimbursementDetail.getZepFpldate(), "yyyyMMdd"); String dateFormat = DateUtil.getDateFormat(costReimbursementDetail.getZepFpldate(), "yyyyMMdd");
detailMap.put("ZEP_FPLDATE",dateFormat); detailMap.put("ZEP_FPLDATE",dateFormat);
......
...@@ -219,7 +219,10 @@ public class SapCostReimbursementController extends CommonController { ...@@ -219,7 +219,10 @@ public class SapCostReimbursementController extends CommonController {
public String checkzyl06(){ public String checkzyl06(){
SDO sdo = this.getSDO(); SDO sdo = this.getSDO();
String zyl06 = sdo.getString("zyl06"); String zyl06 = sdo.getString("zyl06");
Integer count = costReimbursementApplication.checkzyl06(zyl06); Integer count = 0;
if (StringUtil.isNotBlank(zyl06)){
count = costReimbursementApplication.checkzyl06(zyl06);
}
return success(count); return success(count);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment