maiven gateway · online··
manifest · 1d ago
Sign in
Back to catalog
MAIVENmodelstaging

stg_postgres__customer_invoices

staging view

Customer invoices, cleaned.

Definition

AR invoice headers per customer (reusing the ecommerce customer + order). Open balance (`total_amount` - `amount_received`) ties to the AR control account.

21 of 21
Column
Description
Tests · PII
customer_invoice_id
Primary key — UInt64.
4 tests
invoice_number
Customer-facing invoice number. Unique.
2 tests
legal_entity_id
FK to `stg_postgres__legal_entities.legal_entity_id`. Nullable.
customer_id
FK to ecommerce `stg_postgres__customers.customer_id`. NOT NULL.
order_id
FK to ecommerce `stg_postgres__orders.order_id`. Nullable.
period_id
FK to fiscal_periods.period_id (not staged in this slice). NOT NULL.
1 test
journal_entry_id
FK to `stg_postgres__gl_journal_entries.journal_entry_id`. Nullable.
invoice_date
Invoice date. Date.
invoice_day
Calendar date — toDate(invoice_date).
due_date
Payment due date. Date.
currency
Transaction currency, uppercased.
fx_rate_id
FK to `stg_postgres__fx_rates.fx_rate_id`. Nullable.
subtotal_amount
Pre-tax total in txn currency. Decimal(12,2).
tax_amount
Tax total in txn currency. Decimal(12,2).
total_amount
Grand total in txn currency. Decimal(12,2).
base_total_amount
Grand total in functional USD. Decimal(14,2).
amount_received
Cumulative received in txn currency. Decimal(12,2).
status
Lifecycle — draft / open / partially_paid / paid / void / written_off.
1 test
source_created_at
Row insert timestamp from the source DB. DateTime64(6).
source_updated_at
Row update timestamp from the source DB. DateTime64(6).
airbyte_extracted_at
When the loader extracted this row from postgres-source.