ตัวอย่างการคำนวณเอกสารสำหรับ บริษัทจดภาษี
(Vat registered company)
1. เอกสาร (Simple Document)
เอกสาร สามารถตั้งค่าเอกสารได้ทั้งหมด 3 แบบ ดังนี้
- เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และไม่คำนวณภาษีมูลค่าเพิ่ม ตัวอย่าง
- เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และคำนวณภาษีมูลค่าเพิ่ม ตัวอย่าง
- เอกสารคิดราคาสินค้าแบบรวมภาษี ตัวอย่าง
Scenario บริษัท ตัวอย่าง จำกัด ต้องการออกเอกสาร ใบกำกับภาษี ให้กับลูกค้า
มีรายการสินค้าดังนี้:
- สินค้า: Product 1
- ราคาต่อหน่วย: 200 บาท
- จำนวน: 5 ชิ้น
- ส่วนลดรวม 50 บาท
การคำนวณระดับสินค้า
Field | Calculation logic | Example | Value |
---|---|---|---|
quantity | input | 5 | 5 |
pricePerUnit | input | 200 | 200 |
total | quantity × pricePerUnit | 5 × 200 | 1000 |
1.1 เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และไม่คำนวณภาษีมูลค่าเพิ่ม
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | (5 × 200) | 1000 |
discountPercentage | input | 5 | 5 |
discountAmount | input | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount | 1000 - 50 | 950 |
vatAmount | 0 | 0 | 0 |
grandTotal | totalAfterDiscount | 950 | 950 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 5,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": false,
"vatAmount": 0,
"grandTotal": 950,
"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": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 1000,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": ""
}
]
}
1.2 เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และคำนวณภาษีมูลค่าเพ ิ่ม
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | true |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 × 200 | 1000 |
discountPercentage | input | 5 | 5 |
discountAmount | input | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount | 1000 - 50 | 950 |
vatAmount | totalAfterDiscount × 7 / 100 | 950 × 7 / 100 | 66.50 |
grandTotal | totalAfterDiscount + vatAmount | 950 + 66.50 | 1016.50 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 5,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": true,
"vatAmount": 66.50,
"grandTotal": 1016.50,
"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": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 1000,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": ""
}
]
}
1.3 เอกสารคิดราคาสินค้าแบบรวมภาษี
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | true |
isVat | true |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 × 200 | 1000 |
discountPercentage | input | 5 | 5 |
discountAmount | input | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount | 1000 - 50 | 950 |
vatAmount | totalAfterDiscount × 7 / 107 | 950 × 7 / 107 | 62.15 |
grandTotal | totalAfterDiscount | 950 | 950 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": true,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 5,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": true,
"vatAmount": 62.15,
"grandTotal": 950,
"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": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "บริการ",
"pricePerUnit": 200,
"total": 1000,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": ""
}
]
}
2. เอกสาร แบบส่วนลด แยกตามรายการสินค้า (Inline Discount Document)
เอกสาร แยกตามรายการสินค้า สามารถตั้งค่าเอกสารได้ทั้งหมด 3 แบบ ดังนี้
- เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และไม่คำนวณภาษีมูลค่าเพิ่ม ตัวอย่าง
- เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และคำนวณภาษีมูลค่าเพิ่ม ตัวอย่าง
- เอกสารคิดราคาสินค้าแบบรวมภาษี ตัวอย่าง
Scenario บริษัท ตัวอย่าง จำกัด ต้องการออกเอกสาร ใบกำกับภาษี ให้กับลูกค้า มีส่วนลดแยกรายการ
โดยมีรายการสินค้าดังนี้:
- สินค้า: Product 1
- ราคาต่อหน่วย: 200 บาท
- จำนวน: 5 ชิ้น
- ส่วนลดสินค้า 50 บาท
การคำนวณระดับสินค้า
Field | Calculation logic | Example | Value |
---|---|---|---|
quantity | input | 5 | 5 |
pricePerUnit | input | 200 | 200 |
discountAmount[item] * | input | 50 | 50 |
total | (quantity × pricePerUnit ) - discountAmount[item] | (5 × 200) - 50 | 950 |
*หมายเหตุ
- ถ้าส่วนลด รายสินค้าเป็น เปอร์เซ็นต์ ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 1 - ถ้าส่วนลด รายสินค้าเป็น จำนวน ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 3
2.1 เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และไม่คำนวณภาษีมูลค่าเพิ่ม
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | false |
useInlineDiscount | true |
useInlineVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | (5 × 200) | 1000 |
discountAmount[document] | ∑(discountAmount[item] ) | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount[document] | 1000 - 50 | 950 |
exemptAmount | totalAfterDiscount | 950 | 950 |
vatableAmount | 0 | 0 | 0 |
vatAmount | 0 | 0 | 0 |
grandTotal | exemptAmount + vatableAmount + vatAmount | 950 + 0 + 0 | 950 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 0,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": false,
"vatAmount": 0,
"grandTotal": 950,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 3,
"useInlineDiscount": true,
"useInlineVat": false,
"exemptAmount": 950,
"vatableAmount": 0,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 950,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 50,
"vatRate": 0
}
]
}
2.2 เอกสารคิดราคาสินค้าแบบไม่รวมภาษี และคำนวณภาษีมูลค่าเพิ่ม
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | true |
useInlineDiscount | true |
useInlineVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 × 200 | 1000 |
discountAmount[document] | ∑(discountAmount[item] ) | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount[document] | 1000 - 50 | 950 |
exemptAmount | 0 | 0 | 0 |
vatableAmount | totalAfterDiscount | 950 | 950 |
vatAmount | totalAfterDiscount × 7 / 100 | 950 × 7 / 100 | 66.50 |
grandTotal | exemptAmount + vatableAmount + vatAmount | 0 + 950 + 66.50 | 1016.50 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 0,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": true,
"vatAmount": 66.50,
"grandTotal": 1016.50,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 3,
"useInlineDiscount": true,
"useInlineVat": false,
"exemptAmount": 0,
"vatableAmount": 950,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 950,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 50,
"vatRate": 0
}
]
}
2.3 เอกสารคิดราคาสินค้าแบบรวมภาษี
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | true |
isVat | true |
useInlineDiscount | true |
useInlineVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 × 200 | 1000 |
discountAmount[document] | ∑(discountAmount[item] ) | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount[document] | 1000 - 50 | 950 |
exemptAmount | 0 | 0 | 0 |
vatableAmount | totalAfterDiscount × 100 / 107 | 950 × 100 / 107 | 887.85 |
vatAmount | totalAfterDiscount × 7 / 100 | 950 × 7 / 107 | 62.15 |
grandTotal | exemptAmount + vatableAmount + vatAmount | 0 + 887.85 + 62.15 | 950 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้ า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": true,
"useReceiptDeduction": false,
"subTotal": 1000,
"discountPercentage": 0,
"discountAmount": 50,
"totalAfterDiscount": 950,
"isVat": true,
"vatAmount": 62.15,
"grandTotal": 950,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 3,
"useInlineDiscount": true,
"useInlineVat": false,
"exemptAmount": 0,
"vatableAmount": 887.85,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "Product 1",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 950,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 50,
"vatRate": 0
}
]
}
3. เอกสารแบบส่วนลดและภาษี แยกตามรายการสินค้า (Inline Discount and Vat Document)
เอกสาร แบบส่วนลดและภาษี แยกตามรายการสินค้า สามารถตั้งค่าเอกสารได้ทั้งหมด 2 แบบ ดังนี้
Scenario บริษัท ตัวอย่าง จำกัด ต้องการออกเอกสาร ใบกำกับภาษี ให้กับลูกค้า มีส่วนลดและภาษีแยกรายการ
มีรายการสินค้าดังนี้:
- รายการ 1: สินค้าคิดภาษี 7
- ราคาต่อหน่วย: 200 บา ท
- จำนวน: 5 ชิ้น
- ส่วนลดสินค้า 50 บาท
- ภาษี 7 %
- รายการ 2: สินค้าภาษี 0
- ราคาต่อหน่วย: 100 บาท
- จำนวน: 2 ชิ้น
- ส่วนลดสินค้า 0 บาท
- ภาษี: 0 %
- รายการ 3: สินค้ายกเว้นภาษี
- ราคาต่อหน่วย: 150 บาท
- จำนวน: 3 ชิ้น
- ส่วนลดสินค้า: 20 บาท
- ภาษี: ยกเว้น
การคำนวณระดับสินค้า
Field | Value |
---|---|
quantity | input |
pricePerUnit | input |
discountAmount[item] * | input |
total | (quantity × pricePerUnit ) - discountAmount[item] |
*หมายเหตุ
- ถ้าส่วนลด รายสินค้าเป็น เปอร์เซ็นต์ ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 1 - ถ้าส่วนลด รายสินค้าเป็น จำนวน ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 3
รายการสินค้า | quantity | pricePerUnit | discountAmount | total | Value |
---|---|---|---|---|---|
สินค้าคิดภาษี 7 | 5 | 200 | 50 | (5 × 200) - 50 | 950 |
สินค้ารวมภาษี | 2 | 100 | 0 | (2 × 100) - 0 | 200 |
สินค้าภาษี 0 | 3 | 150 | 20 | (3 × 150) - 20 | 430 |
3.1 เอกสารคิดราคาสินค้าแบบไม่รวมภาษี
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | true |
useInlineDiscount | true |
useInlineVat | true |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | (5 × 200) + (2 × 100) + (3 × 150) | 1650 |
discountAmount[document] | ∑(discountAmount[item] ) | 50 + 0 + 20 | 70 |
totalAfterDiscount | subTotal - discountAmount[document] | 1650 - 70 | 1580 |
exemptAmount | ∑(total ) (ผลรวมเฉพาะรายการสินค้า ที่มีภาษี 0% หรือ ยกเว้นภาษี) | 200 + 430 | 630 |
vatableAmount | totalAfterDiscount - exemptAmount | 1580 - 630 | 950 |
vatAmount | (totalAfterDiscount - exemptAmount ) x 7 / 100 | (1580 - 630) × 7 / 100 | 66.50 |
grandTotal | exemptAmount + vatableAmount + vatAmount | 630 + 950 + 66.50 | 1646.50 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": false,
"useReceiptDeduction": false,
"subTotal": 1650,
"discountPercentage": 0,
"discountAmount": 70,
"totalAfterDiscount": 1580,
"isVat": true,
"vatAmount": 66.50,
"grandTotal": 1646.50,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 3,
"useInlineDiscount": true,
"useInlineVat": true,
"exemptAmount": 630,
"vatableAmount": 950,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "สินค้าคิดภาษี 7",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 950,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 50,
"vatRate": 7
},
{
"id": 2,
"type": 1,
"name": "สินค้าภาษี 0",
"description": "Type Product",
"quantity": 2,
"unitName": "unit",
"pricePerUnit": 100,
"total": 200,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 0,
"vatRate": 0
},
{
"id": 3,
"type": 1,
"name": "สินค้ายกเว้นภาษี",
"description": "Type Product",
"quantity": 3,
"unitName": "unit",
"pricePerUnit": 150,
"total": 430,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 20,
"vatRate": -1
}
]
}
3.2 เอกสารคิดราคาสินค้าแบบรวมภาษี
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | true |
isVat | true |
useInlineDiscount | true |
useInlineVat | true |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | (5 × 200) + (2 × 100) + (3 × 150) | 1650 |
discountAmount[document] | ∑(discountAmount[item] ) | 50 + 0 + 20 | 70 |
totalAfterDiscount | subTotal - discountAmount[document] | 1650 - 70 | 1580 |
exemptAmount | ∑(total ) (ผลรวมเฉพาะรายการสินค้า ที่มีภาษี 0% หรือ ยกเว้นภาษี) | 200 + 430 | 630 |
vatableAmount | (totalAfterDiscount - exemptAmount ) / 1.07 | (1580 - 630) × (100/107) | 887.85 |
vatAmount | (totalAfterDiscount - exemptAmount ) x 7 / 107 | (1530 - 630) × (7/107) | 62.15 |
grandTotal | exemptAmount + vatableAmount + vatAmount | 630 + 887.85 + 62.15 | 1580 |

