Skip to content

Sale Invoice POS Service ​

API บิลขายหน้าร้าน (POS) — อ่านอย่างเดียว (GET)

บิล POS คือเอกสารใน ic_trans ที่ trans_flag = 44 และ is_pos = 1
ใบขายปกติ (is_pos = 0) อยู่ที่ Sale Invoice Service — ข้อมูลสองเส้นนี้แยกกันเด็ดขาด ไม่ปนกัน


Header Request ​

FieldValue
GUIDGUID สำหรับการเชื่อมต่อ (smlx เสมอ)
providerชื่อผู้ใช้บริการ
databaseNameชื่อฐานข้อมูล
configFileNameชื่อไฟล์ตั้งค่า — รูปแบบ SMLConfig<provider>.xml
Content-Typeapplication/json; charset=utf-8

Header Example ​

json
{
  "GUID": "smlx",
  "provider": "DATA",
  "databaseName": "data1",
  "configFileName": "SMLConfigDATA.xml",
  "Content-Type": "application/json; charset=utf-8"
}

HTTP Response ​

Statusความหมาย
200สำเร็จ — กรณี list ที่ไม่พบเอกสารก็ได้ 200 เช่นกัน โดย data เป็น [] และ pages.total_record เป็น 0
400ข้อมูลผิดพลาด (code = 99) — ดูสาเหตุจริงใน message
404ไม่พบเอกสาร (code = 404) กรณี GET ตามเลขที่เอกสาร หรือเรียก URL / path ไม่ถูกต้อง
405ใช้ HTTP method ไม่ถูกต้อง
500ข้อผิดพลาดภายในระบบ

SaleInvoicePOS List ​

แสดงบิลขาย POS ทั้งหมด

EndPoint ​

GET /SMLJavaRESTService/saleinvoicepos/v4

ขอบเขตข้อมูล: คืนเฉพาะบิล POS (trans_flag = 44, is_pos = 1) ที่ยังไม่ถูกยกเลิก (last_status = 0)

Query Request ​

FieldDescriptionExample
dateกรองเฉพาะวันเดียว2023-05-29
from_dateตั้งแต่วันที่ (≥) — ใช้คู่กับ to_date ได้2023-01-01
to_dateจนถึงวันที่ (≤) — ใช้คู่กับ from_date ได้2023-12-31
cust_codeรหัสลูกหนี้/ลูกค้าSPY000999
sale_codeรหัสพนักงานขายS001
pay_typeประเภทการชำระ (cash หรือ credit)cash
doc_noเลขที่เอกสาร (ค้นแบบตรงตัว)POS03-230529-0008
last_update_date_timeวันที่แก้ไขล่าสุดตั้งแต่ (≥)2023-05-01
pageหน้าที่ (เริ่ม 1)1
sizeจำนวนต่อหน้า10

หมายเหตุ:

  • ถ้าส่ง date มาแล้ว ระบบจะใช้ date ก่อน (ไม่สนใจ from_date/to_date)
  • วันที่ทุกตัวใช้รูปแบบ yyyy-MM-dd
  • size คือจำนวนเอกสารต่อหน้า แต่ละเอกสารจะมีรายการสินค้า (details) ครบทุกบรรทัดเสมอ
  • total_record คือจำนวนเอกสารทั้งหมดที่ตรงเงื่อนไข และ max_page คือจำนวนหน้าทั้งหมด
  • บิล POS บางใบไม่มีรหัสลูกค้า (cust_code เป็นค่าว่าง) เพราะเป็นการขายหน้าร้านทั่วไป

Example: ​

GET localhost:8084/SMLJavaRESTService/saleinvoicepos/v4?page=1&size=10
GET localhost:8084/SMLJavaRESTService/saleinvoicepos/v4?from_date=2023-01-01&to_date=2023-12-31&page=1&size=10
GET localhost:8084/SMLJavaRESTService/saleinvoicepos/v4?cust_code=SPY000999&page=1&size=10

Response Success ​

ตัวอย่างจริงจากคำสั่ง GET /SMLJavaRESTService/saleinvoicepos/v4?doc_no=INV-2010300002&page=1&size=1

