Database tables & columns

Reference

Schema is defined in database/migrations/tenant/. Use the module tabs below (same layout as Sidebar menus). Pair with Screens and the how-to guides for day-to-day workflows: Inventory, Sales, Purchase, Accounting.

How to read these tables

List screen and Create / edit form: Yes = shown in the UI, No = stored but hidden, Auto = system-assigned (IDs, numbers, timestamps), Calc = calculated on save from lines or payment allocations.

Document links

Child document Parent / link Database field
Quotation Customer quotations.customer_idcustomers
Sales order Customer, optional Quotation customer_id, quotation_id
Sales order Warehouse (fulfilment) warehouse_idwarehouses
Sales invoice Customer, optional Sales order customer_id, sales_order_id
Sales invoice Credit/debit note original reference_invoice_idsales_invoices
Payment receipt Customer payment_receipts.customer_id
Payment allocation Invoice + receipt payment_allocations links receipt to sales_invoices
Sales return Customer, optional Invoice sales_invoice_id, sales_order_id
Purchase requisition Requester (user) Internal approval workflow
RFQ Requisition (optional) Sourcing event before PO
Purchase order Vendor purchase_orders.vendor_id
Purchase order Requisition / RFQ / Blanket PO purchase_requisition_id, rfq_id, blanket_po_id
Goods receipt PO, Vendor, Warehouse purchase_order_id, vendor_id, warehouse_id
GRN line PO line goods_receipt_items.purchase_order_item_id
Purchase invoice Vendor, optional PO vendor_id, purchase_order_id
Purchase invoice line PO line / GRN line purchase_order_item_id, goods_receipt_item_id
Vendor payment Vendor Allocations → purchase_invoices
Stock movement Product + Warehouse Updates stock_balances; SO reservations use type reservation
Journal entry line GL account journal_entry_lines.account_idchart_of_accounts
Sales invoice GL (when posted) sales_invoices.journal_entry_idjournal_entries
Payment receipt GL (when posted) payment_receipts.journal_entry_idjournal_entries
Sales return GL (when posted) sales_returns.journal_entry_idjournal_entries

customers

Sales → Customers

Master record for anyone you sell to.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
name string Display name on sales documents. Yes Yes
email string Contact email. Yes Yes
phone string Contact phone. Yes Yes
address text Default billing/shipping text. No Yes
gstin string Customer tax ID (GSTIN). No Yes
credit_limit decimal(12,2) Maximum outstanding AR (informational). No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

quotations

Sales → Quotations

Non-binding price offer; may convert to a sales order.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Unique quote number. Yes Auto
customer_id FK Customer receiving the quote. Yes Yes → customers.id
date date Quote date. Yes Yes
valid_until date Offer expiry. No Yes
status string draft, sent, accepted, rejected. Yes Yes
notes text Customer-visible notes. No Yes
currency_code char(3) Document currency. No Yes
exchange_rate decimal(15,6) Rate to base currency. No Yes
discount_amount decimal(15,2) Header discount after line discounts. No Yes
payment_terms string Payment terms text. No Yes
internal_notes text Staff-only notes. No Yes
subtotal decimal(15,2) Sum of line amounts before tax. No Calc
tax_total decimal(15,2) Total tax from lines. No Calc
total decimal(15,2) Grand total. Yes Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

quotation_items

Sales → Quotations (lines)

Line rows for a quotation.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
quotation_id FK Parent quotation. No Auto → quotations.id
product_id FK Optional product link. No Yes → products.id
description string Line description. No Yes
qty decimal(15,4) Quantity in product UOM. No Yes
unit_price decimal(15,2) Unit selling price. No Yes
discount_percent decimal(5,2) Line discount percent. No Yes
tax_rate decimal(5,2) Tax/GST rate. No Yes
line_total decimal(15,2) Line amount after discount and tax. No Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

sales_orders

Sales → Sales orders

