Debian Codegraph @

addons/l10n_hu_edi/views/report_invoice.xml

raw
1 <?xml version="1.0" encoding="utf-8"?>
2 <odoo>
3
4 <template id="report_invoice" inherit_id="account.report_invoice">
5 <xpath expr='//t[@t-call="account.report_invoice_document"]' position="after">
6 <t t-if="o._get_name_invoice_report() == 'l10n_hu_edi.report_invoice_document'" t-call="l10n_hu_edi.report_invoice_document" t-lang="lang"/>
7 </xpath>
8 </template>
9
10 <template id="report_invoice_document" inherit_id="account.report_invoice_document" primary="True">
11 <xpath expr="//t[@t-set='forced_vat']" position="replace"/>
12 <xpath expr="//t[@t-set='o']" position="after">
13 <t t-set="sign" t-value="-1 if 'refund' in o.move_type else 1"/>
14 <t t-set="custom_header" t-value="'l10n_hu_edi.custom_header'"/>
15 <t t-set="information_block">
16 <div class="col-6">
17 <div><strong>Supplier:</strong></div>
18 <div class="float-start company_address">
19 <ul class="list-unstyled">
20 <li><t t-out="o.company_id.partner_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": true}'/></li>
21 <li>
22 <t t-set="default_vat_label">Tax ID</t>
23 <t t-if="not o.fiscal_position_id.foreign_vat and o.company_id.partner_id.l10n_hu_group_vat">Group Tax ID</t>
24 <t t-else="else" t-out="o.company_id.account_fiscal_country_id.vat_label or default_vat_label"/>:
25 <span t-if="o.fiscal_position_id.foreign_vat" t-out="o.fiscal_position_id.foreign_vat"/>
26 <span t-else="else" t-out="o.company_id.vat"/>
27 </li>
28 <li t-if="not o.fiscal_position_id.foreign_vat and o.company_id.partner_id.l10n_hu_group_vat">Group Member Tax ID: <span t-field="o.company_id.partner_id.l10n_hu_group_vat"/></li>
29 <li t-if="o.partner_id.commercial_partner_id.country_id and o.partner_id.commercial_partner_id.country_id.code!='HU' and o.company_id.vat">
30 EU Tax ID: <span t-out="'HU%s' % o.company_id.vat[:8]"/>
31 </li>
32 <li t-if="o.move_type in ['out_invoice', 'out_receipt'] and o.partner_bank_id">Bank Account: <span t-field="o.partner_bank_id.acc_number"/></li>
33 <li t-if="o.company_id.l10n_hu_tax_regime=='ie'">The issuer of the invoice is <u>Exempt from VAT</u>.</li>
34 <li t-if="o.company_id.l10n_hu_tax_regime=='ca'">The issuer of the invoice is <u>Cash accounting</u>.</li>
35 <li t-if="o.company_id.l10n_hu_tax_regime=='sb'">The issuer of the invoice is <u>Small taxpayer</u>.</li>
36 </ul>
37 </div>
38 </div>
39 </t>
40 </xpath>
41 <xpath expr="//div[@name='invoice_date']/t[1]" position="attributes">
42 <attribute name="t-if">o.move_type == 'out_invoice' or (o.move_type == 'out_refund' and not o.reversed_entry_id)</attribute>
43 </xpath>
44 <xpath expr="//div[@name='address_not_same_as_shipping']//address" position="before">
45 <strong>Customer:</strong>
46 </xpath>
47 <xpath expr="//div[@name='shipping_address_block']/../.." position="replace"/>
48 <xpath expr="//div[@name='address_not_same_as_shipping']//span[@t-field='o.partner_id.vat']/.." position="after">
49 <div t-if="o.partner_id.l10n_hu_group_vat">Group Member Tax ID: <span t-field="o.partner_id.l10n_hu_group_vat"/></div>
50 <div groups="account.group_delivery_invoice_address" name="shipping_address_block">
51 <div/>
52 <strong class="d-block mt-3">Shipping Address</strong>
53 <div t-field="o.partner_shipping_id" t-options='{"widget": "contact", "fields": ["address", "name"], "no_marker": True}'/>
54 </div>
55 </xpath>
56 <xpath expr="//div[@name='address_same_as_shipping']//address" position="before">
57 <strong>Customer:</strong>
58 </xpath>
59 <xpath expr="//div[@name='address_same_as_shipping']//span[@t-field='o.partner_id.vat']/.." position="after">
60 <div t-if="o.partner_id.l10n_hu_group_vat">Group Member Tax ID: <span t-field="o.partner_id.l10n_hu_group_vat"/></div>
61 <div t-if="o.move_type == 'out_refund' and o.partner_bank_id">Bank Account: <span t-field="o.partner_bank_id.acc_number"/></div>
62 </xpath>
63 <xpath expr="//div[@name='no_shipping']//address" position="before">
64 <strong>Customer:</strong>
65 </xpath>
66 <xpath expr="//div[@name='no_shipping']//span[@t-field='o.partner_id.vat']/.." position="after">
67 <div t-if="o.partner_id.l10n_hu_group_vat">Group Member Tax ID: <span t-field="o.partner_id.l10n_hu_group_vat"/></div>
68 </xpath>
69 <xpath expr="//div[@name='due_date']" position="after">
70 <div class="col" t-if="o.l10n_hu_payment_mode" name="l10n_hu_payment_mode">
71 <strong>Payment Mode</strong>
72 <div t-field="o.l10n_hu_payment_mode"/>
73 </div>
74 </xpath>
75 <xpath expr="//table[@name='invoice_line_table']//span[@t-field='line.quantity']" position="attributes">
76 <attribute name="t-field"/>
77 <attribute name="t-out">line.quantity * sign if line.quantity != 0 else line.quantity</attribute>
78 </xpath>
79 <xpath expr="//table[@name='invoice_line_table']//span[@t-field='line.price_subtotal']" position="attributes">
80 <attribute name="t-field"/>
81 <attribute name="t-out">line.price_subtotal * sign</attribute>
82 <attribute name="t-options">{"widget": "monetary", "display_currency": o.currency_id}</attribute>
83 </xpath>
84 <xpath expr="//table[@name='invoice_line_table']//span[@t-out='section_subtotal']" position="attributes">
85 <attribute name="t-out">section_subtotal * sign</attribute>
86 </xpath>
87 <xpath expr="//div[hasclass('clearfix')]//span[@t-field='o.amount_residual']" position="attributes">
88 <attribute name="t-field"/>
89 <attribute name="t-out">o.amount_residual * sign</attribute>
90 <attribute name="t-options">{"widget": "monetary", "display_currency": o.currency_id}</attribute>
91 </xpath>
92 <xpath expr="//div[hasclass('clearfix')]//t[@t-call='account.document_tax_totals']" position="attributes">
93 <attribute name="t-call">l10n_hu_edi.document_tax_totals</attribute>
94 </xpath>
95 <xpath expr="//div[hasclass('clearfix')]//t[@t-set='tax_totals']" position="attributes">
96 <attribute name="t-value">o._l10n_hu_get_invoice_totals_for_report()</attribute>
97 </xpath>
98 <xpath expr="//td[@name='account_invoice_line_name']/span" position="after">
99 <div t-if="line.product_id.l10n_hu_product_code_type and line.product_id.l10n_hu_product_code">
100 <span t-if="line.product_id.l10n_hu_product_code_type == 'OTHER'">Other Product Code</span>
101 <span t-else="else" t-out="line.product_id.l10n_hu_product_code_type"/>:
102 <span t-out="line.product_id.l10n_hu_product_code"/>
103 </div>
104 </xpath>
105 </template>
106
107 <template id="document_tax_totals" inherit_id="account.document_tax_totals" primary="True">
108 <xpath expr="//tr[hasclass('o_total')]" position="after">
109 <tr t-if="o.currency_id.name != 'HUF'">
110 <td><strong>Total VAT amount in HUF</strong></td>
111 <td class="text-end text-nowrap">
112 <span t-out="tax_totals['formatted_total_vat_amount_in_huf']"/>
113 </td>
114 </tr>
115 </xpath>
116 </template>
117
118 <template id="custom_header">
119 <div class="row mb8">
120 <div class="col-6">
121 <img t-if="company.logo" class="o_company_logo_small" t-att-src="image_data_uri(company.logo)" alt="Logo"/>
122 </div>
123 <div class="col-6 text-end mb4">
124 <div class="mt0 h4" t-field="company.report_header"/>
125 </div>
126 </div>
127 </template>
128 </odoo>