json
{
    "success": true,
    "data": [
        {
            "trans_type": 2,
            "trans_flag": 44,
            "doc_group": "",
            "doc_date": "2020-10-30",
            "doc_no": "INV-2010300002",
            "doc_ref": "",
            "tax_doc_no": "INV-2010300002",
            "tax_doc_date": "2020-10-30",
            "inquiry_type": 1,
            "vat_type": 1,
            "cust_code": "",
            "contactor": "",
            "branch_code": "000",
            "project_code": "",
            "side_code": "",
            "department_code": "",
            "sale_area_code": "",
            "sale_code": "001",
            "send_type": 0,
            "send_day": 0,
            "credit_day": 0,
            "due_date": null,
            "answer_type": 0,
            "transport_value": 0,
            "discount_word": "",
            "vat_rate": 0,
            "currency_code": "",
            "exchange_rate": 0,
            "total_cost": 0,
            "total_value": 500,
            "total_discount": 0,
            "total_vat_value": 0,
            "total_after_vat": 500,
            "total_except_vat": 0,
            "total_amount": 500,
            "balance_amount": 0,
            "adjust_reason": "",
            "approve_code": "",
            "remark": "",
            "status": 0,
            "user_request": "",
            "expire_day": 0,
            "send_mail": 0,
            "send_sms": 0,
            "doc_ref_trans": "",
            "total_before_vat": 500,
            "doc_time": "08:50",
            "allocate_code": "",
            "job_code": "",
            "pay_amount": 0,
            "money": 0,
            "sum_pay_money_diff": 0,
            "currency_money": 0,
            "total_debt_amount": 0,
            "cancel_type": 0,
            "last_status": 0,
            "used_status": 0,
            "doc_success": 0,
            "total_manual": 0,
            "on_hold": 0,
            "extra_word": "",
            "transport_code": "",
            "want_day": 0,
            "deposit_day": 0,
            "sale_group": "",
            "not_approve_1": 0,
            "user_approve": "",
            "approve_status": 0,
            "expire_status": 0,
            "advance_amount": 0,
            "doc_format_code": "",
            "used_status_2": 0,
            "remark_2": "",
            "remark_3": "",
            "ref_amount": 0,
            "ref_new_amount": 0,
            "ref_diff": 0,
            "sum_point": 0,
            "cashier_code": "001",
            "is_pos": 1,
            "pos_id": "POS01",
            "member_code": "",
            "doc_no_guid": "",
            "pos_bill_type": 0,
            "pos_bill_change": 0,
            "doc_type": 0,
            "recheck_count_day": 0,
            "recheck_count": 0,
            "wh_from": "",
            "location_from": "",
            "wh_to": "",
            "location_to": "",
            "auto_create": 0,
            "send_to_pick_and_pack": 0,
            "service_charge_word": "",
            "total_service_charge": 0,
            "sale_shift_id": "",
            "creator_code": "",
            "last_editor_code": "",
            "table_number": "",
            "period_guid": "",
            "branch_code_to": "",
            "allocate_code_to": "",
            "project_code_to": "",
            "job_code_to": "",
            "side_code_to": "",
            "department_code_to": "",
            "point_telephone": "",
            "sum_point_2": 0,
            "remark_4": "",
            "remark_5": "",
            "is_manual_vat": 0,
            "pass_book_code": "",
            "total_amount_2": 0,
            "sender_code": "",
            "is_cancel": 0,
            "cancel_code": "",
            "is_hold": 0,
            "auto_approved": 0,
            "pos_transfer": 0,
            "doc_close": 0,
            "ref_doc_type": "",
            "is_doc_copy": 0,
            "doc_reason": "",
            "discount_word_2": "",
            "total_discount_2": 0,
            "total_value_2": 0,
            "total_amout_old": 0,
            "lost_profit_exchange_amount": 0,
            "details": [
                {
                    "trans_type": 2,
                    "trans_flag": 44,
                    "doc_group": "",
                    "doc_date": "2020-10-30",
                    "doc_no": "INV-2010300002",
                    "doc_ref": "",
                    "cust_code": "",
                    "inquiry_type": 1,
                    "item_code": "AGPAN15B001",
                    "item_name": "ใบตัดท้าย 15 นิ้ว",
                    "unit_code": "ลัง",
                    "qty": 1,
                    "price": 500,
                    "discount": "",
                    "sum_of_cost": 900,
                    "sum_amount": 500,
                    "remark": "ราคาปรกติ 500.00",
                    "status": 0,
                    "line_number": 0,
                    "ref_doc_no": "",
                    "ref_line_number": 0,
                    "ref_cust_code": "",
                    "branch_code": "000",
                    "wh_code": "",
                    "shelf_code": "",
                    "wh_code_2": "",
                    "shelf_code_2": "",
                    "department_code": "",
                    "total_vat_value": 0,
                    "cancel_qty": 0,
                    "total_qty": 0,
                    "stand_value": 1,
                    "divide_value": 1,
                    "ratio": 0,
                    "ic_pattern": "",
                    "ic_color": "",
                    "ic_size": "",
                    "priority_level": 0,
                    "calc_flag": -1,
                    "last_status": 0,
                    "set_ref_line": "",
                    "set_ref_price": 0,
                    "set_ref_qty": 0,
                    "item_type": 0,
                    "vat_type": 1,
                    "doc_ref_type": 0,
                    "item_code_main": "",
                    "ref_row": 0,
                    "ref_guid": "",
                    "doc_time": "08:50",
                    "is_permium": 0,
                    "is_get_price": 0,
                    "average_cost": 900,
                    "sum_amount_exclude_vat": 500,
                    "doc_date_calc": "2020-10-30",
                    "doc_time_calc": "08:50",
                    "discount_amount": 0,
                    "price_exclude_vat": 0,
                    "user_approve": "",
                    "price_type": 5,
                    "price_mode": 0,
                    "temp_float_1": 0,
                    "temp_float_2": 0,
                    "temp_string_1": "",
                    "is_serial_number": 0,
                    "bank_name": "",
                    "bank_branch": "",
                    "chq_number": "",
                    "barcode": "8851828778495",
                    "discount_number": 0,
                    "price_changed": 0,
                    "discount_changed": 0,
                    "price_default": 500,
                    "tax_type": 0,
                    "is_pos": 1,
                    "auto_create": 0,
                    "hidden_cost_1": 0,
                    "hidden_cost_1_exclude_vat": 0,
                    "hidden_cost_2": 0,
                    "hidden_cost_2_exclude_vat": 0,
                    "sum_of_cost_1": 900,
                    "average_cost_1": 900,
                    "sale_code": "001",
                    "sale_group": "",
                    "lot_number_1": "",
                    "item_code_2": "",
                    "bank_name_2": "",
                    "bank_branch_2": "",
                    "sale_shift_id": "",
                    "price_base": 0,
                    "creator_code": "",
                    "last_editor_code": "",
                    "fee_amount": 0,
                    "transfer_amount": 0,
                    "price_set_ratio": 0,
                    "mfn_code": "",
                    "mfn_name": "",
                    "price_2": 0,
                    "sum_amount_2": 0,
                    "price_guid": "",
                    "discount_amount_2": 0,
                    "is_lock_cost": 0,
                    "sum_of_cost_fix": 0,
                    "profit_lost_cost_amount": 0,
                    "is_doc_copy": 0,
                    "bat_number": "",
                    "product_year": "",
                    "product_week": "",
                    "currency_code": "",
                    "exchange_rate": 0,
                    "qty_2": 0,
                    "unit_code_2": "",
                    "total_size": 0,
                    "unit_size": 0,
                    "exchange_rate_old": 0,
                    "promotion_code": "",
                    "item_brand": "SCG",
                    "item_brand_name": "ກາຊ້າງ",
                    "group_main": "A",
                    "group_main_name": "ຊີມັງ",
                    "group_sub": "AA",
                    "group_sub_name": "ປູນເທົາ"
                }
            ],
            "sale_name": "พนักงาน SML",
            "billing_status": true,
            "value_balance": 500,
            "total_cost_calc": 900
        }
    ],
    "pages": {
        "size": 1,
        "page": 1,
        "total_record": 1,
        "max_page": 1
    }
}

Response Error ​

json
{
    "success": false,
    "error": true,
    "message": "error message",
    "code": "99"
}

SaleInvoicePOS Information ​

ดึงบิลขาย POS ทีละ 1 เอกสาร พร้อมรายการสินค้าและรายการชำระเงิน

EndPoint ​

GET /SMLJavaRESTService/saleinvoicepos/v4/{doc_no}

Path Parameter ​

NameDescriptionExample
doc_noเลขที่เอกสาร (ต้องเป็นบิล POS is_pos = 1 — ถ้าส่งเลขที่ใบขายปกติจะได้ 404)POS03-230529-0008

Example: ​

GET localhost:8084/SMLJavaRESTService/saleinvoicepos/v4/POS03-230529-0008

Response Success ​

ตัวอย่างจริงจากคำสั่ง GET /SMLJavaRESTService/saleinvoicepos/v4/POS03-230529-0008
เอกสารนี้ไม่มีการรับชำระใน cb_trans จึงไม่มี key payment — ฟิลด์ที่เป็น null จะไม่ถูกส่งออก ยกเว้น due_date และฟิลด์ยี่ห้อ/กลุ่มสินค้าที่ส่งเป็น null เสมอ

