Quickbooks-创建新发票时出错

时间:2018-09-06 15:53:01

标签: quickbooks dotconnect

公司ID: 123146108771499

我正在尝试添加新的发票项目,但由于在请求使用dotConnect sdk添加发票时遇到错误,因此我陷入了困境。

错误代码:2020

错误消息:“请求中缺少必需的参数Line.SalesItemLineDetail”

以下是LINE对象的JSON:

"[{\"Amount\": 100.00,\"DetailType\": 
\"SalesItemLineDetail\",\"SalesItemLineDetail\": {\"ItemRef\":             
{\"value\": \"1\",\"name\": \"Services\"}, \"UnitPrice\": 10.00, \"Qty\": 
1,\"TaxCodeRef\": {\"value\": \"NON\"}}}]"

然后我尝试使用 API Explorer ,然后又遇到了另一个错误:

"Fault":{"Error":[{"Message":"A business validation error has occurred while processing your request","Detail":"Business Validation Error: Make sure all your transactions have a sales tax rate before you save.","code":"6000","element":""}],"type":"ValidationFault"},"time":"2018-09-06T08:35:52.534-07:00"}

以下是我的请求代码(JSON):

    {
      "Line": [
        {
          "Amount": 100.00,
          "DetailType": "SalesItemLineDetail",
          "SalesItemLineDetail": {
            "ItemRef": {
              "value": "1",
              "name": "Services"
            },
            "TaxCodeRef": {"value": "NON"}
          }
        }
      ],
      "CustomerRef": {
        "value": "1"
      }
    }

我对这个问题的根源感到困惑。是否可以为此设置管理员。我试图检查但未能成功。

修改1: 我注意到我的Quickbook帐户是针对印度地区的,美国地区不支持 TaxCodeRef =“ NON” 。然后,我找到了它的ID,并在“ API探索的”中运行查询并成功运行。 我将Api Explorer JSON更改为以下内容:

{
  "Line": [
    {
      "Amount": 100.00,
      "DetailType": "SalesItemLineDetail",
      "SalesItemLineDetail": {
        "ItemRef": {
          "value": "1",
          "name": "Services"
        },
        "TaxCodeRef": {"value": "23"}
      }
    }
  ],
  "CustomerRef": {
    "value": "1"
  }
}

但是,当我对.ne t的 DotConnect SDK代码进行了以下更改时:

"[{\"Amount\": 100.00,\"DetailType\": 
\"SalesItemLineDetail\",\"SalesItemLineDetail\": {\"ItemRef\":             
{\"value\": \"1\",\"name\": \"Services\"}, \"UnitPrice\": 10.00, \"Qty\": 
1,\"TaxCodeRef\": {\"value\": \"23\"}}}]"

我仍然遇到以下错误:

ErrrorCode: 2020

错误源: Devart.Data.SqlShim

错误消息:“请求中缺少必需的参数Line.SalesItemLineDetail”

以下是示例Ado.net查询:

INSERT INTO Invoice
(PrivateNote, BillAddr_Line3, BillAddr_Line4, CustomerRefId, 
BillAddr_Line1, BillAddr_Line2, BillAddr_City, BillAddr_Country, 
BillAddr_CountrySubDivisionCode, 
BillAddr_PostalCode, ShipAddr_Line1, ShipAddr_Line2, ShipAddr_City, 
ShipAddr_Country, ShipAddr_CountrySubDivisionCode, ShipAddr_PostalCode, 
ShipAddr_Note, BillEmail_Address, Line)
 VALUES        ('a', 'b', 'c', '1', 'd', 'e', 'f', 'US', 'AN', '110011',
 's1', 's2', 's3', 's4', 's5', 's6', 's7', 'bil@test.com', 
  '[{"Amount": 86.00,   "Description": "AMERICAN2",   "DetailType": "SalesItemLineDetail", "SalesItemLineDetail": {           "ItemRef": {"value": "1", "name": "A AMERICAN2"       }, "UnitPrice": 86.00, "Qty": 1,"TaxCodeRef": {"value": "23"}}}]')

谢谢

0 个答案:

没有答案