Debian Codegraph @

addons/l10n_gcc_invoice/views/report_invoice.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3 <data>
4 <template id="l10n_gcc_report_invoice_document" inherit_id="account.report_invoice_document" primary="True">
5 <t t-set="o" position="after">
6 <t name="l10n_gcc_settings">
7 <t t-if="lang != 'ar_001'" t-set="lang_sec" t-value="o.env['res.lang']._get_code('ar_001')"/>
8 <t t-else="" t-set="lang_sec" t-value="o.env['res.lang']._get_code('en_US')"/>
9 <t t-set="o_sec" t-value="o.with_context(lang=lang_sec)"/>
10 <t t-set="display_in_lang_sec" t-value="o.company_id.l10n_gcc_country_is_gcc and o.company_id.l10n_gcc_dual_language_invoice"/>
11 <t t-set="display_in_ar" t-value="display_in_lang_sec and lang_sec == 'ar_001'"/>
12 <t t-set="display_in_en" t-value="display_in_lang_sec and lang_sec == 'en_US'"/>
13 <t t-set="invoice_gcc_title" t-value="o._l10n_gcc_get_invoice_title()"/>
14 <t t-set="invoice_gcc_title_sec" t-value="o_sec._l10n_gcc_get_invoice_title()"/>
15 </t>
16 </t>
17 <!-- Arabic & English titles -->
18 <t name="invoice_title" position="attributes">
19 <attribute name="t-if">not invoice_gcc_title</attribute>
20 </t>
21 <t name="invoice_title" position="after">
22 <t t-else="" name="invoice_gcc_title" t-out="invoice_gcc_title"></t>
23 </t>
24 <span t-field='o.name' position="after">
25 <t t-if="display_in_ar and not proforma" t-translation="off">
26 <span t-if="o.move_type == 'out_invoice' and o.state == 'posted'">
27 <t t-if="not invoice_gcc_title_sec" name="invoice_title_ar">فاتورة</t>
28 <t t-else="" name="invoice_gcc_title_ar" t-out="invoice_gcc_title_sec"></t>
29 </span>
30 <span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'">
31 <t name="draft_invoice_title_ar">مسودة فاتورة</t>
32 </span>
33 <span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'">
34 <t name="cancelled_invoice_title_ar">فاتورة ملغاة</t>
35 </span>
36 <span t-elif="o.move_type == 'out_refund' and o.state == 'posted'">
37 <t name="credit_note_title_ar">إشعار دائن</t>
38 </span>
39 <span t-elif="o.move_type == 'out_refund' and o.state == 'draft'">
40 <t name="draft_credit_note_title_ar">مسودة إشعار دائن</t>
41 </span>
42 <span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'">
43 <t name="cancelled_credit_note_title_ar">إشعار دائن ملغاة</t>
44 </span>
45 <span t-elif="o.move_type == 'in_refund'">
46 <t name="vendor_credit_note_title_ar">إشعار المورد الدائن</t>
47 </span>
48 <span t-elif="o.move_type == 'in_invoice'">
49 <t name="vendor_bill_title_ar">فاتورة المورد</t>
50 </span>
51 </t>
52 <t t-elif="display_in_en and not proforma" t-translation="off">
53 <span t-if="o.move_type == 'out_invoice' and o.state == 'posted'" dir="rtl">
54 <t t-if="not invoice_gcc_title_sec" name="invoice_title_en">Invoice</t>
55 <t t-else="" name="invoice_gcc_title_en" t-out="invoice_gcc_title_sec"></t>
56 </span>
57 <span t-elif="o.move_type == 'out_invoice' and o.state == 'draft'" dir="rtl">
58 <t name="draft_invoice_title_en">Draft Invoice</t>
59 </span>
60 <span t-elif="o.move_type == 'out_invoice' and o.state == 'cancel'" dir="rtl">
61 <t name="cancelled_invoice_title_en">Cancelled Invoice</t>
62 </span>
63 <span t-elif="o.move_type == 'out_refund' and o.state == 'posted'" dir="rtl">
64 <t name="credit_note_title_en">Credit Note</t>
65 </span>
66 <span t-elif="o.move_type == 'out_refund' and o.state == 'draft'" dir="rtl">
67 <t name="draft_credit_note_title_en">Draft Credit Note</t>
68 </span>
69 <span t-elif="o.move_type == 'out_refund' and o.state == 'cancel'" dir="rtl">
70 <t name="cancelled_credit_note_title_en">Cancelled Credit Note</t>
71 </span>
72 <span t-elif="o.move_type == 'in_refund'" dir="rtl">
73 <t name="vendor_credit_note_title_en">Vendor Credit Note</t>
74 </span>
75 <span t-elif="o.move_type == 'in_invoice'" dir="rtl">
76 <t name="vendor_bill_title_en">Vendor Bill</t>
77 </span>
78 </t>
79 </span>
80 <!-- End Arabic & English titles -->
81 <!-- Arabic & English information div -->
82 <xpath expr="//div[@name='invoice_date']/t" position="before">
83 <t t-if="display_in_en" t-translation="off">
84 <t name="out_invoice_date_en" t-if="o.move_type == 'out_invoice'"><strong>Invoice Date</strong></t>
85 <t name="out_refund_date_en" t-elif="o.move_type == 'out_refund'"><strong>Credit Note Date</strong></t>
86 <t name="out_receipt_date_en" t-elif="o.move_type == 'out_receipt'"><strong>Receipt Date</strong></t>
87 <t name="move_date_en" t-else=""><strong>Date</strong></t>
88 <br/>
89 </t>
90 <t t-elif="display_in_ar" t-translation="off">
91 <t name="out_invoice_date_ar" t-if="o.move_type == 'out_invoice'"><strong>تاريخ فاتورة العميل</strong></t>
92 <t name="out_refund_date_ar" t-elif="o.move_type == 'out_refund'"><strong>تاريخ إشعار الدائن</strong></t>
93 <t name="out_receipt_date_ar" t-elif="o.move_type == 'out_receipt'"><strong>تاريخ الإيصال</strong></t>
94 <t name="move_date_ar" t-else=""><strong>تاريخ</strong></t>
95 <br/>
96 </t>
97 </xpath>
98 <xpath expr="//div[@name='due_date']/strong" position="before">
99 <strong name="due_date_ar" t-if="display_in_ar" t-translation="off">تاريخ الاستحقاق<br/></strong>
100 <strong name="due_date_en" t-if="display_in_en" t-translation="off">Due Date<br/></strong>
101 </xpath>
102 <xpath expr="//div[@name='delivery_date']/strong" position="before">
103 <strong name="delivery_date_ar" t-if="display_in_ar" t-translation="off">تاريخ التوصيل<br/></strong>
104 <strong name="delivery_date_en" t-if="display_in_en" t-translation="off">Delivery Date<br/></strong>
105 </xpath>
106 <xpath expr="//div[@name='origin']/strong" position="before">
107 <strong name="origin_ar" t-if="display_in_ar" t-translation="off">المصدر<br/></strong>
108 <strong name="origin_en" t-if="display_in_en" t-translation="off">Source<br/></strong>
109 </xpath>
110 <xpath expr="//div[@name='customer_code']/strong" position="before">
111 <strong name="customer_code_ar" t-if="display_in_ar" t-translation="off">كود العميل<br/></strong>
112 <strong name="customer_code_en" t-if="display_in_en" t-translation="off">Customer Code<br/></strong>
113 </xpath>
114 <xpath expr="//div[@name='reference']/strong" position="before">
115 <strong name="reference_ar" t-if="display_in_ar" t-translation="off">رقم الإشارة<br/></strong>
116 <strong name="reference_en" t-if="display_in_en" t-translation="off">Reference<br/></strong>
117 </xpath>
118 <xpath expr="//div[@name='incoterm_id']/strong" position="before">
119 <strong name="incoterm_id_ar" t-if="display_in_ar" t-translation="off">شرط التجارة الدولي<br/></strong>
120 <strong name="incoterm_id_en" t-if="display_in_en" t-translation="off">Incoterm<br/></strong>
121 </xpath>
122 <!-- End Arabic & English information div -->
123 <!-- Arabic & English table headers -->
124 <xpath expr="//th[@name='th_description']/span" position="before">
125 <span name="th_description_ar" t-if="display_in_ar" t-translation="off">الوصف<br/></span>
126 <span name="th_description_en" t-if="display_in_en" t-translation="off">Description<br/></span>
127 </xpath>
128 <xpath expr="//th[@name='th_quantity']/span" position="before">
129 <span name="th_quantity_ar" t-if="display_in_ar" t-translation="off">الكمية<br/></span>
130 <span name="th_quantity_en" t-if="display_in_en" t-translation="off">Quantity<br/></span>
131 </xpath>
132 <xpath expr="//th[@name='th_priceunit']/span" position="before">
133 <span name="th_priceunit_ar" t-if="display_in_ar" t-translation="off">سعر الوحدة<br/></span>
134 <span name="th_priceunit_en" t-if="display_in_en" t-translation="off">Unit Price<br/></span>
135 </xpath>
136 <xpath expr="//th[@name='th_discount']/span" position="before">
137 <span name="th_discount_ar" t-if="display_in_ar" t-translation="off">٪ خصم<br/></span>
138 <span name="th_discount_en" t-if="display_in_en" t-translation="off">Disc.%<br/></span>
139 </xpath>
140 <xpath expr="//th[@name='th_taxes']/span" position="before">
141 <span name="th_taxes_ar" t-if="display_in_ar" t-translation="off">الضرائب<br/></span>
142 <span name="th_taxes_en" t-if="display_in_en" t-translation="off">Taxes<br/></span>
143 </xpath>
144 <xpath expr="//th[@name='th_subtotal']/span" position="before">
145 <span name="th_subtotal_ar" t-if="display_in_ar" t-translation="off">المبلغ<br/></span>
146 <span name="th_subtotal_en" t-if="display_in_en" t-translation="off">Amount<br/></span>
147 </xpath>
148 <!-- End Arabic & English table headers -->
149 <!-- Arabic & English table body -->
150 <xpath expr="//td[@name='account_invoice_line_name']/span" position="replace">
151 <t t-if="line.product_id and display_in_lang_sec">
152 <t t-set="english_name" t-value="line.with_context(lang='en_US').product_id.display_name"/>
153 <t t-set="arabic_name" t-value="line.with_context(lang=o.env['res.lang']._get_code('ar_001')).product_id.display_name"/>
154
155 <span t-out="arabic_name + '\n'" t-if="arabic_name not in line.name" t-options="{'widget': 'text'}" dir="rtl"/>
156 <span t-out="english_name + '\n'" t-if="(english_name != arabic_name) and (english_name not in line.name)" t-options="{'widget': 'text'}"/>
157 </t>
158 <span t-if="line.name" t-field="line.name" t-options="{'widget': 'text'}" t-att-dir="o.env['res.lang']._get_data(code=lang).direction"/>
159 </xpath>
160 <!-- End Arabic & English table body -->
161 <!-- Arabic & English payment terms -->
162 <span id="payment_terms_note_id" position="before">
163 <span id="payment_terms_note_id_lang_sec"
164 t-if="o.invoice_payment_term_id.note and o.invoice_payment_term_id.note != o_sec.invoice_payment_term_id.note
165 and display_in_lang_sec"
166 t-out="o_sec.invoice_payment_term_id.note"
167 name="payment_term_lang_sec"/>
168 </span>
169 <t t-set="payment_term_details" position="after">
170 <t t-set="payment_term_details_sec" t-value="o_sec.payment_term_details"/>
171 </t>
172 <xpath expr="//div[@id='total_payment_term_details_table']//td" position="before">
173 <td name="td_payment_term_ar" t-if="display_in_ar" t-translation="off">
174 <span t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}'
175 t-out="o_sec.invoice_payment_term_id._get_amount_due_after_discount(o_sec.amount_total, o_sec.amount_tax)" dir="rtl">30.00</span> المبلغ المستحق إذا تم الدفع قبل
176 <span t-out="o_sec.invoice_payment_term_id._get_last_discount_date_formatted(o_sec.invoice_date)" dir="rtl">2024-01-01</span>
177 </td>
178 <td name="td_payment_term_en" t-if="display_in_en" t-translation="off">
179 <span t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}'
180 t-out="o_sec.invoice_payment_term_id._get_amount_due_after_discount(o_sec.amount_total, o_sec.amount_tax)" dir="ltr">30.00</span> due if paid before
181 <span t-out="o_sec.invoice_payment_term_id._get_last_discount_date_formatted(o_sec.invoice_date)" dir="ltr">2024-01-01</span>
182 </td>
183 </xpath>
184 <xpath expr="//div[@id='total_payment_term_details_table']//div[@id='early_payment_discount']" position="before">
185 <div name="td_payment_term_ar" t-if="display_in_ar" t-translation="off">
186 <span t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}'
187 t-out="o_sec.invoice_payment_term_id._get_amount_due_after_discount(o_sec.amount_total, o_sec.amount_tax)" dir="rtl">30.00</span> المبلغ المستحق إذا تم الدفع قبل
188 <span t-out="o_sec.invoice_payment_term_id._get_last_discount_date_formatted(o_sec.invoice_date)" dir="rtl">2024-01-01</span>
189 </div>
190 <div name="td_payment_term_en" t-if="display_in_en" t-translation="off">
191 <span t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}'
192 t-out="o_sec.invoice_payment_term_id._get_amount_due_after_discount(o_sec.amount_total, o_sec.amount_tax)" dir="ltr">30.00</span> due if paid before
193 <span t-out="o_sec.invoice_payment_term_id._get_last_discount_date_formatted(o_sec.invoice_date)" dir="ltr">2024-01-01</span>
194 </div>
195 </xpath>
196 <xpath expr="//div[@id='total_payment_term_details_table']//t[2]" position="before">
197 <t name="div_payment_term_ar" t-if="len(payment_term_details_sec) > 1 and display_in_ar" t-foreach="payment_term_details_sec" t-as="term" t-translation="off">
198 <div dir="rtl">
199 <span t-out="term_index + 1">1</span> - دفعة من
200 <t t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}' t-out="term.get('amount')" class="text-end">31.05</t>
201 <span> مستحق في </span>
202 <t t-out="term.get('date')" class="text-start">2024-01-01</t>
203 </div>
204 </t>
205 <t name="div_payment_term_en" t-if="len(payment_term_details_sec) > 1 and display_in_en" t-foreach="payment_term_details_sec" t-as="term" t-translation="off">
206 <div dir="ltr">
207 <span t-out="term_index + 1">1</span> - Installment of
208 <t t-options='{"widget": "monetary", "display_currency": o_sec.currency_id}' t-out="term.get('amount')" class="text-end">31.05</t>
209 <span> due on </span>
210 <t t-out="term.get('date')" class="text-start">2024-01-01</t>
211 </div>
212 </t>
213 </xpath>
214 <!-- End Arabic & English payment terms -->
215 <!-- Arabic & English amount in words -->
216 <p t-if="o.company_id.display_invoice_amount_total_words" position="before">
217 <p name="amount_total_words_lang_sec" t-if="o.company_id.display_invoice_amount_total_words and display_in_lang_sec"
218 t-att-dir="env['res.lang']._get_data(code=lang_sec).direction or 'ltr'" t-translation="off">
219 <span t-if="display_in_ar">المبلغ الإجمالي كتابةً: <br/></span>
220 <span t-if="display_in_en">Total amount in words: <br/></span>
221 <small class="text-muted lh-sm"><span t-out="o_sec.currency_id.amount_to_text(o_sec.amount_total).replace(' and ', ' و')"></span></small>
222 </p>
223 </p>
224 <!-- End Arabic & English amount in words -->
225 <!-- Arabic & English amount in words -->
226 <p name="payment_communication" position="before">
227 <p name="payment_communication_ar" t-if="display_in_ar" t-translation="off">
228 <span class="fw-bold" t-out="o_sec.payment_reference">INV/2023/00001</span> :التواصل بشأن الدفع
229 <t t-if="o_sec.partner_bank_id">
230 <br/><span t-out="o_sec.partner_bank_id.acc_number" class="fw-bold"/> :في هذا الحساب
231 </t>
232 </p>
233 <p name="payment_communication_en" t-if="display_in_en" t-translation="off">
234 Payment Communication: <span class="fw-bold" t-out="o_sec.payment_reference">INV/2023/00001</span>
235 <t t-if="o_sec.partner_bank_id">
236 <br/> on this account: <span t-out="o_sec.partner_bank_id.acc_number" class="fw-bold"/>
237 </t>
238 </p>
239 </p>
240 <!-- End Arabic & English amount in words -->
241 <!-- Call custom tax totals templates -->
242 <t t-set="tax_totals" position="after">
243 <t t-set="tax_totals_sec" t-value="o_sec.tax_totals"/>
244 </t>
245 <t t-call="account.document_tax_totals" position="attributes">
246 <attribute name="t-call">l10n_gcc_invoice.l10n_gcc_document_tax_totals</attribute>
247 </t>
248 <xpath expr="(//t[@t-set='tax_totals'])[2]" position="after">
249 <t t-set="tax_totals_sec" t-value="o_sec.tax_totals"/>
250 <t t-set="show_exchange_rate" t-value="0"/>
251 </xpath>
252 <t t-call="account.document_tax_totals_company_currency_template" position="attributes">
253 <attribute name="t-call">l10n_gcc_invoice.l10n_gcc_document_tax_totals_company_currency_template</attribute>
254 </t>
255 <!-- End Call custom tax totals templates -->
256 </template>
257
258 <template id="l10n_gcc_document_tax_totals" inherit_id="account.document_tax_totals" primary="True">
259 <xpath expr="//t[@t-set='same_tax_base']" position="after">
260 <t t-set="subtotal_index" t-value="0"/>
261 </xpath>
262 <xpath expr="//tr[hasclass('o_subtotal')]" position="before">
263 <t t-set="subtotal_sec" t-value="tax_totals_sec['subtotals'][subtotal_index]"/>
264 <t t-set="subtotal_index" t-value="subtotal_index + 1"/>
265 <t t-set="tax_group_index" t-value="0"/>
266 </xpath>
267 <xpath expr="//tr[hasclass('o_taxes')]" position="before">
268 <t t-set="tax_group_sec" t-value="subtotal_sec['tax_groups'][tax_group_index]"/>
269 <t t-set="tax_group_index" t-value="tax_group_index + 1"/>
270 </xpath>
271 <span t-out="subtotal['name']" position="after">
272 <span name="untaxed_amount_ar" t-if="display_in_ar" t-translation="off"> / بدون ضريبة</span>
273 <span name="untaxed_amount_en" t-if="display_in_en" t-translation="off"> / Untaxed Amount</span>
274 </span>
275 <xpath expr="//tr[hasclass('o_total')]/td" position="inside">
276 <strong name="total_ar" t-if="display_in_ar" t-translation="off"> / الإجمالي</strong>
277 <strong name="total_en" t-if="display_in_en" t-translation="off"> / Total</strong>
278 </xpath>
279 </template>
280
281 <template id="l10n_gcc_document_tax_totals_company_currency_template" inherit_id="account.document_tax_totals_company_currency_template" primary="True">
282 <xpath expr="//t[@t-set='same_tax_base']" position="after">
283 <t t-set="subtotal_index" t-value="0"/>
284 </xpath>
285 <xpath expr="//t[@t-as='subtotal']" position="before">
286 <tr t-if="show_exchange_rate">
287 <t t-set="exchange_rate" t-if="o.amount_total" t-value="abs(o.amount_total_signed) / o.amount_total"/>
288 <t t-set="exchange_rate" t-else="" t-value="o.env['res.currency']._get_conversion_rate(o.currency_id, o.company_id.currency_id, o.company_id, o.invoice_date or datetime.date.today())"/>
289 <td>
290 <span>Exchange Rate</span>
291 <span t-if="display_in_ar" t-translation="off"> / سعر الصرف</span>
292 <span t-if="display_in_en" t-translation="off"> / Exchange Rate</span>
293 </td>
294 <td class="text-end" t-out="exchange_rate" t-options='{"widget": "float", "precision": 5}'/>
295 </tr>
296 </xpath>
297 <xpath expr="//tr[hasclass('o_subtotal')]" position="before">
298 <t t-set="subtotal_sec" t-value="tax_totals_sec['subtotals'][subtotal_index]"/>
299 <t t-set="subtotal_index" t-value="subtotal_index + 1"/>
300 <t t-set="tax_group_index" t-value="0"/>
301 </xpath>
302 <xpath expr="//tr[hasclass('o_taxes')]" position="before">
303 <t t-set="tax_group_sec" t-value="subtotal_sec['tax_groups'][tax_group_index]"/>
304 <t t-set="tax_group_index" t-value="tax_group_index + 1"/>
305 </xpath>
306 <span t-field="o.company_currency_id" position="after">
307 <t name="taxes_ar" t-if="display_in_ar" t-translation="off" dir="rtl">
308 الضرائب
309 </t>
310 </span>
311 <span t-field="o.company_currency_id" position="after">
312 <t name="taxes_en" t-if="display_in_en" t-translation="off">
313 Taxes
314 </t>
315 </span>
316 <span t-out="subtotal['name']" position="after">
317 <span name="untaxed_amount_ar" t-if="display_in_ar" t-translation="off"> / المبلغ دون ضريبة</span>
318 <span name="untaxed_amount_en" t-if="display_in_en" t-translation="off"> / Untaxed Amount</span>
319 </span>
320 <xpath expr="//tr[hasclass('o_total')]/td" position="inside">
321 <strong name="total_ar" t-if="display_in_ar" t-translation="off"> / الإجمالي</strong>
322 <strong name="total_en" t-if="display_in_en" t-translation="off"> / Total</strong>
323 </xpath>
324 </template>
325
326 <!-- Workaround for Studio reports, see odoo/odoo#60660 -->
327 <template id="report_invoice" inherit_id="account.report_invoice">
328 <xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
329 <t t-elif="o._get_name_invoice_report() == 'l10n_gcc_invoice.l10n_gcc_report_invoice_document'"
330 t-call="l10n_gcc_invoice.l10n_gcc_report_invoice_document"
331 t-lang="lang"/>
332 </xpath>
333 </template>
334 </data>
335 </odoo>