无法使用Rest API为订单创建付款

时间:2019-07-18 11:15:28

标签: acumatica

尝试创建“付款时付款和应用程序”屏幕时,面对以下问题

  

“ exceptionMessage”:“ PX.Data.PXRowPersistingException:错误:'OrigDocAmt'不能为空。\ r \ n在PX.Data.PXDefaultAttribute.RowPersisting(PXCache发送器,PXRowPersistingEventArgs e)\ r \ n在PX.Data .PXCache.OnRowPersisting(对象项,PXDBOperation操作)\ r \ n在PX.Data.PXCache 1.PersistInserted(Object row, Boolean bypassInterceptor)\r\n at PX.Data.PXCache 1.Persist(PXDBOperation操作)\ r \ n在PX.Data.PXGraph.Persist(类型cacheType,PXDBOperation操作)\ r \ n在PX.Data.PXGraph.Persist()\ r \ n在C:\ Bld \ AC-FULL2018R24-JOB1 \ sources \ WebSites \ Pure \中的PX.Objects.AR.ARPaymentEntry.Persist() PX.Objects \ AR \ ARPaymentEntry.cs:行2458 \ r \ n在PX.Data.PXSave 1.<Handler>d__2.MoveNext()\r\n at PX.Data.PXAction 1.d__32.MoveNext()\ r \ n在PX.Data.PXAction`1.d__32.MoveNext ()\ r \ n在PX.Api.SyImportProcessor.SyStep.a(对象A_0,PXFilterRow [] A_1,PXFilterRow [] A_2)\ r \ n在PX.Api.SyImportProcessor.ExportTableHelper.ExportTable()\ nPayment.CashAccount :“现金帐户”不能为空。\ nPayment.CustomerID:错误:“客户”不能为空。\ nPayment.PaymentMethod:“付款方法”不能为空。”,

{
"Type" : { "Value":"Payment" },
"CustomerID" : { "Value":"10101010"},
"PaymentMethod" : { "Value":"CHECK"},
"PaymentRef" : { "Value": "123456789" },
"PaymentAmount" : { "Value": "250" },
"Branch" : {"Value":"PRODWHOLE"} --->Financial  setting tab

}

1 个答案:

答案 0 :(得分:1)

REST API是区分大小写的,因此您需要使用小写的“ value”关键字:

{
"Type" : { "value":"Payment" },
"CustomerID" : { "value":"ABARTENDE"},
"PaymentMethod" : { "value":"CHECK"},
"PaymentRef" : { "value": "123456789" },
"PaymentAmount" : { "value": "250" },
"Branch" : {"value":"PRODWHOLE"} 
}

请注意,从2019r1版本的Acumatica ERP开始,您可以在一次呼叫中发送带有付款的销售订单:

Put: {{sitename}}/entity/Default/18.200.001/SalesOrder?$select=OrderNbr,CashAccount
{
"CashAccount": {
    "value": "10200"
},
"CustomerID": {
    "value": "ABARTENDE"
},
"Details": [
    {
        "BranchID": {
            "value": "HQ"
        },"InventoryID": {
            "value": "AAMACHINE"
        },
        "OrderQty": {
            "value": 1
        },
    "UnitPrice": {
            "value": 269.85
        },
    "WharehouseID": {
            "value": "WHOLESALE"
        },
    "ManualPrice": {
            "value": true
            }
    }
],
"OrderType": {
    "value": "SO"
},
"PaymentMethod": {
    "value": "CHECK"
},
  "ExternalRef": {
    "value": "9593"
},
"Payments": [
    {
        "PaymentRef": {
            "value": "SOpay123"
        },
        "AppliedToOrder": {
            "value": 269.85
        },
        "CashAccount": {
            "value": "10300"
        },
        "PaymentMethod": {
            "value": "CHECK"
        }
    }
]
}