From 1ebff01d35c4aa4bfc2d36e9ec8955c73b810925 Mon Sep 17 00:00:00 2001 From: gsinghpal Date: Sun, 19 Apr 2026 23:55:45 -0400 Subject: [PATCH] feat(fusion_accounting_reports): seed 3 partner-grouped reports Adds Aged Receivable, Aged Payable, and Partner Ledger as fusion.report records using the new compute_partner_grouped engine method. REPORT_TYPES is extended with aged_receivable / aged_payable / partner_ledger so each report has a unique report_type. The HTTP controller dispatches these to engine.compute_partner_grouped with the appropriate account_type via PARTNER_GROUPED_ACCOUNT_TYPE. Output includes per-partner aging buckets: current, 1-30, 31-60, 61-90, 90+ days. Westin total: 4 + 4 + 3 = 11 of Enterprise's 22 standard reports. Made-with: Cursor --- fusion_accounting_reports/__manifest__.py | 3 +++ .../controllers/reports_controller.py | 19 ++++++++++++++++++- .../data/report_aged_payable.xml | 14 ++++++++++++++ .../data/report_aged_receivable.xml | 14 ++++++++++++++ .../data/report_partner_ledger.xml | 14 ++++++++++++++ .../models/fusion_report.py | 3 +++ 6 files changed, 66 insertions(+), 1 deletion(-) create mode 100644 fusion_accounting_reports/data/report_aged_payable.xml create mode 100644 fusion_accounting_reports/data/report_aged_receivable.xml create mode 100644 fusion_accounting_reports/data/report_partner_ledger.xml diff --git a/fusion_accounting_reports/__manifest__.py b/fusion_accounting_reports/__manifest__.py index a7a254a3..a5c7f068 100644 --- a/fusion_accounting_reports/__manifest__.py +++ b/fusion_accounting_reports/__manifest__.py @@ -40,6 +40,9 @@ menu hides; the engine and AI tools remain available for the chat. 'data/report_executive_summary.xml', 'data/report_tax_report.xml', 'data/report_annual_statements.xml', + 'data/report_aged_receivable.xml', + 'data/report_aged_payable.xml', + 'data/report_partner_ledger.xml', 'data/cron.xml', 'reports/report_pdf_template.xml', 'wizards/xlsx_export_wizard_views.xml', diff --git a/fusion_accounting_reports/controllers/reports_controller.py b/fusion_accounting_reports/controllers/reports_controller.py index cc020a46..5db231c6 100644 --- a/fusion_accounting_reports/controllers/reports_controller.py +++ b/fusion_accounting_reports/controllers/reports_controller.py @@ -18,7 +18,16 @@ from ..services.date_periods import Period _logger = logging.getLogger(__name__) -REPORT_TYPES = {'pnl', 'balance_sheet', 'trial_balance', 'general_ledger'} +REPORT_TYPES = { + 'pnl', 'balance_sheet', 'trial_balance', 'general_ledger', + 'aged_receivable', 'aged_payable', 'partner_ledger', +} + +PARTNER_GROUPED_ACCOUNT_TYPE = { + 'aged_receivable': 'asset_receivable', + 'aged_payable': 'liability_payable', + 'partner_ledger': 'asset_receivable', +} def _parse_date(value): @@ -76,6 +85,14 @@ class FusionReportsController(http.Controller): if report_type == 'trial_balance': period = _build_period(date_from, date_to) return engine.compute_trial_balance(period, company_id=company_id) + if report_type in PARTNER_GROUPED_ACCOUNT_TYPE: + period = _build_period(date_from, date_to) + return engine.compute_partner_grouped( + period, + account_type=PARTNER_GROUPED_ACCOUNT_TYPE[report_type], + comparison=comparison, + company_id=company_id, + ) # general_ledger period = _build_period(date_from, date_to) return engine.compute_gl(period, company_id=company_id) diff --git a/fusion_accounting_reports/data/report_aged_payable.xml b/fusion_accounting_reports/data/report_aged_payable.xml new file mode 100644 index 00000000..17bd24c5 --- /dev/null +++ b/fusion_accounting_reports/data/report_aged_payable.xml @@ -0,0 +1,14 @@ + + + + Aged Payable + aged_payable + aged_payable + 36 + Per-vendor outstanding payables, bucketed by aging. + + + + diff --git a/fusion_accounting_reports/data/report_aged_receivable.xml b/fusion_accounting_reports/data/report_aged_receivable.xml new file mode 100644 index 00000000..0136d715 --- /dev/null +++ b/fusion_accounting_reports/data/report_aged_receivable.xml @@ -0,0 +1,14 @@ + + + + Aged Receivable + aged_receivable + aged_receivable + 35 + Per-customer outstanding receivables, bucketed by aging. + + + + diff --git a/fusion_accounting_reports/data/report_partner_ledger.xml b/fusion_accounting_reports/data/report_partner_ledger.xml new file mode 100644 index 00000000..9131de4c --- /dev/null +++ b/fusion_accounting_reports/data/report_partner_ledger.xml @@ -0,0 +1,14 @@ + + + + Partner Ledger + partner_ledger + partner_ledger + 40 + Per-partner ledger combining receivable and payable activity. + + + + diff --git a/fusion_accounting_reports/models/fusion_report.py b/fusion_accounting_reports/models/fusion_report.py index d14c7eb8..47b9d6c4 100644 --- a/fusion_accounting_reports/models/fusion_report.py +++ b/fusion_accounting_reports/models/fusion_report.py @@ -13,6 +13,9 @@ REPORT_TYPES = [ ('balance_sheet', 'Balance Sheet'), ('trial_balance', 'Trial Balance'), ('general_ledger', 'General Ledger'), + ('aged_receivable', 'Aged Receivable'), + ('aged_payable', 'Aged Payable'), + ('partner_ledger', 'Partner Ledger'), ]