Firm commitment to deliver; reserves stock when confirmed.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Unique order number. Yes Auto
customer_id FK Customer on the order. Yes Yes → customers.id
quotation_id FK Source quotation, if converted. No Yes → quotations.id
date date Order date. Yes Yes
status string Lifecycle: draft through completed/cancelled. Yes Yes
notes text Customer-visible notes. No Yes
currency_code char(3) Document currency. No Yes
exchange_rate decimal(15,6) Rate to base currency. No Yes
discount_amount decimal(15,2) Header discount after line discounts. No Yes
payment_terms string Payment terms. No Yes
expected_delivery_date date Promised delivery date. No Yes
due_date date Payment due date. No Yes
customer_gstin string(15) GSTIN copied for tax. No Yes
supply_type string(10) B2B, B2C, EXPORT, SEZ. No Yes
place_of_supply string(2) State code for GST. No Yes
warehouse_id FK Fulfilment warehouse. No Yes → warehouses.id
delivery_status string(30) pending, partially_delivered, fully_delivered. No Yes
invoice_status string(30) not_invoiced, partially_invoiced, fully_invoiced. No Yes
hold_reason text Required when status is on_hold. No Yes
internal_notes text Staff-only notes. No Yes
billing_address_snapshot json Billing address at save time. No Yes
shipping_address_snapshot json Shipping address at save time. No Yes
subtotal decimal(15,2) Sum before tax. No Calc
tax_total decimal(15,2) Tax from lines. No Calc
total decimal(15,2) Order grand total. Yes Calc
amount_invoiced decimal(15,2) Total invoiced against this order. No Calc
amount_paid decimal(15,2) Customer payments applied. No Calc
outstanding_amount decimal(15,2) Remaining AR on the order. No Calc
confirmed_at timestamp When order was confirmed. No Auto
completed_at timestamp When order completed. No Auto
cancelled_at timestamp When order cancelled. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

sales_order_items

Sales → Sales orders (lines)

Product lines on a sales order.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
sales_order_id FK Parent sales order. No Auto → sales_orders.id
product_id FK Product sold. No Yes → products.id
hsn_sac_code string(20) HSN/SAC tax code. No Yes
description string Line description. No Yes
qty decimal(15,4) Ordered quantity. No Yes
delivered_qty decimal(15,4) Quantity shipped/delivered. No Calc
invoiced_qty decimal(15,4) Quantity invoiced. No Calc
unit_price decimal(15,2) Unit selling price. No Yes
discount_percent decimal(5,2) Line discount percent. No Yes
tax_rate decimal(5,2) Tax rate. No Yes
line_total decimal(15,2) Line total. No Calc
warehouse_id FK Line fulfilment warehouse. No No → warehouses.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

sales_invoices

Sales → Sales invoices

Accounts receivable billing document (tax invoice, credit note, etc.).

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Unique invoice number. Yes Auto
invoice_type string(20) tax_invoice (GST or non-GST via line tax), proforma, credit_note, debit_note. No Yes
customer_id FK Bill-to customer. Yes Yes → customers.id
sales_order_id FK Source sales order. No Yes → sales_orders.id
reference_invoice_id FK Original invoice for credit/debit notes. No Yes → sales_invoices.id
customer_gstin string(15) GSTIN on invoice. No Yes
supply_type string(10) B2B, B2C, EXPORT, SEZ. No Yes
place_of_supply string(2) Place of supply state code. No Yes
reverse_charge boolean RCM flag. No Yes
currency_code char(3) Document currency. No Yes
exchange_rate decimal(15,6) Rate to base currency. No Yes
discount_amount decimal(15,2) Header discount. No Yes
date date Invoice date. Yes Yes
due_date date Payment due date. No Yes
status string draft, sent, paid, cancelled, etc. Yes Yes
notes text Customer-visible notes. No Yes
attachment_path string Uploaded PDF/image path. No Yes
subtotal decimal(15,2) Sum before tax. No Calc
tax_total decimal(15,2) Tax total. No Calc
total decimal(15,2) Invoice grand total. Yes Calc
tds_amount decimal(15,2) TDS withheld. No Yes
amount_paid decimal(15,2) Allocated receipt total. Yes Calc
outstanding_amount decimal(15,2) Balance due (AR). Yes Calc
payment_terms string Payment terms. No Yes
internal_notes text Staff-only notes. No Yes
billing_address_snapshot json Billing address snapshot. No Yes
shipping_address_snapshot json Shipping address snapshot. No Yes
financial_year string(9) FY label for compliance. No Auto
journal_entry_id FK Posted GL entry. No Auto → journal_entries.id
irn_number string(64) E-invoice IRN. No Auto
irn_generated_at timestamp When IRN was generated. No Auto
qr_code_data text E-invoice QR payload. No Auto
ack_number string(32) E-invoice acknowledgement. No Auto
ack_date timestamp Acknowledgement timestamp. No Auto
e_way_bill_number string(16) E-way bill number. No Auto
sent_at timestamp When sent to customer. No Auto
paid_at timestamp When fully paid. No Auto
cancelled_at timestamp When cancelled. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

sales_invoice_items

Sales → Sales invoices (lines)

Line rows on a sales invoice.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
sales_invoice_id FK Parent invoice. No Auto → sales_invoices.id
product_id FK Product billed. No Yes → products.id
hsn_sac_code string(20) HSN/SAC code. No Yes
description string Line description. No Yes
qty decimal(15,4) Billed quantity. No Yes
unit_price decimal(15,2) Unit price. No Yes
discount_percent decimal(5,2) Line discount percent. No Yes
tax_rate decimal(5,2) GST rate % on line; 0 = non-GST / exempt line. No Yes
line_total decimal(15,2) Line total. No Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

