Commit b1245ca9 authored by 1650842865's avatar 1650842865

付款申请无PO:选择BP编号后可调用接口查询需付款的报关合同信息;当选择了报关合同号时,在创建申请时无需设置成本中心和内部订单两个必输其一,在后续的申请人节...

付款申请无PO:选择BP编号后可调用接口查询需付款的报关合同信息;当选择了报关合同号时,在创建申请时无需设置成本中心和内部订单两个必输其一,在后续的申请人节点也无需填写费用类型。当选择了报关合同号时,所有的含税/不含税金额默认=运保费+运杂费,所有的税额默认=0
parent b715a812
......@@ -253,6 +253,37 @@ function getColumns() {
});
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: "zcustom", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
required: false, type: "select",
data: {
type: 'system',
name: "getZcustom",
getParam: function (item) {
return {
PARTNER:item.partner
}
},
back: {
ZCUSTOM: "zcustom",
ZEXPENSE1: "zexpense1",
ZEXPENSE2: "zexpense2",
}
},
}
});
columns.push({display: "运保费", name: "zexpense1", width: 100, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
});
columns.push({display: "运杂费", name: "zexpense2", width: 100, minwidth: 120, type: "money", align: "left",
editor: {
mask: 'nnnnnnnnn.nn',
type: 'text'
}
});
columns.push({display: "计划付款日期", name: "zepFpldate", width: 120, minwidth: 120, type: "string", align: "left",
editor: {
type: "date"
......@@ -429,8 +460,15 @@ function loadGrid(obj) {
if (obj.node==="reimbursementApplierGrid"){
canEdit = true;
var columns = obj.columns;
//当选择了报关合同号时,在后续的申请人节点也无需填写费用类型
var zcustom = obj.data.Rows[0].zcustom;
columns.some(column => {
if (column.name == "zepExtype" || column.name == "zyl06" || column.name == "zyl05TextView"){
if (Public.isBlank(zcustom)){
if (column.name == "zepExtype"){
column.editor.required = true;
}
}
if (column.name == "zyl06" || column.name == "zyl05TextView"){
column.editor.required = true;
}
})
......@@ -704,6 +742,32 @@ function loadGrid(obj) {
}
})
}
//当选择了报关合同号时,所有的含税/不含税金额默认=运保费+运杂费,所有的税额默认=0
if (item.column.name == "zcustom"){
var zexpense1 = item.record.zexpense1;
var zexpense2 = item.record.zexpense2;
var zexpense = MathUtil.add(zexpense1,zexpense2);
//含税金额(本位币)计算
//"公司代码等于1000币别等于CNY时,默认等于含税金额;
// 公司代码等于1000币别不等于CNY时,等于含税金额*币别对应的汇率"
var money = 0;
if (item.record.waers === "CNY"){
money=zexpense;
}else {
money = MathUtil.mul(zexpense,item.record.kursf)
}
obj.gridManager.updateRow(item.record, {
kzwi1:zexpense,//含税金额
netwr:zexpense,//不含税金额
kwetr: 0,//税额
kwetr1: 0,//税额(本位币)
kzwi11: money, //含税金额(本位币)
mwskz: 0, // 税码
mwskzTextView: 0 // 税码
});
totalGrid();
changeFinancialAuditGridData();
}
return item;
},
onAfterShowData:function (){
......@@ -915,6 +979,8 @@ function getExtendedData(processAction) {
//提交前校验
function checkConstraints() {
//判断成本中心、内部订单必输1个,可以同时都输入
//当选择了报关合同号时,在创建申请时无需设置成本中心和内部订单两个必输其一,在后续的申请人节点也无需填写费用类型
var _grid = UICtrl.getGridManager('#reimbursementApplierGrid');
var datas = DataUtil.getGridData({
gridManager: _grid,
......@@ -928,7 +994,7 @@ function checkConstraints() {
}
var checked = false
$.each(datas, function (i, o) {
if (Public.isBlank(o.kostl) && Public.isBlank(o.aufnr)){
if (Public.isBlank(o.zcustom) && Public.isBlank(o.kostl) && Public.isBlank(o.aufnr)){
checked = true
}
});
......
......@@ -179,7 +179,21 @@ function initItemGrid() {
fixedCellHeight: true,
selectRowButtonOnly: true,
//autoApplyNextEditor:false,
toolbar: toolbarOptions1
toolbar: toolbarOptions1,
onAfterEdit: function (item) {
if (item.column.name == "money"){
var value = item.value;
var zbrtwr = item.record.zbrtwr;
if (MathUtil.compare(value,zbrtwr) > 0){
itemGridManager1.updateRow(item.record, {
money: null,
});
Public.tip("金额不能大于过账金额(含税)")
return false;
}
}
return item;
},
})
UICtrl.setSearchAreaToggle(itemGridManager1);
......@@ -312,7 +326,7 @@ columns1 = [
WERKS: "werks",
MATNR: "productCode",
TXZ01: "productName",
BPMNG: "bpmng",
BPMNG: "number",
MEINS: "unit",
MSEHL: "unitName",
MWSKZ: "mwskz",
......@@ -341,10 +355,10 @@ columns1 = [
display: "货币", name: "ktext", width: "80", align: "left", type: "string"
},
{
display: "过账金额(含税)", name: "zbrtwr", width: "80", align: "left", type: "money"
display: "过账金额(含税)", name: "zbrtwr", width: "120", align: "left", type: "money"
},
//填写现有金额必须≤ZBRTWR(过账金额(含税))
{display: "金额", name: "money", width: "100", align: "left", type: "money"
{display: "金额", name: "money", width: "120", align: "left", type: "money"
,editor: {required: true,type: "text",mask: '9999999.999'}
},
{display: "日期", name: "sendDate", width: "140", align: "left", type: "date"
......
......@@ -1005,4 +1005,13 @@ public class ResourceSearchController {
return sapDictionaryApplication.initEasySearchModel( mapList, param, sdo);
}
@EasySearch(queryName = "getZcustom")
public Map<String, Object> getZcustom(SDO sdo) throws IOException {
String param = sdo.getString("paramValue");
String PARTNER = sdo.getString("PARTNER");
List<Map<String, String>> mapList = new ArrayList<>();
mapList = sapPaymentApplication.getZcustom(PARTNER);
return sapDictionaryApplication.initEasySearchModel( mapList, param, sdo);
}
}
......@@ -477,6 +477,23 @@ public class SapCostReimbursementDetail implements Serializable {
*/
@Column(name = "gjahr2")
private String gjahr2;
//新增字段:ZCUSTOM、ZEXPENSE1、ZEXPENSE2
/**
* 报关合同号
*/
@Column(name = "ZCUSTOM")
private String zcustom;
/**
* 运保费
*/
@Column(name = "ZEXPENSE1")
private BigDecimal zexpense1;
/**
* 运杂费
*/
@Column(name = "ZEXPENSE2")
private BigDecimal zexpense2;
}
\ No newline at end of file
......@@ -61,4 +61,11 @@ public interface SapPaymentApplication {
* @return
*/
List<Map<String, String>> getPartnerInvs(String BUKRS,String PARTNER,String ZEP_FTYPE);
/**
* 根据供应商查询报关合同
* @param partner
* @return
*/
List<Map<String, String>> getZcustom(String partner);
}
......@@ -180,4 +180,25 @@ public class SapPaymentApplicationImpl implements SapPaymentApplication {
}
return mapList;
}
@Override
public List<Map<String, String>> getZcustom(String partner) {
Map<String,Object> param = new HashMap<>();
param.put("PARTNER",partner);
String execute = null;
List<Map<String,String>> mapList = new ArrayList<>();
try {
execute = httpClient.execute(param, "search/SCH_ZCUSTOM");
Map<String, String> map = JSONObject.parseObject(execute, Map.class);
SapResult sapResult = JSONObject.parseObject(JSONUtil.toJsonStr(map.get("MSG")), SapResult.class);
if ("S".equals(sapResult.getTYPE())) {
ObjectMapper objectMapper = SAPUtils.objectMapper();
mapList = objectMapper.readValue(com.huigou.util.JSONUtil.toString(map.get("RDATA")), new TypeReference<List<Map<String, String>>>() {});
}
} catch (IOException e) {
throw new RuntimeException("查询报关合同出错”。");
}
return mapList;
}
}
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