AccOS Pro

Master Data ของระบบ
มีอะไร & ควรเพิ่มอะไร?

วิเคราะห์ข้อมูลพื้นฐาน (Master Data) ที่ระบบ AccOS Pro มีอยู่แล้ว เทียบกับสิ่งที่โปรแกรมบัญชีอันดับ 1 ของไทยควรมี — อัปเดตจาก codebase จริง มิถุนายน 2569

91
Total Tables
ใน schema-pg.ts
27
Master Data Tables
ข้อมูลพื้นฐาน
12
เพิ่มใหม่แล้ว
จาก Analysis ก่อนหน้า
34
Transaction Tables
ธุรกรรม & เอกสาร
30
Feature Tables
ฟีเจอร์เสริม

Master Data ที่มีอยู่แล้ว (27 Tables)

ข้อมูลพื้นฐานทั้งหมดที่มี schema ใน schema-pg.ts — อัปเดต มิ.ย. 2026

กลุ่มที่ 1: โครงสร้างองค์กร (Organization Structure)

companies มีแล้ว

ข้อมูลบริษัท: ชื่อ, เลขผู้เสียภาษี, ที่อยู่, logo, fiscal year start

Fields: name, taxId, address, logoUrl, fiscalYearStart, baseCurrency
users มีแล้ว

ผู้ใช้ระบบ: ชื่อ, อีเมล, password hash, บทบาท

Fields: name, email, password, role, isActive
memberships มีแล้ว

สิทธิ์ผู้ใช้ต่อบริษัท: user x company x role (RBAC)

Fields: userId, companyId, role
company_branches มีแล้ว

สาขาของบริษัท: ชื่อสาขา, ที่อยู่, เลขประจำตัวผู้เสียภาษี

Fields: name, branchCode, address, taxId, isHeadquarters
departments ใหม่

แผนก/ฝ่ายงาน: รหัส, ชื่อ, หัวหน้า, สถานะ

Fields: code, name, headEmployeeId, isActive
positions ใหม่

ตำแหน่งงาน: ชื่อตำแหน่ง, สถานะ

Fields: name, isActive
banks ใหม่

ธนาคารพาณิชย์: รหัสธนาคาร, ชื่อไทย/อังกฤษ, SWIFT, PromptPay

Fields: code, nameTh, nameEn, swiftCode, logoUrl, supportsPromptPay
currencies ใหม่

สกุลเงิน: รหัส, ชื่อ, สัญลักษณ์, จำนวนทศนิยม

Fields: code, nameTh, nameEn, symbol, decimalPlaces
exchange_rates ใหม่

อัตราแลกเปลี่ยน: จาก-ถึง สกุลเงิน, อัตรา, วันที่มีผล

Fields: fromCurrency, toCurrency, rate, effectiveDate

กลุ่มที่ 2: บัญชี (Accounting Master)

accounts (Chart of Accounts) มีแล้ว

ผังบัญชี Thai GAAP: รหัสบัญชี, ชื่อบัญชี, หมวดหมู่, normalBalance

Fields: code, name, category, subCategory, normalBalance, isHeader, isSystem, isActive
fiscal_periods มีแล้ว

งวดบัญชีรายเดือน/รายปี + period lock status

Fields: startDate, endDate, status, isLocked
cost_centers มีแล้ว

ศูนย์ต้นทุน: รหัส, ชื่อ, สถานะ

Fields: code, name, description, isActive
projects มีแล้ว

โครงการ: รหัส, ชื่อ, วันเริ่ม-สิ้นสุด, งบประมาณ

Fields: code, name, startDate, endDate, budget, status
budgets มีแล้ว

งบประมาณรายบัญชี: ระบุจำนวนเงินต่องวดต่อบัญชี

Fields: accountId, periodId, amount, notes
tax_rates ใหม่

อัตราภาษี: ประเภท (VAT/WHT/PIT/CIT), อัตรา, วันมีผล

Fields: type, code, name, rate, effectiveFrom, effectiveTo, isActive
document_sequences มีแล้ว

ลำดับหมายเลขเอกสาร: JV, Invoice, Bill, etc.

Fields: prefix, nextNumber, companyId
period_locks มีแล้ว

การล็อคงวดบัญชี: ป้องกันการแก้ไขย้อนหลัง

Fields: fiscalPeriodId, locked, lockedAt, lockedBy

กลุ่มที่ 3: คู่ค้า (Business Partners)

customers มีแล้ว

ลูกค้า: ชื่อ, เลขผู้เสียภาษี, ที่อยู่, เบอร์โทร, อีเมล, creditTerms

Fields: name, taxId, address, phone, email, contactPerson, creditTermsDays, isActive
vendors มีแล้ว