payment_receipts

Sales → Payments

Customer payment received; may allocate to one or more invoices.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Receipt number. Yes Auto
customer_id FK Paying customer. Yes Yes → customers.id
sales_invoice_id FK Legacy single-invoice link (prefer allocations). No No → sales_invoices.id
date date Receipt date. Yes Yes
amount decimal(15,2) Payment amount in document currency. Yes Yes
currency_code char(3) Payment currency. No Yes
exchange_rate decimal(15,6) Rate to base currency. No Yes
amount_base decimal(15,2) Amount in base currency. No Calc
method string cash, bank, card, upi, cheque. Yes Yes
reference string Bank/UPI/cheque reference. No Yes
cheque_date date Cheque date. No Yes
cheque_status string(20) Cheque clearance status. No Yes
is_advance boolean Unallocated customer advance. No Yes
allocated_amount decimal(15,2) Sum allocated to invoices. No Calc
unallocated_amount decimal(15,2) Remaining unallocated balance. No Calc
tds_amount decimal(15,2) TDS on receipt. No Yes
tds_section string(20) TDS section code. No Yes
gateway_transaction_id string(100) Payment gateway ID. No Yes
gateway_status string(30) Gateway status. No Yes
status string(20) received, allocated, etc. No Yes
notes text Notes. No Yes
journal_entry_id FK Posted GL entry. No Auto → journal_entries.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

payment_allocations

Sales → Payments (allocations)

Links a payment receipt to one or more sales invoices.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
payment_receipt_id FK Payment receipt. No Yes → payment_receipts.id
sales_invoice_id FK Invoice being paid. No Yes → sales_invoices.id
allocated_amount decimal(15,2) Amount applied to this invoice. No Yes
allocation_date date Date of allocation. No Yes
notes string(500) Allocation notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

sales_returns

Sales → Sales returns

RMA / return request; may generate credit note and restock.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Return document number. Yes Auto
sales_invoice_id FK Invoice being returned against. No Yes → sales_invoices.id
sales_order_id FK Related sales order. No Yes → sales_orders.id
customer_id FK Customer. Yes Yes → customers.id
date date Return date. Yes Yes
reason string(100) Return reason code. No Yes
reason_details text Reason details. No Yes
status string(30) requested through completed. Yes Yes
approved_by bigint User who approved. No Auto
approved_at timestamp Approval time. No Auto
received_at timestamp When goods received back. No Auto
refund_type string(20) Refund method. No Yes
credit_note_id FK Generated credit note invoice. No Auto → sales_invoices.id
refund_amount decimal(15,2) Refund amount. No Yes
warehouse_id FK Return-to warehouse. No Yes → warehouses.id
subtotal decimal(15,2) Return subtotal. No Calc
tax_total decimal(15,2) Return tax. No Calc
total decimal(15,2) Return total. Yes Calc
notes text Customer notes. No Yes
internal_notes text Staff notes. No Yes
journal_entry_id FK Posted GL entry. No Auto → journal_entries.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

sales_return_items

Sales → Sales returns (lines)

Products/qty on a sales return.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
sales_return_id FK Parent return. No Auto → sales_returns.id
sales_invoice_item_id FK Source invoice line. No Yes → sales_invoice_items.id
product_id FK Product returned. No Yes → products.id
hsn_sac_code string(20) HSN/SAC. No Yes
description string Line description. No Yes
qty decimal(15,4) Return quantity. No Yes
unit_price decimal(15,2) Unit price credited. No Yes
discount_percent decimal(5,2) Line discount. No Yes
tax_rate decimal(5,2) Tax rate. No Yes
line_total decimal(15,2) Line total. No Calc
inspection_status string(20) QC inspection result. No Yes
warehouse_id FK Restock warehouse. No Yes → warehouses.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

vendors

Purchase → Vendors