json
{
    "success": true,
    "data": {
        "trans_type": 2,
        "trans_flag": 44,
        "doc_group": "",
        "doc_date": "2023-05-29",
        "doc_no": "POS03-230529-0008",
        "doc_ref": "",
        "tax_doc_no": "POS03-230529-0008",
        "tax_doc_date": "2023-05-29",
        "inquiry_type": 1,
        "vat_type": 1,
        "cust_code": "SPY000999",
        "contactor": "",
        "branch_code": "",
        "project_code": "",
        "side_code": "",
        "department_code": "ACC",
        "sale_area_code": "",
        "sale_code": "001",
        "send_type": 0,
        "send_day": 0,
        "send_date": "2023-05-29",
        "credit_day": 0,
        "due_date": null,
        "answer_type": 0,
        "transport_value": 0,
        "discount_word": "",
        "vat_rate": 7,
        "currency_code": "",
        "exchange_rate": 0,
        "total_cost": 0,
        "total_value": 3669,
        "total_discount": 0,
        "total_vat_value": 219.49,
        "total_after_vat": 3355,
        "total_except_vat": 100,
        "total_amount": 3455,
        "balance_amount": 0,
        "adjust_reason": "",
        "approve_code": "",
        "remark": "",
        "status": 0,
        "user_request": "",
        "expire_day": 0,
        "send_mail": 0,
        "send_sms": 0,
        "doc_ref_trans": "",
        "total_before_vat": 3135.51,
        "doc_time": "11:12",
        "allocate_code": "",
        "job_code": "",
        "pay_amount": 0,
        "money": 0,
        "sum_pay_money_diff": 0,
        "currency_money": 0,
        "total_debt_amount": 0,
        "cancel_type": 0,
        "last_status": 0,
        "used_status": 0,
        "doc_success": 0,
        "total_manual": 0,
        "on_hold": 0,
        "extra_word": "",
        "transport_code": "",
        "want_day": 0,
        "deposit_day": 0,
        "sale_group": "",
        "not_approve_1": 0,
        "user_approve": "",
        "approve_status": 0,
        "expire_status": 0,
        "advance_amount": 214,
        "doc_format_code": "SIP",
        "used_status_2": 0,
        "remark_2": "",
        "remark_3": "",
        "ref_amount": 0,
        "ref_new_amount": 0,
        "ref_diff": 0,
        "sum_point": 6,
        "cashier_code": "001",
        "is_pos": 1,
        "pos_id": "POS03",
        "member_code": "spy000999",
        "doc_no_guid": "",
        "pos_bill_type": 0,
        "pos_bill_change": 0,
        "doc_type": 0,
        "recheck_count_day": 0,
        "recheck_count": 0,
        "wh_from": "",
        "location_from": "",
        "wh_to": "",
        "location_to": "",
        "auto_create": 0,
        "send_to_pick_and_pack": 0,
        "service_charge_word": "",
        "total_service_charge": 0,
        "sale_shift_id": "",
        "creator_code": "",
        "last_editor_code": "",
        "table_number": "",
        "period_guid": "",
        "branch_code_to": "",
        "allocate_code_to": "",
        "project_code_to": "",
        "job_code_to": "",
        "side_code_to": "",
        "department_code_to": "",
        "point_telephone": "",
        "sum_point_2": 0,
        "remark_4": "",
        "remark_5": "",
        "is_manual_vat": 0,
        "pass_book_code": "",
        "total_amount_2": 0,
        "sender_code": "",
        "is_cancel": 0,
        "cancel_code": "",
        "is_hold": 0,
        "auto_approved": 0,
        "pos_transfer": 0,
        "doc_close": 0,
        "ref_doc_type": "",
        "is_doc_copy": 0,
        "doc_reason": "",
        "discount_word_2": "",
        "total_discount_2": 0,
        "total_value_2": 0,
        "total_amout_old": 0,
        "lost_profit_exchange_amount": 0,
        "details": [
            {
                "trans_type": 2,
                "trans_flag": 44,
                "doc_group": "",
                "doc_date": "2023-05-29",
                "doc_no": "POS03-230529-0008",
                "doc_ref": "",
                "cust_code": "SPY000999",
                "inquiry_type": 1,
                "item_code": "AGPAN15B001",
                "item_name": "แก้วเยติ (สีดำ)",
                "unit_code": "แก้ว",
                "qty": 1,
                "price": 100,
                "discount": "",
                "sum_of_cost": 410.34,
                "sum_amount": 100,
                "remark": "ราคาสมาชิก 100.00",
                "status": 0,
                "line_number": 0,
                "ref_doc_no": "",
                "ref_line_number": 0,
                "ref_cust_code": "",
                "branch_code": "",
                "wh_code": "WH001",
                "shelf_code": "LC001",
                "wh_code_2": "",
                "shelf_code_2": "",
                "department_code": "",
                "total_vat_value": 0,
                "cancel_qty": 0,
                "total_qty": 0,
                "stand_value": 1,
                "divide_value": 1,
                "ratio": 0,
                "ic_pattern": "",
                "ic_color": "",
                "ic_size": "",
                "priority_level": 0,
                "calc_flag": -1,
                "last_status": 0,
                "set_ref_line": "",
                "set_ref_price": 0,
                "set_ref_qty": 0,
                "item_type": 0,
                "vat_type": 1,
                "doc_ref_type": 0,
                "item_code_main": "",
                "ref_row": 0,
                "ref_guid": "",
                "doc_time": "11:12",
                "is_permium": 0,
                "is_get_price": 0,
                "average_cost": 410.34,
                "sum_amount_exclude_vat": 100,
                "doc_date_calc": "2023-05-29",
                "doc_time_calc": "11:12",
                "discount_amount": 0,
                "price_exclude_vat": 0,
                "user_approve": "",
                "price_type": 7,
                "price_mode": 0,
                "temp_float_1": 0,
                "temp_float_2": 0,
                "temp_string_1": "",
                "is_serial_number": 0,
                "bank_name": "",
                "bank_branch": "",
                "chq_number": "",
                "barcode": "8851828778495",
                "discount_number": 0,
                "price_changed": 0,
                "discount_changed": 0,
                "price_default": 120,
                "tax_type": 1,
                "is_pos": 1,
                "auto_create": 0,
                "hidden_cost_1": 0,
                "hidden_cost_1_exclude_vat": 0,
                "hidden_cost_2": 0,
                "hidden_cost_2_exclude_vat": 0,
                "sum_of_cost_1": 410.34,
                "average_cost_1": 410.34,
                "sale_code": "001",
                "sale_group": "",
                "lot_number_1": "",
                "item_code_2": "",
                "bank_name_2": "",
                "bank_branch_2": "",
                "sale_shift_id": "",
                "price_base": 300,
                "creator_code": "",
                "last_editor_code": "",
                "fee_amount": 0,
                "transfer_amount": 0,
                "price_set_ratio": 0,
                "mfn_code": "",
                "mfn_name": "",
                "price_2": 0,
                "sum_amount_2": 0,
                "price_guid": "",
                "discount_amount_2": 0,
                "is_lock_cost": 0,
                "sum_of_cost_fix": 0,
                "profit_lost_cost_amount": 0,
                "is_doc_copy": 0,
                "bat_number": "",
                "product_year": "",
                "product_week": "",
                "currency_code": "",
                "exchange_rate": 0,
                "qty_2": 0,
                "unit_code_2": "",
                "total_size": 0,
                "unit_size": 0,
                "exchange_rate_old": 0,
                "promotion_code": "",
                "item_brand": "SCG",
                "item_brand_name": "ກາຊ້າງ",
                "group_main": "A",
                "group_main_name": "ຊີມັງ",
                "group_sub": "AA",
                "group_sub_name": "ປູນເທົາ"
            },
            {
                "trans_type": 2,
                "trans_flag": 44,
                "doc_group": "",
                "doc_date": "2023-05-29",
                "doc_no": "POS03-230529-0008",
                "doc_ref": "",
                "cust_code": "SPY000999",
                "inquiry_type": 1,
                "item_code": "FAN-0002",
                "item_name": "พัดลม Hatari สีฟ้า",
                "unit_code": "เครื่อง",
                "qty": 1,
                "price": 1350,
                "discount": "",
                "sum_of_cost": 296.59,
                "sum_amount": 1350,
                "remark": "ราคาปรกติ 1,350.00",
                "status": 0,
                "line_number": 1,
                "ref_doc_no": "",
                "ref_line_number": 0,
                "ref_cust_code": "",
                "branch_code": "",
                "wh_code": "WH001",
                "shelf_code": "LC001",
                "wh_code_2": "",
                "shelf_code_2": "",
                "department_code": "",
                "total_vat_value": 88.32,
                "cancel_qty": 0,
                "total_qty": 0,
                "stand_value": 1,
                "divide_value": 1,
                "ratio": 0,
                "ic_pattern": "",
                "ic_color": "",
                "ic_size": "",
                "priority_level": 0,
                "calc_flag": -1,
                "last_status": 0,
                "set_ref_line": "",
                "set_ref_price": 0,
                "set_ref_qty": 0,
                "item_type": 0,
                "vat_type": 1,
                "doc_ref_type": 0,
                "item_code_main": "",
                "ref_row": 0,
                "ref_guid": "",
                "doc_time": "11:12",
                "is_permium": 0,
                "is_get_price": 0,
                "average_cost": 296.59,
                "sum_amount_exclude_vat": 1261.68,
                "doc_date_calc": "2023-05-29",
                "doc_time_calc": "11:12",
                "discount_amount": 0,
                "price_exclude_vat": 0,
                "user_approve": "",
                "price_type": 5,
                "price_mode": 0,
                "temp_float_1": 0,
                "temp_float_2": 0,
                "temp_string_1": "",
                "is_serial_number": 0,
                "bank_name": "",
                "bank_branch": "",
                "chq_number": "",
                "barcode": "8851888891851",
                "discount_number": 0,
                "price_changed": 0,
                "discount_changed": 0,
                "price_default": 1350,
                "tax_type": 0,
                "is_pos": 1,
                "auto_create": 0,
                "hidden_cost_1": 0,
                "hidden_cost_1_exclude_vat": 0,
                "hidden_cost_2": 0,
                "hidden_cost_2_exclude_vat": 0,
                "sum_of_cost_1": 296.59,
                "average_cost_1": 296.59,
                "sale_code": "001",
                "sale_group": "",
                "lot_number_1": "",
                "item_code_2": "",
                "bank_name_2": "",
                "bank_branch_2": "",
                "sale_shift_id": "",
                "price_base": 0,
                "creator_code": "",
                "last_editor_code": "",
                "fee_amount": 0,
                "transfer_amount": 0,
                "price_set_ratio": 0,
                "mfn_code": "",
                "mfn_name": "",
                "price_2": 0,
                "sum_amount_2": 0,
                "price_guid": "",
                "discount_amount_2": 0,
                "is_lock_cost": 0,
                "sum_of_cost_fix": 0,
                "profit_lost_cost_amount": 0,
                "is_doc_copy": 0,
                "bat_number": "",
                "product_year": "",
                "product_week": "",
                "currency_code": "",
                "exchange_rate": 0,
                "qty_2": 0,
                "unit_code_2": "",
                "total_size": 0,
                "unit_size": 0,
                "exchange_rate_old": 0,
                "promotion_code": "",
                "item_brand": "",
                "item_brand_name": null,
                "group_main": "",
                "group_main_name": null,
                "group_sub": "",
                "group_sub_name": null
            },
            {
                "trans_type": 2,
                "trans_flag": 44,
                "doc_group": "",
                "doc_date": "2023-05-29",
                "doc_no": "POS03-230529-0008",
                "doc_ref": "",
                "cust_code": "SPY000999",
                "inquiry_type": 1,
                "item_code": "BEER-0001",
                "item_name": "ลีโอ เบียร์กระป๋อง 330cc.",
                "unit_code": "ลัง",
                "qty": 4,
                "price": 420,
                "discount": "",
                "sum_of_cost": 1585.44,
                "sum_amount": 1680,
                "remark": "ราคาปรกติ 420.00",
                "status": 0,
                "line_number": 2,
                "ref_doc_no": "",
                "ref_line_number": 0,
                "ref_cust_code": "",
                "branch_code": "",
                "wh_code": "WH001",
                "shelf_code": "LC001",
                "wh_code_2": "",
                "shelf_code_2": "",
                "department_code": "",
                "total_vat_value": 109.91,
                "cancel_qty": 0,
                "total_qty": 0,
                "stand_value": 12,
                "divide_value": 1,
                "ratio": 0,
                "ic_pattern": "",
                "ic_color": "",
                "ic_size": "",
                "priority_level": 0,
                "calc_flag": -1,
                "last_status": 0,
                "set_ref_line": "",
                "set_ref_price": 0,
                "set_ref_qty": 0,
                "item_type": 0,
                "vat_type": 1,
                "doc_ref_type": 0,
                "item_code_main": "",
                "ref_row": 0,
                "ref_guid": "",
                "doc_time": "11:12",
                "is_permium": 0,
                "is_get_price": 0,
                "average_cost": 33.03,
                "sum_amount_exclude_vat": 1570.09,
                "doc_date_calc": "2023-05-29",
                "doc_time_calc": "11:12",
                "discount_amount": 0,
                "price_exclude_vat": 0,
                "user_approve": "",
                "price_type": 5,
                "price_mode": 0,
                "temp_float_1": 0,
                "temp_float_2": 0,
                "temp_string_1": "",
                "is_serial_number": 0,
                "bank_name": "",
                "bank_branch": "",
                "chq_number": "",
                "barcode": "8852614554002",
                "discount_number": 0,
                "price_changed": 0,
                "discount_changed": 0,
                "price_default": 420,
                "tax_type": 0,
                "is_pos": 1,
                "auto_create": 0,
                "hidden_cost_1": 0,
                "hidden_cost_1_exclude_vat": 0,
                "hidden_cost_2": 0,
                "hidden_cost_2_exclude_vat": 0,
                "sum_of_cost_1": 1585.44,
                "average_cost_1": 33.03,
                "sale_code": "001",
                "sale_group": "",
                "lot_number_1": "",
                "item_code_2": "",
                "bank_name_2": "",
                "bank_branch_2": "",
                "sale_shift_id": "",
                "price_base": 420,
                "creator_code": "",
                "last_editor_code": "",
                "fee_amount": 0,
                "transfer_amount": 0,
                "price_set_ratio": 0,
                "mfn_code": "",
                "mfn_name": "",
                "price_2": 0,
                "sum_amount_2": 0,
                "price_guid": "",
                "discount_amount_2": 0,
                "is_lock_cost": 0,
                "sum_of_cost_fix": 0,
                "profit_lost_cost_amount": 0,
                "is_doc_copy": 0,
                "bat_number": "",
                "product_year": "",
                "product_week": "",
                "currency_code": "",
                "exchange_rate": 0,
                "qty_2": 0,
                "unit_code_2": "",
                "total_size": 0,
                "unit_size": 0,
                "exchange_rate_old": 0,
                "promotion_code": "",
                "item_brand": "",
                "item_brand_name": null,
                "group_main": "",
                "group_main_name": null,
                "group_sub": "",
                "group_sub_name": null
            },
            {
                "trans_type": 2,
                "trans_flag": 44,
                "doc_group": "",
                "doc_date": "2023-05-29",
                "doc_no": "POS03-230529-0008",
                "doc_ref": "",
                "cust_code": "SPY000999",
                "inquiry_type": 1,
                "item_code": "AGPAN20A002",
                "item_name": "หูฟังไร้สาย",
                "unit_code": "เส้น",
                "qty": 1,
                "price": 189,
                "discount": "",
                "sum_of_cost": 1647.58,
                "sum_amount": 189,
                "remark": "ราคาปรกติ 189.00",
                "status": 0,
                "line_number": 3,
                "ref_doc_no": "",
                "ref_line_number": 0,
                "ref_cust_code": "",
                "branch_code": "",
                "wh_code": "WH001",
                "shelf_code": "LC001",
                "wh_code_2": "",
                "shelf_code_2": "",
                "department_code": "",
                "total_vat_value": 12.36,
                "cancel_qty": 0,
                "total_qty": 0,
                "stand_value": 1,
                "divide_value": 1,
                "ratio": 0,
                "ic_pattern": "",
                "ic_color": "",
                "ic_size": "",
                "priority_level": 0,
                "calc_flag": -1,
                "last_status": 0,
                "set_ref_line": "",
                "set_ref_price": 0,
                "set_ref_qty": 0,
                "item_type": 0,
                "vat_type": 1,
                "doc_ref_type": 0,
                "item_code_main": "",
                "ref_row": 0,
                "ref_guid": "",
                "doc_time": "11:12",
                "is_permium": 0,
                "is_get_price": 0,
                "average_cost": 1647.58,
                "sum_amount_exclude_vat": 176.64,
                "doc_date_calc": "2023-05-29",
                "doc_time_calc": "11:12",
                "discount_amount": 0,
                "price_exclude_vat": 0,
                "user_approve": "",
                "price_type": 5,
                "price_mode": 0,
                "temp_float_1": 0,
                "temp_float_2": 0,
                "temp_string_1": "",
                "is_serial_number": 0,
                "bank_name": "",
                "bank_branch": "",
                "chq_number": "",
                "barcode": "8854852753285",
                "discount_number": 0,
                "price_changed": 0,
                "discount_changed": 0,
                "price_default": 189,
                "tax_type": 0,
                "is_pos": 1,
                "auto_create": 0,
                "hidden_cost_1": 0,
                "hidden_cost_1_exclude_vat": 0,
                "hidden_cost_2": 0,
                "hidden_cost_2_exclude_vat": 0,
                "sum_of_cost_1": 1647.58,
                "average_cost_1": 1647.58,
                "sale_code": "001",
                "sale_group": "",
                "lot_number_1": "",
                "item_code_2": "",
                "bank_name_2": "",
                "bank_branch_2": "",
                "sale_shift_id": "",
                "price_base": 1200,
                "creator_code": "",
                "last_editor_code": "",
                "fee_amount": 0,
                "transfer_amount": 0,
                "price_set_ratio": 0,
                "mfn_code": "",
                "mfn_name": "",
                "price_2": 0,
                "sum_amount_2": 0,
                "price_guid": "",
                "discount_amount_2": 0,
                "is_lock_cost": 0,
                "sum_of_cost_fix": 0,
                "profit_lost_cost_amount": 0,
                "is_doc_copy": 0,
                "bat_number": "",
                "product_year": "",
                "product_week": "",
                "currency_code": "",
                "exchange_rate": 0,
                "qty_2": 0,
                "unit_code_2": "",
                "total_size": 0,
                "unit_size": 0,
                "exchange_rate_old": 0,
                "promotion_code": "",
                "item_brand": "",
                "item_brand_name": null,
                "group_main": "",
                "group_main_name": null,
                "group_sub": "",
                "group_sub_name": null
            },
            {
                "trans_type": 2,
                "trans_flag": 44,
                "doc_group": "",
                "doc_date": "2023-05-29",
                "doc_no": "POS03-230529-0008",
                "doc_ref": "",
                "cust_code": "SPY000999",
                "inquiry_type": 1,
                "item_code": "A-1100-99",
                "item_name": "นาฬิกา ติดผนัง (กลาง)",
                "unit_code": "เรือน",
                "qty": 1,
                "price": 350,
                "discount": "",
                "sum_of_cost": 842.88,
                "sum_amount": 350,
                "remark": "ราคาปรกติ 350.00",
                "status": 0,
                "line_number": 4,
                "ref_doc_no": "",
                "ref_line_number": 0,
                "ref_cust_code": "",
                "branch_code": "",
                "wh_code": "WH001",
                "shelf_code": "LC001",
                "wh_code_2": "",
                "shelf_code_2": "",
                "department_code": "",
                "total_vat_value": 22.9,
                "cancel_qty": 0,
                "total_qty": 0,
                "stand_value": 1,
                "divide_value": 1,
                "ratio": 0,
                "ic_pattern": "",
                "ic_color": "",
                "ic_size": "",
                "priority_level": 0,
                "calc_flag": -1,
                "last_status": 0,
                "set_ref_line": "",
                "set_ref_price": 0,
                "set_ref_qty": 0,
                "item_type": 0,
                "vat_type": 1,
                "doc_ref_type": 0,
                "item_code_main": "",
                "ref_row": 0,
                "ref_guid": "",
                "doc_time": "11:12",
                "is_permium": 0,
                "is_get_price": 0,
                "average_cost": 842.88,
                "sum_amount_exclude_vat": 327.1,
                "doc_date_calc": "2023-05-29",
                "doc_time_calc": "11:12",
                "discount_amount": 0,
                "price_exclude_vat": 0,
                "user_approve": "",
                "price_type": 5,
                "price_mode": 0,
                "temp_float_1": 0,
                "temp_float_2": 0,
                "temp_string_1": "",
                "is_serial_number": 0,
                "bank_name": "",
                "bank_branch": "",
                "chq_number": "",
                "barcode": "8857332464336",
                "discount_number": 0,
                "price_changed": 0,
                "discount_changed": 0,
                "price_default": 350,
                "tax_type": 0,
                "is_pos": 1,
                "auto_create": 0,
                "hidden_cost_1": 0,
                "hidden_cost_1_exclude_vat": 0,
                "hidden_cost_2": 0,
                "hidden_cost_2_exclude_vat": 0,
                "sum_of_cost_1": 842.88,
                "average_cost_1": 842.88,
                "sale_code": "001",
                "sale_group": "",
                "lot_number_1": "",
                "item_code_2": "",
                "bank_name_2": "",
                "bank_branch_2": "",
                "sale_shift_id": "",
                "price_base": 800,
                "creator_code": "",
                "last_editor_code": "",
                "fee_amount": 0,
                "transfer_amount": 0,
                "price_set_ratio": 0,
                "mfn_code": "",
                "mfn_name": "",
                "price_2": 0,
                "sum_amount_2": 0,
                "price_guid": "",
                "discount_amount_2": 0,
                "is_lock_cost": 0,
                "sum_of_cost_fix": 0,
                "profit_lost_cost_amount": 0,
                "is_doc_copy": 0,
                "bat_number": "",
                "product_year": "",
                "product_week": "",
                "currency_code": "",
                "exchange_rate": 0,
                "qty_2": 0,
                "unit_code_2": "",
                "total_size": 0,
                "unit_size": 0,
                "exchange_rate_old": 0,
                "promotion_code": "",
                "item_brand": "CLOCK",
                "item_brand_name": "นาฬิกา",
                "group_main": "A",
                "group_main_name": "ຊີມັງ",
                "group_sub": "AB",
                "group_sub_name": "ປູນຂາວ"
            }
        ],
        "cust_name": "ร้านน้องติงลี่",
        "sale_name": "พนักงาน SML",
        "billing_status": true,
        "value_balance": 3455,
        "total_cost_calc": 4782.83
    }
}

