| |
| |
| |
| key: gl_lines |
| label: General ledger (raw, posted) |
| entity: account.move.line |
| |
| |
| scope: |
| posted_only: "journal entries with state = posted only" |
| basis: "RAW GL β debit-positive balance; expenses positive, income negative (negated in metrics)" |
| level: "company-level (HQ) β no business-unit split" |
| date_field: "accounting date (account.move.line.date)" |
| grain: "one row per posted journal line; time-filterable by accounting date" |
|
|
| store: |
| table: account_move_line |
| alias: l |
| join: "JOIN account_move m ON m.id = l.move_id JOIN account_account a ON a.id = l.account_id" |
| date_col: "l.date" |
| scope_sql: "m.state = 'posted'" |
| dims: |
| account: {col: "l.account_id", name_col: "l.account_name", label: "GL account"} |
| account_type: {col: "a.account_type", name_col: null, label: "Account type"} |
| partner: {col: "l.partner_id", name_col: "l.partner_name", label: "Partner"} |
|
|
| ai_context: > |
| The raw posted general ledger. Use for operating-expense analysis (opex), GL-basis revenue, and |
| ledger drill-downs β the same basis as the Expenses dashboard. Expense-type accounts |
| ('expense', 'expense_depreciation') carry opex; 'expense_direct_cost' is COGS and is EXCLUDED |
| from opex by definition. Income accounts store credit-negative balances; the gl_revenue metric |
| negates them to read positively. This topic is company-level: business-unit filters do not |
| apply here (use sales_lines for BU questions). The newest month is often still being booked β |
| a sharply lower final month usually means an OPEN period, not a cost win (close-lag). |
| |