转单接口–转入来源进货单生成【进货退回单】PC->PB

概述

该接口主要用于第三方平台或自主研发者,通过调用【进货退回单】的转单接口,将第三方进货退回的货品相关信息推送到Sunlike ERP或Online ERP系统中,从而生成Sunlike ERP或Online ERP系统的【进货退回单】。

参数说明

1.请求方式

请求方式 POST
接口地址 http://ERPAPI站点/DRPPC/TRANDATA
格式 JSON
编码类型 UTF-8

2.header参数

Content-Type application/json
Authorization token 获取每次登录的值

3.请求参数

请求JSON示例

{
  "REF_NO": "HYPPB2212220001",        //第三方单号,必填
  "PGM": "DRPPB",            //程序代号,必填
  "MF_PSS": [          //请求生成单据的表头参数信息
    {
      "PS_ID": "PB",       //生成单据别,必填
      "PS_NO": "",         //ERP为自动编号,则取ERP系统编码;为手工编码,则与REF_NO必须相同
      "TRAN_BIL_ID":"PC",       //来源单据别,必填
      "USR":"ADMIN"         //制单人,必填
    }
  ],
  "TF_PSS": [            //请求生成单据的表身参数信息,变更表身资料
    {
      "PS_ID": "PB",
      "PS_NO": "",
      "ITM": 1,           //表身项次,必填
      "TRAN_BIL_ID":"PC",             //来源单据别,必填
      "TRAN_BIL_NO":"PC2212220001",      //来源单号,必填
      "TRAN_BIL_ITM":1,      //转单项次,可通过查询接口查来源单表身TRAN_BIL_ITM的值,必填
      "QTY":10          //数量,必填
    },
    {
      "PS_ID": "PB",
      "PS_NO": "",
      "ITM": 2,
      "TRAN_BIL_ID":"PC",
      "TRAN_BIL_NO":"PC2212220002",
      "TRAN_BIL_ITM":1,
      "QTY":20
    }
  ]
}

返回结果示例

{
    "code": 0,              //为0表示执行成功,其他表示错误
    "message": "新增成功",
    "data": {
        "MF_PSS": [             //生成进货退回单表头内容
            {
                "PS_ID": "PB",
                "PS_NO": "PB2302070001",
                "PS_DD": "2023-02-07 00:00:00",
                "PAY_DD": "2023-01-01 00:00:00",
                "CHK_DD": "2023-03-03 00:00:00",
                "CUS_NO": "CU0301",
                "DEP": "D0300",
                "TAX_ID": "2",
                "SEND_MTH": "1",
                "ZHANG_ID": "1",
                "CUR_ID": "",
                "EXC_RTO": 1.0,
                "SAL_NO": "001",
                "ARP_NO": "AP2302070001",
                "ARP_DD": "2023-02-07 00:00:00",
                "PAY_MTH": "1",
                "PAY_DAYS": 1,
                "CHK_DAYS": 61,
                "INT_DAYS": 60,
                "PAY_REM": "结帐期:2023-01-01;票据到期日:2023-03-03",
                "USR": "ADMIN",
                "CHK_MAN": "ADMIN",
                "PRT_SW": "N",
                "CLS_DATE": "2023-02-07 19:13:45",
                "BIL_TYPE": "",
                "OS_ID": "PC",
                "OS_NO": "PC2212220001",
                "SYS_DATE": "2023-02-07 19:13:45",
                "REM": "",
                "TOT_QTY": 30.0,
                "KP_ID": "F",
                "TRAN_BIL_ID": "PC"
            }
        ],
        "TF_PSS": [               //生成进货退回单表身内容
            {
                "PS_ID": "PB",
                "PS_NO": "PB2302070001",
                "ITM": 1,
                "PS_DD": "2023-02-07 00:00:00",
                "WH": "YH002",
                "PRD_NO": "001",
                "PRD_NAME": "哈姆卡通玩具",
                "PRD_MARK": "",
                "UNIT": "1",
                "TAX_RTO": 5.0,
                "REM": "",
                "QTY": 10.0,
                "UP": 100.0,
                "QTY1": 10.0,
                "UP_QTY1": 100.0,
                "AMTN_NET": 952.38,
                "AMT": 1000.0,
                "CST_STD": 200.0,
                "PRE_ITM": 1,
                "OS_NO": "PC2212220001",
                "OS_ID": "PC",
                "CSTN_SAL": 952.38,
                "TAX": 47.62,
                "OTH_ITM": 1,
                "VALID_DD": "2023-01-02 00:00:00",
                "SPC": "WQT*63WT1",
                "PAK_UNIT": "2箱",
                "PAK_EXC": 5.0,
                "PAK_NW": 2.0,
                "PAK_WEIGHT_UNIT": "个",
                "PAK_GW": 4.0,
                "PAK_MEAST": 6.0,
                "PAK_MEAST_UNIT": "件",
                "UP_MAIN": 100.0,
                "CST_SAL": 1000.0,
                "SUP_PRD_NO": "1070300082",
                "SUP_PRD_MARK": "",
                "UP_STD": 20.0,
                "TRAN_BIL_ITM": 1,
                "QTY_ORG_ALL": 10.0,
                "PRD_NO_NO": "001",
                "TRAN_BIL_ID": "PC",
                "TRAN_BIL_NO": "PC2212220001"
            },
            {
                "PS_ID": "PB",
                "PS_NO": "PB2302070001",
                "ITM": 2,
                "PS_DD": "2023-02-07 00:00:00",
                "WH": "YH002",
                "PRD_NO": "001",
                "PRD_NAME": "哈姆卡通玩具",
                "PRD_MARK": "",
                "UNIT": "1",
                "TAX_RTO": 5.0,
                "REM": "",
                "QTY": 20.0,
                "UP": 100.0,
                "QTY1": 20.0,
                "UP_QTY1": 100.0,
                "AMTN_NET": 1904.76,
                "AMT": 2000.0,
                "CST_STD": 400.0,
                "PRE_ITM": 2,
                "OS_NO": "PC2212220002",
                "OS_ID": "PC",
                "CSTN_SAL": 1904.76,
                "TAX": 95.24,
                "OTH_ITM": 1,
                "VALID_DD": "2023-01-02 00:00:00",
                "SPC": "WQT*63WT1",
                "PAK_UNIT": "4箱",
                "PAK_EXC": 5.0,
                "PAK_NW": 4.0,
                "PAK_WEIGHT_UNIT": "个",
                "PAK_GW": 8.0,
                "PAK_MEAST": 12.0,
                "PAK_MEAST_UNIT": "件",
                "UP_MAIN": 100.0,
                "CST_SAL": 2000.0,
                "SUP_PRD_NO": "1070300082",
                "SUP_PRD_MARK": "",
                "UP_STD": 20.0,
                "TRAN_BIL_ITM": 1,
                "QTY_ORG_ALL": 20.0,
                "PRD_NO_NO": "001",
                "TRAN_BIL_ID": "PC",
                "TRAN_BIL_NO": "PC2212220002"
            }
        ],
        "TF_PSS_RCV": [
            {
                "PS_ID": "PB",
                "PS_NO": "PB2302070001"
            }
        ],
        "BILL_STATE": {
            "READONLY": false,
            "READONLY_REM": []
        }
    }
}