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"> <t t-call="web.external_layout">
<div class="page"> <div class="page">
<h2 class="text-center">Commercial Invoice / Facture Commerciale</h2> <h2 class="text-center">Commercial Invoice / Facture Commerciale</h2>
<!-- Header Info --> <!-- Header Info -->
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<tr> <tr>
<td width="33%"> <td width="33%">
<strong>Export Date / Date d'exportation:</strong><br/> <strong>Export Date / Date d'exportation:</strong>
<br/>
<span t-field="o.date"/> <span t-field="o.date"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Invoice # / No. de facture:</strong><br/> <strong>Invoice # / No. de facture:</strong>
<br/>
<span t-field="o.name"/> <span t-field="o.name"/>
</td> </td>
<td width="33%"> <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> <span t-out="'Yes / Oui' if o.related_parties else 'No / Non'"></span>
</td> </td>
</tr> </tr>
@ -37,14 +40,18 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="50%"> <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-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>
<td width="50%"> <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-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> </td>
</tr> </tr>
</table> </table>
@ -53,15 +60,18 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="33%"> <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"/> <span t-field="o.company_id.country_id.name"/>
</td> </td>
<td width="33%"> <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"/> <span t-field="o.payment_term_id.name"/>
</td> </td>
<td width="33%"> <td width="33%">
<strong>Currency / Devise:</strong><br/> <strong>Currency / Devise:</strong>
<br/>
<span t-field="o.currency_id.name"/> <span t-field="o.currency_id.name"/>
</td> </td>
</tr> </tr>
@ -71,14 +81,17 @@
<table class="table table-sm table-bordered"> <table class="table table-sm table-bordered">
<tr> <tr>
<td width="50%"> <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="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')"/> <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])"/> <span t-out="', '.join([x for x in origins if x])"/>
</td> </td>
<td width="50%" rowspan="2"> <td width="50%" rowspan="2">
<strong>Importer of Record / Importateur attitré:</strong><br/> <strong>Importer of Record / Importateur attitré:</strong>
<span>(if different than consignee / si différent du destinataire)</span><br/> <br/>
<span>(if different than consignee / si différent du destinataire)</span>
<br/>
<t t-if="o.importer_id != o.partner_id"> <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}'/> <div t-field="o.importer_id" t-options='{"widget": "contact", "fields": ["name", "address"], "no_marker": True}'/>
</t> </t>
@ -86,7 +99,8 @@
</tr> </tr>
<tr> <tr>
<td> <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"/> <span t-field="o.partner_id.country_id.name"/>
</td> </td>
</tr> </tr>
@ -96,25 +110,27 @@
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm table-bordered mt-4">
<thead> <thead>
<tr> <tr>
<th>Item # &amp; Description<br/>No. d'article &amp; description</th> <th name="item">Item # &amp; Description<br/>
<th>Client Item #<br/>No. d'article client</th> No. d'article &amp; description</th>
<th>HS #<br/>No. SH</th> <th>HS #<br/>
<th>Quantity<br/>Quantité</th> No. SH</th>
<th>Unit Value<br/>Valeur unitaire</th> <th>Quantity<br/>
<th>Total Value<br/>Valeur totale</th> Quantité</th>
<th>Unit Value<br/>
Valeur unitaire</th>
<th>Total Value<br/>
Valeur totale</th>
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
<t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/> <t t-set="all_lines" t-value="o.invoice_ids.mapped('invoice_line_ids')"/>
<tr t-foreach="all_lines" t-as="line"> <tr t-foreach="all_lines" t-as="line">
<td> <td name="line_name">
<span t-field="line.product_id.name"/> <span t-field="line.name"/>
<t t-if="line.name != line.product_id.name"> </td>
<br/><span class="text-muted" t-field="line.name"/> <td>
</t> <span t-field="line.product_id.hs_code"/>
</td> </td>
<td><span t-field="line.product_id.default_code"/></td>
<td><span t-field="line.product_id.hs_code"/></td>
<td> <td>
<span t-field="line.quantity"/> <span t-field="line.quantity"/>
<span t-field="line.product_uom_id" groups="uom.group_uom"/> <span t-field="line.product_uom_id" groups="uom.group_uom"/>
@ -138,82 +154,97 @@
Administration Regulations. Diversion contrary to Canadian law prohibited.<br/> 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 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/> 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 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 administratifs sur l'exportation des Etats-Unis. Tout agissement contraire à la loi Canadienne est strictement
interdit.<br/> interdit.<br/>
Je certifie par la présente que les prix indiqués sur cette facture sont exacts, qu'aucune autre facture 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. commerciale n'a été produite et que tous les renseignements fournis sont véridiques.
</p> </p>
<!-- Signature --> <!-- Signature -->
<div class="mt-4"> <div class="mt-4">
<div>Signature: _______________________</div> <div>Signature: _______________________</div>
<div>Title / Titre: _______________________</div> <div>Title / Titre: _______________________</div>
<div>Date: _______________________</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>
</div> </div>
</div>
<!-- Footer Info --> <div class="col-5">
<table class="table table-sm table-bordered mt-4"> <table class="table table-sm">
<tr> <tr>
<td width="33%"> <td>
<strong>Customs Broker / Courtier en douane:</strong><br/> <strong>Packaging / Emballage:</strong>
<span t-field="o.customs_broker_id.name"/>
</td> </td>
<td width="33%"> <td class="text-right">
<strong>Number of Packages / Nombre de colis:</strong><br/> <span t-field="o.packaging_cost" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
<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> </td>
</tr> </tr>
<tr> <tr>
<td colspan="3"> <td>
<strong>Incoterms:</strong> <strong>Freight / Fret:</strong>
<t t-if="o.incoterm_id"> </td>
<span t-field="o.incoterm_id.code"/> - <span t-field="o.incoterm_id.name"/> <td class="text-right">
</t> <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> </td>
</tr> </tr>
</table> </table>
</div> </div>
</t> </div>
</template>
<!-- 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> </odoo>