Odoo18-Base/addons/l10n_sa_edi/views/report_invoice.xml
2025-01-06 10:57:38 +07:00

63 lines
3.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<odoo>
<data>
<template id="arabic_english_invoice" inherit_id="l10n_sa.arabic_english_invoice">
<!-- Add Currency Exchange rate if different currency than SAR -->
<xpath expr="//div[hasclass('clearfix')]" position="after">
<table t-if="o.company_id.country_id.code == 'SA' and o.currency_id != o.company_id.currency_id"
id="sar_amounts" t-att-style="'ltr' if lang != 'ar_001' else 'rtl'" class="row clearfix ms-auto my-3 table table-sm table-borderless">
<t t-set="sar_rate"
t-value="o.env['res.currency']._get_conversion_rate(o.currency_id, o.company_id.currency_id, o.company_id, o.invoice_date)"/>
<tr>
<td style="width: 25%"><strong>Exchange Rate</strong></td>
<td style="width: 25%"><strong>Subtotal (SAR)</strong></td>
<td style="width: 25%"><strong>VAT Amount (SAR)</strong></td>
<td style="width: 25%"><strong>Total (SAR)</strong></td>
</tr>
<tr>
<td><p class="m-0" t-esc="sar_rate" t-options='{"widget": "float", "precision": 5}'/></td>
<td><p class="m-0" t-esc="o.amount_untaxed_signed"
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'/></td>
<td><p class="m-0"
t-esc="o.currency_id._convert(o.amount_tax, o.company_id.currency_id, o.company_id, o.invoice_date)"
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'/></td>
<td><p class="m-0" t-esc="o.amount_total_signed"
t-options='{"widget": "monetary", "display_currency": o.company_currency_id}'/></td>
</tr>
</table>
</xpath>
<xpath expr="//t[@t-set='address']" position="inside">
<div t-if="o.partner_id.l10n_sa_additional_identification_scheme and o.partner_id.l10n_sa_additional_identification_number" class="text-end mt0">
<span t-field="o.partner_id.l10n_sa_additional_identification_scheme"/>:
<span t-field="o.partner_id.l10n_sa_additional_identification_number"/>
</div>
</xpath>
<xpath expr="//div[hasclass('col-4')]//span[@t-if=&quot;o.move_type == &apos;out_invoice&apos; and o.state == &apos;posted&apos;&quot;]" position="replace">
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">
<t t-if="o._l10n_sa_is_simplified()">
Simplified Tax Invoice
</t>
<t t-else="">
Tax Invoice
</t>
</span>
</xpath>
<xpath expr="//div[hasclass('col-4')][3]//span[@t-if=&quot;o.move_type == &apos;out_invoice&apos; and o.state == &apos;posted&apos;&quot;]" position="replace">
<span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">
<t t-if="o._l10n_sa_is_simplified()">
فاتورة ضريبية مبسطة
</t>
<t t-else="">
فاتورة ضريبية
</t>
</span>
</xpath>
</template>
</data>
</odoo>