Supplier master; approval and AVL flags control PO use.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
vendor_code string(20) Unique supplier code. Yes Auto
name string Display name. Yes Yes
legal_name string Registered legal name. No Yes
vendor_type string(30) supplier, contractor, etc. No Yes
category_id FK Vendor category. Yes Yes → vendor_categories.id
status string(20) draft, pending, approved, blocked. Yes Yes
is_avl boolean Approved vendor list flag. Yes Yes
primary_contact_name string(100) Main contact. No Yes
email string Email. No Yes
phone string Phone. No Yes
website string Website URL. No Yes
address text Legacy single address (see vendor_addresses). No Yes
gstin string GSTIN. Yes Yes
pan string(10) PAN. No Yes
gst_treatment string(30) regular, composition, etc. No Yes
msme_number string(20) MSME registration. No Yes
msme_category string(20) MSME category. No Yes
tan string(10) TAN for TDS. No Yes
payment_terms string(30) Default payment terms. No Yes
credit_period_days smallint Credit days. No Yes
credit_limit decimal(18,2) Credit limit. No Yes
default_currency char(3) Default currency. No Yes
tds_section string(10) Default TDS section. No Yes
tds_rate decimal(5,2) Default TDS rate. No Yes
lower_deduction_cert string(50) Lower deduction certificate no. No Yes
lower_deduction_rate decimal(5,2) Reduced TDS rate. No Yes
lower_deduction_valid_to date Certificate expiry. No Yes
composite_score decimal(5,2) Vendor score. No Calc
performance_grade char(1) A–D grade. Yes Calc
notes text Notes. No Yes
custom_fields json Extra fields. No Yes
approved_at timestamp When approved. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

purchase_requisitions

Purchase → Requisitions

Internal purchase request before PO/RFQ.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
pr_number string(20) Requisition number. Yes Auto
pr_date date Requisition date. Yes Yes
required_by date Needed-by date. Yes Yes
requester_user_id bigint Central user ID of requester. No Auto
requester_name string Requester display name. Yes Yes
department string Department. No Yes
cost_center string Cost center. No Yes
priority string(10) low, normal, high, urgent. No Yes
source string(20) manual, reorder, etc. No Yes
source_reference string(100) External reference. No Yes
status string(30) Approval workflow status. Yes Yes
justification text Business justification. No Yes
total_estimated_value decimal(18,2) Sum of line estimates. Yes Calc
currency_code char(3) Currency. No Yes
notes text Notes. No Yes
rejection_reason string(1000) Why rejected. No Yes
submitted_at timestamp Submitted for approval. No Auto
approved_at timestamp Approved time. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

purchase_requisition_items

Purchase → Requisitions (lines)

Requested items on a requisition.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
purchase_requisition_id FK Parent requisition. No Auto → purchase_requisitions.id
line_number smallint Line sequence. No Yes
product_id FK Product if catalogued. No Yes → products.id
item_description string(500) Item description. No Yes
specification text Technical spec. No Yes
requested_qty decimal(15,3) Qty requested. No Yes
converted_qty decimal(15,3) Qty converted to PO. No Calc
estimated_unit_price decimal(15,4) Estimated unit price. No Yes
estimated_line_total decimal(18,2) Estimated line total. No Calc
suggested_vendor_id FK Preferred vendor. No Yes → vendors.id
sort_order int Display order. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

rfqs

Purchase → RFQs

Request for quotation sent to multiple vendors.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
rfq_number string(20) RFQ number. Yes Auto
rfq_date date RFQ date. No Yes
response_deadline datetime Vendor response cutoff. Yes Yes
required_by date Material needed by. No Yes
purchase_requisition_id FK Source requisition. No Yes → purchase_requisitions.id
title string RFQ title. Yes Yes
description text Scope description. No Yes
delivery_warehouse_id FK Delivery warehouse. No Yes → warehouses.id
payment_terms string(100) Requested payment terms. No Yes
currency_code char(3) Currency. No Yes
status string(30) draft through awarded/cancelled. Yes Yes
awarded_at timestamp When awarded. No Auto
awarded_by bigint User who awarded. No Auto
terms_conditions text T&C. No Yes
notes text Notes. No Yes
created_by bigint Creator user ID. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No
deleted_at timestamp Soft-delete marker; hidden from default queries. No No

purchase_orders

Purchase → Purchase orders

