318 lines
19 KiB
XML
318 lines
19 KiB
XML
<?xml version="1.0" encoding="UTF-8"?>
|
|
<!--
|
|
Copyright 2026 Nexa Systems Inc.
|
|
License OPL-1 (Odoo Proprietary License v1.0)
|
|
Purchase Order / RFQ — portrait + landscape.
|
|
-->
|
|
<odoo>
|
|
|
|
<!-- ============================================================= -->
|
|
<!-- PORTRAIT -->
|
|
<!-- ============================================================= -->
|
|
<template id="report_fr_purchase_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-call="fusion_reports_templates.fr_portrait_styles"/>
|
|
<div class="fr-report">
|
|
<div class="page">
|
|
|
|
<h4>
|
|
<t t-if="doc.state in ['draft', 'sent', 'to approve']">Request for Quotation </t>
|
|
<t t-else="">Purchase Order </t>
|
|
<span t-field="doc.name"/>
|
|
</h4>
|
|
|
|
<table class="bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 50%;">VENDOR</th>
|
|
<th style="width: 50%;">SHIP TO</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="height: 70px;">
|
|
<div t-field="doc.partner_id"
|
|
t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone', 'email'], 'no_marker': True}"/>
|
|
</td>
|
|
<td style="height: 70px;">
|
|
<t t-if="doc.dest_address_id">
|
|
<div t-field="doc.dest_address_id"
|
|
t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
|
|
</t>
|
|
<t t-else="">
|
|
<strong><span t-field="doc.company_id.name"/></strong><br/>
|
|
<span t-field="doc.company_id.partner_id"
|
|
t-options="{'widget': 'contact', 'fields': ['address', 'phone'], 'no_marker': True}"/>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<table class="bordered">
|
|
<thead>
|
|
<tr>
|
|
<th class="info-header" style="width: 25%;">ORDER DATE</th>
|
|
<th class="info-header" style="width: 25%;">EXPECTED</th>
|
|
<th class="info-header" style="width: 25%;">BUYER</th>
|
|
<th class="info-header" style="width: 25%;">VENDOR REF</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.date_planned" t-options="{'widget': 'date'}"/></td>
|
|
<td class="text-center"><span t-field="doc.user_id"/></td>
|
|
<td class="text-center"><span t-esc="doc.partner_ref or '-'"/></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<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: 8%;">TAX</th>
|
|
<th style="width: 12%;">AMOUNT</th>
|
|
</tr>
|
|
</thead>
|
|
<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>
|
|
</t>
|
|
<t t-elif="line.display_type == 'line_note'">
|
|
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
|
|
</t>
|
|
<t t-else="">
|
|
<tr>
|
|
<td class="text-center"><span t-esc="line.product_id.default_code or ''"/></td>
|
|
<td><span t-esc="line.name"/></td>
|
|
<td class="text-center">
|
|
<span t-esc="int(line.product_qty) if line.product_qty == int(line.product_qty) else line.product_qty"/>
|
|
</td>
|
|
<td class="text-center"><span t-field="line.product_uom_id"/></td>
|
|
<td class="text-end">
|
|
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
<td class="text-center">
|
|
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or '-'"/>
|
|
</td>
|
|
<td class="text-end">
|
|
<span t-field="line.price_subtotal" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
|
|
<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;">
|
|
<table class="totals-table" style="width: auto; margin-left: auto;">
|
|
<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}'/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Taxes</td>
|
|
<td class="text-end">
|
|
<span t-field="doc.amount_tax" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
</tr>
|
|
<tr style="background-color: #eaf2f8;">
|
|
<td><strong>Grand Total</strong></td>
|
|
<td class="text-end"><strong>
|
|
<span t-field="doc.amount_total" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</strong></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<t t-if="doc.notes">
|
|
<div style="margin-top: 15px;">
|
|
<strong>Notes:</strong>
|
|
<div t-field="doc.notes"/>
|
|
</div>
|
|
</t>
|
|
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
|
|
<!-- ============================================================= -->
|
|
<!-- LANDSCAPE -->
|
|
<!-- ============================================================= -->
|
|
<template id="report_fr_purchase_landscape">
|
|
<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-call="fusion_reports_templates.fr_landscape_styles"/>
|
|
<div class="fr-landscape">
|
|
<div class="page">
|
|
|
|
<h2>
|
|
<t t-if="doc.state in ['draft', 'sent', 'to approve']">Request for Quotation </t>
|
|
<t t-else="">Purchase Order </t>
|
|
<span t-field="doc.name"/>
|
|
</h2>
|
|
|
|
<table class="bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 50%;">VENDOR</th>
|
|
<th style="width: 50%;">SHIP TO</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td style="height: 70px; font-size: 12pt;">
|
|
<div t-field="doc.partner_id"
|
|
t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone', 'email'], 'no_marker': True}"/>
|
|
</td>
|
|
<td style="height: 70px; font-size: 12pt;">
|
|
<t t-if="doc.dest_address_id">
|
|
<div t-field="doc.dest_address_id"
|
|
t-options="{'widget': 'contact', 'fields': ['name', 'address', 'phone'], 'no_marker': True}"/>
|
|
</t>
|
|
<t t-else="">
|
|
<strong><span t-field="doc.company_id.name"/></strong><br/>
|
|
<span t-field="doc.company_id.partner_id"
|
|
t-options="{'widget': 'contact', 'fields': ['address', 'phone'], 'no_marker': True}"/>
|
|
</t>
|
|
</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<table class="bordered info-table">
|
|
<thead>
|
|
<tr>
|
|
<th>ORDER DATE</th>
|
|
<th>EXPECTED ARRIVAL</th>
|
|
<th>BUYER</th>
|
|
<th>VENDOR REF</th>
|
|
<th>PAYMENT TERMS</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.date_planned" t-options="{'widget': 'date'}"/></td>
|
|
<td class="text-center"><span t-field="doc.user_id"/></td>
|
|
<td class="text-center"><span t-esc="doc.partner_ref or '-'"/></td>
|
|
<td class="text-center"><span t-field="doc.payment_term_id"/></td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
<table class="bordered">
|
|
<thead>
|
|
<tr>
|
|
<th style="width: 10%;">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: 10%;">TAX</th>
|
|
<th style="width: 12%;">AMOUNT</th>
|
|
</tr>
|
|
</thead>
|
|
<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>
|
|
</t>
|
|
<t t-elif="line.display_type == 'line_note'">
|
|
<tr class="note-row"><td colspan="7"><span t-field="line.name"/></td></tr>
|
|
</t>
|
|
<t t-else="">
|
|
<tr>
|
|
<td class="text-center"><span t-esc="line.product_id.default_code or ''"/></td>
|
|
<td><span t-esc="line.name"/></td>
|
|
<td class="text-center">
|
|
<span t-esc="int(line.product_qty) if line.product_qty == int(line.product_qty) else line.product_qty"/>
|
|
</td>
|
|
<td class="text-center"><span t-field="line.product_uom_id"/></td>
|
|
<td class="text-end">
|
|
<span t-field="line.price_unit" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
<td class="text-center">
|
|
<t t-esc="', '.join([(tax.invoice_label or tax.name) for tax in line.tax_ids]) or '-'"/>
|
|
</td>
|
|
<td class="text-end">
|
|
<span t-field="line.price_subtotal" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
</tr>
|
|
</t>
|
|
</t>
|
|
</tbody>
|
|
</table>
|
|
|
|
<div class="row" style="margin-top: 15px;">
|
|
<div class="col-7">
|
|
<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-5" style="text-align: right;">
|
|
<table class="totals-table" style="width: auto; margin-left: auto;">
|
|
<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}'/>
|
|
</td>
|
|
</tr>
|
|
<tr>
|
|
<td>Taxes</td>
|
|
<td class="text-end">
|
|
<span t-field="doc.amount_tax" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</td>
|
|
</tr>
|
|
<tr style="background-color: #eaf2f8;">
|
|
<td><strong>Grand Total</strong></td>
|
|
<td class="text-end"><strong>
|
|
<span t-field="doc.amount_total" t-options='{"widget": "monetary", "display_currency": doc.currency_id}'/>
|
|
</strong></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
</div>
|
|
|
|
<t t-if="doc.notes">
|
|
<div style="margin-top: 15px;">
|
|
<strong>Notes:</strong>
|
|
<div t-field="doc.notes"/>
|
|
</div>
|
|
</t>
|
|
|
|
</div>
|
|
</div>
|
|
</t>
|
|
</t>
|
|
</t>
|
|
</template>
|
|
|
|
</odoo>
|