diff --git a/fusion_accounting_reports/__manifest__.py b/fusion_accounting_reports/__manifest__.py index 7c0136e6..e6c73617 100644 --- a/fusion_accounting_reports/__manifest__.py +++ b/fusion_accounting_reports/__manifest__.py @@ -1,6 +1,6 @@ { 'name': 'Fusion Accounting Reports', - 'version': '19.0.1.0.24', + 'version': '19.0.1.0.25', 'category': 'Accounting/Accounting', 'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).', 'description': """ @@ -46,6 +46,8 @@ menu hides; the engine and AI tools remain available for the chat. 'fusion_accounting_reports/static/src/views/report_viewer/report_viewer.js', 'fusion_accounting_reports/static/src/views/report_viewer/report_viewer.xml', 'fusion_accounting_reports/static/src/views/report_viewer/report_viewer_view.js', + 'fusion_accounting_reports/static/src/components/report_table/report_table.js', + 'fusion_accounting_reports/static/src/components/report_table/report_table.xml', ], }, 'installable': True, diff --git a/fusion_accounting_reports/static/src/components/report_table/report_table.js b/fusion_accounting_reports/static/src/components/report_table/report_table.js new file mode 100644 index 00000000..5bc7da93 --- /dev/null +++ b/fusion_accounting_reports/static/src/components/report_table/report_table.js @@ -0,0 +1,36 @@ +/** @odoo-module **/ + +import { Component } from "@odoo/owl"; + +export class ReportTable extends Component { + static template = "fusion_accounting_reports.ReportTable"; + static props = { + result: { type: Object }, + onDrillDown: { type: Function, optional: true }, + }; + + formatAmount(amount) { + if (amount === null || amount === undefined) return ""; + return new Intl.NumberFormat(undefined, { + minimumFractionDigits: 2, maximumFractionDigits: 2, + }).format(amount); + } + + onRowClick(row) { + if (row.account_id && this.props.onDrillDown) { + this.props.onDrillDown(row.account_id, row.label); + } + } + + rowClass(row) { + const classes = ['report-row', `level-${row.level || 0}`]; + if (row.is_subtotal) classes.push('subtotal'); + if (row.account_id) classes.push('drillable'); + return classes.join(' '); + } + + varianceClass(pct) { + if (pct === null || pct === undefined) return ""; + return pct > 0 ? 'variance-pos' : pct < 0 ? 'variance-neg' : ''; + } +} diff --git a/fusion_accounting_reports/static/src/components/report_table/report_table.xml b/fusion_accounting_reports/static/src/components/report_table/report_table.xml new file mode 100644 index 00000000..1a143d8f --- /dev/null +++ b/fusion_accounting_reports/static/src/components/report_table/report_table.xml @@ -0,0 +1,45 @@ + + + + +
+ + + + + + + + + + + + + + + + + + + + + +
LineAmount + + Variance %
+ + + + + + + + % + +
+
+
+ +