Response Error ​

ไม่พบเอกสาร (รวมถึงกรณีส่งเลขที่ใบขายปกติมา) → HTTP 404

json
{
    "success": false,
    "error": true,
    "message": "SaleInvoicePOS not found: INV2106-0001",
    "code": "404"
}

SaleInvoicePOS Attribute ​

เรื่องต้นทุน

  • ต้นทุนต่อรายการสินค้าอยู่ที่ sum_of_cost ใน details แต่ละบรรทัด
  • ต้นทุนรวมของเอกสารอยู่ที่ total_cost_calc ซึ่งระบบคำนวณให้จากผลรวม sum_of_cost ของรายการสินค้า (ไม่นับบรรทัดที่ถูกยกเลิก)
  • ฟิลด์ total_cost เป็นค่าที่ SML เก็บไว้ในเอกสาร ซึ่งปกติเป็น 0 จึงไม่ควรนำไปใช้
  • ค่าต้นทุนจะเป็น 0 ถ้า SML ยังไม่ได้ประมวลผลต้นทุนของเอกสารนั้น รวมถึงเอกสารที่เพิ่งสร้างผ่าน API

เส้นนี้เป็น GET อย่างเดียว ทุกฟิลด์จึงเป็นข้อมูลที่ระบบคืนกลับมา