Payload
{
"recordId": 0,
"contactCode": "001",
"contactName": "บริษัท ลูกค้า จำกัด, คุณลูกค้า ซื้อประจำ",
"contactAddress": "ที่อยู่ ลูกค้า/ผู้จำหน่าย",
"contactTaxId": "1234567890123",
"contactBranch": "สำนักงาน/สาขา",
"contactPerson": "ลูกค้า",
"contactEmail": "contact@email.com",
"contactNumber": "099-999-9999",
"contactZipCode": "12345",
"contactGroup": 1,
"publishedOn": "2025-05-01",
"creditType": 1,
"creditDays": 30,
"dueDate": "2025-05-31",
"salesName": "พนักงาน ขายหน้าร้าน",
"projectName": "project A",
"reference": "INV2020010001",
"isVatInclusive": true,
"useReceiptDeduction": false,
"subTotal": 1650,
"discountPercentage": 0,
"discountAmount": 70,
"totalAfterDiscount": 1580,
"isVat": true,
"vatAmount": 62.15,
"grandTotal": 1580,
"documentShowWithholdingTax": false,
"documentWithholdingTaxPercentage": 0,
"documentWithholdingTaxAmount": 0,
"documentDeductionType": 0,
"documentDeductionAmount": 0,
"remarks": "remarks",
"internalNotes": "note",
"showSignatureOrStamp": true,
"discountType": 3,
"useInlineDiscount": true,
"useInlineVat": true,
"exemptAmount": 630,
"vatableAmount": 887.85,
"documentStructureType": "InlineDocument",
"saleAndPurchaseChannel": "",
"items": [
{
"id": 1,
"type": 1,
"name": "สินค้าคิดภาษี 7",
"description": "Type Product",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 950,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 50,
"vatRate": 7
},
{
"id": 2,
"type": 1,
"name": "สินค้าภาษี 0",
"description": "Type Product",
"quantity": 2,
"unitName": "unit",
"pricePerUnit": 100,
"total": 200,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 0,
"vatRate": 0
},
{
"id": 3,
"type": 1,
"name": "สินค้ายกเว้นภาษี",
"description": "Type Product",
"quantity": 3,
"unitName": "unit",
"pricePerUnit": 150,
"total": 430,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": "",
"discountAmount": 20,
"vatRate": -1
}
]
}