Commitment to buy from a vendor; may link requisition, RFQ, or blanket PO.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string PO number. Yes Auto
vendor_id FK Supplier. Yes Yes → vendors.id
purchase_requisition_id FK Source requisition. No Yes → purchase_requisitions.id
rfq_id FK Source RFQ. No Yes → rfqs.id
blanket_po_id FK Parent blanket agreement. No Yes → purchase_orders.id
po_type string(20) standard, blanket, release. No Yes
vendor_name_snapshot string Vendor name at save. No Auto
vendor_address_snapshot text Vendor address at save. No Auto
vendor_gstin_snapshot string(15) Vendor GSTIN at save. No Auto
ship_to_warehouse_id FK Receive-at warehouse. No Yes → warehouses.id
ship_to_address_snapshot text Ship-to address snapshot. No Auto
date date PO date. Yes Yes
expected_date date Expected delivery. No Yes
valid_from date Blanket validity start. No Yes
valid_to date Blanket validity end. No Yes
blanket_qty_cap decimal(15,3) Blanket quantity cap. No Yes
blanket_value_cap decimal(18,2) Blanket value cap. No Yes
payment_terms string(100) Payment terms. No Yes
credit_period_days int Credit days. No Yes
currency_code char(3) PO currency. No Yes
exchange_rate decimal(12,6) FX rate. No Yes
status string draft through received/cancelled. Yes Yes
notes text Vendor-visible notes. No Yes
terms_conditions text Terms and conditions. No Yes
internal_notes text Internal notes. No Yes
subtotal decimal(15,2) Subtotal. No Calc
tax_total decimal(15,2) Tax total. No Calc
header_discount_amount decimal(18,2) Header discount. No Yes
additional_charges decimal(18,2) Freight/other charges. No Yes
total decimal(15,2) PO total. Yes Calc
sent_to_vendor_at timestamp When sent. No Auto
acknowledged_at timestamp Vendor acknowledgement. No Auto
approved_at timestamp Internal approval. No Auto
approved_by bigint Approver user ID. No Auto
cancelled_at timestamp Cancellation time. No Auto
cancellation_reason text Why cancelled. No Yes
created_by bigint Creator user ID. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

purchase_order_items

Purchase → Purchase orders (lines)

Lines on a purchase order.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
purchase_order_id FK Parent PO. No Auto → purchase_orders.id
purchase_requisition_item_id FK Source PR line. No Auto → purchase_requisition_items.id
blanket_po_item_id FK Blanket line for releases. No Auto → purchase_order_items.id
product_id FK Product purchased. No Yes → products.id
vendor_price_list_id FK Contract price list used. No Auto → vendor_price_lists.id
description string Line description. No Yes
qty decimal(15,4) Ordered qty. No Yes
unit_cost decimal(15,2) Unit cost. No Yes
list_unit_price decimal(15,4) List/contract price before override. No Auto
price_override_reason string Why price differs from list. No Yes
tax_rate decimal(5,2) Tax rate. No Yes
line_total decimal(15,2) Line total. No Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

goods_receipts

Inventory → Goods receipts

GRN: receive stock against a PO or ad hoc.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string GRN number. Yes Auto
purchase_order_id FK Source PO. No Yes → purchase_orders.id
vendor_id FK Supplier. No Yes → vendors.id
warehouse_id FK Receiving warehouse. No Yes → warehouses.id
warehouse_bin_id FK Receiving bin. No Yes → warehouse_bins.id
receipt_date date Receipt date. Yes Yes
status string(20) draft, posted, cancelled. Yes Yes
vendor_invoice_no string(80) Vendor delivery note / invoice ref. No Yes
notes text Notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

goods_receipt_items

Inventory → Goods receipts (lines)

Qty received per line.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
goods_receipt_id FK Parent GRN. No Auto → goods_receipts.id
purchase_order_item_id FK PO line received. No Yes → purchase_order_items.id
product_id FK Product received. No Yes → products.id
description string Line description. No Yes
qty decimal(15,4) Received qty. No Yes
unit_cost decimal(15,2) Unit cost for inventory. No Yes
line_total decimal(15,2) Line cost total. No Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

purchase_invoices

Purchase → Purchase invoices

Vendor bill (accounts payable).

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Internal AP document number. Yes Auto
vendor_invoice_no string(50) Vendor bill number. No Yes
vendor_id FK Vendor. Yes Yes → vendors.id
purchase_order_id FK Matched PO. No Yes → purchase_orders.id
invoice_type string(20) goods, service, etc. No Yes
date date Invoice date. Yes Yes
received_date date Date bill received. No Yes
due_date date Payment due. No Yes
status string draft, approved, paid, etc. Yes Yes
notes text Notes. No Yes
attachment_path string Scanned bill path. No Yes
subtotal decimal(15,2) Subtotal. No Calc
tax_total decimal(15,2) Tax. No Calc
tds_amount decimal(18,2) TDS on bill. No Yes
total decimal(15,2) Bill total. Yes Calc
amount_paid decimal(18,2) Paid via vendor payments. No Calc
balance_amount decimal(18,2) Outstanding AP. No Calc
three_way_match_status string(20) PO–GRN–invoice match. No Calc
match_exceptions json Match discrepancy details. No No
aging_bucket string(10) AP aging bucket. No Calc
hold_reason string Payment hold reason. No Yes
dispute_reason text Dispute notes. No Yes
irn string(64) E-invoice IRN from vendor. No Yes
approved_at timestamp Approval time. No Auto
approved_by bigint Approver. No Auto
created_by bigint Creator. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

purchase_invoice_items

