Files
Odoo-Modules/fusion_claims/report/sale_report_portrait.xml
Nexa Admin 431052920e feat: separate fusion field service and LTC into standalone modules, update core modules
- fusion_claims: separated field service logic, updated controllers/views
- fusion_tasks: updated task views and map integration
- fusion_authorizer_portal: added page 11 signing, schedule booking, migrations
- fusion_shipping: new standalone shipping module (Canada Post, FedEx, DHL, Purolator)
- fusion_ltc_management: new standalone LTC management module
2026-03-11 16:19:52 +00:00

282 lines
18 KiB
XML

<?xml version="1.0" encoding="UTF-8"?>
<!--
Copyright 2024-2025 Nexa Systems Inc.
License OPL-1 (Odoo Proprietary License v1.0)
Part of the Fusion Claim Assistant product family.
-->
<odoo>
<template id="report_saleorder_portrait">
<t t-call="web.html_container">
<t t-foreach="docs" t-as="doc">
<t t-call="web.external_layout">
<t t-set="doc" t-value="doc.with_context(lang=doc.partner_id.lang)"/>
<t t-set="is_adp" t-value="doc.x_fc_is_adp_sale"/>
<style>
.fc-report { font-family: Arial, sans-serif; font-size: 10pt; }
.fc-report table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.fc-report table.bordered, .fc-report table.bordered th, .fc-report table.bordered td { border: 1px solid #000; }
.fc-report th { background-color: #0066a1; color: white; padding: 6px 8px; font-weight: bold; text-align: center; }
.fc-report td { padding: 6px 8px; vertical-align: top; }
.fc-report .text-center { text-align: center; }
.fc-report .text-end { text-align: right; }
.fc-report .text-start { text-align: left; }
.fc-report .adp-bg { background-color: #e3f2fd; }
.fc-report .client-bg { background-color: #fff3e0; }
.fc-report .section-row { background-color: #f0f0f0; font-weight: bold; }
.fc-report .note-row { font-style: italic; }
.fc-report h4 { color: #0066a1; margin: 0 0 15px 0; font-size: 16pt; }
.fc-report .totals-table { border: 1px solid #000; border-collapse: collapse; }
.fc-report .totals-table td { border: 1px solid #000; padding: 6px 8px; }
.fc-report .info-header { background-color: #f5f5f5; color: #333; }
.fc-report .adp-header { background-color: #e3f2fd; color: #333; }
</style>
<div class="fc-report">
<div class="page">
<!-- Document Title -->
<h4>
<span t-if="doc.state in ['draft','sent']">Quotation </span>
<span t-else="">Sales Order </span>
<span t-field="doc.name"/>
</h4>
<!-- Address Table -->
<table class="bordered">
<thead>
<tr>
<th style="width: 50%;">BILLING ADDRESS</th>
<th style="width: 50%;">SHIPPING ADDRESS</th>
</tr>
</thead>
<tbody>
<tr>
<td style="height: 70px; font-size: 12pt;">
<div t-field="doc.partner_invoice_id"
t-options="{'widget': 'contact', 'fields': ['name', 'address'], 'no_marker': True}"/>
</td>
<td style="height: 70px; font-size: 12pt;">
<div t-field="doc.partner_shipping_id"
t-options="{'widget': 'contact', 'fields': ['name', 'address'], 'no_marker': True}"/>
</td>
</tr>
</tbody>
</table>
<!-- Order Info Table -->
<table class="bordered">
<thead>
<tr>
<th class="info-header" style="width: 25%;">ORDER DATE</th>
<th class="info-header" style="width: 25%;">EXPIRATION</th>
<th class="info-header" style="width: 25%;">SALESPERSON</th>
<th class="info-header" style="width: 25%;">
<t t-if="is_adp">APPLICATION TYPE</t>
<t t-else="">SALE TYPE</t>
</th>
</tr>
</thead>
<tbody>
<tr>
<td class="text-center">
<span t-field="doc.date_order" t-options="{'widget': 'date'}"/>
</td>
<td class="text-center">
<span t-field="doc.validity_date"/>
</td>
<td class="text-center">
<span t-field="doc.user_id"/>
</td>
<td class="text-center">
<t t-if="is_adp">
<!-- Show Application Type (Reason for Application) for ADP sales -->
<t t-set="app_type" t-value="dict(doc._fields.get('x_fc_reason_for_application') and doc._fields['x_fc_reason_for_application'].selection or []).get(doc.x_fc_reason_for_application, '-')"/>
<span t-esc="app_type"/>
</t>
<t t-else="">
<span t-esc="doc.x_fc_sale_type or '-'"/>
</t>
</td>
</tr>
</tbody>
</table>
<!-- ADP Info Table (only for ADP orders) -->
<t t-if="is_adp">
<table class="bordered">
<thead>
<tr>
<th class="adp-header" style="width: 25%;">CLAIM NUMBER</th>
<th class="adp-header" style="width: 25%;">CLIENT TYPE</th>
<th class="adp-header" style="width: 25%;">DELIVERY DATE</th>
<th class="adp-header" style="width: 25%;">AUTHORIZER</th>
</tr>
</thead>
<tbody>
<tr class="adp-bg">
<td class="text-center">
<span t-esc="doc.x_fc_claim_number or '-'"/>
</td>
<td class="text-center">
<span t-esc="doc.x_fc_client_type or '-'"/>
</td>
<td class="text-center">
<t t-if="doc.x_fc_adp_delivery_date">
<span t-field="doc.x_fc_adp_delivery_date"/>
</t>
<t t-else="">-</t>
</td>
<td class="text-center">
<span t-if="doc.x_fc_authorizer_id" t-field="doc.x_fc_authorizer_id"/>
<span t-else="">-</span>
</td>
</tr>
</tbody>
</table>
</t>
<!-- Order Lines Table -->
<table class="bordered" style="font-size: 9pt;">
<thead>
<tr>
<th class="text-center" style="width: 10%;">ADP CODE</th>
<th class="text-start" style="width: 25%;">DESCRIPTION</th>
<th t-if="is_adp" class="text-center" style="width: 10%;">SERIAL #</th>
<th class="text-center" style="width: 7%;">QTY</th>
<th class="text-center" style="width: 10%;">UNIT PRICE</th>
<th class="text-center" style="width: 8%;">TAXES</th>
<th t-if="is_adp" class="text-center" style="width: 10%; background-color: #1976d2; color: white;">ADP PORTION</th>
<th t-if="is_adp" class="text-center" style="width: 10%; background-color: #e65100; color: white;">CLIENT PORTION</th>
<th class="text-center" style="width: 10%;">AMOUNT</th>
</tr>
</thead>
<tbody>
<t t-foreach="doc.order_line" t-as="line">
<!-- Section Header -->
<t t-if="line.display_type == 'line_section'">
<tr class="section-row">
<td t-att-colspan="'9' if is_adp else '6'">
<span t-field="line.name"/>
</td>
</tr>
</t>
<!-- Note Line -->
<t t-elif="line.display_type == 'line_note'">
<tr class="note-row">
<td t-att-colspan="'9' if is_adp else '6'">
<span t-field="line.name"/>
</td>
</tr>
</t>
<!-- Product Line -->
<t t-elif="not line.display_type">
<tr>
<td class="text-center">
<span t-field="line.product_id.x_fc_adp_device_code"/>
</td>
<td>
<t t-if="line.name">
<t t-set="clean_name" t-value="line.name"/>
<t t-if="'] ' in line.name">
<t t-set="clean_name" t-value="line.name.split('] ', 1)[1]"/>
</t>
<t t-esc="clean_name"/>
</t>
</td>
<td t-if="is_adp" class="text-center">
<span t-esc="line.x_fc_serial_number or ''"/>
</td>
<td class="text-center">
<span t-esc="int(line.product_uom_qty) if line.product_uom_qty == int(line.product_uom_qty) else line.product_uom_qty"/>
</td>
<td class="text-end">
<!-- Show ADP price if available, otherwise unit price -->
<t t-if="line.product_id.product_tmpl_id.x_fc_adp_price">
<span t-esc="line.product_id.product_tmpl_id.x_fc_adp_price" t-options="{'widget': 'monetary', 'display_currency': doc.currency_id}"/>
</t>
<t t-else="">
<span t-field="line.price_unit"/>
</t>
</td>
<td class="text-center">
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or 'NO TAX'"/>
</td>
<td t-if="is_adp" class="text-end adp-bg">
<span t-field="line.x_fc_adp_portion"/>
</td>
<td t-if="is_adp" class="text-end client-bg">
<span t-field="line.x_fc_client_portion"/>
</td>
<td class="text-end">
<span t-field="line.price_subtotal"/>
</td>
</tr>
</t>
</t>
</tbody>
</table>
<!-- Payment Terms and Totals Row -->
<div class="row" style="margin-top: 15px;">
<div class="col-6">
<t t-if="doc.payment_term_id.note">
<strong>Payment Terms:</strong><br/>
<span t-field="doc.payment_term_id.note"/>
</t>
</div>
<div class="col-6" style="text-align: right;">
<!-- Totals Table with borders - aligned right, auto width -->
<table class="totals-table" style="width: auto; margin-left: auto;">
<tr>
<td style="min-width: 140px;">Subtotal</td>
<td class="text-end" style="min-width: 100px;"><span t-field="doc.amount_untaxed"/></td>
</tr>
<tr>
<td>Taxes</td>
<td class="text-end"><span t-field="doc.amount_tax"/></td>
</tr>
<tr>
<td><strong>Total</strong></td>
<td class="text-end"><strong><span t-field="doc.amount_total"/></strong></td>
</tr>
<t t-if="is_adp">
<tr class="adp-bg">
<td><strong>Total ADP Portion</strong></td>
<td class="text-end"><span t-field="doc.x_fc_adp_portion_total"/></td>
</tr>
<tr class="client-bg">
<td><strong>Total Client Portion</strong></td>
<td class="text-end"><span t-field="doc.x_fc_client_portion_total"/></td>
</tr>
</t>
</table>
</div>
</div>
<!-- Terms and Conditions -->
<t t-if="doc.note">
<div style="margin-top: 15px;">
<strong>Terms and Conditions:</strong>
<div t-field="doc.note"/>
</div>
</t>
<!-- Signature -->
<t t-if="doc.signature">
<div style="margin-top: 20px; text-align: right;">
<strong>Signature</strong><br/>
<img t-att-src="image_data_uri(doc.signature)" style="max-height: 4cm; max-width: 8cm;"/><br/>
<span t-field="doc.signed_by"/>
</div>
</t>
</div>
</div>
</t>
</t>
</t>
</template>
</odoo>