Field NameField TypeLengthDescription
adjust_reasonString25เหตุผลการปรับปรุง
advance_amountFloatตัดเงินมัดจำ
allocate_codeString25การจัดสรร
answer_typeIntegerลูกค้าตอบกลับ
approve_codeString25กลุ่มผู้อนุมัติ
approve_dateDateวันที่อนุมัติ
approve_statusIntegerสถานะการอนุมัติ
auto_approvedIntegerอนุมัติโดยอัตโนมัติ
auto_createIntegerสร้างโดยโปรแกรม
balance_amountFloatยอดเงินคงเหลือ
billing_statusBooleanสถานะวางบิล (true = ชำระครบ) (read-only)
branch_codeString25สาขา
branch_code_toString25ถึงสาขา
cancel_codeString255ผู้ยกเลิกเอกสาร
cancel_datetimeDateเวลายกเลิกเอกสาร
cancel_typeIntegerประเภทการยกเลิก
cashier_codeString25Cashier
contactorString25ผู้ติดต่อ
create_datetimeDateวันที่สร้างเอกสาร
creator_codeString255ผู้สร้างเอกสาร
credit_dateDateวันที่ครบกำหนด
credit_dayIntegerวันเครดิต
currency_codeString25รหัสสกุลเงิน
currency_moneyFloatยอดคงเหลือ (ตามสกุลเงิน)
cust_codeString25ลูกหนี้/เจ้าหนี้
cust_nameStringชื่อลูกค้า (จาก ar_customer) (read-only)
delivery_dateDateวันที่ส่งของ
department_codeString25แผนก
department_code_toString25ถึงแผนก
deposit_dateDateระยะเวลาภายใน (วันที่)
deposit_dayIntegerระยะเวลาภายใน (วัน)
detailsArrayObjectรายละเอียดสินค้า
discount_wordString25ส่วนลด
discount_word_2String25ส่วนลด (สกุลเงิน)
doc_closeIntegerปิดเอกสาร
doc_dateDateเอกสารวันที่
doc_format_codeString25รหัสเอกสาร
doc_groupString25กลุ่มเอกสาร
doc_noString25เอกสารเลขที่
doc_no_guidString25เลขที่เอกสารเปรียบเทียบ
doc_reasonStringเหตุผล
doc_refString255เอกสารอ้างอิง
doc_ref_dateDateเอกสารอ้างอิงวันที่
doc_ref_transStringอ้างอิงเอกสาร
doc_successIntegerสิ้นสุด
doc_timeString5เวลา (HH:mm)
doc_typeIntegerประเภทเอกสาร
due_dateDateวันที่ครบกำหนด
exchange_rateFloatอัตราแลกเปลี่ยน
expire_dateDateวันที่หมดอายุ
expire_dayIntegerจำนวนวันหมดอายุ
expire_statusIntegerสถานะหมดอายุ
extra_wordStringข้อความเพิ่มเติม
guid_codeStringGUID
inquiry_typeIntegerประเภทรายการ
is_cancelIntegerเอกสารยกเลิก
is_doc_copyIntegerเป็นเอกสารที่ออกแทน
is_holdIntegerระงับเอกสาร
is_manual_vatIntegerบันทึกรายการภาษีเอง
is_posIntegerจากระบบ POS (default: 0)
job_codeString25งาน
job_code_toString25ถึงงาน
last_editor_codeString255ผู้แก้ไขเอกสารล่าสุด
last_statusIntegerสถานะล่าสุด
lastedit_datetimeDateวันที่แก้ไขล่าสุด
latitudeFloatละติจูด (เก็บใน ic_trans_shipment)
location_fromStringพื้นที่เก็บ (ต้นทาง)
location_toStringพื้นที่เก็บ (ปลายทาง)
longitudeFloatลองจิจูด (เก็บใน ic_trans_shipment)
lost_profit_exchange_amountFloatผลต่างจากอัตราแลกเปลี่ยน
member_codeString25รหัสสมาชิก
moneyFloatจำนวนเงินคืน
not_approve_1Integerไม่อนุมัติ
on_holdIntegerระงับชั่วคราว
pass_book_codeStringสมุดเงินฝาก
pay_amountFloatเงินชำระ
paymentObjectข้อมูลชำระเงิน
period_guidStringGUID กะ
point_telephoneStringหมายเลขโทรศัพท์
pos_bill_changeInteger0=ปรกติ, 1=ใบแทน
pos_bill_typeInteger0=อย่างย่อ, 1=อย่างเต็ม
pos_idStringหมายเลขเครื่อง POS
pos_transferIntegerโอนมาจาก POS
project_codeString25โครงการ
project_code_toString25ถึงโครงการ
recheck_countIntegerเปิดระบบเตือนตรวจนับซ้ำ
recheck_count_dayFloatเตือนย้อนหลัง (วัน)
ref_amountFloatมูลค่าเอกสารเดิม
ref_diffFloatผลต่าง
ref_new_amountFloatมูลค่าที่ถูกต้อง
remarkString255หมายเหตุ
remark_2String255หมายเหตุ 2
remark_3String255หมายเหตุ 3
remark_4String255หมายเหตุ 4
remark_5String255หมายเหตุ 5
sale_area_codeString25เขตการขาย
sale_codeString25พนักงานขาย
sale_groupString25กลุ่มพนักงานขาย
sale_nameStringชื่อพนักงานขาย (จาก erp_user) (read-only)
sale_shift_idStringรอบการขาย
send_dateDateวันที่รับ/ส่งสินค้า
send_dayIntegerรับ/ส่ง ภายใน (วัน)
send_mailIntegerแจ้งส่งทางอีเมล์
send_smsIntegerแจ้งส่งทาง SMS
send_to_pick_and_packIntegerสั่งจัดสินค้า
send_typeIntegerประเภทการส่ง
sender_codeStringพนักงานขนส่ง
service_charge_wordStringService Charge
side_codeString25ฝ่าย
side_code_toString25ถึงฝ่าย
statusIntegerสถานะ
sum_pay_money_diffFloatผลต่างยอดชำระ
sum_pointFloatแต้ม
sum_point_2Floatยอดแต้มสะสมระบบกลาง
table_numberStringหมายเลขโต๊ะ
tax_doc_dateDateวันที่ใบกำกับ
tax_doc_noString25เลขที่ใบกำกับ
total_after_vatFloatมูลค่าหลังคิดภาษี
total_amountFloatมูลค่าสุทธิ
total_amount_2Floatมูลค่าสุทธิ (สกุลเงิน)
total_amout_oldFloatมูลค่าสุทธิเดิม
total_before_vatFloatยอดก่อนภาษี
total_cost_calcFloatต้นทุนรวมของเอกสาร คำนวณจากผลรวม sum_of_cost ของรายการสินค้า (read-only)
total_costFloatต้นทุนสินค้า
total_debt_amountFloatยอดหนี้รวมภาษี
total_discountFloatมูลค่าส่วนลด
total_discount_2Floatมูลค่าส่วนลด (สกุลเงิน)
total_except_vatFloatมูลค่ายกเว้นภาษี
total_manualIntegerบันทึกยอดรวมเอง
total_service_chargeFloatมูลค่า Service Charge
total_vat_valueFloatภาษีมูลค่าเพิ่ม
total_valueFloatมูลค่าสินค้า
total_value_2Floatมูลค่าสินค้า (สกุลเงิน)
trans_flagIntegerรายวันระบบ (44 = ใบขายสินค้า, auto)
trans_typeIntegerประเภทรายวัน (2 = ขาย, auto)
transport_addressString1000ที่อยู่จัดส่ง (เก็บใน ic_trans_shipment)
transport_codeString25ขนส่งโดย
transport_nameString255ชื่อผู้รับ (เก็บใน ic_trans_shipment)
transport_remarkString255หมายเหตุจัดส่ง (เก็บใน ic_trans_shipment.remark)
transport_remark_2String255หมายเหตุจัดส่ง 2 (เก็บใน ic_trans_shipment.remark_2)
transport_valueFloatค่าขนส่ง
used_statusIntegerมีการอ้างอิงแล้ว
used_status_2Integerสถานะ 2
user_approveStringผู้อนุมัติ
user_requestStringผู้ขออนุมัติ
value_balanceFloatยอดคงค้าง (total_amount − ยอดรับชำระ) (read-only)
vat_rateFloatอัตราภาษี
vat_typeIntegerประเภทภาษี (0=แยกนอก, 1=รวมใน, 2=ยกเว้นภาษี, 3=ไม่กระทบภาษี) — หมายเหตุ: ค่าคนละชุดกับ detail
want_dateDateต้องการภายใน (วันที่)
want_dayIntegerต้องการภายใน (วัน)
wh_fromStringคลัง (ต้นทาง)
wh_toStringคลัง (ปลายทาง)

