Files
Odoo-Modules/fusion_accounting_ai/static/src/components/chat/approval_card.js
gsinghpal 6c72f2ab49 refactor(fusion_accounting): move AI module code into fusion_accounting_ai sub-module
git mv preserves history. fusion_accounting/ retains only __manifest__.py,
__init__.py, CLAUDE.md, and docs/ — the meta-module shell. All Python,
data, views, security, services, static, tests, wizards, report move to
fusion_accounting_ai/. Manifest data list updated; security.xml move to
_core deferred to Task 12.

Made-with: Cursor
2026-04-18 21:45:06 -04:00

38 lines
1.1 KiB
JavaScript

/** @odoo-module **/
import { Component } from "@odoo/owl";
export class FusionApprovalCard extends Component {
static template = "fusion_accounting.ApprovalCard";
static props = ["approval", "onApprove", "onReject"];
get toolLabel() {
const name = this.props.approval.tool_name || "";
// Short labels for common tools
const labels = {
create_payroll_journal_entry: "Payroll JE",
create_vendor_bill: "Vendor Bill",
register_bill_payment: "Bill Payment",
create_expense_entry: "Expense",
register_hst_payment: "HST Payment",
apply_payment: "Payment",
send_followup: "Follow-up",
flag_entry: "Flag",
};
return labels[name] || name.replace(/_/g, " ").replace(/\b\w/g, c => c.toUpperCase());
}
formatAmount(val) {
if (!val) return "";
return Number(val).toLocaleString("en-CA", { minimumFractionDigits: 2, maximumFractionDigits: 2 });
}
approve() {
this.props.onApprove(this.props.approval.id);
}
reject() {
this.props.onReject(this.props.approval.id);
}
}