update commercial invoice template, moving customer code out to specific module:

This commit is contained in:
Marc Durepos 2025-04-10 10:25:14 -04:00
parent 57ba6be5b9
commit dd4062a0d3

View file

@ -14,20 +14,23 @@
<t t-call="web.external_layout">
<div class="page">
<h2 class="text-center">Commercial Invoice / Facture Commerciale</h2>
<!-- Header Info -->
<table class="table table-sm table-bordered mt-4">
<tr>
<td width="33%">
<strong>Export Date / Date d'exportation:</strong><br/>
<strong>Export Date / Date d'exportation:</strong>
<br/>
<span t-field="o.date"/>
</td>
<td width="33%">
<strong>Invoice # / No. de facture:</strong><br/>
<strong>Invoice # / No. de facture:</strong>
<br/>
<span t-field="o.name"/>
</td>
<td width="33%">
<strong>Related Parties / Parties liées:</strong><br/>
<strong>Related Parties / Parties liées:</strong>
<br/>
<span t-out="'Yes / Oui' if o.related_parties else 'No / Non'"></span>
</td>
</tr>
@ -37,14 +40,18 @@
<table class="table table-sm table-bordered">
<tr>
<td width="50%">
<strong>Shipper/Exporter - Expéditeur/Exportateur:</strong><br/>
<strong>Shipper/Exporter - Expéditeur/Exportateur:</strong>
<br/>
<div t-field="o.company_id.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
<div t-if="o.company_id.vat">Tax ID: <span t-field="o.company_id.vat"/></div>
<div t-if="o.company_id.vat">Tax ID: <span t-field="o.company_id.vat"/>
</div>
</td>
<td width="50%">
<strong>Consignee - Destinataire:</strong><br/>
<strong>Consignee - Destinataire:</strong>
<br/>
<div t-field="o.partner_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
<div t-if="o.partner_id.vat">Tax ID: <span t-field="o.partner_id.vat"/></div>
<div t-if="o.partner_id.vat">Tax ID: <span t-field="o.partner_id.vat"/>
</div>
</td>
</tr>
</table>
@ -53,15 +60,18 @@
<table class="table table-sm table-bordered">
<tr>
<td width="33%">
<strong>Country of Export / Pays d'exportation:</strong><br/>
<strong>Country of Export / Pays d'exportation:</strong>
<br/>
<span t-field="o.company_id.country_id.name"/>
</td>
<td width="33%">
<strong>Terms of Sale / Conditions de vente:</strong><br/>
<strong>Terms of Sale / Conditions de vente:</strong>
<br/>
<span t-field="o.payment_term_id.name"/>
</td>
<td width="33%">
<strong>Currency / Devise:</strong><br/>
<strong>Currency / Devise:</strong>
<br/>
<span t-field="o.currency_id.name"/>
</td>
</tr>
@ -71,14 +81,17 @@
<table class="table table-sm table-bordered">
<tr>
<td width="50%">
<strong>Country of Origin / Pays d'origine:</strong><br/>
<strong>Country of Origin / Pays d'origine:</strong>
<br/>
<t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/>
<t t-set="origins" t-value="all_lines.mapped('product_id.country_of_origin.name')"/>
<span t-out="', '.join([x for x in origins if x])"/>
</td>
<td width="50%" rowspan="2">
<strong>Importer of Record / Importateur attitré:</strong><br/>
<span>(if different than consignee / si différent du destinataire)</span><br/>
<strong>Importer of Record / Importateur attitré:</strong>
<br/>
<span>(if different than consignee / si différent du destinataire)</span>
<br/>
<t t-if="o.importer_id != o.partner_id">
<div t-field="o.importer_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
</t>
@ -86,7 +99,8 @@
</tr>
<tr>
<td>
<strong>Country of Ultimate Destination / Pays de destination finale:</strong><br/>
<strong>Country of Ultimate Destination / Pays de destination finale:</strong>
<br/>
<span t-field="o.partner_id.country_id.name"/>
</td>
</tr>
@ -96,25 +110,27 @@
<table class="table table-sm table-bordered mt-4">
<thead>
<tr>
<th>Item # &amp; Description<br/>No. d'article &amp; description</th>
<th>Client Item #<br/>No. d'article client</th>
<th>HS #<br/>No. SH</th>
<th>Quantity<br/>Quantité</th>
<th>Unit Value<br/>Valeur unitaire</th>
<th>Total Value<br/>Valeur totale</th>
<th name="item">Item # &amp; Description<br/>
No. d'article &amp; description</th>
<th>HS #<br/>
No. SH</th>
<th>Quantity<br/>
Quantité</th>
<th>Unit Value<br/>
Valeur unitaire</th>
<th>Total Value<br/>
Valeur totale</th>
</tr>
</thead>
<tbody>
<t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/>
<tr t-foreach="all_lines" t-as="line">
<td>
<span t-field="line.product_id.name"/>
<t t-if="line.name != line.product_id.name">
<br/><span class="text-muted" t-field="line.name"/>
</t>
<td name="line_name">
<span t-field="line.name"/>
</td>
<td>
<span t-field="line.product_id.hs_code"/>
</td>
<td><span t-field="line.product_id.default_code"/></td>
<td><span t-field="line.product_id.hs_code"/></td>
<td>
<span t-field="line.quantity"/>
<span t-field="line.product_uom_id" groups="uom.group_uom"/>
@ -138,82 +154,97 @@
Administration Regulations. Diversion contrary to Canadian law prohibited.<br/>
It is hereby certified that this invoice shows the actual price of the goods described, that no other invoice has
been issued and that all particulars are true and correct.<br/>
----------------------------------------------------------------------------<br/>
---------------------------------------------------------------------------- <br/>
Ces marchandises, technologies ou logiciels ont été exportés du Canada conformément aux règlements
administratifs sur l'exportation des Etats-Unis. Tout agissement contraire à la loi Canadienne est strictement
interdit.<br/>
Je certifie par la présente que les prix indiqués sur cette facture sont exacts, qu'aucune autre facture
commerciale n'a été produite et que tous les renseignements fournis sont véridiques.
</p>
<!-- Signature -->
<div class="mt-4">
<div>Signature: _______________________</div>
<div>Title / Titre: _______________________</div>
<div>Date: _______________________</div>
</div>
</div>
<div class="col-5">
<table class="table table-sm">
<tr>
<td><strong>Packaging / Emballage:</strong></td>
<td class="text-right">
<span t-field="o.packaging_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td><strong>Freight / Fret:</strong></td>
<td class="text-right">
<span t-field="o.freight_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td><strong>Insurance / Assurance:</strong></td>
<td class="text-right">
<span t-field="o.insurance_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td><strong>Other / Autre:</strong></td>
<td class="text-right">
<span t-field="o.other_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr class="border-black">
<td><strong>Total Invoice Value / Valeur totale de la facture:</strong></td>
<td class="text-right">
<strong t-field="o.total_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
</div>
</p>
<!-- Signature -->
<div class="mt-4">
<div>Signature: _______________________</div>
<div>Title / Titre: _______________________</div>
<div>Date: _______________________</div>
</div>
<!-- Footer Info -->
<table class="table table-sm table-bordered mt-4">
</div>
<div class="col-5">
<table class="table table-sm">
<tr>
<td width="33%">
<strong>Customs Broker / Courtier en douane:</strong><br/>
<span t-field="o.customs_broker_id.name"/>
<td>
<strong>Packaging / Emballage:</strong>
</td>
<td width="33%">
<strong>Number of Packages / Nombre de colis:</strong><br/>
<span t-field="o.number_of_packages"/>
</td>
<td width="33%">
<strong>Total Weight / Poids total:</strong><br/>
<span t-field="o.total_weight"/> kg
<td class="text-right">
<span t-field="o.packaging_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td colspan="3">
<strong>Incoterms:</strong>
<t t-if="o.incoterm_id">
<span t-field="o.incoterm_id.code"/> - <span t-field="o.incoterm_id.name"/>
</t>
<td>
<strong>Freight / Fret:</strong>
</td>
<td class="text-right">
<span t-field="o.freight_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
<strong>Insurance / Assurance:</strong>
</td>
<td class="text-right">
<span t-field="o.insurance_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr>
<td>
<strong>Other / Autre:</strong>
</td>
<td class="text-right">
<span t-field="o.other_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
<tr class="border-black">
<td>
<strong>Total Invoice Value / Valeur totale de la facture:</strong>
</td>
<td class="text-right">
<strong t-field="o.total_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</table>
</div>
</t>
</template>
</div>
<!-- Footer Info -->
<table class="table table-sm table-bordered mt-4">
<tr>
<td width="33%">
<strong>Customs Broker / Courtier en douane:</strong>
<br/>
<span t-field="o.customs_broker_id.name"/>
</td>
<td width="33%">
<strong>Number of Packages / Nombre de colis:</strong>
<br/>
<span t-field="o.number_of_packages"/>
</td>
<td width="33%">
<strong>Total Weight / Poids total:</strong>
<br/>
<span t-field="o.total_weight"/>
kg
</td>
</tr>
<tr>
<td colspan="3">
<strong>Incoterms:</strong>
<t t-if="o.incoterm_id">
<span t-field="o.incoterm_id.code"/>
- <span t-field="o.incoterm_id.name"/>
</t>
</td>
</tr>
</table>
</div>
</t>
</template>
</odoo>