Appearance
Sale Invoice Service
Type | Value |
---|---|
URL | /SMLRESTService/restapi/saleinvoice |
Method | POST |
Content-Type | Application/json |
Request Header
name | description |
---|---|
GUID | GUID สำหรับการเชื่อมต่อ (smlx เสมอ) |
configFIleName | ชื่อไฟล์เก็บ Server Config |
databaseName | ชื่อฐานข้อมูล |
Example
{
GUID : smlx
configFIleName : SMLConfigBRSMLST.xml
databaseName : smlst2016
}
Data Params
Field Name | Type | |
---|---|---|
doc_no | String | เอกสารเลขที่ |
doc_format_code | String | รหัสเอกสาร |
doc_date | String | เอกสารวันที่ |
doc_time | String | เวลา |
cust_code | String | รหัสลูกค้า |
sale_code | String | รหัสพนักงานขาย |
sale_type | Number | ประเภทการขาย (0=ขายเชื่อ,1=ขายสด) |
vat_type | Number | ประเภทภาษี (0=แยกนอก,1=รวมใน,2=อัตราภาษีศูนย์) |
vat_rate | Number | อัตราภาษี |
total_value | Number | มูลค่าสินค้า |
total_discount | Number | มูลค่าส่วนลด |
total_before_vat | Number | ยอดก่อนภาษี |
total_vat_value | Number | ภาษีมูลค่าเพิ่ม |
total_except_vat | Number | มูลค่าสินค้ายกเว้นภาษี |
total_after_vat | Number | มูลค่าหลังคิดภาษี |
total_amount | Number | มูลค่าสุทธิ |
cash_amount | Number | ยอดเงินสด |
chq_amount | Number | ยอดเช็ค |
credit_amount | Number | ยอดบัตรเครดิต |
tranfer_amount | Number | ยอดเงินโอน |
credit_day | Number | จำนวนวันเครดิต** |
branch_code | String | สาขา** |
remark | String | หมายเหตุ** |
diff_amount | Number | ยอดปัดเศษ (new)** |
details | JSON Array | รายละเอียดสินค้า |
paydetails | JSON Array | รายละเอียดการชำระเงิน |
project_code | String | โครงการ** |
** Optional Params
Item Detail
Name | Type | |
---|---|---|
item_code | String | รหัสสินค้า |
line_number | Number | หมายเลขบรรทัด |
is_permium | Number | 0=สินค้าปรกติ,1=ของแถม |
unit_code | String | หน่วยนับ |
wh_code | String | คลังสินค้า |
shelf_code | String | ที่เก็บสินค้า |
qty | Number | จำนวน |
price | Number | ราคา |
price_exclude_vat | Number | ราคาไม่รวมภาษี |
discount_amount | Number | ส่วนลด |
sum_amount | Number | รวมมูลค่า |
vat_amount | Number | ยอดภาษี |
tax_type | Number | ประเภทภาษีของสินค้า (0=มีภาษี,1=ยกเว้นภาษี) |
vat_type | Number | ประเภทภาษี (0=แยกนอก,1=รวมใน,2=อัตราภาษีศูนย์) |
sum_amount_exclude_vat | Number | มูลค่าไม่รวมภาษี |
doc_ref_type | Number | ประเภทเอกสารอ้างอิง (1=ใบเสนอราคา 2=สั่งซื้อ/สั่งจอง 3=สั่งขาย) |
ref_doc_no | String | เลขที่เอกสารอ้างอิง |
Payment Detail
Name | Type | |
---|---|---|
pay_type | Number | ประเภทการรับเงิน (1=เงินโอน,2=เช็ค,3=บัตรเครดิต) |
pay_trans_number | String | สมุดเงินฝาก/เลขที่เช็ค/เลขที่บัตรเครดิต |
credit_card_type | String | ประเภทบัตรเครดิต |
no_approved | String | เลขที่อนุมัติ |
bank_code | String | ธนาคาร |
pay_amount | Number | จำนวนเงิน |
chq_due_date | String | วันที่โอน/วันที่บนเช็ค |
charge | Number | ยอด Charge |
sum_amount | Number | ยอดเงินรวม |
Sample Call
{
"doc_no": "SO59120001",
"doc_date": "2016-12-01",
"doc_format_code": "SO",
"cust_code": "20S0108",
"sale_code": "1056",
"vat_rate": 7,
"total_value": 473103.00,
"total_after_vat": 506220.21,
"total_amount": 506220.21,
"total_before_vat": 473103.00,
"total_discount": 0,
"total_except_vat": 0,
"total_vat_value": 33117.21,
"doc_time": "09:00",
"sale_type": 1,
"vat_type": 0,
"cash_amount" : 506220.21,
"chq_amount" : 0,
"credit_amount" : 0,
"details": [{
"item_code": "1000030",
"line_number": 0,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 100,
"price": 697.8900,
"price_exclude_vat": 697.89,
"sum_amount": 69789.00,
"discount_amount": 0,
"vat_amount": 4885.23,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 69789.00
}, {
"item_code": "1000018",
"line_number": 1,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 300,
"price": 667.0500,
"price_exclude_vat": 667.05,
"sum_amount": 200115.00,
"discount_amount": 0,
"vat_amount": 14008.05,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 200115.00
}, {
"item_code": "1000029",
"line_number": 2,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 100,
"price": 697.8900,
"price_exclude_vat": 697.89,
"sum_amount": 69789.00,
"discount_amount": 0,
"vat_amount": 4885.23,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 69789.00
}, {
"item_code": "1000017",
"line_number": 3,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 200,
"price": 667.0500,
"price_exclude_vat": 667.05,
"sum_amount": 133410.00,
"discount_amount": 0,
"vat_amount": 9338.70,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 133410.00
}
],
paydetails : [
{
pay_type: 2,
credit_card_type: '',
pay_trans_number: '',
pay_amount: 128826.93,
no_approved: '',
chq_due_date: '',
bank_code: '',
charge: 0.00,
sum_amount: 128826.93
}
]
}
Response
Response Success | |
---|---|
HTTP Status | 201 |
Response Success JSON Message
{
"status" : "success",
"message" : "create success"
}
Response Error | |
---|---|
HTTP Status | 400 |
Response Success JSON Message
{
"status" : "error",
"message" : "Message Error"
}
With Product Set
{
"doc_no": "SO59120001",
"doc_date": "2016-12-01",
"doc_format_code": "SO",
"cust_code": "20S0108",
"sale_code": "1056",
"vat_rate": 7,
"total_value": 473103.00,
"total_after_vat": 506220.21,
"total_amount": 506220.21,
"total_before_vat": 473103.00,
"total_discount": 0,
"total_except_vat": 0,
"total_vat_value": 33117.21,
"doc_time": "09:00",
"sale_type": 1,
"vat_type": 0,
"details": [{
"item_code": "1000030",
"line_number": 0,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 100,
"price": 697.8900,
"price_exclude_vat": 697.89,
"sum_amount": 69789.00,
"discount_amount": 0,
"vat_amount": 4885.23,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 69789.00
}, {
"item_type" : 3,
"line_number" : 4,
"item_code": "1000017",
"unit_code": "SET",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 1,
"childs" : [
{
"item_code": "1000029",
"line_number": 2,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 100,
"price": 697.8900,
"price_exclude_vat": 697.89,
"sum_amount": 69789.00,
"discount_amount": 0,
"vat_amount": 4885.23,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 69789.00
}, {
"item_code": "1000017",
"line_number": 3,
"is_permium": 0,
"unit_code": "TR",
"wh_code": "CMI01",
"shelf_code": "CMI420",
"qty": 200,
"price": 667.0500,
"price_exclude_vat": 667.05,
"sum_amount": 133410.00,
"discount_amount": 0,
"vat_amount": 9338.70,
"tax_type": 0,
"vat_type": 0,
"sum_amount_exclude_vat": 133410.00
}
]
}
]
}