feat(fusion_accounting_reports): drill_down_dialog OWL component
Made-with: Cursor
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
'name': 'Fusion Accounting Reports',
|
||||
'version': '19.0.1.0.25',
|
||||
'version': '19.0.1.0.26',
|
||||
'category': 'Accounting/Accounting',
|
||||
'summary': 'AI-augmented financial reports (P&L, balance sheet, trial balance, GL).',
|
||||
'description': """
|
||||
@@ -48,6 +48,8 @@ menu hides; the engine and AI tools remain available for the chat.
|
||||
'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',
|
||||
'fusion_accounting_reports/static/src/components/drill_down_dialog/drill_down_dialog.js',
|
||||
'fusion_accounting_reports/static/src/components/drill_down_dialog/drill_down_dialog.xml',
|
||||
],
|
||||
},
|
||||
'installable': True,
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
/** @odoo-module **/
|
||||
|
||||
import { Component } from "@odoo/owl";
|
||||
|
||||
export class DrillDownDialog extends Component {
|
||||
static template = "fusion_accounting_reports.DrillDownDialog";
|
||||
static props = {
|
||||
drill: { type: Object },
|
||||
onClose: { type: Function },
|
||||
};
|
||||
|
||||
formatAmount(amount) {
|
||||
if (amount === null || amount === undefined) return "";
|
||||
return new Intl.NumberFormat(undefined, {
|
||||
minimumFractionDigits: 2, maximumFractionDigits: 2,
|
||||
}).format(amount);
|
||||
}
|
||||
|
||||
onBackdropClick(ev) {
|
||||
if (ev.target.classList.contains('modal-backdrop')) {
|
||||
this.props.onClose();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<templates xml:space="preserve">
|
||||
|
||||
<t t-name="fusion_accounting_reports.DrillDownDialog">
|
||||
<div class="modal modal-backdrop"
|
||||
style="display: block; background: rgba(0,0,0,0.5); position: fixed; top:0; left:0; right:0; bottom:0; z-index: 1050;"
|
||||
t-on-click="onBackdropClick">
|
||||
<div class="modal-dialog modal-xl"
|
||||
style="margin: 5vh auto; max-width: 90%;">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5>Drill-down: <t t-esc="props.drill.label || ''"/></h5>
|
||||
<button class="btn-close" t-on-click="props.onClose">×</button>
|
||||
</div>
|
||||
<div class="modal-body" style="max-height: 70vh; overflow-y: auto;">
|
||||
<div t-if="!props.drill.rows or props.drill.rows.length === 0" class="text-muted">
|
||||
No journal items found.
|
||||
</div>
|
||||
<table t-else="" class="table table-sm">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Date</th>
|
||||
<th>Move</th>
|
||||
<th>Account</th>
|
||||
<th>Partner</th>
|
||||
<th>Description</th>
|
||||
<th class="text-end">Debit</th>
|
||||
<th class="text-end">Credit</th>
|
||||
<th class="text-end">Balance</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
<tr t-foreach="props.drill.rows" t-as="row" t-key="row.move_line_id">
|
||||
<td><t t-esc="row.date"/></td>
|
||||
<td><t t-esc="row.move_name"/></td>
|
||||
<td>
|
||||
<span t-att-title="row.account_name">
|
||||
<t t-esc="row.account_code"/>
|
||||
</span>
|
||||
</td>
|
||||
<td><t t-esc="row.partner_name || ''"/></td>
|
||||
<td><t t-esc="row.label"/></td>
|
||||
<td class="text-end"><t t-esc="formatAmount(row.debit)"/></td>
|
||||
<td class="text-end"><t t-esc="formatAmount(row.credit)"/></td>
|
||||
<td class="text-end"><t t-esc="formatAmount(row.balance)"/></td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<span class="text-muted me-auto"><t t-esc="props.drill.count"/> rows</span>
|
||||
<button class="btn_report" t-on-click="props.onClose">Close</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</t>
|
||||
|
||||
</templates>
|
||||
Reference in New Issue
Block a user