Purchase → Purchase invoices (lines)

Billed lines on a purchase invoice.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
purchase_invoice_id FK Parent invoice. No Auto → purchase_invoices.id
purchase_order_item_id FK Matched PO line. No Auto → purchase_order_items.id
goods_receipt_item_id FK Matched GRN line. No Auto → goods_receipt_items.id
product_id FK Product. No Yes → products.id
description string Description. No Yes
qty decimal(15,4) Billed qty. No Yes
unit_cost decimal(15,2) Unit cost. No Yes
tax_rate decimal(5,2) Tax rate. No Yes
line_total decimal(15,2) Line total. No Calc
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

vendor_payments

Purchase → Vendor payments

Payment to supplier; allocations split across invoices.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Payment number. Yes Auto
vendor_id FK Payee vendor. Yes Yes → vendors.id
payment_type string(20) invoice, advance, refund. No Yes
payment_mode string(20) neft, cheque, cash, etc. No Yes
purchase_invoice_id FK Legacy single-invoice link. No No → purchase_invoices.id
vendor_bank_account_id FK Bank account paid to. No Yes → vendor_bank_accounts.id
date date Payment date. Yes Yes
amount decimal(15,2) Payment amount. Yes Yes
method string Legacy method field. No Yes
reference string Legacy reference. No Yes
cheque_number string(20) Cheque number. No Yes
cheque_date date Cheque date. No Yes
transaction_reference string(50) Bank/UPI reference. No Yes
currency_code char(3) Currency. No Yes
exchange_rate decimal(12,6) FX rate. No Yes
tds_deducted decimal(18,2) TDS deducted. No Yes
bank_charges decimal(18,2) Bank charges. No Yes
base_currency_amount decimal(18,2) Amount in base currency. No Calc
status string(20) draft, scheduled, completed. Yes Yes
scheduled_date date Scheduled pay date. No Yes
processed_at timestamp When processed. No Auto
failure_reason string Failure message. No No
approved_at timestamp Approval time. No Auto
approved_by bigint Approver. No Auto
created_by bigint Creator. No Auto
notes text Notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

vendor_payment_allocations

Purchase → Vendor payments (allocations)

Splits a vendor payment across invoices or debit notes.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
vendor_payment_id FK Parent payment. No Yes → vendor_payments.id
purchase_invoice_id FK Invoice paid. No Yes → purchase_invoices.id
purchase_return_id FK Debit note adjusted. No Yes → purchase_returns.id
allocated_amount decimal(18,2) Amount allocated. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

purchase_returns

Purchase → Debit notes

Return to vendor / debit note reducing AP.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Debit note number. Yes Auto
vendor_id FK Vendor. Yes Yes → vendors.id
purchase_invoice_id FK Source vendor bill. No Yes → purchase_invoices.id
purchase_order_id FK Related PO. No Yes → purchase_orders.id
date date Document date. Yes Yes
reason_code string(50) Return reason. No Yes
reason_notes text Reason details. No Yes
currency_code char(3) Currency. No Yes
status string draft through settled. Yes Yes
notes text Notes. No Yes
subtotal decimal(15,2) Subtotal. No Calc
tax_total decimal(15,2) Tax. No Calc
total decimal(15,2) Debit total. Yes Calc
adjusted_amount decimal(18,2) Applied to AP. No Calc
refunded_amount decimal(18,2) Cash refunded. No Calc
balance_amount decimal(18,2) Remaining credit. No Calc
dispatched_at timestamp Goods dispatched to vendor. No Auto
settled_at timestamp Financial settlement. No Auto
approved_at timestamp Approved time. No Auto
approved_by bigint Approver. No Auto
created_by bigint Creator. No Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

purchase_return_items

Purchase → Debit notes (lines)

Returned qty/cost on a debit note.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
purchase_return_id FK Parent debit note. No Auto → purchase_returns.id
purchase_invoice_item_id FK Source invoice line. No Yes → purchase_invoice_items.id
purchase_order_item_id FK Source PO line. No Yes → purchase_order_items.id
product_id FK Product returned. No Yes → products.id
batch_id FK Batch/lot if tracked. No Yes → batches.id
description string Description. No Yes
qty decimal(15,4) Return qty. No Yes
unit_cost decimal(15,2) Unit cost. No Yes
tax_rate decimal(5,2) Tax rate. No Yes
line_total decimal(15,2) Line total. No Calc
item_reason string(100) Per-line return reason. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

product_categories

Inventory → Categories

Hierarchy for grouping products.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
name string Category name. Yes Yes
slug string URL-safe slug. No Yes
parent_id FK Parent category. No Yes → product_categories.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

warehouses

Inventory → Warehouses

