Where each column of the Invoices list is stored in the external data warehouse.
Screen: Invoices → Invoices list
Tables: invoice, ar_tran, client
Invoices grid
| UI element | Table | Column | Notes |
|---|---|---|---|
| Invoice | invoice |
invoice_number |
|
| Status | invoice |
status |
|
| Aiwyn Draft Invoice | invoice |
ar_tran_id |
Foreign key to the ar_tran row created when the draft invoice was posted. |
| Client |
invoice → ar_tran → client
|
ar_tran_id → client_id → name
|
Joined through the linked ar_tran row. |
| Client ID |
invoice → ar_tran → client
|
ar_tran_id → client_id → client_ref
|
Same join path as Client. |
| Due Date | invoice |
due_date |
Not set on any screen; calculated from the client's payment terms. |
| Invoice Date | ar_tran |
transaction_date |
Sourced from the linked ar_tran row, not invoice.created_at. |
| Invoice Amount / Outstanding | ar_tran |
amount |
Computed from the linked ar_tran plus its allocations, not stored directly on invoice. |
Reading the mapping
-
invoicecarries the identity;ar_trancarries the money and the date. Client, Invoice Date and both amount columns resolve throughinvoice.ar_tran_id. An invoice report built frominvoicealone has a number and a status and nothing else. -
Invoice Date is not
invoice.created_at. The grid showsar_tran.transaction_date. Using the creation timestamp shifts dates whenever posting and transaction dates differ. -
Outstanding is derived, not stored. It comes from the linked
ar_tranand its allocations, so it must be recomputed rather than read.
Related
- Data warehouse field mapping:
ar_tran / payment - Invoices list reference
- Invoice status reference