เจ้าหนี้การค้า: ชื่อ, เลขผู้เสียภาษี, ประเภท (บุคคล/นิติ), WHT rate

Fields: name, taxId, payerType, defaultWhtRate, address, phone, isActive
payment_methods ใหม่

วิธีชำระเงิน: ประเภท, บัญชี GL เริ่มต้น, สถานะ

Fields: name, type (cash/bank/credit/electronic), defaultAccountId, isActive

กลุ่มที่ 4: สินค้าและคลังสินค้า (Products & Inventory)

products มีแล้ว

สินค้า/บริการ: ชื่อ, SKU, ราคาซื้อ, ราคาขาย, unitOfMeasure, VAT rate

Fields: name, sku, description, unitPrice, costPrice, unitOfMeasure, category, isService, vatRate
warehouses มีแล้ว

คลังสินค้า: ชื่อคลัง, ที่อยู่, สถานะ

Fields: name, code, address, isActive
units_of_measure ใหม่

หน่วยนับ: ชื่อ, หน่วยแม่, อัตราแปลง

Fields: name, baseUnit, conversionFactor
product_categories ใหม่

กลุ่มสินค้า: ชื่อ, สถานะ

Fields: name, isActive

กลุ่มที่ 5: ธนาคารและทรัพย์สิน (Banking & Assets)

bank_accounts มีแล้ว

บัญชีธนาคาร: ชื่อธนาคาร, เลขที่บัญชี, GL account, current balance

Fields: name, bankName, accountNumber, accountId (GL), currentBalance, isActive
assets มีแล้ว

ทะเบียนทรัพย์สิน: ชื่อ, วันที่ซื้อ, ราคาทุน, method, อายุการใช้งาน

Fields: name, purchaseDate, cost, salvageValue, usefulLifeMonths, depreciationMethod, accumulatedDepreciation

กลุ่มที่ 6: พนักงานและเงินเดือน (HR & Payroll)

employees มีแล้ว

พนักงาน: ชื่อ, ตำแหน่ง, เลข ปชช., วันเริ่มงาน, เงินเดือน

Fields: firstName, lastName, nationalId, position, department, hireDate, baseSalary, bankAccountId
holidays ใหม่

วันหยุด: วันที่, ชื่อวันหยุด, ประเภท

Fields: date, name, type

กลุ่มที่ 7: ก่อสร้างและเฉพาะทาง (Construction & Specialized)

construction_contracts ก่อสร้าง

สัญญาก่อสร้าง: รหัส, ชื่อ, งบประมาณ, สถานะ

Fields: code, name, budget, status
subcontractors ก่อสร้าง

ผู้รับเหมาช่วง: ชื่อ, ข้อมูลติดต่อ

Fields: name, contact info
llm_settings AI

ตั้งค่า LLM: model, API key, parameters

Fields: model, apiKey, parameters

ตารางที่เพิ่มใหม่ตั้งแต่ Analysis ก่อนหน้า ✅

Master Data ทั้ง 12 รายการที่เคยแนะนำว่าควรเพิ่ม — ถูก implement แล้วทั้งหมด!

🏦

banks

Critical → Done

รายชื่อธนาคารพาณิชย์ พร้อมรหัสธนาคารสำหรับ e-Payment, PromptPay

🏢

departments

Critical → Done

แผนก/ฝ่ายงาน สำหรับจัดกลุ่มพนักงาน, วิเคราะห์ P&L แยกตามแผนก

💳

payment_methods

Critical → Done

วิธีชำระเงิน: เงินสด, เช็ค, โอน, PromptPay, QR, บัตรเครดิต

📊

tax_rates

Critical → Done

อัตราภาษี configurable: VAT, WHT, PIT, CIT พร้อม versioning

💱

currencies + exchange_rates

Critical → Done

สกุลเงิน + อัตราแลกเปลี่ยน history สำหรับ multi-currency

📏

units_of_measure

Important → Done

หน่วยนับพร้อม conversion factors (1 ลัง = 12 ชิ้น)

📦

product_categories

Important → Done

กลุ่มสินค้าแบบ hierarchical สำหรับรายงานยอดขาย

📅

holidays

Important → Done

วันหยุดนักขัตฤกษ์สำหรับคำนวณเงินเดือน daily rate

👔

positions

Important → Done

ตำแหน่งงาน master data สำหรับรายงาน headcount

Transaction & Feature Tables (64 Tables)

ตารางธุรกรรม, เอกสาร, และฟีเจอร์เสริมทั้งหมด

