Skip to content

Create Data Documentation Purchase Invoice

SIMIT Yong Xiang edited this page Feb 28, 2024 · 2 revisions

Create Purchase Invoice Data

Using CURL in terminal console to insert the Invoice data.(* If there is no data in the data column, user may direct remove the column from the insert data array.)

curl --header "Content-Type: application/x-www-form-urlencoded" \
--request POST \
--data '
{
    "action": "createPurchaseInvoice",
    "module": "purchase",
    "token": "simit_5d6ce44404688-30487",
    "uid": "admin",
    "org": "SIMIT",
    "branch": "HQ",
    "data": {
        "headerarr": {
            "document_type": "PI",
            "document_no": "API-PI-00004",
            "document_refno": "API_DOC_TEST",
            "document_date": "2024-01-31",
            "document_status": "D",
            "document_prepareby": "admin",
            "document_desc": "THIS INVOICE CREATED BY API",
            "document_note": "NOTE FROM API",
            "document_reason": "",
            "document_glmemo": "ADDITIONAL GL MEMO",
            "bpartner_no": "6000027",
            "bpartner_name": "",
            "billcontacts_name": "",
            "billcontacts_hp": "",
            "billaddress_street1": "",
            "billaddress_street2": "",
            "billaddress_street3": "",
            "billaddress_street4": "",
            "billaddress_postcode": "",
            "billaddress_city": "",
            "billaddress_area": "",
            "billaddress_country": "",
            "shipaddress_street1": "",
            "shipaddress_street2": "",
            "shipaddress_street3": "",
            "shipaddress_street4": "",
            "shipaddress_postcode": "",
            "shipaddress_city": "",
            "shipaddress_area": "",
            "shipaddress_country": "",
            "shippinginfo": "",
            "shipcontacts_name": "",
            "shipcontacts_hp": "",
            "totalamt": "200",
            "totalamt_local": "0",
            "totaltaxamt": "",
            "totaltaxamt_local": "0",
            "totalnetamt": "200",
            "totalnetamt_local": "0",
            "salesagent_name": "",
            "terms_name": "",
            "terms_day": "",
            "currency_code": "MYR",
            "currency_rate": "1",
            "document_trackdate": "0000-00-00",
            "document_tracktype": "",
            "document_trackremark": "",
            "document_trackupdated": "0000-00-00 00:00:00",
            "document_trackupdatedby": "",
            "track1_code": "",
            "track2_code": "",
            "track3_code": "",
            "track4_code": "",
            "track5_code": "",
            "isprinted": "0",
            "isop": "0",
            "isimport": "0",
            "filling_date": "2019-08-06",
            "filingdatelastchangebyuser": "admin",
            "created": "2024-01-31 12:04:36",
            "createdby": "admin",
            "updated": "2024-01-31 12:04:36",
            "updatedby": "admin",
            "organization_code": "SIMIT",
            "branch_code": "HQ",
            "rounding_amount": "0.00"
        },
        "linearr": [
            {
                "documentline_seq": "10",
                "documentline_desc": "",
                "documentline_promisedate": "0000-00-00",
                "item_code": "100plus",
                "item_name": "100plus",
                "quantity": "1",
                "basequantity": "1",
                "uom_code": "PCS",
                "baseuom_code": "PCS",
                "unitprice": "100",
                "unitprice_local": "100",
                "discount": "",
                "discount_amt": "",
                "amount_sub": "100",
                "amount_sub_local": "100",
                "amount_tax": "",
                "amount_tax_local": "",
                "amount_netttotal": "100",
                "amount_netttotal_local": "100",
                "isinclusive": "0",
                "tax_name": "",
                "tax_rate": "",
                "taxaccounts_id": "",
                "msic_code": "",
                "serialno": "",
                "batchno": "",
                "lotno": "",
                "track1_code": "",
                "track2_code": "",
                "track3_code": "",
                "track4_code": "",
                "track5_code": "",
                "customfield1": "",
                "customfield2": "",
                "customfield3": "",
                "created": "2024-01-31 18:00:00",
                "createdby": "admin",
                "updated": "2024-04-31 18:00:00",
                "updatedby": "admin",
                "isprint": "0",
                "isremark": "0",
                "linedocument_no": "",
                "inventorydebitacc_id": "",
                "inventorycreditacc_id": "",
                "syscalgstamt": "",
                "taxupdatedby": "",
                "inventorycost": "",
                "othercost": "",
                "hscode_code": ""
            },
            {
                "documentline_seq": "10",
                "documentline_desc": "",
                "documentline_promisedate": "0000-00-00",
                "item_code": "100plus",
                "item_name": "100plus",
                "quantity": "1",
                "basequantity": "1",
                "uom_code": "BOX",
                "baseuom_code": "BOX",
                "unitprice": "100",
                "unitprice_local": "100",
                "discount": "",
                "discount_amt": "",
                "amount_sub": "100",
                "amount_sub_local": "100",
                "amount_tax": "",
                "amount_tax_local": "",
                "amount_netttotal": "100",
                "amount_netttotal_local": "100",
                "isinclusive": "0",
                "tax_name": "",
                "tax_rate": "",
                "taxaccounts_id": "",
                "msic_code": "",
                "serialno": "",
                "batchno": "",
                "lotno": "",
                "track1_code": "",
                "track2_code": "",
                "track3_code": "",
                "track4_code": "",
                "track5_code": "",
                "customfield1": "",
                "customfield2": "",
                "customfield3": "",
                "created": "2024-01-31 18:00:00",
                "createdby": "admin",
                "updated": "2024-01-31 18:00:00",
                "updatedby": "admin",
                "isprint": "0",
                "isremark": "0",
                "linedocument_no": "",
                "inventorydebitacc_id": "",
                "inventorycreditacc_id": "",
                "syscalgstamt": "",
                "taxupdatedby": "",
                "inventorycost": "",
                "othercost": "",
                "hscode_code": ""
            }
        ]
    }
}
' \
https://simbiz_system_url/simbiz/api.php

