Skip to content

Create Official Receipt

seansimit edited this page May 16, 2022 · 6 revisions

Using CURL in terminal console to insert the Office Receipt 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": "createOfficialReceipt",
    "module": "sales",
    "token": "simit_5d6ce44404688-30487",
    "uid": "admin",
    "org": "SIMIT",
    "branch": "HQ",
    "data": {
        "headerarr": {
            "document_no": "API-ARCN-00001",
            "document_refno": "API_DOC_TEST",
            "document_date": "2019-09-02",
            "document_status": "D",
            "document_prepareby": "admin",
            "document_desc": "DOCUMENT CREATED FROM API",
            "document_note": "ADDITIONAL NOTE",
            "document_reason": "",
            "document_glmemo": "ADDITIONAL GLMEMO",
            "accounts_code": "11-1000",
            "bpartner_no": "S0001",
            "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": "100",
            "totalamt_local": "100",
            "totaltaxamt": "",
            "totaltaxamt_local": "",
            "totalnetamt": "100",
            "totalnetamt_local": "100",
            "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": "2019-08-06 12:04:36",
            "createdby": "admin",
            "updated": "2019-08-06 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": "",
                "item_name": "TEST ITEM 1",
                "quantity": "1",
                "basequantity": "1",
                "uom_code": "",
                "baseuom_code": "",
                "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",
                "accounts_code": "11-1000",
                "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": "2019-08-06 12:04:36",
                "createdby": "admin",
                "updated": "2019-08-06 12:04:36",
                "updatedby": "admin",
                "isprint": "0",
                "isremark": "0",
                "linedocument_no": "",
                "inventorydebitacc_id": "",
                "inventorycreditacc_id": "",
                "syscalgstamt": "",
                "taxupdatedby": "",
                "inventorycost": "",
                "othercost": "",
                "hscode_code": ""
            },
            {
                "documentline_seq": "20",
                "documentline_desc": "",
                "documentline_promisedate": "0000-00-00",
                "item_code": "",
                "item_name": "TEST ITEM 2",
                "quantity": "1",
                "basequantity": "1",
                "uom_code": "",
                "baseuom_code": "",
                "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",
                "accounts_code": "11-1000",
                "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": "2019-08-06 12:04:36",
                "createdby": "admin",
                "updated": "2019-08-06 12:04:36",
                "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 Office Receipt Data

Office Receipt Header Data

No Field Name Data Type (Size) Required Description
1 document_no varchar(255) Y Office Receipt document number
2 document_refno varchar(255) Office Receipt reference number
3 document_date date Office Receipt document date
4 document_status varchar(30) Office Receipt document status
5 document_prepareby varchar(50) Preparer of the document
6 document_desc text Office Receipt description
7 document_note text Office Receipt document note
8 document_reason varchar(255) Office Receipt Void reason
9 document_glmemo varchar(255) Office Receipt document GL memo
10 accounts_code varchar(50) Y Office Receipt Account Code
11 bpartner_no varchar(50) Office Receipt business partner number
12 bpartner_name varchar(255) Office Receipt business partner name
13 billcontacts_name varchar(255) Office Receipt Bill Contact Name
14 billcontacts_hp varchar(255) Office Receipt bill contact handphone number
15 billaddress_street1 varchar(255) Office Receipt bill address street 1
16 billaddress_street2 varchar(255) Office Receipt bill address street 2
17 billaddress_street3 varchar(255) Office Receipt bill address street 3
18 billaddress_street4 varchar(255) Office Receipt bill address street 4
19 billaddress_postcode varchar(50) Office Receipt bill address postcode
20 billaddress_city varchar(50) Office Receipt bill address city
21 billaddress_area varchar(50) Office Receipt bill address area
22 billaddress_country varchar(50) Office Receipt bill address country
23 shipaddress_street1 varchar(255) Office Receipt ship address street 1
24 shipaddress_street2 varchar(255) Office Receipt ship address street 2
25 shipaddress_street3 varchar(255) Office Receipt ship address street 3
26 shipaddress_street4 varchar(255) Office Receipt ship address street 4
27 shipaddress_postcode varchar(50) Office Receipt ship address postcode
28 shipaddress_city varchar(50) Office Receipt ship address city
29 shipaddress_area varchar(50) Office Receipt ship address area
30 shipaddress_country varchar(50) Office Receipt ship address country
31 shippinginfo varchar(255) Office Receipt shipping info
32 shipcontacts_name varchar(255) Office Receipt shipping contact name
33 shipcontacts_hp varchar(50) Office Receipt shipping contact handphone
34 totalamt decimal(22,2) Office Receipt total amount
35 totalamt_local decimal(22,2) Office Receipt total amount in local currency
36 totaltaxamt decimal(22,2) Office Receipt total tax amount
37 totaltaxamt_local decimal(22,2) Office Receipt total tax amount in local currency
38 totalnetamt decimal(22,2) Office Receipt total net amount (amt + tax)
39 totalnetamt_local decimal(22,2) Office Receipt total net amount in local currency
40 salesagent_name varchar(255) Office Receipt sales agent
41 terms_name varchar(255) Office Receipt term name
42 terms_day int(11) Office Receipt term day
43 currency_code varchar(255) Office Receipt currency code
44 currency_rate decimal(14,8) NULL Office Receipt currency rate
45 document_trackdate date [1970-01-01] Office Receipt track date
46 document_tracktype varchar(100) Office Receipt track type
47 document_trackremark text Office Receipt track remark
48 document_trackupdated datetime Office Receipt track last update date time
49 document_trackupdatedby varchar(50) Office Receipt track last update by
50 track1_code varchar(255) Office Receipt track 1 code
51 track2_code varchar(255) Office Receipt track 2 code
52 track3_code varchar(255) Office Receipt track 3 code
53 track4_code varchar(255) Office Receipt track 4 code
54 track5_code varchar(255) Office Receipt track 5 code
55 isprinted smallint(1) Office Receipt is allow print out in the print format (Yes[1]/No[0])
56 isop smallint(1) [0]
57 isimport smallint(1)
58 filling_date date Office Receipt filling Date
59 filingdatelastchangebyuser varchar(50) Office Receipt filling Date last updated user
60 created datetime Office Receipt created date in the system
61 createdby varchar(50) Office Receipt creator
62 updated datetime Office Receipt last updated date
63 updatedby varchar(50) Office Receipt last updated user
64 organization_code varchar(10) Office Receipt was created under which organization
65 branch_code varchar(40) Office Receipt was created under which branch
66 process_auto_knockoff smallint(1) Option to procress auto knockoff with FIFO method (1 for turn on / 0 for turn off)

Office Receipt Line Data

No Field Name Data Type (Size) Required Description
1 documentline_seq smallint(6) Office Receipt's document line Sequence No
2 documentline_desc text Office Receipt's Line description
3 documentline_promisedate date Office Receipt's line promise date
4 item_code varchar(255) Office Receipt's line item code
5 item_name varchar(255) Office Receipt's line item name
6 quantity decimal(28,8) Office Receipt's line item quantity
7 basequantity decimal(28,8) Office Receipt's line item base quantity
8 uom_code varchar(255) Office Receipt's line item UOM
9 baseuom_code varchar(255) Office Receipt's line item base UOM
10 accounts_code varchar(50) Y Office Receipt's line item account code
11 unitprice decimal(24,4) Office Receipt's line item unit price
12 unitprice_local decimal(24,4) Office Receipt's line item unit price in local currency
13 discount varchar(255) Office Receipt's line item discount percentage
14 discount_amt decimal(24,2) Office Receipt's line item discount amount
15 amount_sub decimal(22,2) Office Receipt's line sub amount (unitprice * quantity)
16 amount_sub_local decimal(22,2) Office Receipt's line sub amount in local currency
17 amount_tax decimal(22,2) Office Receipt's line tax amount
18 amount_tax_local decimal(22,2) Office Receipt's line tax amount in local currency
19 amount_netttotal decimal(22,2) Office Receipt's line net total (sub amount + tax amount)
20 amount_netttotal_local decimal(22,2) Office Receipt's line net total in local currency
21 isinclusive smallint(11) Is Inclusive tax? (Yes[1]/No[0])
22 tax_name varchar(255) Office Receipt's line tax name
23 tax_rate decimal(10,4) Office Receipt's line tax rate
24 taxaccounts_id varchar(50) Office Receipt's line tax account
25 msic_code varchar(30) Office Receipt's line MSIC code
26 serialno text NULL Office Receipt's line item's serial number
27 batchno varchar(255) Office Receipt's line item's batch number
28 lotno varchar(255) Office Receipt's line item's lot number
29 track1_code varchar(255) Office Receipt's line track 1 code
30 track2_code varchar(255) Office Receipt's line track 2 code
31 track3_code varchar(255) Office Receipt's line track 3 code
32 track4_code varchar(255) Office Receipt's line track 4 code
33 track5_code varchar(255) Office Receipt's line track 5 code
34 customfield1 varchar(255) Office Receipt's line custom field 1
35 customfield2 varchar(255) Office Receipt's line custom field 2
36 customfield3 varchar(255) Office Receipt's line custom field 3
37 created datetime Office Receipt's line created date in the system
38 createdby varchar(50) Office Receipt's line creator
39 updated datetime Office Receipt's line last updated date
40 updatedby varchar(50) Office Receipt's line last updated user
41 isprint smallint(1) [1] Office Receipt's line is allow print out in the print format? (Yes[1]/No[0])
42 isremark int(11) Is remark? (Yes[1]/No[0])
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 Office Receipt's line item's inventory cost
48 othercost decimal(22,2) NULL Office Receipt's line item's landing cost
49 hscode_code varchar(50) Office Receipt's line item's HS code