SaleInvoicePOS Detail ​

ฟิลด์ที่ระบุ (read-only) คือฟิลด์ที่ JOIN มาจากทะเบียนสินค้า ไม่ได้เก็บในเอกสาร

Field NameField TypeLengthDescription
auto_createIntegerสร้างโดยโปรแกรม
average_costFloatราคาทุนเฉลี่ย
average_cost_1Floatราคาทุนเฉลี่ยแฝง
bank_branchStringสาขาธนาคาร
bank_branch_2Stringสาขาธนาคาร 2
bank_nameStringธนาคาร
bank_name_2Stringธนาคาร 2
barcodeString25Barcode
bat_dateDatebat date
bat_numberStringbat number
branch_codeString25สาขา
calc_flagIntegerบวกหรือลบ (1=บวก, -1=ลบ, default: -1)
cancel_qtyFloatจำนวนยกเลิก
chq_numberStringเลขที่เช็ค
create_datetimeDateวันที่สร้างเอกสาร
creator_codeStringผู้สร้างเอกสาร
currency_codeString25สกุลเงิน
cust_codeString25ลูกหนี้/เจ้าหนี้
date_dueDateวันครบกำหนด
date_expireDateหมดอายุ
department_codeString25แผนก
discountString25ส่วนลด
discount_amountFloatมูลค่าส่วนลด
discount_amount_2Floatมูลค่าส่วนลด (สกุลเงิน)
discount_changedIntegerมีการแก้ไขส่วนลด
discount_numberIntegerหมายเลขส่วนลด
divide_valueFloatตัวหาร
doc_dateDateเอกสารวันที่
doc_date_calcDateวันที่สำหรับคำนวณ
doc_groupStringกลุ่มเอกสาร
doc_noString25เอกสารเลขที่
doc_refStringเอกสารอ้างอิง
doc_ref_typeIntegerประเภทเอกสารอ้างอิง
doc_timeStringเวลา
doc_time_calcStringเวลาสำหรับคำนวณ
due_dateDateวันที่ต้องการ
exchange_rateFloatอัตราแลกเปลี่ยน
exchange_rate_oldFloatอัตราแลกเปลี่ยนเดิม
fee_amountFloatค่าธรรมเนียม
group_mainString25รหัสกลุ่มสินค้าหลัก (จากทะเบียนสินค้า) (read-only)
group_main_nameString255ชื่อกลุ่มสินค้าหลัก (read-only)
group_subString25รหัสกลุ่มสินค้าย่อย (จากทะเบียนสินค้า) (read-only)
group_sub_nameString255ชื่อกลุ่มสินค้าย่อย (read-only)
hidden_cost_1Floatต้นทุนแฝงบริหาร
hidden_cost_1_exclude_vatFloatต้นทุนแฝงบริหารไม่รวมภาษี
hidden_cost_2Floatต้นทุนแฝงบัญชี
hidden_cost_2_exclude_vatFloatต้นทุนแฝงบัญชีไม่รวมภาษี
ic_colorStringสีสินค้า
ic_patternStringรูปแบบสินค้า
ic_sizeStringขนาดสินค้า
inquiry_typeIntegerประเภทการซื้อ
is_doc_copyIntegerเป็นเอกสารที่ออกแทน
is_get_priceIntegerให้ดึงราคาขาย (1=ดึง)
is_lock_costIntegerกำหนดต้นทุนเอง
is_permiumInteger1=ของแถม
is_posIntegerจาก POS
is_serial_numberIntegerมีหมายเลขเครื่อง
item_brandString25รหัสยี่ห้อสินค้า (จากทะเบียนสินค้า) (read-only)
item_brand_nameString255ชื่อยี่ห้อสินค้า (read-only)
item_codeString25รหัสสินค้า
item_code_2String25รหัสสินค้า 2
item_code_mainString25สินค้าหลัก
item_nameString255ชื่อสินค้า
item_typeIntegerประเภทสินค้า
last_editor_codeStringผู้แก้ไขเอกสารล่าสุด
last_statusIntegerสถานะล่าสุด (0=Normal, 1=ยกเลิก)
lastedit_datetimeDateวันที่แก้ไขล่าสุด
line_numberIntegerบรรทัด
lot_number_1Stringเลข LOT
mfd_dateDateวันที่ผลิต
mfn_codeStringรหัสผู้ผลิต
mfn_nameStringผู้ผลิต
priceFloatราคา
price_2Floatราคา (สกุลเงิน)
price_baseFloatราคากลาง
price_changedIntegerมีการแก้ไขราคา
price_defaultFloatราคาเริ่มต้น
price_exclude_vatFloatราคาไม่รวมภาษี
price_guidStringPrice Guid
price_modeIntegerกลุ่มราคา
price_set_ratioFloatอัตราส่วนราคาสินค้าชุด
price_typeIntegerประเภทราคา
priority_levelIntegerความสำคัญ
product_weekStringสัปดาห์ที่ผลิต
product_yearStringปีที่ผลิต
profit_lost_cost_amountFloatกำไรขาดทุน
promotion_codeStringรหัสโปรโมชั่น
qtyFloatจำนวน
qty_2Floatจำนวนขาย
ratioFloatอัตราส่วน
ref_cust_codeString25อ้างอิง เจ้าหนี้/ลูกหนี้
ref_doc_dateDateอ้างอิง วันที่
ref_doc_noString25อ้างอิงเอกสาร
ref_guidStringref_guid
ref_line_numberIntegerอ้างอิง บรรทัด
ref_rowIntegerref_row
remarkString255หมายเหตุ
sale_codeString25รหัสพนักงานขาย
sale_groupString25กลุ่มพนักงานขาย
sale_shift_idStringรอบการขาย
set_ref_lineStringบรรทัดอ้างอิง (สินค้าชุด)
set_ref_priceFloatราคาอ้างอิง (สินค้าชุด)
set_ref_qtyFloatจำนวนอ้างอิง (สินค้าชุด)
shelf_codeString25พื้นที่เก็บ
shelf_code_2String25พื้นที่เก็บ 2
stand_valueFloatตัวตั้ง
statusIntegerสถานะ
sum_amountFloatรวมมูลค่า
sum_amount_2Floatรวมมูลค่า (สกุลเงิน)
sum_amount_exclude_vatFloatรวมมูลค่าไม่รวมภาษี
sum_of_costFloatรวมต้นทุน
sum_of_cost_1Floatต้นทุนรวมต้นทุนแฝงบริหาร
sum_of_cost_fixFloatต้นทุน (กำหนดเอง)
tax_typeIntegerประเภทภาษี (0=มีภาษี, 1=ยกเว้น)
temp_float_1Floatตัวเลข 1
temp_float_2Floatตัวเลข 2
temp_string_1Stringตัวอักษร 1
total_qtyFloatจำนวนคงเหลือ
total_sizeFloatรวมหน่วยนับ 2
total_vat_valueFloatภาษีมูลค่าเพิ่ม
trans_flagIntegerรายวันระบบ (44 = ใบขายสินค้า, auto)
trans_typeIntegerประเภทรายวัน (2 = ขาย, auto)
transfer_amountFloatยอดโอนเงิน
unit_codeString25หน่วยนับ
unit_code_2String25หน่วยช่วยขาย
unit_sizeFloatขนาดสินค้า
user_approveStringรหัสผู้อนุมัติ
vat_typeIntegerประเภทภาษี (0=แยกนอก, 1=รวมใน, 2=อัตรา 0)
wh_codeString25คลัง
wh_code_2String25คลัง 2

