Database Connections: center(main),incentive(financial/quotations)
Generated from: Laravel migrations & Eloquent models
Last Updated: 2026-03-24
| วิธี | คำสั่ง | หมายเหตุ |
|---|---|---|
| VSCode Preview | Cmd+Shift+V | ง่ายสุด ดูได้ทันที |
| Docsify | npx docsify-cli serve . | zero-config เป็นเว็บ |
| MkDocs Material | pip install mkdocs-material && mkdocs serve | สวย มี search |
| GitHub Pages | push ขึ้น GitHub เปิด Pages | ฟรี render อัตโนมัติ |
| Grip (GitHub-style) | pip install grip && grip DATA_DICTIONARY.md | เหมือน GitHub เป๊ะ |
users — ผู้ใช้งานระบบ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
role_id | unsignedBigInteger | YES | NULL | FK → roles.id |
group_id | int | YES | NULL | กลุ่มผู้ใช้ |
status | boolean | YES | NULL | 1=active, 2=inactive, 9=deleted |
username | string | NO | — | Unique, ชื่อผู้ใช้ |
first_name | string | YES | NULL | ชื่อจริง |
last_name | string | YES | NULL | นามสกุล |
nickname | string | YES | NULL | ชื่อเล่น |
email | string | NO | — | Unique, อีเมล |
password | string | NO | — | รหัสผ่าน (hashed) |
user_address | text | YES | NULL | ที่อยู่ |
user_tel | string | YES | NULL | เบอร์โทร |
user_line_id | string | YES | NULL | Line ID |
user_team_id | unsignedBigInteger | YES | NULL | ทีม |
user_lang | string | YES | NULL | ภาษา |
user_mode | string | YES | NULL | โหมดการใช้งาน |
is_owner | boolean | YES | NULL | เป็นเจ้าของ |
is_sales | boolean | YES | NULL | เป็นเซลล์ |
reset_password | boolean | YES | NULL | ต้อง reset password |
new_password | boolean | YES | NULL | password ใหม่ |
name | string | YES | NULL | ชื่อ (alternative) |
tel | string | YES | NULL | เบอร์โทร (alternative) |
phone | string | YES | NULL | มือถือ |
avatar | string | YES | NULL | รูปโปรไฟล์ |
line | string | YES | NULL | Line (alternative) |
address | text | YES | NULL | ที่อยู่ (alternative) |
user_last_login | datetime | YES | NULL | เข้าสู่ระบบล่าสุด |
last_login_at | datetime | YES | NULL | เข้าสู่ระบบล่าสุด (v2) |
last_login_ip | string | YES | NULL | IP ล่าสุด |
remember_token | string | YES | NULL | Remember me token |
create_user_id | unsignedBigInteger | YES | NULL | FK → users.id สร้างโดย |
create_at | timestamp | YES | NULL | วันที่สร้าง (legacy) |
update_user_id | unsignedBigInteger | YES | NULL | FK → users.id แก้ไขโดย |
update_at | timestamp | YES | NULL | วันที่แก้ไข (legacy) |
remark | text | YES | NULL | หมายเหตุ |
created_at | timestamp | YES | NULL | Laravel timestamp |
updated_at | timestamp | YES | NULL | Laravel timestamp |
roles — บทบาท (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
name | string | YES | NULL | ชื่อบทบาท |
code | string | YES | NULL | รหัสบทบาท |
description | string | YES | NULL | คำอธิบาย |
scopes | string | YES | NULL | ขอบเขตสิทธิ์ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
user_role_permits — Pivot: ผู้ใช้-บทบาท (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
user_id | unsignedBigInteger | NO | — | FK → users.id |
role_id | unsignedBigInteger | NO | — | FK → roles.id |
user_country_permits — สิทธิ์ดูแลประเทศ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
user_id | unsignedBigInteger | NO | — | FK → users.id |
country_id | unsignedBigInteger | NO | — | FK → country.country_id |
permit | string | YES | NULL | ประเภทสิทธิ์ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
agency — ตัวแทน/เอเจนท์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
agen_id | bigint | NO | auto | Primary Key |
agen_user_name | string | YES | NULL | ชื่อผู้ใช้ (indexed) |
agen_password | string | YES | NULL | รหัสผ่าน (legacy) |
password | string | YES | NULL | รหัสผ่าน (v2, hashed) |
status | boolean | YES | NULL | 0=pending, 1=active, 2=inactive, 9=deleted |
agen_fname | string | YES | NULL | ชื่อ |
agen_lname | string | YES | NULL | นามสกุล |
agen_nickname | string | YES | NULL | ชื่อเล่น |
agen_position | string | YES | NULL | ตำแหน่ง |
agen_email | string | YES | NULL | อีเมล |
agen_email_confirm | boolean | YES | NULL | ยืนยันอีเมลแล้ว |
agen_email_confirm_at | timestamp | YES | NULL | วันที่ยืนยัน |
agen_tel | string | YES | NULL | เบอร์โทร |
agen_line_id | string | YES | NULL | Line ID |
agen_skype | string | YES | NULL | Skype ID |
agen_code | string | YES | NULL | รหัสเอเจนท์ |
agen_role | string | YES | NULL | บทบาท |
agen_start | boolean | YES | NULL | เริ่มต้นใช้งาน |
agency_company_id | unsignedBigInteger | YES | NULL | FK → agency_company.agen_com_id (indexed) |
api_key | string | YES | NULL | API Key |
role_id | boolean | YES | NULL | บทบาท |
prefix | string | YES | NULL | คำนำหน้า |
name | string | YES | NULL | ชื่อ (v2) |
surname | string | YES | NULL | นามสกุล (v2) |
id_number | string | YES | NULL | เลขบัตรประชาชน |
date_of_birth | date | YES | NULL | วันเกิด |
nationality | string | YES | NULL | สัญชาติ |
avatar | string | YES | NULL | รูปโปรไฟล์ |
remember_token | string | YES | NULL | Remember token |
lastvisit | datetime | YES | NULL | เข้าสู่ระบบล่าสุด |
last_login_at | datetime | YES | NULL | เข้าสู่ระบบล่าสุด (v2) |
last_login_ip | string | YES | NULL | IP ล่าสุด |
agen_show | boolean | YES | NULL | 1=show, 2=hide |
agen_note_com_name | string | YES | NULL | ชื่อบริษัท (note) |
agen_note_com_address1 | text | YES | NULL | ที่อยู่บริษัท (note) |
agen_note_com_tel | string | YES | NULL | เบอร์บริษัท (note) |
agen_note_com_fax | string | YES | NULL | แฟกซ์บริษัท (note) |
agen_note_com_ttt_on | string | YES | NULL | เลข ททท. (note) |
create_user_id | unsignedBigInteger | YES | NULL | สร้างโดย |
create_date | datetime | YES | NULL | วันที่สร้าง |
update_user_id | unsignedBigInteger | YES | NULL | แก้ไขโดย |
update_date | datetime | YES | NULL | วันที่แก้ไข |
remark | string | YES | NULL | หมายเหตุ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
agency_company — บริษัทตัวแทน (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
agen_com_id | bigint | NO | auto | Primary Key |
agen_com_code | string(10) | YES | NULL | รหัสบริษัท |
agen_com_name | string | YES | NULL | ชื่อบริษัท (EN) |
agen_com_name_th | string | YES | NULL | ชื่อบริษัท (TH) |
agen_com_username | string | YES | NULL | username บริษัท |
short_name | string | YES | NULL | ชื่อย่อ |
license_number | string(30) | YES | NULL | เลขใบอนุญาต |
license_type | boolean | YES | NULL | ประเภทใบอนุญาต |
license_file | string | YES | NULL | ไฟล์ใบอนุญาต |
license_issued_at | date | YES | NULL | วันออกใบอนุญาต |
license_expired_at | date | YES | NULL | วันหมดอายุ |
license_name | string | YES | NULL | ชื่อในใบอนุญาต |
license_status | boolean | YES | NULL | สถานะใบอนุญาต |
license_regisno | string(30) | YES | NULL | เลขทะเบียน |
agen_com_tel | string(100) | YES | NULL | เบอร์โทร |
agen_com_tax | string(100) | YES | NULL | เลขภาษี |
agen_com_fax | string(100) | YES | NULL | แฟกซ์ |
agen_com_ttt_type | boolean | NO | — | ประเภท ททท. |
agen_com_ttt_on | string | YES | NULL | เลข ททท. |
agen_com_ttt_url_img | string | YES | NULL | รูปใบ ททท. |
agen_com_logo_img | string | YES | NULL | โลโก้ (legacy) |
logo | string | YES | NULL | โลโก้ (v2) |
agen_com_poster | string | YES | NULL | โปสเตอร์ |
agen_com_address1 | string | YES | NULL | ที่อยู่ 1 |
agen_com_address2 | string | YES | NULL | ที่อยู่ 2 |
agen_com_geo | unsignedSmallInt | YES | NULL | ภูมิภาค (indexed) |
agen_com_province | unsignedSmallInt | YES | NULL | FK → province (indexed) |
agen_com_amphur | unsignedSmallInt | YES | NULL | FK → amphur (indexed) |
agen_com_district | unsignedSmallInt | YES | NULL | FK → district (indexed) |
agen_com_postcode | string(5) | YES | NULL | รหัสไปรษณีย์ |
agen_com_email | string | YES | NULL | อีเมล |
agen_com_website | string | YES | NULL | เว็บไซต์ |
agen_com_guarantee | boolean | YES | NULL | ค้ำประกัน |
agen_com_user_id | unsignedBigInteger | YES | NULL | ผู้ดูแล |
agen_com_token | string | YES | NULL | Token |
agen_com_score | unsignedBigInteger | NO | 0 | คะแนน |
agen_com_star | unsignedBigInteger | NO | 0 | ดาว |
status | boolean | YES | 0 | 0=pending, 1=active (indexed) |
location_address | string | YES | NULL | ที่อยู่ (v2) |
location_district | string | YES | NULL | แขวง/ตำบล (v2) |
location_city | string | YES | NULL | เขต/อำเภอ (v2) |
location_province | string | YES | NULL | จังหวัด (v2) |
location_zip | string | YES | NULL | ไปรษณีย์ (v2) |
location_lat | string | YES | NULL | ละติจูด |
location_lng | string | YES | NULL | ลองจิจูด |
social_line | string | YES | NULL | Line official |
social_facebook | string | YES | NULL | |
version | int | YES | NULL | เวอร์ชัน |
tax_name | string | YES | NULL | ชื่อผู้เสียภาษี |
tax_address | string | YES | NULL | ที่อยู่ภาษี |
tax_number | string | YES | NULL | เลขภาษี |
head_office | unsignedBigInteger | YES | NULL | สำนักงานใหญ่ |
branch | string | YES | NULL | สาขา |
md_name | string | YES | NULL | ชื่อ MD |
md_email | string | YES | NULL | อีเมล MD |
md_phone | string | YES | NULL | เบอร์ MD |
sm_name | string | YES | NULL | ชื่อ Sales Manager |
sm_email | string | YES | NULL | อีเมล SM |
sm_phone | string | YES | NULL | เบอร์ SM |
am_name | string | YES | NULL | ชื่อ Account Manager |
am_email | string | YES | NULL | อีเมล AM |
am_phone | string | YES | NULL | เบอร์ AM |
am_tel | string | YES | NULL | เบอร์ AM (สำรอง) |
acc_phone | string | YES | NULL | เบอร์บัญชี |
sales_phone | string | YES | NULL | เบอร์เซลล์ |
numemp | tinyInteger | YES | NULL | จำนวนพนักงาน |
dbd_type | tinyInteger | YES | NULL | ประเภท DBD |
dbd_no | string | YES | NULL | เลข DBD |
dbd_issued_at | date | YES | NULL | วันออก DBD |
dbd_name | string | YES | NULL | ชื่อ DBD (TH) |
dbd_name_en | string | YES | NULL | ชื่อ DBD (EN) |
dbd_address | string | YES | NULL | ที่อยู่ DBD (TH) |
dbd_address_en | string | YES | NULL | ที่อยู่ DBD (EN) |
dbd_file | string | YES | NULL | ไฟล์ DBD |
transfer_type | tinyInteger | YES | NULL | ประเภทโอน |
is_credit_card | tinyInteger | YES | NULL | รับบัตรเครดิต |
is_tax | tinyInteger | YES | NULL | มีใบกำกับภาษี |
tax_no | string | YES | NULL | เลขภาษี (alt) |
tax_issued_at | date | YES | NULL | วันออกภาษี |
tax_file | string | YES | NULL | ไฟล์ภาษี |
refund_bank_id | tinyInteger | YES | NULL | ธนาคารคืนเงิน |
refund_bank_branch | string | YES | NULL | สาขาธนาคาร |
refund_bank_name | string | YES | NULL | ชื่อบัญชี |
refund_bank_no | string | YES | NULL | เลขบัญชี |
description | string | YES | NULL | คำอธิบาย |
credit_shell_value | float | YES | NULL | Credit shell มูลค่า |
credit_shell_used | float | YES | NULL | Credit shell ใช้แล้ว |
credit_shell_balance | float | YES | NULL | Credit shell คงเหลือ |
remark | string | YES | NULL | หมายเหตุ |
create_user_id | string | YES | NULL | สร้างโดย (indexed) |
create_date | datetime | YES | NULL | วันที่สร้าง |
update_user_id | string | YES | NULL | แก้ไขโดย (indexed) |
update_date | datetime | YES | NULL | วันที่แก้ไข |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
agency_credit_shells — เครดิตเชลล์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
agency_company_id | unsignedBigInteger | YES | NULL | FK → agency_company |
booking_id | unsignedBigInteger | YES | NULL | FK → booking |
amount | decimal | YES | NULL | จำนวนเงิน |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
agency_access_tokens — Token เข้าถึง (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
agency_id | unsignedBigInteger | YES | NULL | FK → agency |
token | string | YES | NULL | Token |
name | string | YES | NULL | ชื่อ token |
abilities | string | YES | NULL | ความสามารถ |
active | boolean | YES | NULL | สถานะ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
country — ประเทศ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
country_id | bigint | NO | auto | Primary Key |
country_code | string | YES | NULL | รหัสประเทศ |
country_name | string | YES | NULL | ชื่อประเทศ |
country_description | text | YES | NULL | คำอธิบาย |
country_deposit | decimal(10,2) | YES | NULL | มัดจำ |
status | boolean | YES | 1 | 1=active |
country_img | string | YES | NULL | รูปประเทศ |
country_flag | string | YES | NULL | ธง |
country_image | string | YES | NULL | รูป (v2) |
tagbag_code | string | YES | NULL | รหัส tagbag |
country_seq | smallInteger | YES | NULL | ลำดับแสดง |
country_color | string | YES | NULL | สีประจำ |
has_visa | boolean | YES | NULL | ต้องมีวีซ่า |
permalink | string | YES | NULL | URL ถาวร |
flagicon | string | YES | NULL | ไอคอนธง |
create_user_id | unsignedBigInteger | YES | NULL | สร้างโดย (indexed) |
create_date | timestamp | YES | NULL | วันที่สร้าง |
update_user_id | unsignedBigInteger | YES | NULL | แก้ไขโดย (indexed) |
update_date | timestamp | YES | NULL | วันที่แก้ไข |
remark | text | YES | NULL | หมายเหตุ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
series — ซีรีส์ทัวร์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
ser_id | bigint | NO | auto | Primary Key (indexed) |
ser_type | boolean | YES | NULL | 0=package tour, 1=incentive, 2=ticket only |
ser_name | string | YES | NULL | ชื่อซีรีส์ |
ser_code | string | YES | NULL | รหัสซีรีส์ |
country_id | unsignedBigInteger | YES | NULL | FK → country (indexed) |
city_id | unsignedBigInteger | YES | NULL | FK → tour_location_city (indexed) |
ser_city | string | YES | NULL | เมือง (text) |
air_id | string | YES | NULL | FK → airline (indexed) |
ser_go_flight_code | string | YES | NULL | เที่ยวบินขาไป |
ser_go_route | string | YES | NULL | เส้นทางขาไป |
ser_go_time | string | YES | NULL | เวลาขาไป |
ser_return_flight_code | string | YES | NULL | เที่ยวบินขากลับ |
ser_return_route | string | YES | NULL | เส้นทางขากลับ |
ser_return_time | string | YES | NULL | เวลาขากลับ |
ser_route | string | YES | NULL | เส้นทางรวม |
ser_price | decimal(10,2) | YES | NULL | ราคา |
ser_deposit | decimal(10,2) | YES | NULL | มัดจำ |
start_price | decimal | YES | NULL | ราคาเริ่มต้น |
ser_url_img_1 - ser_url_img_5 | string | YES | NULL | รูปภาพ 1-5 |
ser_url_word | string | YES | NULL | ไฟล์ Word |
ser_url_pdf | string | YES | NULL | ไฟล์ PDF |
status | boolean | YES | NULL | 1=active, 2=suspended, 9=closed |
ser_show | boolean | YES | 0 | 0=normal, 1=promoted, 2=promotion, 3=hot |
ser_is_promote | boolean | YES | NULL | โปรโมท |
ser_is_recommend | boolean | YES | NULL | แนะนำ |
on_web | boolean | YES | 1 | แสดงบนเว็บ |
create_user_id | unsignedBigInteger | YES | NULL | FK → users (indexed) |
create_date | datetime | YES | NULL | วันที่สร้าง |
update_user_id | unsignedBigInteger | YES | NULL | FK → users (indexed) |
update_date | datetime | YES | NULL | วันที่แก้ไข |
remark | string | YES | NULL | หมายเหตุ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
airline — สายการบิน (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
air_id | bigint | NO | auto | Primary Key |
air_name | string | YES | NULL | ชื่อสายการบิน |
air_code | string | YES | NULL | รหัส IATA |
status | boolean | YES | NULL | สถานะ |
tour_location_city — เมืองปลายทาง (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
name | string | YES | NULL | ชื่อเมือง |
country_id | unsignedBigInteger | YES | NULL | FK → country |
periods — เพียเรียด/รอบทัวร์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
per_id | bigint | NO | auto | Primary Key |
per_date_start | date | YES | NULL | วันเริ่มทัวร์ |
per_date_end | date | YES | NULL | วันสิ้นสุดทัวร์ |
per_price_1 | decimal(10,2) | YES | NULL | ราคาผู้ใหญ่ |
per_price_2 | decimal(10,2) | YES | NULL | ราคาเด็ก 2-11 ปี |
per_price_3 | decimal(10,2) | YES | NULL | ราคาเด็กไม่มีเตียง 2-11 ปี |
per_price_4 | decimal(10,2) | YES | NULL | ราคาทารก 0-2 ปี |
per_price_5 | decimal(10,2) | YES | NULL | ราคา Joinland |
single_charge | decimal(18,2) | YES | NULL | ค่าห้องเดี่ยว |
per_qty_seats | int | YES | NULL | จำนวนที่นั่ง |
per_cost | decimal(10,2) | YES | NULL | ต้นทุน |
per_expenses | decimal(10,2) | YES | NULL | ค่าใช้จ่าย |
status | boolean | YES | NULL | 1=open, 2=full, 3=closed, 9=suspended, 10=cut tickets |
ser_id | unsignedBigInteger | YES | NULL | FK → series |
per_com_agency | decimal(10,2) | YES | NULL | คอมมิชชั่นเอเจนท์ |
per_com_company_agency | decimal(10,2) | YES | NULL | คอมมิชชั่นบริษัทเอเจนท์ |
per_url_word | string | YES | NULL | ไฟล์ Word |
per_url_pdf | string | YES | NULL | ไฟล์ PDF |
per_hotel_tel | string | YES | NULL | เบอร์โรงแรม |
arrival_date | datetime | YES | NULL | วันถึง |
per_cost_file | string | YES | NULL | ไฟล์ต้ นทุน |
per_on_fire | boolean | YES | NULL | ราคาพิเศษ (fire sale) |
per_discount | float(10,2) | YES | NULL | ส่วนลด |
cancel_mode | boolean | YES | 0 | โหมดยกเลิก |
per_bus_value | boolean | YES | NULL | มูลค่ารถบัส |
create_user_id | unsignedBigInteger | YES | NULL | สร้างโดย |
create_date | timestamp | YES | NULL | วันที่สร้าง |
update_user_id | unsignedBigInteger | YES | NULL | แก้ไขโดย |
update_date | timestamp | YES | NULL | วันที่แก้ไข |
remark | text | YES | NULL | หมายเหตุ |
bus_lists — รถบัส/กรุ๊ป (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
bus_id | bigint | NO | auto | Primary Key |
per_id | unsignedBigInteger | YES | NULL | FK → periods |
bus_name | string | YES | NULL | ชื่อกรุ๊ป |
bus_seats | int | YES | NULL | จำนวนที่นั่ง |
status | boolean | YES | NULL | สถานะ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
land_operations — แลนด์โอเปอเรเตอร์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
name | string | YES | NULL | ชื่อ |
description | text | YES | NULL | คำอธิบาย |
image | string | YES | NULL | รูปภาพ |
status | enum | NO | 1 | 1=active, 2=inactive, 3=draft, 4=expired |
created_by | int | YES | NULL | สร้างโดย |
updated_by | int | YES | NULL | แก้ไขโดย |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
country_land_operations — Pivot: ประเทศ-แลนด์ (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
land_operation_id | unsignedBigInteger | YES | NULL | FK → land_operations |
country_id | unsignedBigInteger | YES | NULL | FK → country |
created_by | int | YES | NULL | สร้างโดย |
updated_by | int | YES | NULL | แก้ไขโดย |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
booking — การจอง (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
book_id | bigint | NO | auto | Primary Key (indexed) |
book_code | string | NO | — | รหัสจอง (indexed) |
invoice_code | string | YES | NULL | เลขใบแจ้งหนี้ (indexed) |
invoice_date | datetime | YES | NULL | วันที่ใบแจ้งหนี้ |
inv_rev_no | unsignedSmallInt | YES | NULL | เลขปรับปรุง invoice |
receipt_code | string | YES | NULL | เลขใบเสร็จ |
receipt_date | datetime | YES | NULL | วันที่ใบเสร็จ |
agen_id | unsignedBigInteger | YES | NULL | FK → agency (indexed) |
user_id | unsignedBigInteger | YES | NULL | FK → users (indexed) |
per_id | unsignedBigInteger | YES | NULL | FK → periods (indexed) |
bus_id | unsignedBigInteger | YES | NULL | FK → bus_lists (indexed) |
bus_no | unsignedBigInteger | YES | NULL | FK → bus_list (indexed) |
book_discount | decimal(10,2) | YES | NULL | ส่วนลด |
extra_discount | float(9,2) | YES | NULL | ส่วนลดพิเศษ |
book_total_discount | float(9,2) | YES | NULL | ส่วนลดรวม |
book_total | decimal(10,2) | YES | NULL | ยอดรวม |
book_amountgrandtotal | decimal(18,2) | YES | NULL | ยอดรวมสุทธิ |
book_amounte | decimal(18,2) | YES | NULL | ยอดเงิน |
book_net_amounte | decimal(18,2) | YES | NULL | ยอดสุทธิ |
book_comment | string | YES | NULL | หมายเหตุ |
book_extralist_total | float(9,2) | YES | NULL | ยอดรายการพิเศษ |
extra_charge | float(9,2) | YES | NULL | ค่าใช้จ่ายเพิ่มเติม |
book_master_deposit | decimal(10,2) | YES | NULL | มัดจำ |
book_due_date_deposit | datetime | YES | NULL | วันครบกำหนดมัดจำ |
book_master_full_payment | decimal(10,2) | YES | NULL | ยอดชำระเต็ม |
book_due_date_full_payment | datetime | YES | NULL | วันครบกำหนดชำระเต็ม |
book_pax | unsignedSmallInt | YES | NULL | จำนวนผู้โดยสาร |
book_paid_type | boolean | YES | NULL | 1=cash, 2=credit, 3=check, 4=transfer |
airline_charge | unsignedBigInteger | YES | NULL | ค่าสายการบิน |
bankbook_id | unsignedBigInteger | YES | NULL | FK → bankbook |
book_cradit_no | string | YES | NULL | เลขบัตรเครดิต |
book_cradit_cheque_bank | string | YES | NULL | ธนาคารเช็ค |
book_cheque_no | string | YES | NULL | เลขเช็ค |
book_cheque_date | datetime | YES | NULL | วันที่เช็ค |
book_bank_transfer_date | date | YES | NULL | วันโอน |
book_bank_transfer_time | time | YES | NULL | เวลาโอน |
status | boolean | YES | NULL | ดูตาราง Status Codes (indexed) |
status_cancel | boolean | YES | 0 | 1=30 วัน, 2=10 วัน, 3=ไม่คืนเงิน |
book_cancel | decimal(10,2) | YES | 0 | ยอดยกเลิก |
remark_cancel | text | YES | NULL | เหตุผลยกเลิก |
book_com_agency_company | decimal(10,2) | YES | NULL | คอมฯ บริษัทเอเจนท์ |
book_com_agency | decimal(10,2) | YES | NULL | คอมฯ เอเจนท์ |
book_com_qty | tinyInteger | YES | NULL | จำนวนคอมฯ |
book_date | datetime | YES | NULL | วันจอง |
book_receipt | decimal(10,2) | YES | 0 | ยอดใบเสร็จ |
book_room_tripletwin | tinyInteger | YES | NULL | ห้อง triple-twin |
book_room_twin | tinyInteger | YES | NULL | ห้อง twin |
book_room_double | tinyInteger | YES | NULL | ห้อง double |
book_room_triple | tinyInteger | YES | NULL | ห้อง triple |
book_room_single | tinyInteger | YES | NULL | ห้อง single |
book_log | text | YES | NULL | log |
book_cus_name | string | YES | NULL | ชื่อลูกค้า |
book_cus_tel | string | YES | NULL | เบอร์ลูกค้า |
book_is_guarantee | boolean | YES | 0 | มีค้ำประกัน |
book_is_guarantee_at | timestamp | YES | NULL | วันค้ำประกัน |
book_is_guarantee_id | int | YES | NULL | ID ค้ำประกัน |
book_guarantee_file | string | YES | NULL | ไฟล์ค้ำประกัน |
book_guarantee_file_date | datetime | YES | NULL | วันไฟล์ค้ำประกัน |
book_guarantee_file_by | int | YES | 0 | อัพโหลดโดย |
book_guarantee_checked | boolean | YES | NULL | 0=pending, 1=approved, 2=rejected |
cancel_by | string | YES | NULL | ยกเลิกโดย |
cancel_user_id | int | YES | NULL | FK → users |
cancel_agen_id | int | YES | NULL | FK → agency |
cancel_status | boolean | YES | NULL | สถานะยกเลิก |
cancel_condition | tinyInteger | YES | NULL | เงื่อนไขยกเลิก |
cancel_date | datetime | YES | NULL | วันยกเลิก |
booking_passport | boolean | YES | NULL | 1=recorded, 2=printed incomplete, 3=printed complete |
book_on_wl | boolean | YES | NULL | 0=normal, 1=from WL |
book_v2 | boolean | YES | NULL | เวอร์ชัน 2 |
traveler_update_id | int | YES | NULL | อัพเดทผู้เดินทางโดย |
traveler_update_date | datetime | YES | NULL | วันอัพเดทผู้เดินทาง |
promo_id | unsignedBigInteger | YES | NULL | FK → promotion |
promo_val | float(9,2) | YES | NULL | มูลค่าโปรโมชั่น |
promo_discount | float(9,2) | YES | NULL | ส่วนลดโปรโมชั่น |
book_version | boolean | YES | NULL | เวอร์ชัน |
is_vat | boolean | YES | NULL | 0=no, 1=request, 2=use, 3=reject |
guarantee_id | unsignedBigInteger | YES | NULL | FK → booking_guarantee |
value | decimal | YES | NULL | มูลค่า |
create_user_id | unsignedBigInteger | YES | NULL | FK → users สร้างโดย |
create_date | datetime | YES | NULL | วันที่สร้าง |
update_user_id | unsignedBigInteger | YES | NULL | FK → users แก้ไขโดย |
update_date | datetime | YES | NULL | วันที่แก้ไข |
remark | text | YES | NULL | หมายเหตุ |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
| Code | Status | Description |
|---|---|---|
| 00 | Booked | จองแล้ว |
| 05 | Waiting | รอดำเนินการ |
| 10 | Invoice | ออกใบแจ้งหนี้แล้ว |
| 20 | Deposit Partial | ชำระมัดจำบางส่วน |
| 25 | Deposit Full | ชำระมัดจำครบ |
| 30 | Payment Partial | ชำระเงินบางส่วน |
| 35 | Payment Full | ชำระเงินครบ |
| 40 | Cancelled | ยกเลิก |
| 50 | Waiting List | รอที่นั่ง |
| 55 | Payment Notice | แจ้งชำระเงิน |
| 60 | Payment Reject | ปฏิเสธการชำระ |
booking_details — รายละเอียดการจอง (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
booking_id | unsignedBigInteger | YES | NULL | FK → booking (indexed) |
name | string | YES | NULL | รายการ |
price | float(9,2) | YES | NULL | ราคา |
qty | tinyInteger | YES | NULL | จำนวน |
discount | float(9,2) | YES | NULL | ส่วนลด |
total | float(9,2) | YES | NULL | รวม |
symbol | boolean | YES | 1 | 0=add, 1=subtract |
type_id | int | YES | NULL | ประเภท |
key_id | string | YES | NULL | key อ้างอิง |
created_at | timestamp | YES | NULL | |
updated_at | timestamp | YES | NULL |
booking_additionals — รายการเพิ่มเติม (DB: center)| Column | Type | Nullable | Default | Description |
|---|---|---|---|---|
id | bigint | NO | auto | Primary Key |
book_id | unsignedBigInteger | YES | NULL | FK → booking |
name | string | YES | NULL | ชื่อรายการ |
quantity | int | YES | 1 | จำนวน |
sum | decimal(15,2) | YES | 0 | ยอดรวม |
created_user_id | unsignedBigInteger | YES | NULL |