ตัวอย่างการคำนวณเอกสารสำหรับ บริษัทไม่จดภาษี
(Non vat registered company)
1. เอกสาร (Simple Document)
Scenario บริษัท ตัวอย่าง จำกัด ต้องการออกเอกสาร ใบแจ้งหนี้ ให้กับลูกค้า
มีรายการสินค้าดังนี้:
- รายการสินค้า: Product 1
- ราคาต่อหน่วย: 200 บาท
- จำนวน: 5 ชิ้น
- ส่วนลดรวม 50 บาท
การคำนวณระดับสินค้า
Field | Calculation logic | Example | Value |
---|---|---|---|
quantity | input | 5 | 5 |
pricePerUnit | input | 200 | 200 |
total | quantity x pricePerUnit | 5 x 200 | 1000 |
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 x 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": "",
"quantity": 5,
"unitName": "unit",
"pricePerUnit": 200,
"total": 1000,
"sellChartOfAccountCode": "41210",
"buyChartOfAccountCode": ""
}
]
}
2. เอกสารแบบส่วนลด แยกตามรายการสินค้า (Inline Discount Document)
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 x pricePerUnit ) - discountAmount | (5 x 200) - 50 | 950 |
*หมายเหตุ
- ถ้าส่วนลด รายสินค้าเป็น เปอร์เซ็นต์ ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 1 - ถ้าส่วนลด รายสินค้าเป็น จำนวน ให้ตั้งค่า
discountType
ที่ระดับเอกสาร เป็น 3
การตั้งค่าเอกสาร
Field | Value |
---|---|
isVatInclusive | false |
isVat | false |
useInlineDiscount | true |
useinlineVat | false |
การคำนวณระดับเอกสาร
Field | Calculation logic | Example | Value |
---|---|---|---|
subTotal | ∑(quantity × pricePerUnit ) | 5 x 200 | 1000 |
discountAmount | ∑(discountAmount[item] ) | 50 | 50 |
totalAfterDiscount | subTotal - discountAmount | 1000 - 50 | 950 |
exemptAmount | totalAfterDiscount | 950 | 950 |
vatableAmount | 0 | 0 | 0 |
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": 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
}
]
}