Payment Attribute ​

โครงสร้าง payment object (เก็บใน cb_trans)

ตอน GET ระบบจะค้น cb_trans ด้วย cb_trans.doc_ref = ic_trans.doc_no

Field NameField TypeLengthDescription
advance_amountFloatตัดเงินมัดจำ
ap_ar_codeString25รหัสเจ้าหนี้/ลูกหนี้ (default = cust_code ของเอกสาร)
book_codeString25สมุดรายวัน
branch_codeString25รหัสสาขา
card_amountFloatยอดบัตรเครดิต
cash_amountFloatยอดเงินสด
cashier_codeString25Cashier
chq_amountFloatยอดเช็ค
coupon_amountFloatยอดชำระด้วยคูปอง
currency_codeString25รหัสสกุลเงิน
deposit_amountFloatยอดตัดเงินล่วงหน้า
descriptionStringรายละเอียด
detailArrayObjectรายละเอียดการชำระ
discount_amountFloatส่วนลดชำระเงิน
doc_dateDateเอกสารวันที่ (default = doc_date ของใบขาย)
doc_format_codeString25รหัสรูปแบบเอกสาร
doc_groupStringกลุ่มเอกสาร
doc_noString25เอกสารเลขที่ของใบรับเงิน
doc_refStringเอกสารอ้างอิง (default = doc_no ของใบขาย)
doc_timeString5เวลา
exchange_rateFloatอัตราแลกเปลี่ยน
guid_codeStringGUID
is_doc_copyIntegerเป็นเอกสารออกแทน
money_changeFloatเงินทอน
pay_cash_amountFloatจ่ายเงิน
pay_typeInteger1=รับ, 2=จ่าย
petty_cash_amountFloatเงินสดย่อย
point_amountFloatยอดชำระด้วยแต้ม
point_qtyFloatจำนวนแต้มที่ใช้
point_rateFloatแต้มต่อบาท
remarkStringหมายเหตุ
sale_shift_idStringรอบการขาย
statusIntegerสถานะ
total_amountFloatรวมยอดเงิน
total_amount_payFloatรวมจ่าย
total_credit_chargeFloatค่า Charge บัตรเครดิต
total_expense_otherFloatรายจ่ายอื่น
total_fee_amountFloatค่าธรรมเนียม
total_income_amountFloatปัดเศษ
total_income_otherFloatรายได้อื่น
total_net_amountFloatยอดรวมทั้งสิ้น
total_other_amountFloatปัดเศษ (ลด)
total_other_currencyFloatสกุลเงินอื่นๆ
total_tax_at_payFloatภาษีหัก ณ ที่จ่าย
tranfer_amountFloatยอดเงินโอน (สะกดตามฐานข้อมูล)
trans_flagIntegerรายวันระบบ
trans_typeIntegerประเภทรายวัน (1=รับเงิน, 2=จ่ายเงิน)
wallet_amountFloatWallet Payment

