Invoice Examples Document Change API

文件资料 •
在此文中

Example adding an Invoice

the following example shows how to use document change to create invoices with Document Change in Banana. These rows can only be inserted in the Invoices table using the Estimates and Invoices application. The Invoice JSON object represents the data structure through which a new invoice can be created.


{
  "format": "documentChange",
  "error": "",
  "data": [
    {
      "document": {
        "dataUnits": [
          {
            "nameXml": "Invoices",
            "data": {
              "rowLists": [
                {
                  "rows": [
                    {//Invoice 1
                      "operation": {
                        "name": "add"
                      },
                      "fields": {
                         (Invoice JSON Object)
                     },
                     {//Invoice 2
                       "operation": { 
                         "name": "add" 
                      }, 
                      "fields": { 
                         (Invoice JSON Object)
                    }
                  ]
                }
              ]
            }
          }
        ]
      },
      "creator": {
        "executionDate": "2021-09-13",
        "name": "extension_name.js",
        "version": "1.0"
      }
    }
  ]
}


Assure that the JSon Invoice Object is valid

It is advisable to check that the JSon Invoice Object is valid. Therefore:

  • Create a Json Invoice Object.
  • Pass the object to the function Calculate invoice.
  • Add the object to the document change

 

请帮助我们完善必备文件

我们非常欢迎您发送宝贵的反馈意见

请告诉我们什么主题需要更好的解释或如何才能更好的对其诠释。

分享这篇文章: Twitter | Facebook | LinkedIn | Email