Storage locations for stock.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
name string Warehouse name. Yes Yes
code string Short unique code. Yes Yes
address text Address. No Yes
stock_movements_frozen boolean Blocks GRN, transfers, adjustments, manual movements. No Yes
stock_movements_frozen_at timestamp When warehouse freeze was enabled. No Yes
stock_movements_frozen_reason string Optional freeze reason. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

warehouse_bins

Inventory → Bins

Sub-locations inside a warehouse.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
warehouse_id FK Parent warehouse. No Yes → warehouses.id
code string(64) Bin code (unique per warehouse). Yes Yes
name string Bin label. Yes Yes
zone string(120) Zone/aisle. No Yes
is_active boolean Active flag. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

products

Inventory → Products

SKU master for stockable items and services.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
category_id FK Product category. No Yes → product_categories.id
warehouse_id FK Default warehouse (legacy). No Yes → warehouses.id
name string Product name. Yes Yes
sku string Stock keeping unit. Yes Yes
image_path string Product image path. Yes Yes
unit string Unit of measure. No Yes
price decimal(12,2) Default selling price. Yes Yes
cost decimal(12,2) Default cost. No Yes
tax_rate decimal(5,2) Default tax rate. No Yes
qty decimal(15,4) Legacy on-hand (prefer stock_balances). Yes No
reorder_point decimal(15,4) Low-stock threshold. Yes Yes
valuation_method string(16) fifo, weighted_avg, etc. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

stock_balances

Inventory → Stock availability

On-hand qty per product and warehouse.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
product_id FK Product. Yes No → products.id
warehouse_id FK Warehouse. Yes No → warehouses.id
qty decimal(15,4) On-hand quantity. Yes No
reserved_qty decimal(15,4) Reserved for sales orders. Yes No
incoming_qty decimal(15,4) Expected inbound (PO/transfer). Yes No
in_transit_qty decimal(15,4) Qty in transit between warehouses. Yes No
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

stock_movements

Inventory → Stock movements

Read-only ledger of quantity changes.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
product_id FK Product moved. Yes No → products.id
warehouse_id FK From/source warehouse. Yes No → warehouses.id
to_warehouse_id FK Destination for transfers. No No → warehouses.id
warehouse_bin_id FK Bin if applicable. No No → warehouse_bins.id
type string in, out, transfer, adjustment, reservation. Yes No
qty decimal(15,4) Quantity moved (signed). Yes No
reference string Source document reference. Yes No
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

stock_transfers

Inventory → Stock transfers

Move stock between warehouses.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Transfer number. Yes Auto
from_warehouse_id FK Source warehouse. No Yes → warehouses.id
to_warehouse_id FK Destination warehouse. No Yes → warehouses.id
transfer_date date Transfer date. Yes Yes
expected_at date Expected arrival. No Yes
status string(20) draft, dispatched, received. Yes Yes
dispatched_at timestamp When goods left source. No Yes
received_at timestamp When goods arrived at destination. No Yes
notes text Notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

stock_adjustments

Inventory → Stock adjustments

Correct on-hand qty (shrinkage, migration).

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Adjustment number. Yes Auto
warehouse_id FK Warehouse adjusted. No Yes → warehouses.id
adjustment_date date Adjustment date. Yes Yes
status string(20) draft, posted. Yes Yes
reason string(120) Reason code. No Yes
notes text Notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

physical_counts

Inventory → Physical counts

Cycle or full count with variance posting.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
number string Count sheet number. Yes Auto
warehouse_id FK Warehouse counted. No Yes → warehouses.id
count_date date Count date. Yes Yes
status string(20) draft, posted. Yes Yes
notes text Notes. No Yes
inventory_frozen boolean Block movements during count. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

accounting_periods

Accounting → Accounting periods

Fiscal periods (monthly Apr–Mar); open allows JE posting.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
fiscal_year smallint FY ending year (e.g. 2026 = FY 2025-26). Yes Yes
period_code string Unique code e.g. FY2025-26-M04. Yes Auto
period_name string Display label. Yes Yes
start_date date Period start. Yes Yes
end_date date Period end. Yes Yes
status string open, closed, locked. Yes Auto
is_year_end boolean March period flag. No Auto
closing_notes text Notes on close. No Yes
reopen_reason string Required when reopening. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

chart_of_accounts

Accounting → Chart of accounts

General ledger account master.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
code string Unique GL code (max 20, alphanumeric/dash). Yes Yes
name string Account name. Yes Yes
description text Optional notes. No Yes
type string asset, liability, equity, revenue, expense. Yes Yes Must match parent type
parent_id FK Parent account in hierarchy. No Yes → chart_of_accounts.id
is_active boolean Inactive accounts hidden from journal pickers. Yes Yes
allow_posting boolean False for group accounts (has children). Yes Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

