This commit is contained in:
gsinghpal
2026-05-16 13:18:52 -04:00
parent 191a9c82be
commit 9ebf89bde2
1080 changed files with 0 additions and 1197 deletions

View File

@@ -0,0 +1,15 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
export class AgingBucketStrip extends Component {
static template = "fusion_accounting_followup.AgingBucketStrip";
static props = {
aging: { type: Object },
};
bucketWidth(bucket) {
const total = this.props.aging.total_amount || 1;
return ((bucket.amount / total) * 100).toFixed(2) + "%";
}
}

View File

@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_accounting_followup.AgingBucketStrip">
<div class="mt-2">
<div class="fu-aging-strip">
<div t-foreach="props.aging.buckets" t-as="b" t-key="b.name"
class="bucket" t-att-data-name="b.name"
t-att-style="'width: ' + bucketWidth(b)"
t-att-title="b.name + ': $' + (b.amount or 0).toFixed(2)"/>
</div>
<div class="d-flex justify-content-between text-muted" style="font-size: 0.7rem;">
<span>Current</span>
<span>30</span>
<span>60</span>
<span>90</span>
<span>120+</span>
</div>
</div>
</t>
</templates>

View File

@@ -0,0 +1,10 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
export class AiTextPanel extends Component {
static template = "fusion_accounting_followup.AiTextPanel";
static props = {
text: { type: Object },
};
}

View File

@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_accounting_followup.AiTextPanel">
<div class="fu-ai-text-panel mt-3">
<h5>AI-Generated Follow-up Text</h5>
<div class="ai-subject">
Subject: <t t-esc="props.text.subject"/>
</div>
<div class="ai-body">
<t t-esc="props.text.body"/>
</div>
<div class="key-points" t-if="props.text.key_points and props.text.key_points.length">
<strong>Key points:</strong>
<ul>
<li t-foreach="props.text.key_points" t-as="point" t-key="point_index">
<t t-esc="point"/>
</li>
</ul>
</div>
<div class="text-muted mt-2" style="font-size: 0.75rem;">
Tone used: <t t-esc="props.text.tone_used or props.text.tone or 'gentle'"/>
</div>
</div>
</t>
</templates>

View File

@@ -0,0 +1,15 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
export class FollowupHistoryTable extends Component {
static template = "fusion_accounting_followup.FollowupHistoryTable";
static props = {
history: { type: Object },
};
formatDate(s) {
if (!s) return "";
return s.slice(0, 10);
}
}

View File

@@ -0,0 +1,33 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_accounting_followup.FollowupHistoryTable">
<div class="mt-4">
<h5>Follow-up History (<t t-esc="props.history.count or 0"/>)</h5>
<table t-if="props.history.runs and props.history.runs.length" class="fu-history-table">
<thead>
<tr>
<th>Date</th>
<th>Level</th>
<th>Tone</th>
<th>State</th>
<th class="text-end">Overdue</th>
</tr>
</thead>
<tbody>
<tr t-foreach="props.history.runs" t-as="run" t-key="run.id">
<td><t t-esc="formatDate(run.date)"/></td>
<td><t t-esc="run.level_name or '-'"/></td>
<td><t t-esc="run.tone_used or '-'"/></td>
<td><t t-esc="run.state"/></td>
<td class="text-end">
<t t-if="run.overdue_amount">$<t t-esc="run.overdue_amount.toFixed(2)"/></t>
</td>
</tr>
</tbody>
</table>
<div t-else="" class="text-muted">No history yet.</div>
</div>
</t>
</templates>

View File

@@ -0,0 +1,15 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
import { RiskBadge } from "../risk_badge/risk_badge";
export class PartnerCard extends Component {
static template = "fusion_accounting_followup.PartnerCard";
static props = {
partner: { type: Object },
selected: { type: Boolean, optional: true },
onSelect: { type: Function },
formatCurrency: { type: Function },
};
static components = { RiskBadge };
}

View File

@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_accounting_followup.PartnerCard">
<div class="o_fusion_followup_card"
t-att-class="props.selected ? 'selected' : ''"
t-on-click="props.onSelect">
<div class="o_fusion_followup_card_header">
<div class="partner-name"><t t-esc="props.partner.partner_name"/></div>
<div>
<span class="fu-status-badge" t-att-data-status="props.partner.status">
<t t-esc="props.partner.status"/>
</span>
</div>
</div>
<div class="partner-numbers">
<div>
<span class="label">Overdue:</span>
<span class="value">$<t t-esc="props.formatCurrency(props.partner.overdue_amount)"/></span>
</div>
<div>
<span class="label">Lines:</span>
<span class="value"><t t-esc="props.partner.overdue_line_count or 0"/></span>
</div>
<div>
<span class="label">Risk:</span>
<RiskBadge band="props.partner.risk_band" score="props.partner.risk_score"/>
</div>
<div t-if="props.partner.last_level_name">
<span class="label">Last:</span>
<span class="value"><t t-esc="props.partner.last_level_name"/></span>
</div>
</div>
</div>
</t>
</templates>

View File

@@ -0,0 +1,11 @@
/** @odoo-module **/
import { Component } from "@odoo/owl";
export class RiskBadge extends Component {
static template = "fusion_accounting_followup.RiskBadge";
static props = {
band: { type: String, optional: true },
score: { type: Number, optional: true },
};
}

View File

@@ -0,0 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<templates xml:space="preserve">
<t t-name="fusion_accounting_followup.RiskBadge">
<span class="fu-risk-badge" t-att-data-band="props.band || 'low'">
<t t-esc="props.band || 'low'"/>
<t t-if="props.score !== undefined"> (<t t-esc="props.score"/>)</t>
</span>
</t>
</templates>