Sale Invoice POS Service
API บิลขายหน้าร้าน (POS) — อ่านอย่างเดียว (GET)
บิล POS คือเอกสารใน
ic_transที่trans_flag= 44 และis_pos= 1
ใบขายปกติ (is_pos= 0) อยู่ที่ Sale Invoice Service — ข้อมูลสองเส้นนี้แยกกันเด็ดขาด ไม่ปนกัน
- ดึงบิลขาย POS ทั้งหมด
- ดึงบิลขาย POS ตามเลขที่เอกสาร
- SaleInvoicePOS Attribute
- SaleInvoicePOS Detail Attribute
- Payment Attribute
- Payment Detail Attribute
Header Request
| Field | Value |
|---|---|
| GUID | GUID สำหรับการเชื่อมต่อ (smlx เสมอ) |
| provider | ชื่อผู้ใช้บริการ |
| databaseName | ชื่อฐานข้อมูล |
| configFileName | ชื่อไฟล์ตั้งค่า — รูปแบบ SMLConfig<provider>.xml |
| Content-Type | application/json; charset=utf-8 |
Header Example
{
"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
| Field | Description | Example |
|---|---|---|
| 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-ddsizeคือจำนวนเอกสารต่อหน้า แต่ละเอกสารจะมีรายการสินค้า (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=10Response Success
ตัวอย่างจริงจากคำสั่ง
GET /SMLJavaRESTService/saleinvoicepos/v4?doc_no=INV-2010300002&page=1&size=1
{
"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
{
"success": false,
"error": true,
"message": "error message",
"code": "99"
}SaleInvoicePOS Information
ดึงบิลขาย POS ทีละ 1 เอกสาร พร้อมรายการสินค้าและรายการชำระเงิน
EndPoint
GET /SMLJavaRESTService/saleinvoicepos/v4/{doc_no}
Path Parameter
| Name | Description | Example |
|---|---|---|
| doc_no | เลขที่เอกสาร (ต้องเป็นบิล POS is_pos = 1 — ถ้าส่งเลขที่ใบขายปกติจะได้ 404) | POS03-230529-0008 |
Example:
GET localhost:8084/SMLJavaRESTService/saleinvoicepos/v4/POS03-230529-0008Response Success
ตัวอย่างจริงจากคำสั่ง
GET /SMLJavaRESTService/saleinvoicepos/v4/POS03-230529-0008
เอกสารนี้ไม่มีการรับชำระในcb_transจึงไม่มี keypayment— ฟิลด์ที่เป็นnullจะไม่ถูกส่งออก ยกเว้นdue_dateและฟิลด์ยี่ห้อ/กลุ่มสินค้าที่ส่งเป็นnullเสมอ
{
"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
{
"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 Name | Field Type | Length | Description |
|---|---|---|---|
| adjust_reason | String | 25 | เหตุผลการปรับปรุง |
| advance_amount | Float | ตัดเงินมัดจำ | |
| allocate_code | String | 25 | การจัดสรร |
| answer_type | Integer | ลูกค้าตอบกลับ | |
| approve_code | String | 25 | กลุ่มผู้อนุมัติ |
| approve_date | Date | วันที่อนุมัติ | |
| approve_status | Integer | สถานะการอนุมัติ | |
| auto_approved | Integer | อนุมัติโดยอัตโนมัติ | |
| auto_create | Integer | สร้างโดยโปรแกรม | |
| balance_amount | Float | ยอดเงินคงเหลือ | |
| billing_status | Boolean | สถานะวางบิล (true = ชำระครบ) (read-only) | |
| branch_code | String | 25 | สาขา |
| branch_code_to | String | 25 | ถึงสาขา |
| cancel_code | String | 255 | ผู้ยกเลิกเอกสาร |
| cancel_datetime | Date | เวลายกเลิกเอกสาร | |
| cancel_type | Integer | ประเภทการยกเลิก | |
| cashier_code | String | 25 | Cashier |
| contactor | String | 25 | ผู้ติดต่อ |
| create_datetime | Date | วันที่สร้างเอกสาร | |
| creator_code | String | 255 | ผู้สร้างเอกสาร |
| credit_date | Date | วันที่ครบกำหนด | |
| credit_day | Integer | วันเครดิต | |
| currency_code | String | 25 | รหัสสกุลเงิน |
| currency_money | Float | ยอดคงเหลือ (ตามสกุลเงิน) | |
| cust_code | String | 25 | ลูกหนี้/เจ้าหนี้ |
| cust_name | String | ชื่อลูกค้า (จาก ar_customer) (read-only) | |
| delivery_date | Date | วันที่ส่งของ | |
| department_code | String | 25 | แผนก |
| department_code_to | String | 25 | ถึงแผนก |
| deposit_date | Date | ระยะเวลาภายใน (วันที่) | |
| deposit_day | Integer | ระยะเวลาภายใน (วัน) | |
| details | ArrayObject | รายละเอียดสินค้า | |
| discount_word | String | 25 | ส่วนลด |
| discount_word_2 | String | 25 | ส่วนลด (สกุลเงิน) |
| doc_close | Integer | ปิดเอกสาร | |
| doc_date | Date | เอกสารวันที่ | |
| doc_format_code | String | 25 | รหัสเอกสาร |
| doc_group | String | 25 | กลุ่มเอกสาร |
| doc_no | String | 25 | เอกสารเลขที่ |
| doc_no_guid | String | 25 | เลขที่เอกสารเปรียบเทียบ |
| doc_reason | String | เหตุผล | |
| doc_ref | String | 255 | เอกสารอ้างอิง |
| doc_ref_date | Date | เอกสารอ้างอิงวันที่ | |
| doc_ref_trans | String | อ้างอิงเอกสาร | |
| doc_success | Integer | สิ้นสุด | |
| doc_time | String | 5 | เวลา (HH:mm) |
| doc_type | Integer | ประเภทเอกสาร | |
| due_date | Date | วันที่ครบกำหนด | |
| exchange_rate | Float | อัตราแลกเปลี่ยน | |
| expire_date | Date | วันที่หมดอายุ | |
| expire_day | Integer | จำนวนวันหมดอายุ | |
| expire_status | Integer | สถานะหมดอายุ | |
| extra_word | String | ข้อความเพิ่มเติม | |
| guid_code | String | GUID | |
| inquiry_type | Integer | ประเภทรายการ | |
| is_cancel | Integer | เอกสารยกเลิก | |
| is_doc_copy | Integer | เป็นเอกสารที่ออกแทน | |
| is_hold | Integer | ระงับเอกสาร | |
| is_manual_vat | Integer | บันทึกรายการภาษีเอง | |
| is_pos | Integer | จากระบบ POS (default: 0) | |
| job_code | String | 25 | งาน |
| job_code_to | String | 25 | ถึงงาน |
| last_editor_code | String | 255 | ผู้แก้ไขเอกสารล่าสุด |
| last_status | Integer | สถานะล่าสุด | |
| lastedit_datetime | Date | วันที่แก้ไขล่าสุด | |
| latitude | Float | ละติจูด (เก็บใน ic_trans_shipment) | |
| location_from | String | พื้นที่เก็บ (ต้นทาง) | |
| location_to | String | พื้นที่เก็บ (ปลายทาง) | |
| longitude | Float | ลองจิจูด (เก็บใน ic_trans_shipment) | |
| lost_profit_exchange_amount | Float | ผลต่างจากอัตราแลกเปลี่ยน | |
| member_code | String | 25 | รหัสสมาชิก |
| money | Float | จำนวนเงินคืน | |
| not_approve_1 | Integer | ไม่อนุมัติ | |
| on_hold | Integer | ระงับชั่วคราว | |
| pass_book_code | String | สมุดเงินฝาก | |
| pay_amount | Float | เงินชำระ | |
| payment | Object | ข้อมูลชำระเงิน | |
| period_guid | String | GUID กะ | |
| point_telephone | String | หมายเลขโทรศัพท์ | |
| pos_bill_change | Integer | 0=ปรกติ, 1=ใบแทน | |
| pos_bill_type | Integer | 0=อย่างย่อ, 1=อย่างเต็ม | |
| pos_id | String | หมายเลขเครื่อง POS | |
| pos_transfer | Integer | โอนมาจาก POS | |
| project_code | String | 25 | โครงการ |
| project_code_to | String | 25 | ถึงโครงการ |
| recheck_count | Integer | เปิดระบบเตือนตรวจนับซ้ำ | |
| recheck_count_day | Float | เตือนย้อนหลัง (วัน) | |
| ref_amount | Float | มูลค่าเอกสารเดิม | |
| ref_diff | Float | ผลต่าง | |
| ref_new_amount | Float | มูลค่าที่ถูกต้อง | |
| remark | String | 255 | หมายเหตุ |
| remark_2 | String | 255 | หมายเหตุ 2 |
| remark_3 | String | 255 | หมายเหตุ 3 |
| remark_4 | String | 255 | หมายเหตุ 4 |
| remark_5 | String | 255 | หมายเหตุ 5 |
| sale_area_code | String | 25 | เขตการขาย |
| sale_code | String | 25 | พนักงานขาย |
| sale_group | String | 25 | กลุ่มพนักงานขาย |
| sale_name | String | ชื่อพนักงานขาย (จาก erp_user) (read-only) | |
| sale_shift_id | String | รอบการขาย | |
| send_date | Date | วันที่รับ/ส่งสินค้า | |
| send_day | Integer | รับ/ส่ง ภายใน (วัน) | |
| send_mail | Integer | แจ้งส่งทางอีเมล์ | |
| send_sms | Integer | แจ้งส่งทาง SMS | |
| send_to_pick_and_pack | Integer | สั่งจัดสินค้า | |
| send_type | Integer | ประเภทการส่ง | |
| sender_code | String | พนักงานขนส่ง | |
| service_charge_word | String | Service Charge | |
| side_code | String | 25 | ฝ่าย |
| side_code_to | String | 25 | ถึงฝ่าย |
| status | Integer | สถานะ | |
| sum_pay_money_diff | Float | ผลต่างยอดชำระ | |
| sum_point | Float | แต้ม | |
| sum_point_2 | Float | ยอดแต้มสะสมระบบกลาง | |
| table_number | String | หมายเลขโต๊ะ | |
| tax_doc_date | Date | วันที่ใบกำกับ | |
| tax_doc_no | String | 25 | เลขที่ใบกำกับ |
| total_after_vat | Float | มูลค่าหลังคิดภาษี | |
| total_amount | Float | มูลค่าสุทธิ | |
| total_amount_2 | Float | มูลค่าสุทธิ (สกุลเงิน) | |
| total_amout_old | Float | มูลค่าสุทธิเดิม | |
| total_before_vat | Float | ยอดก่อนภาษี | |
| total_cost_calc | Float | ต้นทุนรวมของเอกสาร คำนวณจากผลรวม sum_of_cost ของรายการสินค้า (read-only) | |
| total_cost | Float | ต้นทุนสินค้า | |
| total_debt_amount | Float | ยอดหนี้รวมภาษี | |
| total_discount | Float | มูลค่าส่วนลด | |
| total_discount_2 | Float | มูลค่าส่วนลด (สกุลเงิน) | |
| total_except_vat | Float | มูลค่ายกเว้นภาษี | |
| total_manual | Integer | บันทึกยอดรวมเอง | |
| total_service_charge | Float | มูลค่า Service Charge | |
| total_vat_value | Float | ภาษีมูลค่าเพิ่ม | |
| total_value | Float | มูลค่าสินค้า | |
| total_value_2 | Float | มูลค่าสินค้า (สกุลเงิน) | |
| trans_flag | Integer | รายวันระบบ (44 = ใบขายสินค้า, auto) | |
| trans_type | Integer | ประเภทรายวัน (2 = ขาย, auto) | |
| transport_address | String | 1000 | ที่อยู่จัดส่ง (เก็บใน ic_trans_shipment) |
| transport_code | String | 25 | ขนส่งโดย |
| transport_name | String | 255 | ชื่อผู้รับ (เก็บใน ic_trans_shipment) |
| transport_remark | String | 255 | หมายเหตุจัดส่ง (เก็บใน ic_trans_shipment.remark) |
| transport_remark_2 | String | 255 | หมายเหตุจัดส่ง 2 (เก็บใน ic_trans_shipment.remark_2) |
| transport_value | Float | ค่าขนส่ง | |
| used_status | Integer | มีการอ้างอิงแล้ว | |
| used_status_2 | Integer | สถานะ 2 | |
| user_approve | String | ผู้อนุมัติ | |
| user_request | String | ผู้ขออนุมัติ | |
| value_balance | Float | ยอดคงค้าง (total_amount − ยอดรับชำระ) (read-only) | |
| vat_rate | Float | อัตราภาษี | |
| vat_type | Integer | ประเภทภาษี (0=แยกนอก, 1=รวมใน, 2=ยกเว้นภาษี, 3=ไม่กระทบภาษี) — หมายเหตุ: ค่าคนละชุดกับ detail | |
| want_date | Date | ต้องการภายใน (วันที่) | |
| want_day | Integer | ต้องการภายใน (วัน) | |
| wh_from | String | คลัง (ต้นทาง) | |
| wh_to | String | คลัง (ปลายทาง) |
SaleInvoicePOS Detail
ฟิลด์ที่ระบุ (read-only) คือฟิลด์ที่ JOIN มาจากทะเบียนสินค้า ไม่ได้เก็บในเอกสาร
| Field Name | Field Type | Length | Description |
|---|---|---|---|
| auto_create | Integer | สร้างโดยโปรแกรม | |
| average_cost | Float | ราคาทุนเฉลี่ย | |
| average_cost_1 | Float | ราคาทุนเฉลี่ยแฝง | |
| bank_branch | String | สาขาธนาคาร | |
| bank_branch_2 | String | สาขาธนาคาร 2 | |
| bank_name | String | ธนาคาร | |
| bank_name_2 | String | ธนาคาร 2 | |
| barcode | String | 25 | Barcode |
| bat_date | Date | bat date | |
| bat_number | String | bat number | |
| branch_code | String | 25 | สาขา |
| calc_flag | Integer | บวกหรือลบ (1=บวก, -1=ลบ, default: -1) | |
| cancel_qty | Float | จำนวนยกเลิก | |
| chq_number | String | เลขที่เช็ค | |
| create_datetime | Date | วันที่สร้างเอกสาร | |
| creator_code | String | ผู้สร้างเอกสาร | |
| currency_code | String | 25 | สกุลเงิน |
| cust_code | String | 25 | ลูกหนี้/เจ้าหนี้ |
| date_due | Date | วันครบกำหนด | |
| date_expire | Date | หมดอายุ | |
| department_code | String | 25 | แผนก |
| discount | String | 25 | ส่วนลด |
| discount_amount | Float | มูลค่าส่วนลด | |
| discount_amount_2 | Float | มูลค่าส่วนลด (สกุลเงิน) | |
| discount_changed | Integer | มีการแก้ไขส่วนลด | |
| discount_number | Integer | หมายเลขส่วนลด | |
| divide_value | Float | ตัวหาร | |
| doc_date | Date | เอกสารวันที่ | |
| doc_date_calc | Date | วันที่สำหรับคำนวณ | |
| doc_group | String | กลุ่มเอกสาร | |
| doc_no | String | 25 | เอกสารเลขที่ |
| doc_ref | String | เอกสารอ้างอิง | |
| doc_ref_type | Integer | ประเภทเอกสารอ้างอิง | |
| doc_time | String | เวลา | |
| doc_time_calc | String | เวลาสำหรับคำนวณ | |
| due_date | Date | วันที่ต้องการ | |
| exchange_rate | Float | อัตราแลกเปลี่ยน | |
| exchange_rate_old | Float | อัตราแลกเปลี่ยนเดิม | |
| fee_amount | Float | ค่าธรรมเนียม | |
| group_main | String | 25 | รหัสกลุ่มสินค้าหลัก (จากทะเบียนสินค้า) (read-only) |
| group_main_name | String | 255 | ชื่อกลุ่มสินค้าหลัก (read-only) |
| group_sub | String | 25 | รหัสกลุ่มสินค้าย่อย (จากทะเบียนสินค้า) (read-only) |
| group_sub_name | String | 255 | ชื่อกลุ่มสินค้าย่อย (read-only) |
| hidden_cost_1 | Float | ต้นทุนแฝงบริหาร | |
| hidden_cost_1_exclude_vat | Float | ต้นทุนแฝงบริหารไม่รวมภาษี | |
| hidden_cost_2 | Float | ต้นทุนแฝงบัญชี | |
| hidden_cost_2_exclude_vat | Float | ต้นทุนแฝงบัญชีไม่รวมภาษี | |
| ic_color | String | สีสินค้า | |
| ic_pattern | String | รูปแบบสินค้า | |
| ic_size | String | ขนาดสินค้า | |
| inquiry_type | Integer | ประเภทการซื้อ | |
| is_doc_copy | Integer | เป็นเอกสารที่ออกแทน | |
| is_get_price | Integer | ให้ดึงราคาขาย (1=ดึง) | |
| is_lock_cost | Integer | กำหนดต้นทุนเอง | |
| is_permium | Integer | 1=ของแถม | |
| is_pos | Integer | จาก POS | |
| is_serial_number | Integer | มีหมายเลขเครื่อง | |
| item_brand | String | 25 | รหัสยี่ห้อสินค้า (จากทะเบียนสินค้า) (read-only) |
| item_brand_name | String | 255 | ชื่อยี่ห้อสินค้า (read-only) |
| item_code | String | 25 | รหัสสินค้า |
| item_code_2 | String | 25 | รหัสสินค้า 2 |
| item_code_main | String | 25 | สินค้าหลัก |
| item_name | String | 255 | ชื่อสินค้า |
| item_type | Integer | ประเภทสินค้า | |
| last_editor_code | String | ผู้แก้ไขเอกสารล่าสุด | |
| last_status | Integer | สถานะล่าสุด (0=Normal, 1=ยกเลิก) | |
| lastedit_datetime | Date | วันที่แก้ไขล่าสุด | |
| line_number | Integer | บรรทัด | |
| lot_number_1 | String | เลข LOT | |
| mfd_date | Date | วันที่ผลิต | |
| mfn_code | String | รหัสผู้ผลิต | |
| mfn_name | String | ผู้ผลิต | |
| price | Float | ราคา | |
| price_2 | Float | ราคา (สกุลเงิน) | |
| price_base | Float | ราคากลาง | |
| price_changed | Integer | มีการแก้ไขราคา | |
| price_default | Float | ราคาเริ่มต้น | |
| price_exclude_vat | Float | ราคาไม่รวมภาษี | |
| price_guid | String | Price Guid | |
| price_mode | Integer | กลุ่มราคา | |
| price_set_ratio | Float | อัตราส่วนราคาสินค้าชุด | |
| price_type | Integer | ประเภทราคา | |
| priority_level | Integer | ความสำคัญ | |
| product_week | String | สัปดาห์ที่ผลิต | |
| product_year | String | ปีที่ผลิต | |
| profit_lost_cost_amount | Float | กำไรขาดทุน | |
| promotion_code | String | รหัสโปรโมชั่น | |
| qty | Float | จำนวน | |
| qty_2 | Float | จำนวนขาย | |
| ratio | Float | อัตราส่วน | |
| ref_cust_code | String | 25 | อ้างอิง เจ้าหนี้/ลูกหนี้ |
| ref_doc_date | Date | อ้างอิง วันที่ | |
| ref_doc_no | String | 25 | อ้างอิงเอกสาร |
| ref_guid | String | ref_guid | |
| ref_line_number | Integer | อ้างอิง บรรทัด | |
| ref_row | Integer | ref_row | |
| remark | String | 255 | หมายเหตุ |
| sale_code | String | 25 | รหัสพนักงานขาย |
| sale_group | String | 25 | กลุ่มพนักงานขาย |
| sale_shift_id | String | รอบการขาย | |
| set_ref_line | String | บรรทัดอ้างอิง (สินค้าชุด) | |
| set_ref_price | Float | ราคาอ้างอิง (สินค้าชุด) | |
| set_ref_qty | Float | จำนวนอ้างอิง (สินค้าชุด) | |
| shelf_code | String | 25 | พื้นที่เก็บ |
| shelf_code_2 | String | 25 | พื้นที่เก็บ 2 |
| stand_value | Float | ตัวตั้ง | |
| status | Integer | สถานะ | |
| sum_amount | Float | รวมมูลค่า | |
| sum_amount_2 | Float | รวมมูลค่า (สกุลเงิน) | |
| sum_amount_exclude_vat | Float | รวมมูลค่าไม่รวมภาษี | |
| sum_of_cost | Float | รวมต้นทุน | |
| sum_of_cost_1 | Float | ต้นทุนรวมต้นทุนแฝงบริหาร | |
| sum_of_cost_fix | Float | ต้นทุน (กำหนดเอง) | |
| tax_type | Integer | ประเภทภาษี (0=มีภาษี, 1=ยกเว้น) | |
| temp_float_1 | Float | ตัวเลข 1 | |
| temp_float_2 | Float | ตัวเลข 2 | |
| temp_string_1 | String | ตัวอักษร 1 | |
| total_qty | Float | จำนวนคงเหลือ | |
| total_size | Float | รวมหน่วยนับ 2 | |
| total_vat_value | Float | ภาษีมูลค่าเพิ่ม | |
| trans_flag | Integer | รายวันระบบ (44 = ใบขายสินค้า, auto) | |
| trans_type | Integer | ประเภทรายวัน (2 = ขาย, auto) | |
| transfer_amount | Float | ยอดโอนเงิน | |
| unit_code | String | 25 | หน่วยนับ |
| unit_code_2 | String | 25 | หน่วยช่วยขาย |
| unit_size | Float | ขนาดสินค้า | |
| user_approve | String | รหัสผู้อนุมัติ | |
| vat_type | Integer | ประเภทภาษี (0=แยกนอก, 1=รวมใน, 2=อัตรา 0) | |
| wh_code | String | 25 | คลัง |
| wh_code_2 | String | 25 | คลัง 2 |
Payment Attribute
โครงสร้าง payment object (เก็บใน cb_trans)
ตอน GET ระบบจะค้น cb_trans ด้วย
cb_trans.doc_ref = ic_trans.doc_no
| Field Name | Field Type | Length | Description |
|---|---|---|---|
| advance_amount | Float | ตัดเงินมัดจำ | |
| ap_ar_code | String | 25 | รหัสเจ้าหนี้/ลูกหนี้ (default = cust_code ของเอกสาร) |
| book_code | String | 25 | สมุดรายวัน |
| branch_code | String | 25 | รหัสสาขา |
| card_amount | Float | ยอดบัตรเครดิต | |
| cash_amount | Float | ยอดเงินสด | |
| cashier_code | String | 25 | Cashier |
| chq_amount | Float | ยอดเช็ค | |
| coupon_amount | Float | ยอดชำระด้วยคูปอง | |
| currency_code | String | 25 | รหัสสกุลเงิน |
| deposit_amount | Float | ยอดตัดเงินล่วงหน้า | |
| description | String | รายละเอียด | |
| detail | ArrayObject | รายละเอียดการชำระ | |
| discount_amount | Float | ส่วนลดชำระเงิน | |
| doc_date | Date | เอกสารวันที่ (default = doc_date ของใบขาย) | |
| doc_format_code | String | 25 | รหัสรูปแบบเอกสาร |
| doc_group | String | กลุ่มเอกสาร | |
| doc_no | String | 25 | เอกสารเลขที่ของใบรับเงิน |
| doc_ref | String | เอกสารอ้างอิง (default = doc_no ของใบขาย) | |
| doc_time | String | 5 | เวลา |
| exchange_rate | Float | อัตราแลกเปลี่ยน | |
| guid_code | String | GUID | |
| is_doc_copy | Integer | เป็นเอกสารออกแทน | |
| money_change | Float | เงินทอน | |
| pay_cash_amount | Float | จ่ายเงิน | |
| pay_type | Integer | 1=รับ, 2=จ่าย | |
| petty_cash_amount | Float | เงินสดย่อย | |
| point_amount | Float | ยอดชำระด้วยแต้ม | |
| point_qty | Float | จำนวนแต้มที่ใช้ | |
| point_rate | Float | แต้มต่อบาท | |
| remark | String | หมายเหตุ | |
| sale_shift_id | String | รอบการขาย | |
| status | Integer | สถานะ | |
| total_amount | Float | รวมยอดเงิน | |
| total_amount_pay | Float | รวมจ่าย | |
| total_credit_charge | Float | ค่า Charge บัตรเครดิต | |
| total_expense_other | Float | รายจ่ายอื่น | |
| total_fee_amount | Float | ค่าธรรมเนียม | |
| total_income_amount | Float | ปัดเศษ | |
| total_income_other | Float | รายได้อื่น | |
| total_net_amount | Float | ยอดรวมทั้งสิ้น | |
| total_other_amount | Float | ปัดเศษ (ลด) | |
| total_other_currency | Float | สกุลเงินอื่นๆ | |
| total_tax_at_pay | Float | ภาษีหัก ณ ที่จ่าย | |
| tranfer_amount | Float | ยอดเงินโอน (สะกดตามฐานข้อมูล) | |
| trans_flag | Integer | รายวันระบบ | |
| trans_type | Integer | ประเภทรายวัน (1=รับเงิน, 2=จ่ายเงิน) | |
| wallet_amount | Float | Wallet Payment |
Payment Detail
โครงสร้าง payment.detail[] (เก็บใน cb_trans_detail) — รายการย่อยของการชำระเงินแยกตามวิธี (เช่น แต่ละใบเช็ค, แต่ละบัตรเครดิต, แต่ละการโอน)
| Field Name | Field Type | Length | Description |
|---|---|---|---|
| amount | Float | จำนวนเงิน | |
| ap_ar_code | String | 25 | รหัสเจ้าหนี้/ลูกหนี้ (default = cust_code ของเอกสาร) |
| ap_ar_type | Integer | 1=ลูกหนี้, 2=เจ้าหนี้ | |
| approve_code | String | 25 | กลุ่มผู้อนุมัติ |
| approve_date | Date | วันที่อนุมัติ | |
| balance_amount | Float | ยอดคงเหลือ | |
| bank_branch | String | สาขาธนาคาร | |
| bank_code | String | รหัสธนาคาร | |
| charge | Float | ยอด Charge | |
| chq_date | Date | วันที่ออกเช็ค/รับเช็ค | |
| chq_due_date | Date | วันที่บนเช็ค | |
| chq_on_hand | Integer | ประเภทเช็ค | |
| chq_ref | String | อ้างอิงเช็คเลขที่ | |
| credit_card_type | String | ประเภทบัตรเครดิต | |
| currency_code | String | รหัสสกุลเงิน | |
| doc_date | Date | เอกสารวันที่ (default = doc_date ของ payment header) | |
| doc_date_ref | Date | วันที่อ้างอิง | |
| doc_group | String | กลุ่มเอกสาร | |
| doc_no | String | 25 | เอกสารเลขที่ (auto fill = payment.doc_no) |
| doc_ref | String | เอกสารอ้างอิง | |
| doc_time | String | เวลา | |
| doc_type | Integer | 1=เงินโอน, 2=เช็ค, 3=บัตรเครดิต, 4=เงินสดย่อย, 5=เงินล่วงหน้า, 9=คูปอง, 11=จ่ายอื่น, 12=รับอื่น, 19=สกุลเงินอื่น, 21=eWallet | |
| exchange_rate | Float | อัตราแลกเปลี่ยน | |
| external_chq | Integer | การเรียกเก็บ | |
| fee_amount | Float | ค่าธรรมเนียม | |
| is_doc_copy | Integer | เอกสารออกแทน | |
| last_status | Integer | สถานะล่าสุด | |
| line_number | Integer | บรรทัด (auto +1 ถ้าไม่ส่ง) | |
| no_approved | String | เลขที่อนุมัติ | |
| other_amount | Float | ค่าใช้จ่ายอื่นๆ | |
| pass_book_code | String | สมุดเงินฝาก | |
| period_number | Integer | งวดที่ | |
| ref1 | String | เลขที่อ้างอิง 1 | |
| ref2 | String | เลขที่อ้างอิง 2 | |
| remark | String | หมายเหตุ | |
| sale_shift_id | String | รอบการขาย | |
| status | Integer | สถานะ | |
| sum_amount | Float | ยอดเงินรวม | |
| sum_amount_2 | Float | รวมจำนวนเงิน (สกุลเงิน) | |
| tax_at_pay | Float | ภาษีหัก ณ ที่จ่าย | |
| trans_flag | Integer | รายวันระบบ | |
| trans_number | String | เลขที่เช็ค/เลขที่อนุมัติ | |
| trans_number_type | Integer | ประเภท (1=รับ, 2=จ่าย) | |
| trans_type | Integer | ประเภทรายวัน |