Skip to content

Purchasing — Data model

31 tables · auto-generated from migrations-v2/*.sql — do not edit by hand.

ER diagram

%%{init: {"theme":"base","themeVariables":{"darkMode":true,"background":"#1e1e1e","primaryColor":"#2d2d30","primaryBorderColor":"#569cd6","primaryTextColor":"#d4d4d4","lineColor":"#6796c6","secondaryColor":"#3a3d41","secondaryBorderColor":"#dcdcaa","secondaryTextColor":"#d4d4d4","tertiaryColor":"#252526","tertiaryBorderColor":"#569cd6","noteBkgColor":"#3a3d41","noteTextColor":"#dcdcaa","clusterBkg":"#252526","clusterBorder":"#569cd6","titleColor":"#569cd6","attributeBackgroundColorOdd":"#252526","attributeBackgroundColorEven":"#2d2d30"},"er":{"useMaxWidth":false}}}%%
erDiagram
  PURCHASING_BLANKET_ORDER {
    integer id PK
    text company_id FK
    integer supplier_id FK
    text doc_no
    text valid_from
    text valid_to
    text commitment_type
    text release_policy
  }
  PURCHASING_BLANKET_ORDER_LINE {
    integer id PK
    text company_id FK
    integer blanket_order_id FK
    integer item_id FK
    integer line_no
    numeric committed_qty
    numeric released_qty
    text uom_code
  }
  PURCHASING_BLANKET_ORDER_STUB {
    integer id PK
    text company_id FK
    integer supplier_id FK
    text doc_no
    text valid_from
    text valid_to
    text commitment_type
    text lines_json
  }
  PURCHASING_BLANKET_RELEASE {
    integer id PK
    text company_id FK
    integer blanket_order_id FK
    integer blanket_line_id FK
    integer purchase_order_id FK
    integer po_line_id FK
    numeric released_qty
    integer created_at
  }
  PURCHASING_GOODS_RECEIPT {
    integer id PK
    text company_id FK
    integer kernel_document_id FK
    integer supplier_id FK
    text doc_no
    integer docstatus
    text received_at
    text received_by
  }
  PURCHASING_GRN_LINE {
    integer id PK
    text company_id FK
    integer goods_receipt_id FK
    integer po_line_id FK
    integer item_id FK
    integer destination_location_id FK
    integer line_no
    numeric qty
  }
  PURCHASING_LANDED_COST_ALLOCATION {
    integer id PK
    text company_id FK
    integer landed_cost_voucher_id FK
    integer grn_line_id FK
    numeric allocation_amount
    integer created_at
  }
  PURCHASING_LANDED_COST_VOUCHER {
    integer id PK
    text company_id FK
    integer kernel_document_id FK
    integer supplier_id FK
    integer source_bill_id FK
    text doc_no
    integer docstatus
    text allocation_method
  }
  PURCHASING_MATCH_EXCEPTION {
    integer id PK
    text company_id FK
    integer vendor_bill_id FK
    integer vendor_bill_line_id FK
    text kind
    numeric delta_qty
    numeric delta_amount
    text resolution
  }
  PURCHASING_MATCH_POLICY {
    integer id PK
    text company_id FK
    text code
    text name
    text match_basis
    numeric qty_tolerance_pct
    numeric price_tolerance_pct
    numeric bill_amount_abs_tolerance
  }
  PURCHASING_PO_LINE {
    integer id PK
    text company_id FK
    integer purchase_order_id FK
    integer item_id FK
    integer line_no
    text description
    numeric qty
    text uom_code
  }
  PURCHASING_PURCHASE_ORDER {
    integer id PK
    text company_id FK
    integer supplier_id FK
    integer supplier_profile_id FK
    integer ship_to_location_id FK
    text doc_no
    integer docstatus
    text po_kind
  }
  PURCHASING_RFQ {
    integer id PK
    text company_id FK
    text doc_no
    text quote_deadline
    text source_pr_refs
    integer docstatus
    text award_state
    text created_by
  }
  PURCHASING_RFQ_AWARD {
    integer id PK
    text company_id FK
    integer rfq_id FK
    integer quotation_id FK
    integer quotation_line_id FK
    integer purchase_order_id FK
    integer po_line_id FK
    numeric awarded_qty
  }
  PURCHASING_RFQ_LINE {
    integer id PK
    text company_id FK
    integer rfq_id FK
    integer item_id FK
    integer line_no
    numeric qty
    text uom_code
    text need_by
  }
  PURCHASING_RFQ_STUB {
    integer id PK
    text company_id FK
    text doc_no
    text supplier_set_json
    text source_pr_refs
    integer docstatus
    integer created_at
  }
  PURCHASING_RFQ_SUPPLIER {
    integer id PK
    text company_id FK
    integer rfq_id FK
    integer supplier_id FK
    integer sent_at
    text channel
    text response_state
    integer created_at
  }
  PURCHASING_SUBCONTRACT_COMPONENT_ISSUE {
    integer id PK
    text company_id FK
    integer kernel_document_id FK
    integer purchase_order_id FK
    integer from_location_id FK
    integer subcontractor_location_id FK
    text doc_no
    integer docstatus
  }
  PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_LINE {
    integer id PK
    text company_id FK
    integer component_issue_id FK
    integer item_id FK
    integer line_no
    numeric qty
    text uom_code
    integer identity_bundle_id
  }
  PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_STUB {
    integer id PK
    text company_id FK
    integer purchase_order_id FK
    integer subcontractor_location_id FK
    text doc_no
    text component_lines_json
    numeric consumed_qty
    integer docstatus
  }
  PURCHASING_SUPPLIER_PRICE_ENTRY {
    integer id PK
    text company_id FK
    integer supplier_id FK
    integer item_id FK
    integer superseded_by_id FK
    text source
    numeric unit_price
    text currency_code
  }
  PURCHASING_SUPPLIER_PROFILE {
    integer id PK
    text company_id FK
    integer party_id FK
    text supplier_code
    text default_currency_code
    text payment_terms_code
    text incoterm
    text default_wht_type_code
  }
  PURCHASING_SUPPLIER_QUOTATION {
    integer id PK
    text company_id FK
    integer supplier_id FK
    integer rfq_id FK
    text doc_no
    text valid_until
    text award_state
    integer docstatus
  }
  PURCHASING_SUPPLIER_QUOTATION_LINE {
    integer id PK
    text company_id FK
    integer quotation_id FK
    integer rfq_line_id FK
    integer item_id FK
    integer line_no
    numeric qty
    text uom_code
  }
  PURCHASING_SUPPLIER_QUOTATION_STUB {
    integer id PK
    text company_id FK
    integer supplier_id FK
    integer rfq_id FK
    text doc_no
    text valid_until
    text award_state
    text lines_json
  }
  PURCHASING_SUPPLIER_SCORECARD {
    integer id PK
    text company_id FK
    integer supplier_id FK
    numeric current_score
    text standing
    text criteria_json
    text period_code
    text standing_overridden_by
  }
  PURCHASING_SUPPLIER_SCORECARD_STUB {
    integer id PK
    text company_id FK
    integer supplier_id FK
    numeric current_score
    text standing
    text criteria_json
    text period_code
    integer created_at
  }
  PURCHASING_VENDOR_BILL {
    integer id PK
    text company_id FK
    integer kernel_document_id FK
    integer supplier_id FK
    text doc_no
    integer docstatus
    text supplier_invoice_no
    text supplier_invoice_date
  }
  PURCHASING_VENDOR_BILL_LINE {
    integer id PK
    text company_id FK
    integer vendor_bill_id FK
    integer po_line_id FK
    integer line_no
    text grn_line_refs
    text description
    numeric qty
  }
  PURCHASING_VENDOR_CUSTODY_LOCATION {
    integer id PK
    text company_id FK
    integer supplier_id FK
    integer location_id FK
    text custody_type
    integer created_at
  }
  PURCHASING_WHT_TYPE_POLICY {
    integer id PK
    text company_id FK
    text income_type_code
    text name_th
    text name_en
    numeric rate
    text applies_to
    text payee_kind
  }
  PURCHASING_BLANKET_ORDER ||--o{ PURCHASING_BLANKET_ORDER_LINE : blanket_order
  PURCHASING_BLANKET_ORDER ||--o{ PURCHASING_BLANKET_RELEASE : blanket_order
  PURCHASING_BLANKET_ORDER_LINE ||--o{ PURCHASING_BLANKET_RELEASE : blanket_line
  PURCHASING_PURCHASE_ORDER ||--o{ PURCHASING_BLANKET_RELEASE : purchase_order
  PURCHASING_PO_LINE ||--o{ PURCHASING_BLANKET_RELEASE : po_line
  PURCHASING_GOODS_RECEIPT ||--o{ PURCHASING_GRN_LINE : goods_receipt
  PURCHASING_PO_LINE ||--o{ PURCHASING_GRN_LINE : po_line
  PURCHASING_LANDED_COST_VOUCHER ||--o{ PURCHASING_LANDED_COST_ALLOCATION : landed_cost_voucher
  PURCHASING_GRN_LINE ||--o{ PURCHASING_LANDED_COST_ALLOCATION : grn_line
  PURCHASING_VENDOR_BILL ||--o{ PURCHASING_LANDED_COST_VOUCHER : source_bill
  PURCHASING_VENDOR_BILL ||--o{ PURCHASING_MATCH_EXCEPTION : vendor_bill
  PURCHASING_VENDOR_BILL_LINE ||--o{ PURCHASING_MATCH_EXCEPTION : vendor_bill_line
  PURCHASING_PURCHASE_ORDER ||--o{ PURCHASING_PO_LINE : purchase_order
  PURCHASING_SUPPLIER_PROFILE ||--o{ PURCHASING_PURCHASE_ORDER : supplier_profile
  PURCHASING_RFQ ||--o{ PURCHASING_RFQ_AWARD : rfq
  PURCHASING_SUPPLIER_QUOTATION ||--o{ PURCHASING_RFQ_AWARD : quotation
  PURCHASING_SUPPLIER_QUOTATION_LINE ||--o{ PURCHASING_RFQ_AWARD : quotation_line
  PURCHASING_PURCHASE_ORDER ||--o{ PURCHASING_RFQ_AWARD : purchase_order
  PURCHASING_PO_LINE ||--o{ PURCHASING_RFQ_AWARD : po_line
  PURCHASING_RFQ ||--o{ PURCHASING_RFQ_LINE : rfq
  PURCHASING_RFQ ||--o{ PURCHASING_RFQ_SUPPLIER : rfq
  PURCHASING_PURCHASE_ORDER ||--o{ PURCHASING_SUBCONTRACT_COMPONENT_ISSUE : purchase_order
  PURCHASING_SUBCONTRACT_COMPONENT_ISSUE ||--o{ PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_LINE : component_issue
  PURCHASING_PURCHASE_ORDER ||--o{ PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_STUB : purchase_order
  PURCHASING_SUPPLIER_PRICE_ENTRY ||--o{ PURCHASING_SUPPLIER_PRICE_ENTRY : superseded_by
  PURCHASING_RFQ ||--o{ PURCHASING_SUPPLIER_QUOTATION : rfq
  PURCHASING_SUPPLIER_QUOTATION ||--o{ PURCHASING_SUPPLIER_QUOTATION_LINE : quotation
  PURCHASING_RFQ_LINE ||--o{ PURCHASING_SUPPLIER_QUOTATION_LINE : rfq_line
  PURCHASING_RFQ_STUB ||--o{ PURCHASING_SUPPLIER_QUOTATION_STUB : rfq
  PURCHASING_VENDOR_BILL ||--o{ PURCHASING_VENDOR_BILL_LINE : vendor_bill
  PURCHASING_PO_LINE ||--o{ PURCHASING_VENDOR_BILL_LINE : po_line

Cross-module references

  • PURCHASING_BLANKET_ORDER.company_idCOMPANY (core)
  • PURCHASING_BLANKET_ORDER.supplier_idPARTY (core)
  • PURCHASING_BLANKET_ORDER_LINE.company_idCOMPANY (core)
  • PURCHASING_BLANKET_ORDER_LINE.item_idITEM (core)
  • PURCHASING_BLANKET_ORDER_STUB.company_idCOMPANY (core)
  • PURCHASING_BLANKET_ORDER_STUB.supplier_idPARTY (core)
  • PURCHASING_BLANKET_RELEASE.company_idCOMPANY (core)
  • PURCHASING_GOODS_RECEIPT.company_idCOMPANY (core)
  • PURCHASING_GOODS_RECEIPT.kernel_document_idDOCUMENT (core)
  • PURCHASING_GOODS_RECEIPT.supplier_idPARTY (core)
  • PURCHASING_GRN_LINE.company_idCOMPANY (core)
  • PURCHASING_GRN_LINE.item_idITEM (core)
  • PURCHASING_GRN_LINE.destination_location_idLOCATION (core)
  • PURCHASING_LANDED_COST_ALLOCATION.company_idCOMPANY (core)
  • PURCHASING_LANDED_COST_VOUCHER.company_idCOMPANY (core)
  • PURCHASING_LANDED_COST_VOUCHER.kernel_document_idDOCUMENT (core)
  • PURCHASING_LANDED_COST_VOUCHER.supplier_idPARTY (core)
  • PURCHASING_MATCH_EXCEPTION.company_idCOMPANY (core)
  • PURCHASING_MATCH_POLICY.company_idCOMPANY (core)
  • PURCHASING_PO_LINE.company_idCOMPANY (core)
  • PURCHASING_PO_LINE.item_idITEM (core)
  • PURCHASING_PURCHASE_ORDER.company_idCOMPANY (core)
  • PURCHASING_PURCHASE_ORDER.supplier_idPARTY (core)
  • PURCHASING_PURCHASE_ORDER.ship_to_location_idLOCATION (core)
  • PURCHASING_RFQ.company_idCOMPANY (core)
  • PURCHASING_RFQ_AWARD.company_idCOMPANY (core)
  • PURCHASING_RFQ_LINE.company_idCOMPANY (core)
  • PURCHASING_RFQ_LINE.item_idITEM (core)
  • PURCHASING_RFQ_STUB.company_idCOMPANY (core)
  • PURCHASING_RFQ_SUPPLIER.company_idCOMPANY (core)
  • PURCHASING_RFQ_SUPPLIER.supplier_idPARTY (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE.company_idCOMPANY (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE.kernel_document_idDOCUMENT (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE.from_location_idLOCATION (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE.subcontractor_location_idLOCATION (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_LINE.company_idCOMPANY (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_LINE.item_idITEM (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_STUB.company_idCOMPANY (core)
  • PURCHASING_SUBCONTRACT_COMPONENT_ISSUE_STUB.subcontractor_location_idLOCATION (core)
  • PURCHASING_SUPPLIER_PRICE_ENTRY.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_PRICE_ENTRY.supplier_idPARTY (core)
  • PURCHASING_SUPPLIER_PRICE_ENTRY.item_idITEM (core)
  • PURCHASING_SUPPLIER_PROFILE.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_PROFILE.party_idPARTY (core)
  • PURCHASING_SUPPLIER_QUOTATION.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_QUOTATION.supplier_idPARTY (core)
  • PURCHASING_SUPPLIER_QUOTATION_LINE.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_QUOTATION_LINE.item_idITEM (core)
  • PURCHASING_SUPPLIER_QUOTATION_STUB.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_QUOTATION_STUB.supplier_idPARTY (core)
  • PURCHASING_SUPPLIER_SCORECARD.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_SCORECARD.supplier_idPARTY (core)
  • PURCHASING_SUPPLIER_SCORECARD_STUB.company_idCOMPANY (core)
  • PURCHASING_SUPPLIER_SCORECARD_STUB.supplier_idPARTY (core)
  • PURCHASING_VENDOR_BILL.company_idCOMPANY (core)
  • PURCHASING_VENDOR_BILL.kernel_document_idDOCUMENT (core)
  • PURCHASING_VENDOR_BILL.supplier_idPARTY (core)
  • PURCHASING_VENDOR_BILL_LINE.company_idCOMPANY (core)
  • PURCHASING_VENDOR_CUSTODY_LOCATION.company_idCOMPANY (core)
  • PURCHASING_VENDOR_CUSTODY_LOCATION.supplier_idPARTY (core)
  • PURCHASING_VENDOR_CUSTODY_LOCATION.location_idLOCATION (core)
  • PURCHASING_WHT_TYPE_POLICY.company_idCOMPANY (core)

Data dictionary

erp_purchasing_blanket_order · 11 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
supplier_id integer FK erp_party
valid_from text
valid_to text
commitment_type text
release_policy text
docstatus integer
created_by text
created_at integer
erp_purchasing_blanket_order_line · 11 cols
column type key references
id integer PK
company_id text FK erp_company
blanket_order_id integer FK erp_purchasing_blanket_order
line_no integer
item_id integer FK erp_item
committed_qty numeric
released_qty numeric
uom_code text
agreed_price numeric
currency_code text
created_at integer
erp_purchasing_blanket_order_stub · 12 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
supplier_id integer FK erp_party
valid_from text
valid_to text
commitment_type text
lines_json text
released_qty numeric
consumed_value numeric
docstatus integer
created_at integer
erp_purchasing_blanket_release · 8 cols
column type key references
id integer PK
company_id text FK erp_company
blanket_order_id integer FK erp_purchasing_blanket_order
blanket_line_id integer FK erp_purchasing_blanket_order_line
purchase_order_id integer FK erp_purchasing_purchase_order
po_line_id integer FK erp_purchasing_po_line
released_qty numeric
created_at integer
erp_purchasing_goods_receipt · 15 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
docstatus integer
kernel_document_id integer FK erp_document
supplier_id integer FK erp_party
received_at text
received_by text
carrier_note_no text
qc_state text
posting_date text
dimension_values text
created_at integer
submitted_at integer
cancelled_at integer
erp_purchasing_grn_line · 16 cols
column type key references
id integer PK
company_id text FK erp_company
goods_receipt_id integer FK erp_purchasing_goods_receipt
line_no integer
po_line_id integer FK erp_purchasing_po_line
item_id integer FK erp_item
qty numeric
uom_code text
base_qty numeric
base_uom_code text
destination_location_id integer FK erp_location
identity_bundle_id integer
over_receipt_pct_applied numeric
stock_ledger_entry_refs text
qc_result_ref text
created_at integer
erp_purchasing_landed_cost_allocation · 6 cols
column type key references
id integer PK
company_id text FK erp_company
landed_cost_voucher_id integer FK erp_purchasing_landed_cost_voucher
grn_line_id integer FK erp_purchasing_grn_line
allocation_amount numeric
created_at integer
erp_purchasing_landed_cost_voucher · 15 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
docstatus integer
kernel_document_id integer FK erp_document
supplier_id integer FK erp_party
source_bill_id integer FK erp_purchasing_vendor_bill
allocation_method text
total_amount numeric
cost_lines text
target_lines text
repost_state text
posting_date text
created_at integer
submitted_at integer
erp_purchasing_match_exception · 13 cols
column type key references
id integer PK
company_id text FK erp_company
vendor_bill_id integer FK erp_purchasing_vendor_bill
vendor_bill_line_id integer FK erp_purchasing_vendor_bill_line
kind text
delta_qty numeric
delta_amount numeric
resolution text
resolver_ref text
resolved_at integer
reason text
approval_ref text
created_at integer
erp_purchasing_match_policy · 11 cols
column type key references
id integer PK
company_id text FK erp_company
code text
name text
match_basis text
qty_tolerance_pct numeric
price_tolerance_pct numeric
bill_amount_abs_tolerance numeric
over_receipt_pct numeric
active integer
created_at integer
erp_purchasing_po_line · 25 cols
column type key references
id integer PK
company_id text FK erp_company
purchase_order_id integer FK erp_purchasing_purchase_order
line_no integer
item_id integer FK erp_item
description text
qty numeric
uom_code text
base_qty numeric
base_uom_code text
unit_price numeric
discount_amount numeric
tax_code text
wht_applicable integer
wht_type_code text
match_policy_snapshot text
received_qty numeric
billed_qty numeric
pr_line_ref integer
need_by text
quotation_line_ref integer
blanket_line_ref integer
subcontract_bom_ref text
close_reason text
created_at integer
erp_purchasing_purchase_order · 28 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
docstatus integer
supplier_id integer FK erp_party
supplier_profile_id integer FK erp_purchasing_supplier_profile
po_kind text
currency_code text
exchange_rate numeric
payment_terms_code text
expected_date text
ship_to_location_id integer FK erp_location
blanket_order_id integer
rfq_ref integer
quotation_ref integer
approval_state text
receipt_status text
billing_status text
untaxed_amount numeric
vat_amount numeric
total_amount numeric
match_policy_code text
dimension_values text
created_by text
submitted_by text
created_at integer
submitted_at integer
cancelled_at integer
erp_purchasing_rfq · 10 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
quote_deadline text
source_pr_refs text
docstatus integer
award_state text
created_by text
created_at integer
submitted_at integer
erp_purchasing_rfq_award · 11 cols
column type key references
id integer PK
company_id text FK erp_company
rfq_id integer FK erp_purchasing_rfq
quotation_id integer FK erp_purchasing_supplier_quotation
quotation_line_id integer FK erp_purchasing_supplier_quotation_line
purchase_order_id integer FK erp_purchasing_purchase_order
po_line_id integer FK erp_purchasing_po_line
awarded_qty numeric
unit_price numeric
award_rank integer
created_at integer
erp_purchasing_rfq_line · 9 cols
column type key references
id integer PK
company_id text FK erp_company
rfq_id integer FK erp_purchasing_rfq
line_no integer
item_id integer FK erp_item
qty numeric
uom_code text
need_by text
created_at integer
erp_purchasing_rfq_stub · 7 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
supplier_set_json text
source_pr_refs text
docstatus integer
created_at integer
erp_purchasing_rfq_supplier · 8 cols
column type key references
id integer PK
company_id text FK erp_company
rfq_id integer FK erp_purchasing_rfq
supplier_id integer FK erp_party
sent_at integer
channel text
response_state text
created_at integer
erp_purchasing_subcontract_component_issue · 12 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
docstatus integer
kernel_document_id integer FK erp_document
purchase_order_id integer FK erp_purchasing_purchase_order
from_location_id integer FK erp_location
subcontractor_location_id integer FK erp_location
posting_date text
created_by text
created_at integer
submitted_at integer
erp_purchasing_subcontract_component_issue_line · 10 cols
column type key references
id integer PK
company_id text FK erp_company
component_issue_id integer FK erp_purchasing_subcontract_component_issue
line_no integer
item_id integer FK erp_item
qty numeric
uom_code text
identity_bundle_id integer
consumed_qty numeric
created_at integer
erp_purchasing_subcontract_component_issue_stub · 9 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
purchase_order_id integer FK erp_purchasing_purchase_order
component_lines_json text
subcontractor_location_id integer FK erp_location
consumed_qty numeric
docstatus integer
created_at integer
erp_purchasing_supplier_price_entry · 16 cols
column type key references
id integer PK
company_id text FK erp_company
supplier_id integer FK erp_party
item_id integer FK erp_item
source text
unit_price numeric
currency_code text
qty_break numeric
lead_time_days integer
valid_from text
valid_to text
source_doc_type text
source_doc_id integer
source_line_id integer
superseded_by_id integer FK erp_purchasing_supplier_price_entry
created_at integer
erp_purchasing_supplier_profile · 27 cols
column type key references
id integer PK
company_id text FK erp_company
party_id integer FK erp_party
supplier_code text
default_currency_code text
payment_terms_code text
incoterm text
default_wht_type_code text
thai_tax_id text
vat_branch_no text
vat_registered integer
hold_state text
hold_reason text
scorecard_standing_ref integer
lead_time_formula text
min_order_amount numeric
is_subcontractor integer
e_tax_capable integer
promptpay_type text
promptpay_value text
dimension_defaults text
rfq_default_policy_ref integer
quotation_default_policy_ref integer
blanket_default_policy_ref integer
subcontract_default_policy_ref integer
created_at integer
updated_at integer
erp_purchasing_supplier_quotation · 10 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
supplier_id integer FK erp_party
rfq_id integer FK erp_purchasing_rfq
valid_until text
award_state text
docstatus integer
created_by text
created_at integer
erp_purchasing_supplier_quotation_line · 13 cols
column type key references
id integer PK
company_id text FK erp_company
quotation_id integer FK erp_purchasing_supplier_quotation
rfq_line_id integer FK erp_purchasing_rfq_line
line_no integer
item_id integer FK erp_item
qty numeric
uom_code text
unit_price numeric
lead_time_days integer
note text
awarded_qty numeric
created_at integer
erp_purchasing_supplier_quotation_stub · 10 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
supplier_id integer FK erp_party
rfq_id integer FK erp_purchasing_rfq_stub
valid_until text
award_state text
lines_json text
docstatus integer
created_at integer
erp_purchasing_supplier_scorecard · 11 cols
column type key references
id integer PK
company_id text FK erp_company
supplier_id integer FK erp_party
current_score numeric
standing text
criteria_json text
period_code text
standing_overridden_by text
override_reason text
created_at integer
updated_at integer
erp_purchasing_supplier_scorecard_stub · 8 cols
column type key references
id integer PK
company_id text FK erp_company
supplier_id integer FK erp_party
current_score numeric
standing text
criteria_json text
period_code text
created_at integer
erp_purchasing_vendor_bill · 22 cols
column type key references
id integer PK
company_id text FK erp_company
doc_no text
docstatus integer
kernel_document_id integer FK erp_document
supplier_id integer FK erp_party
supplier_invoice_no text
supplier_invoice_date text
currency_code text
exchange_rate numeric
match_state text
vat_treatment text
untaxed_amount numeric
vat_amount numeric
wht_withheld_amount numeric
net_payable_amount numeric
due_date text
payment_state text
dimension_values text
created_at integer
submitted_at integer
cancelled_at integer
erp_purchasing_vendor_bill_line · 15 cols
column type key references
id integer PK
company_id text FK erp_company
vendor_bill_id integer FK erp_purchasing_vendor_bill
line_no integer
po_line_id integer FK erp_purchasing_po_line
grn_line_refs text
description text
qty numeric
unit_price numeric
tax_code text
wht_type_code text
wht_rate numeric
wht_amount numeric
dimension_values text
created_at integer
erp_purchasing_vendor_custody_location · 6 cols
column type key references
id integer PK
company_id text FK erp_company
supplier_id integer FK erp_party
location_id integer FK erp_location
custody_type text
created_at integer
erp_purchasing_wht_type_policy · 14 cols
column type key references
id integer PK
company_id text FK erp_company
income_type_code text
name_th text
name_en text
rate numeric
applies_to text
payee_kind text
pnd_form text
min_threshold numeric
effective_from text
effective_to text
active integer
created_at integer