loopable / platform /model /topics /receivables.yml
fsanyoto's picture
Deploy AIOS web (React glide grid + FastAPI slice)
c14ceee verified
Raw
History Blame Contribute Delete
1.65 kB
# Topic: receivables β€” customer invoices/credit notes and what remains unpaid. Company-level
# (AR is consolidated β€” the Collections page convention). Store-only topic (live path = the AR
# module's own domains; the validator compares against a direct live aggregate).
key: receivables
label: Receivables (customer invoices)
entity: account.move
scope:
posted_only: "posted customer documents only (out_invoice + out_refund)"
basis: "amount_residual_signed nets credit notes (+ for invoices, βˆ’ for refunds)"
level: "company-level (HQ) β€” receivables are consolidated, no BU split"
date_field: "invoice date; overdue judged by invoice_date_due vs today"
grain: "one row per posted customer invoice/credit note"
store:
table: account_move
alias: m
join: ""
date_col: "m.invoice_date"
scope_sql: "m.state = 'posted' AND m.move_type IN ('out_invoice', 'out_refund')"
dims:
partner: {col: "m.partner_id", name_col: "m.partner_name", label: "Customer"}
payment_state: {col: "m.payment_state", name_col: null, label: "Payment state"}
ai_context: >
Customer receivables at document grain. "Outstanding" = the signed residual (credit notes net
against invoices). "Overdue" = residual on documents past their due date as of today. AR is
company-level: do not BU-filter. For who-to-call prioritization the platform's Collections
worklist is the richer surface; this topic answers totals, aging-style questions, and
per-customer exposure. Omit date filters when asking "what is outstanding NOW" β€” a date window
restricts by INVOICE date, which is usually not what an outstanding-balance question means.