Payment Detail ​

โครงสร้าง payment.detail[] (เก็บใน cb_trans_detail) — รายการย่อยของการชำระเงินแยกตามวิธี (เช่น แต่ละใบเช็ค, แต่ละบัตรเครดิต, แต่ละการโอน)

Field NameField TypeLengthDescription
amountFloatจำนวนเงิน
ap_ar_codeString25รหัสเจ้าหนี้/ลูกหนี้ (default = cust_code ของเอกสาร)
ap_ar_typeInteger1=ลูกหนี้, 2=เจ้าหนี้
approve_codeString25กลุ่มผู้อนุมัติ
approve_dateDateวันที่อนุมัติ
balance_amountFloatยอดคงเหลือ
bank_branchStringสาขาธนาคาร
bank_codeStringรหัสธนาคาร
chargeFloatยอด Charge
chq_dateDateวันที่ออกเช็ค/รับเช็ค
chq_due_dateDateวันที่บนเช็ค
chq_on_handIntegerประเภทเช็ค
chq_refStringอ้างอิงเช็คเลขที่
credit_card_typeStringประเภทบัตรเครดิต
currency_codeStringรหัสสกุลเงิน
doc_dateDateเอกสารวันที่ (default = doc_date ของ payment header)
doc_date_refDateวันที่อ้างอิง
doc_groupStringกลุ่มเอกสาร
doc_noString25เอกสารเลขที่ (auto fill = payment.doc_no)
doc_refStringเอกสารอ้างอิง
doc_timeStringเวลา
doc_typeInteger1=เงินโอน, 2=เช็ค, 3=บัตรเครดิต, 4=เงินสดย่อย, 5=เงินล่วงหน้า, 9=คูปอง, 11=จ่ายอื่น, 12=รับอื่น, 19=สกุลเงินอื่น, 21=eWallet
exchange_rateFloatอัตราแลกเปลี่ยน
external_chqIntegerการเรียกเก็บ
fee_amountFloatค่าธรรมเนียม
is_doc_copyIntegerเอกสารออกแทน
last_statusIntegerสถานะล่าสุด
line_numberIntegerบรรทัด (auto +1 ถ้าไม่ส่ง)
no_approvedStringเลขที่อนุมัติ
other_amountFloatค่าใช้จ่ายอื่นๆ
pass_book_codeStringสมุดเงินฝาก
period_numberIntegerงวดที่
ref1Stringเลขที่อ้างอิง 1
ref2Stringเลขที่อ้างอิง 2
remarkStringหมายเหตุ
sale_shift_idStringรอบการขาย
statusIntegerสถานะ
sum_amountFloatยอดเงินรวม
sum_amount_2Floatรวมจำนวนเงิน (สกุลเงิน)
tax_at_payFloatภาษีหัก ณ ที่จ่าย
trans_flagIntegerรายวันระบบ
trans_numberStringเลขที่เช็ค/เลขที่อนุมัติ
trans_number_typeIntegerประเภท (1=รับ, 2=จ่าย)
trans_typeIntegerประเภทรายวัน