The available field for insert Invoice Data

Purchase Invoice Header Data
No Field Name Data Type (Size) Required Description
1 document_type varchar(10) Y IN : SI,ARDN; OUT : PI,ARCN
2 document_no varchar(255) Y Purchase Invoice document number
3 document_refno varchar(255) Y Purchase Invoice reference number
4 document_date date Y Purchase Invoice document date
5 document_status varchar(30) Purchase Invoice document status
6 document_prepareby varchar(50) Preparer of the document
7 document_desc text Purchase Invoice description
8 document_note text Purchase Invoice document note
9 document_reason varchar(255) Purchase Invoice Void reason
10 document_glmemo varchar(255) Purchase Invoice document GL memo
11 bpartner_no varchar(50) Y Purchase Invoice business partner number
12 bpartner_name varchar(255) Purchase Invoice business partner name
13 billcontacts_name varchar(255) Purchase Invoice Bill Contact Name
14 billcontacts_hp varchar(255) Purchase Invoice bill contact handphone number
15 billaddress_street1 varchar(255) Purchase Invoice bill address street 1
16 billaddress_street2 varchar(255) Purchase Invoice bill address street 2
17 billaddress_street3 varchar(255) Purchase Invoice bill address street 3
18 billaddress_street4 varchar(255) Purchase Invoice bill address street 4
19 billaddress_postcode varchar(50) Purchase Invoice bill address postcode
20 billaddress_city varchar(50) Purchase Invoice bill address city
21 billaddress_area varchar(50) Purchase Invoice bill address area
22 billaddress_country varchar(50) Purchase Invoice bill address country
23 shipaddress_street1 varchar(255) Purchase Invoice ship address street 1
24 shipaddress_street2 varchar(255) Purchase Invoice ship address street 2
25 shipaddress_street3 varchar(255) Purchase Invoice ship address street 3
26 shipaddress_street4 varchar(255) Purchase Invoice ship address street 4
27 shipaddress_postcode varchar(50) Purchase Invoice ship address postcode
28 shipaddress_city varchar(50) Purchase Invoice ship address city
29 shipaddress_area varchar(50) Purchase Invoice ship address area
30 shipaddress_country varchar(50) Purchase Invoice ship address country
31 shippinginfo varchar(255) Purchase Invoice shipping info
32 shipcontacts_name varchar(255) Purchase Invoice shipping contact name
33 shipcontacts_hp varchar(50) Purchase Invoice shipping contact handphone
34 totalamt decimal(22,2) Purchase Invoice total amount
35 totalamt_local decimal(22,2) Purchase Invoice total amount in local currency
36 totaltaxamt decimal(22,2) Purchase Invoice total tax amount
37 totaltaxamt_local decimal(22,2) Purchase Invoice total tax amount in local currency
38 totalnetamt decimal(22,2) Purchase Invoice total net amount (amt + tax)
39 totalnetamt_local decimal(22,2) Purchase Invoice total net amount in local currency
40 salesagent_name varchar(255) Purchase Invoice sales agent
41 terms_name varchar(255) Purchase Invoice term name
42 terms_day int(11) Purchase Invoice term day
43 currency_code varchar(255) Y Purchase Invoice currency code
44 currency_rate decimal(14,8) NULL Purchase Invoice currency rate
45 document_trackdate date [1970-01-01] Purchase Invoice track date
46 document_tracktype varchar(100) Purchase Invoice track type
47 document_trackremark text Purchase Invoice track remark
48 document_trackupdated datetime Purchase Invoice track last update date time
49 document_trackupdatedby varchar(50) Purchase Invoice track last update by
50 track1_code varchar(255) Purchase Invoice track 1 code
51 track2_code varchar(255) Purchase Invoice track 2 code
52 track3_code varchar(255) Purchase Invoice track 3 code
53 track4_code varchar(255) Purchase Invoice track 4 code
54 track5_code varchar(255) Purchase Invoice track 5 code
55 isprinted smallint(1) Purchase Invoice is allow print out in the print format
56 isop smallint(1) [0]
57 isimport smallint(1)
58 filling_date date Y Purchase Invoice filling Date
59 filingdatelastchangebyuser varchar(50) Purchase Invoice filling Date last updated user
60 created datetime Purchase Invoice created date in the system
61 createdby varchar(50) Purchase Invoice creator
62 updated datetime Purchase Invoice last updated date
63 updatedby varchar(50) Purchase Invoice last updated user
64 organization_code varchar(10) Purchase Invoice was created under which organization
65 branch_code varchar(40) Purchase Invoice was created under which branch
Purchase Invoice Line Data
No Field Name Data Type (Size) Required Description
1 documentline_seq smallint(6) Purchase Invoice's document line Sequence No
2 documentline_desc text Purchase Invoice's Line description
3 documentline_promisedate date Purchase Invoice's line promise date
4 item_code varchar(255) Purchase Invoice's line item code
5 item_name varchar(255) Purchase Invoice's line item name
6 quantity decimal(28,8) Purchase Invoice's line item quantity
7 basequantity decimal(28,8) Purchase Invoice's line item base quantity
8 uom_code varchar(255) Purchase Invoice's line item UOM
9 baseuom_code varchar(255) Purchase Invoice's line item base UOM
10 unitprice decimal(24,4) Purchase Invoice's line item unit price
11 unitprice_local decimal(24,4) Purchase Invoice's line item unit price in local currency
12 discount varchar(255) Purchase Invoice's line item discount percentage
13 discount_amt decimal(24,2) Purchase Invoice's line item discount amount
14 amount_sub decimal(22,2) Purchase Invoice's line sub amount (unitprice * quantity)
15 amount_sub_local decimal(22,2) Purchase Invoice's line sub amount in local currency
16 amount_tax decimal(22,2) Purchase Invoice's line tax amount
17 amount_tax_local decimal(22,2) Purchase Invoice's line tax amount in local currency
18 amount_netttotal decimal(22,2) Purchase Invoice's line net total (sub amount + tax amount)
19 amount_netttotal_local decimal(22,2) Purchase Invoice's line net total in local currency
20 isinclusive smallint(11) Is Inclusive tax? (Yes[1]/No[0])
21 tax_name varchar(255) Purchase Invoice's line tax name
22 tax_rate decimal(10,4) Purchase Invoice's line tax rate
23 taxaccounts_id varchar(50) Purchase Invoice's line tax account
24 msic_code varchar(30) Purchase Invoice's line MSIC code
25 serialno text NULL Purchase Invoice's line item's serial number
26 batchno varchar(255) Purchase Invoice's line item's batch number
27 lotno varchar(255) Purchase Invoice's line item's lot number
28 track1_code varchar(255) Purchase Invoice's line track 1 code
29 track2_code varchar(255) Purchase Invoice's line track 2 code
30 track3_code varchar(255) Purchase Invoice's line track 3 code
31 track4_code varchar(255) Purchase Invoice's line track 4 code
32 track5_code varchar(255) Purchase Invoice's line track 5 code
33 customfield1 varchar(255) Purchase Invoice's line custom field 1
34 customfield2 varchar(255) Purchase Invoice's line custom field 2
35 customfield3 varchar(255) Purchase Invoice's line custom field 3
36 created datetime Purchase Invoice's line created date in the system
37 createdby varchar(50) Purchase Invoice's line creator
38 updated datetime Purchase Invoice's line last updated date
39 updatedby varchar(50) Purchase Invoice's line last updated user
40 isprint smallint(1) [1] Purchase Invoice's line is allow print out in the print format? (Yes[1]/No[0])
41 isremark int(11) Is remark? (Yes[1]/No[0])
42 linedocument_no varchar(255)
43 inventorydebitacc_id varchar(50)
44 inventorycreditacc_id varchar(50)
45 syscalgstamt decimal(14,2)
46 taxupdatedby varchar(50)
47 inventorycost decimal(22,2) NULL Purchase Invoice's line item's inventory cost
48 othercost decimal(22,2) NULL Purchase Invoice's line item's landing cost
49 hscode_code varchar(50) Purchase Invoice's line item's HS code
Clone this wiki locally