journal_entries

Accounting → Journal entries

Manual or system-posted GL header.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
entry_number string JE-YYYY-NNNNN when posted. Yes Auto
date date Posting date. Yes Yes
reference string External reference. Yes Yes
description text Entry description. Yes Yes
status string draft, posted, reversed. Yes Auto
source string manual, sales, reversal. No Auto
posted_at timestamp When entry was posted. No Auto
reverses_journal_entry_id FK Original JE for reversal rows. No Auto → journal_entries.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

journal_entry_lines

Accounting → Journal entries (lines)

Debit/credit lines; must balance per entry.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
journal_entry_id FK Parent journal entry. No Auto → journal_entries.id
account_id FK GL account. No Yes → chart_of_accounts.id
cost_center_id FK Optional cost center / project. No Yes → cost_centers.id
debit decimal(15,2) Debit amount (base currency). No Yes
credit decimal(15,2) Credit amount (base currency). No Yes
currency_code char(3) Optional transaction currency. No Yes
foreign_debit decimal(18,2) Debit in foreign currency. No Yes
foreign_credit decimal(18,2) Credit in foreign currency. No Yes
exchange_rate decimal(18,6) Base per 1 foreign unit. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

currencies

Accounting → Currencies

ISO currency master; one base (functional) currency per tenant.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
code char(3) ISO 4217 code. Yes Yes
name string Currency name. Yes Yes
symbol string Display symbol. No Yes
decimal_places tinyint Rounding precision. Yes Yes
is_base boolean Functional currency flag. Yes Yes
is_active boolean Available for transactions. Yes Yes
fx_gain_account_id FK FX gain GL (optional). No Yes → chart_of_accounts.id
fx_loss_account_id FK FX loss GL (optional). No Yes → chart_of_accounts.id
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

exchange_rates

Accounting → Exchange rates

Daily rates: 1 foreign unit = rate × base currency.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
currency_code char(3) Foreign currency. Yes Yes → currencies.code
rate_date date Effective date. Yes Yes
rate decimal(18,6) Base units per 1 foreign. Yes Yes
source string Rate source (manual, RBI, etc.). No Yes
notes text Optional notes. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

cost_centers

Accounting → Cost centers

Department, cost center, or project dimension.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
code string Unique code. Yes Yes
name string Display name. Yes Yes
center_type string department, cost_center, project. Yes Yes
parent_id FK Optional parent. No Yes → cost_centers.id
is_active boolean Available on journals. Yes Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

budgets

Accounting → Budgets

Budget header by cost center and period.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
budget_number string BG-YYYY-NNNNN. Yes Auto
cost_center_id FK Dimension. Yes Yes → cost_centers.id
period_from date Start date. Yes Yes
period_to date End date. Yes Yes
status string draft, active, closed. Yes Auto
total_amount decimal(15,2) Sum of lines. Yes Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

budget_lines

Accounting → Budgets (lines)

Budgeted amount per expense/revenue GL account.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
budget_id FK Parent budget. No Auto → budgets.id
chart_of_account_id FK GL account. No Yes → chart_of_accounts.id
amount decimal(15,2) Budgeted amount. No Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

recurring_journal_templates

Accounting → Recurring journals

Scheduled JE templates (rent, accruals, etc.).

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
template_number string RJ-YYYY-NNNNN. Yes Auto
frequency string monthly, quarterly, annually. Yes Yes
day_of_month tinyint Run day (1–28). Yes Yes
next_run_date date Next scheduled run. No Auto
status string draft, active, paused. Yes Auto
auto_post boolean Post JE immediately when run. Yes Yes
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

recurring_journal_runs

Accounting → Recurring journals (history)

Links each run to generated journal entry.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
recurring_journal_template_id FK Source template. No Auto → recurring_journal_templates.id
journal_entry_id FK Generated JE. No Auto → journal_entries.id
run_date date Posting date used. Yes Auto
created_at timestamp When the row was created. No No
updated_at timestamp When the row was last updated. No No

tenant_activity_logs

Workspace → Activity log

Audit-style timeline of workspace changes.

Column Type What it is used for List screen Create / edit form Belongs to / links
id bigint Primary key. No No
causer_id bigint User who performed the action. No Auto
causer_name string Display name at time of action. Yes Auto
action string Action key (e.g. created, updated). Yes Auto
subject_type string Polymorphic model class. No Auto
subject_id bigint Polymorphic model ID. No Auto
properties json Extra context payload. No Auto
created_at timestamp When the action occurred. Yes Auto
updated_at timestamp Row update time. No No