journal_entries
สมุดรายวัน (GL)
journal_lines
รายการ Dr/Cr
invoices
ใบแจ้งหนี้ (AR)
invoice_lines
รายการ Invoice
bills
ใบรับวางบิล (AP)
bill_lines
รายการ Bill
quotations
ใบเสนอราคา
purchase_orders
ใบสั่งซื้อ
credit_notes
ใบลดหนี้
credit_note_lines
รายการ Credit Note
payment_receipts
ใบเสร็จรับเงิน
payment_allocations
การจัดสรรเงิน
bank_transactions
รายการธนาคาร
tax_forms
แบบฟอร์มภาษี
tax_form_extras
ข้อมูลเสริมภาษี
tax_filings
การยื่นแบบ
tax_payments
การชำระภาษี
wht_certificates
หนังสือรับรอง 50 ทวิ
payroll_runs
รอบเงินเดือน
payroll_lines
รายการเงินเดือน
recurring_templates
รายการประจำ
e_tax_invoices
e-Tax Invoice
stock_movements
รายการเคลื่อนไหวสต็อก
stock_levels
ระดับสต็อก
stock_reservations
การจองสต็อก
physical_counts
branch_tax_registrations
จดทะเบียนสาขา
branch_users
ผู้ใช้สาขา
inter_branch_transfers
โอนระหว่างสาขา
inter_branch_transfer_lines
รายการโอน
branch_reconciliation_snapshots
กระทบยอดสาขา
depreciation_runs
รอบค่าเสื่อม
fx_gain_loss
กำไร/ขาดทุน FX
input_vat_carry_forward
VAT ซื้อค้างยก
book_tax_reconciliations
กระทบยอดบัญชี-ภาษี
tax_calendar_events
ปฏิทินภาษี
approvals
การอนุมัติ
approval_chains
สายอนุมัติ
audit_log
บันทึกการใช้งาน
notifications
การแจ้งเตือน
closing_entries
รายการปิดบัญชี
closing_checklist_items
Checklist ปิดบัญชี
period_locks
ล็อคงวด
transaction_presences
Multi-user edit
transaction_comments
ความเห็น
share_links
ลิงก์แชร์
import_jobs
นำเข้าข้อมูล
export_jobs
ส่งออกข้อมูล
copilot_chats
AI Chat
copilot_messages
AI Message
refresh_token_families
Auth tokens
construction_contracts
สัญญาก่อสร้าง
construction_boq_items
BOQ รายการ
contract_progress_billings
เรียกเก็บเงิน
wip_to_cogs_reconciliations
WIP → COGS
subcontractors
ผู้รับเหมาช่วง
subcontract_bills
บิลผู้รับเหมา
boq_variance_snapshots
BOQ Variance
cashflow_forecast_snapshots
คาดการณ์ cashflow
inventory_valuation_layers
มูลค่าสินค้า FIFO
physical_count_lines
รายการตรวจนับ

Master Data ที่ควรเพิ่มเพิ่มเติม (3 รายการ)

สิ่งที่ยังไม่มีใน schema — ควรพิจารณาเพิ่มในอนาคต

1. นโยบายการเงิน (Financial Policies)

นโยบายบัญชี: depreciation method default, rounding rules, fiscal year, consolidation rules — ปัจจุบัน hardcode ใน engines

Nice-to-Have

2. ใบอนุญาต/สัญญา (Licenses / Contracts)

ใบอนุญาตประกอบธุรกิจ, สัญญาเช่า, สัญญาจ้าง ที่มีวันหมดอายุ — สำหรับ compliance alerts

Nice-to-Have

3. กลุ่มลูกค้า/เจ้าหนี้ (Customer/Vendor Groups)

จัดกลุ่มคู่ค้า: ลูกค้า VIP, ลูกค้าต่างประเทศ, เจ้าหนี้รายใหญ่, เจ้าหนี้ท้องถิ่น

Nice-to-Have

Summary: สถานะปัจจุบัน

Master Data สถานะ Table หมายเหตุ
ธนาคาร (Banks)✅ Donebankscode, nameTh, nameEn, swiftCode, supportsPromptPay
อัตราภาษี (Tax Rates)✅ Donetax_ratestype, code, rate, effectiveFrom/To
วิธีชำระเงิน (Payment Methods)✅ Donepayment_methodsname, type, defaultAccountId
แผนก (Departments)✅ Donedepartmentscode, name, headEmployeeId
สกุลเงิน (Currencies)✅ Donecurrencies + exchange_ratesMulti-currency + FX history
หน่วยนับ (UoM)✅ Doneunits_of_measurename, baseUnit, conversionFactor
กลุ่มสินค้า (Product Categories)✅ Doneproduct_categoriesname, isActive
วันหยุด (Holidays)✅ Doneholidaysdate, name, type
ตำแหน่งงาน (Positions)✅ Donepositionsname, isActive
Customer/Vendor GroupsFutureNice-to-have
นโยบายการเงินFutureNice-to-have
ใบอนุญาต/สัญญาFutureNice-to-have