【WEBAPI】采购合同变更单接口JSON样例
【WEBAPI】采购合同变更单接口JSON样例
简单的JSON示例:
{
"Model": {
"FID": 0,
"FBillTypeID": {
"FNumber": "CGHT01_SYS"
},
"FPKIDX_H": 100035,(原单的单据FID,肯定不能为空的)
"FVersionNo": "001",
"FBillNo": "CGHT000023_V001",
"FPurchaseOrgId": {
"FNumber": "103"
},
"FSupplierId": {
"FNumber": "test"
},
"FEndDate": "2023-10-11 00:00:00",
"FBeginDate": "2023-10-11 00:00:00",
"FDate": "2023-10-11 00:00:00",
"FChangeReason": "test",
"FCONTRACTNAME": "变更后了",
"FContractFin": {
"FPKIdX_F": 104756,(财务页签那张表的分录id,肯定也是不为空的)
(以下财务页签里的汇率、结算币别、本位币、付款条件等内容肯定也是要填充好的)
"FPayConditionId": {
"FNumber": "010"
},
"FSettleCurrId": {
"FNumber": "PRE001"
},
"FExchangeTypeId": {
"FNumber": "HLTX01_SYS"
},
"FLocalCurrId": {
"FNumber": "PRE001"
},
"FExchangeRate": 1
},
"FContractEntry": [
{
"FPKIDX": 100084,
"FCHANGETYPE": "B",(B代表修改明细,所以要填入原单对应行的分录id,不能为空)
"FMaterialId": {
"FNumber": "053001"
},
"FQtyX": 1,
"FQty": 1,
"FDeliveryDate": "2023-10-11",
"FTaxPriceX": 1,
"FTaxPrice": 1
},
{
"FPKIDX": 0,
"FCHANGETYPE": "A",(A代表新增明细,所以没有原订单对应行的分录id,此处填0)
"FMaterialId": {
"FNumber": "053003"
},
"FQtyX": 1,
"FQty": 1,
"FDeliveryDate": "2023-10-12",
"FTaxPriceX": 1,
"FTaxPrice": 1,
"FEntryTaxRate": 13,
"FRequireOrgId": {
"FNumber": "103"
},
"FReceiveOrgId": {
"FNumber": "103"
},
"FSettleOrgId": {
"FNumber": "103"
},
"FGiveAway": "false"
}
]
}
}
注意事项说明:
注意单据头、财务信息、明细信息等对象中的原始主键字段,分别为FPKIDX_H、FPKIdX_F、FPKIDX;
我们系统的新变更单是继承采购订单的,在新变更单的每个实体对象加上了原始主键字段,用于绑定对应原订单对象的主键字段(PS:单据头对单据头,财务信息对财务信息,明细信息行对行),生效时,直接根据原始主键更新原订单。
所以,单据头的FPKIDX_H、财务信息FPKIdX_F肯定是不为0的,明细信息的FPKIDX,只有FCHANGETYPE为:A,可为:0,其余变更类型FPKIDX字段均不为0。
变更单的单号怎么传?
目前系统不会自动生成,标准做法应该是先调用单据查询接口,获取原订单的版本号比如"000",在此基础上+1得到"001".
新变更单的版本号生效时会反写回原订单的,所以版本号必须传,否则会影响原订单的下一次变更以及变更查询功能。
那么变更单的版本号为"001",单据编号为:原订单编号_V新版本号,如:
"FVersionNo": "001", "FBillNo": "CGDD002796_V001"
如何查询上游合同的单据FID、明细体分录id、财务业务分录id、初始版本号呢?
{ "data": { "FormId": "PUR_ContractChange", "FieldKeys": "FBILLNO,FID,FContractEntry_FEntryid,FContractFin_FEntryid,FVersionNo", "FilterString": "FBILLNO='CGHT000023'", "OrderString": "", "TopRowCount": 0, "StartRow": 0, "Limit": 0, "SubSystemId": "" } }
自测截图:
更多知识:
【WEBAPI】采购领域常用知识链接汇总(持续更新) (kingdee.com)
【WEBAPI】采购合同变更单接口JSON样例
本文2024-09-23 02:37:55发表“云星空知识”栏目。
本文链接:https://wenku.my7c.com/article/kingdee-k3cloud-153698.html