ภาพรวม Document API
warning
เนื้อหานี้สำหรับการใช้งาน Document API ผ่าน /:document
สำหรับเอกสาร Simple และ /:document/inline
สำหรับ เอกสาร inline เท่านั้น
การคำนวณค่าในเอกสาร จะแบ่งตามประเภทของบริษัท และประเภทของเอกสารที่สร ้าง ได้ดังนี้
- บริษัทไม่จดภาษี (Non vat registered company) โดยสามารถสร้างเอกสารได้ 2 แบบ คือ
- สร้างเอกสาร (Simple Document)
- สร้างเอกสาร แบบส่วนลด แยกตามรายการสินค้า (Inline Discount Document)
- บริษัทจดภาษี (Vat registered company) โดยสามารถสร้างเอกสารได้ 3 แบบ คือ
- สร้างเอกสาร (Simple Document)
- สร้างเอกสาร แบบส่วนลด แยกตามรายการสินค้า (Inline Discount Document)
- สร้างเอกสาร แบบส่วนลดและภาษี แยกตามรายการสินค้า (Inline Discount and Vat Document)
การใช้งานฟังก์ชั่นของ เอกสาร
Field | Type | Description |
---|---|---|
isVat | boolean | ตั้งค่าการเปิดใช้งานการคำนวณภาษีมูลค่าเพิ่มของเอกสาร - ป้อนค่า true เมื่อมีการคำนวณภาษีมูลค่าเพิ่ม โดยที่ isVatInclusive สามารถป้อนค่าเป็น true หรือ false ก็ได้ - ป้อนค่า false เมื่อไม่มีการคำนวณภาษีมูลค่าเพิ่ม โดยที่ isVatInclusive ต้องป้อนค่าเป็น false เท่านั้น |
isVatInclusive | boolean | ตั้งค่าการเปิดใช้งานภาษีมูลค่าเพิ่มแบบรวมในราคาต่อหน่วย - ป้อนค่า true เมื่อราคาต่อหน่วยของสินค้าได้รวมภาษีมูลค่าเพิ่มแล้ว - ป้อนค่า false เมื่อราคาต่อหน่วยของสินค้ายังไม่รวมภาษีมูลค่าเพิ่ม (ไม่รวมภาษีมูลค่าเพิ่ม) |
useReceiptDeduction | boolean | ตั้งค่าการใช้งานฟังก์ชั่น ปรับลดท้ายเอกสาร (เฉพาะเอกสารใบกำกับภาษี / ใบเสร็จรับเงิน และ ใบเสร็จรับเงิน / เอกสารขายเงินสด) |
useInlineDiscount | boolean | ตั้งค่าการใช้งานฟังก์ชั่น ส่วนลดแยกรายการ จะมีค ่าคงที่เป็น true เกี่ยวข้องกับ discountAmount |
useInlineVat | boolean | ตั้งค่าการใช้งาน ภาษีมูลค่าเพิ่ม แยกรายการ ที่เกี่ยวข้องกับ vatRate ในสินค้า |
discountType | number | รูปแบบส่วนลดในเอกสาร กรณีใช้รูปแบบ Inline ส่วนลด หรือ ภาษี แยกตามรายการสินค้า สามารถเลือกรูปแบบส่วนลดได้ 1 = เปอร์เซ็นต์ 3 = จำนวน (บาท) |
Product items List
Field | Type | Description | Decimal support |
---|---|---|---|
pricePerUnit | number | ราคาต่อหน่วยของสินค้า | 4 decimal |
quantity | number | จำนวนสินค้า | 4 decimal |
discountAmount | number | ส่วนลดสิน ค้า | 2 decimal |
total | number | ราคารวมในระดับรายการสินค้า | 2 decimal |
Document
Field | Type | Description | Decimal support |
---|---|---|---|
discountPercentage | number | เปอร์เซ็นต์ส่วนลด | 2 decimal |
subTotal | number | ยอดรวมหักส่วนลดอื่นๆ ยังไม่รวม VAT หรือส่วนลดเพิ่มเติม | 2 decimal |
totalAfterDiscount | number | ยอดรวมหลังหักส่วนลด | 2 decimal |
discountAmount | number | ส่วนลดรวม | 2 decimal |
vatableAmount | number | จำนวนเงินที่ต้องเสีย VAT | 2 decimal |
vatAmount | number | จำนวน VAT ทั้งหมด | 2 decimal |
exemptAmount | number | จำนวนเงินที่ได้รับการยกเว้นจาก VAT | 2 decimal |
grandTotal | number | ยอดรวมสุทธิหลังรวม VAT และส่วนลด | 2 decimal |
Payment / Receipt
Field | Type | Description | Decimal support |
---|---|---|---|
paymentAmount | number | จำนวนเงินที่ต้องชำระ | 2 decimal |
paymentWithHeld | number | จำนวนเงินที่ถูกหัก ณ ที่จ่าย | 2 decimal |
remainingCollected | number | จำนวน ยอดเงินขาด หรือ เงินเกิน | 2 decimal |
collected | number | จำนวนเงินที่ได้รับหรือจ่ายแล้ว | 2 decimal |
deductionAmount | number | จำนวนเงินที่ถูกหัก | 2 decimal |
charge | number | ค่าธรรมเนียม | 4 decimal |
info
- ค่าการคำนวณทางบัญชีที่ต้องใส่ให้ถูกต้อง Decimal ที่กำหนด
- เอกสาร Simple
- เอกสาร Inline
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2021-01-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2021-01-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 100.01,
"discountPercentage": 100.0001,
"discountAmount": 100.01,
"totalAfterDiscount": 10.51,
"isVat": false,
"vatAmount": 10.51,
"grandTotal": 321.01,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"documentStructureType": "SimpleDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "Service",
"description": "Type service",
"quantity": 1.1234,
"unitName": "บริการ",
"pricePerUnit": 100.0001,
"total": 100.01,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": ""
}
]
}
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2021-01-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2021-01-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 100.01,
"discountPercentage": 100.0001,
"discountAmount": 100.01,
"totalAfterDiscount": 10.51,
"isVat": false,
"vatAmount": 10.51,
"grandTotal": 321.01,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 1,
"useInlineDiscount": true,
"useInlineVat": false,
"exemptAmount": 10.51,
"vatableAmount": 10.51,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "Service",
"description": "Type service",
"quantity": 1.1234,
"unitName": "บริการ",
"pricePerUnit": 100.0001,
"total": 100.01,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 100.01,
"vatRate": 7
}
]
}