This commit is contained in:
gsinghpal
2026-06-03 19:50:45 -04:00
parent 837198fc8a
commit 2f8b6b3ae0
5 changed files with 169 additions and 25 deletions

View File

@@ -3,7 +3,7 @@
# License OPL-1 (Odoo Proprietary License v1.0)
{
'name': 'Fusion Reports — Templates',
'version': '19.0.1.2.0',
'version': '19.0.1.3.0',
'category': 'Tools/Reports',
'summary': 'Branded PDF templates for Quotation, Sales Order, Invoice, Delivery, Purchase Order, and Payment Receipt.',
'description': """

View File

@@ -78,14 +78,18 @@
</tbody>
</table>
<t t-set="has_discount" t-value="any(l.discount for l in doc.invoice_line_ids)"/>
<t t-set="col_count" t-value="8 if has_discount else 7"/>
<t t-set="total_discount" t-value="sum(l.price_unit * l.quantity * l.discount / 100.0 for l in doc.invoice_line_ids if not l.display_type or l.display_type == 'product')"/>
<table class="bordered">
<thead>
<tr>
<th style="width: 12%;">SKU</th>
<th class="text-start" style="width: 40%;">DESCRIPTION</th>
<th style="width: 8%;">QTY</th>
<th style="width: 8%;">UOM</th>
<th style="width: 12%;">UNIT PRICE</th>
<th style="width: 11%;">SKU</th>
<th class="text-start" style="width: 33%;">DESCRIPTION</th>
<th style="width: 7%;">QTY</th>
<th style="width: 7%;">UOM</th>
<th style="width: 13%;">UNIT PRICE</th>
<th t-if="has_discount" style="width: 9%;">DISCOUNT</th>
<th style="width: 8%;">TAX</th>
<th style="width: 12%;">AMOUNT</th>
</tr>
@@ -93,10 +97,10 @@
<tbody>
<t t-foreach="doc.invoice_line_ids" t-as="line">
<t t-if="line.display_type == 'line_section'">
<tr class="section-row"><td colspan="7"><strong t-field="line.name"/></td></tr>
<tr class="section-row"><td t-att-colspan="col_count"><strong t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'line_note'">
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
<tr class="note-row"><td t-att-colspan="col_count"><span t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'product' or not line.display_type">
<tr>
@@ -109,6 +113,10 @@
<td class="text-end">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
<td t-if="has_discount" class="text-center">
<t t-if="line.discount"><span t-esc="line.discount"/>%</t>
<t t-else="">-</t>
</td>
<td class="text-center">
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or '-'"/>
</td>
@@ -139,9 +147,23 @@
<tr>
<td style="min-width: 150px;">Subtotal</td>
<td class="text-end" style="min-width: 110px;">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
<span t-out="doc.amount_untaxed + total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<t t-if="has_discount">
<tr>
<td>Discount</td>
<td class="text-end">
<span t-out="-total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<tr>
<td>Net Amount</td>
<td class="text-end">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
</t>
<tr>
<td>Taxes</td>
<td class="text-end">
@@ -254,25 +276,29 @@
</tbody>
</table>
<t t-set="has_discount" t-value="any(l.discount for l in doc.invoice_line_ids)"/>
<t t-set="col_count" t-value="8 if has_discount else 7"/>
<t t-set="total_discount" t-value="sum(l.price_unit * l.quantity * l.discount / 100.0 for l in doc.invoice_line_ids if not l.display_type or l.display_type == 'product')"/>
<table class="bordered">
<thead>
<tr>
<th style="width: 10%;">SKU</th>
<th class="text-start" style="width: 40%;">DESCRIPTION</th>
<th class="text-start" style="width: 32%;">DESCRIPTION</th>
<th style="width: 8%;">QTY</th>
<th style="width: 8%;">UOM</th>
<th style="width: 12%;">UNIT PRICE</th>
<th t-if="has_discount" style="width: 10%;">DISCOUNT</th>
<th style="width: 10%;">TAX</th>
<th style="width: 12%;">AMOUNT</th>
<th style="width: 10%;">AMOUNT</th>
</tr>
</thead>
<tbody>
<t t-foreach="doc.invoice_line_ids" t-as="line">
<t t-if="line.display_type == 'line_section'">
<tr class="section-row"><td colspan="7"><strong t-field="line.name"/></td></tr>
<tr class="section-row"><td t-att-colspan="col_count"><strong t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'line_note'">
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
<tr class="note-row"><td t-att-colspan="col_count"><span t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'product' or not line.display_type">
<tr>
@@ -285,6 +311,10 @@
<td class="text-end">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
<td t-if="has_discount" class="text-center">
<t t-if="line.discount"><span t-esc="line.discount"/>%</t>
<t t-else="">-</t>
</td>
<td class="text-center">
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or '-'"/>
</td>
@@ -315,9 +345,23 @@
<tr>
<td style="min-width: 200px;">Subtotal</td>
<td class="text-end" style="min-width: 150px;">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
<span t-out="doc.amount_untaxed + total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<t t-if="has_discount">
<tr>
<td>Discount</td>
<td class="text-end">
<span t-out="-total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<tr>
<td>Net Amount</td>
<td class="text-end">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
</t>
<tr>
<td>Taxes</td>
<td class="text-end">

View File

@@ -64,14 +64,18 @@
</tbody>
</table>
<t t-set="has_discount" t-value="any(l.discount for l in doc.order_line)"/>
<t t-set="col_count" t-value="8 if has_discount else 7"/>
<t t-set="total_discount" t-value="sum(l.price_unit * l.product_uom_qty * l.discount / 100.0 for l in doc.order_line if not l.display_type or l.display_type == 'product')"/>
<table class="bordered">
<thead>
<tr>
<th style="width: 12%;">SKU</th>
<th class="text-start" style="width: 38%;">DESCRIPTION</th>
<th style="width: 8%;">QTY</th>
<th style="width: 8%;">UOM</th>
<th style="width: 14%;">UNIT PRICE</th>
<th style="width: 11%;">SKU</th>
<th class="text-start" style="width: 33%;">DESCRIPTION</th>
<th style="width: 7%;">QTY</th>
<th style="width: 7%;">UOM</th>
<th style="width: 13%;">UNIT PRICE</th>
<th t-if="has_discount" style="width: 9%;">DISCOUNT</th>
<th style="width: 8%;">TAX</th>
<th style="width: 12%;">AMOUNT</th>
</tr>
@@ -79,10 +83,10 @@
<tbody>
<t t-foreach="doc.order_line" t-as="line">
<t t-if="line.display_type == 'line_section'">
<tr class="section-row"><td colspan="7"><strong t-field="line.name"/></td></tr>
<tr class="section-row"><td t-att-colspan="col_count"><strong t-field="line.name"/></td></tr>
</t>
<t t-elif="line.display_type == 'line_note'">
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
<tr class="note-row"><td t-att-colspan="col_count"><span t-field="line.name"/></td></tr>
</t>
<t t-elif="not line.display_type or line.display_type == 'product'">
<tr>
@@ -101,6 +105,10 @@
<td class="text-end">
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
<td t-if="has_discount" class="text-center">
<t t-if="line.discount"><span t-esc="line.discount"/>%</t>
<t t-else="">-</t>
</td>
<td class="text-center">
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or '-'"/>
</td>
@@ -125,9 +133,23 @@
<tr>
<td style="min-width: 150px;">Subtotal</td>
<td class="text-end" style="min-width: 110px;">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
<span t-out="doc.amount_untaxed + total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<t t-if="has_discount">
<tr>
<td>Discount</td>
<td class="text-end">
<span t-out="-total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<tr>
<td>Net Amount</td>
<td class="text-end">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
</t>
<tr>
<td>Taxes</td>
<td class="text-end">
@@ -236,6 +258,7 @@
<t t-set="has_discount" t-value="any(l.discount for l in doc.order_line)"/>
<t t-set="col_count" t-value="8 if has_discount else 7"/>
<t t-set="total_discount" t-value="sum(l.price_unit * l.product_uom_qty * l.discount / 100.0 for l in doc.order_line if not l.display_type or l.display_type == 'product')"/>
<table class="bordered">
<thead>
<tr>
@@ -302,9 +325,23 @@
<tr>
<td style="min-width: 200px;">Subtotal</td>
<td class="text-end" style="min-width: 150px;">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
<span t-out="doc.amount_untaxed + total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<t t-if="has_discount">
<tr>
<td>Discount</td>
<td class="text-end">
<span t-out="-total_discount" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
<tr>
<td>Net Amount</td>
<td class="text-end">
<span t-field="doc.amount_untaxed" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
</td>
</tr>
</t>
<tr>
<td>Taxes</td>
<td class="text-end">