/
sale_report_templates.xml
162 lines (128 loc) · 7.79 KB
/
sale_report_templates.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_saleorder" inherit_id="sale.report_saleorder">
<t t-call="sale.report_saleorder_document" position="attributes">
<attribute name="t-call">#{ doc._get_name_sale_report('sale.report_saleorder_document') }</attribute>
</t>
</template>
<template id="report_saleorder_pro_forma" inherit_id="sale.report_saleorder_pro_forma">
<t t-call="sale.report_saleorder_document" position="attributes">
<attribute name="t-call">#{ doc._get_name_sale_report('sale.report_saleorder_document') }</attribute>
</t>
</template>
<!-- we force priority greater than 16 so that it dont break inheritance of report_saleorder_document_inherit_sale_stock. with this we are loosing the incoterm field added but that sale_stock view -->
<template id="report_saleorder_document" priority="20" inherit_id="sale.report_saleorder_document" primary="True">
<!-- custom header and footer -->
<t t-set="doc" position="after">
<t t-set="custom_header" t-value="'l10n_ar.custom_header'"/>
<t t-set="report_date" t-value="doc.date_order"/>
<t t-set="report_number" t-value="doc.name"/>
<!-- <t t-set="pre_printed_report" t-value="doc.journal_id.l10n_ar_afip_pos_system == 'II_IM'"/> -->
<t t-set="document_letter" t-value="'X'"/>
<t t-set="document_legend">Invalid document as invoice</t>
<t t-if="not (env.context.get('proforma', False) or is_pro_forma)">
<t t-set="report_name" t-if="doc.state not in ['draft','sent']">Order</t>
<t t-set="report_name" t-if="doc.state in ['draft','sent']">Quotation</t>
</t>
<t t-if="env.context.get('proforma', False) or is_pro_forma">
<t t-set="report_name">Pro-Forma Invoice</t>
</t>
<t t-set="header_address" t-value="doc.sale_checkbook_id.report_partner_id or doc.company_id.partner_id"/>
<t t-set="custom_footer">
<div class="row">
<div name="footer_left_column" class="col-8 text-center">
</div>
<div name="footer_right_column" class="col-4 text-right">
<div name="pager" t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</t>
</t>
<!-- remove default partner address -->
<t t-set="address" position="replace"/>
<!-- remove default document title -->
<h2 position="replace"/>
<xpath expr="//span[@t-field='line.price_unit']" position="attributes">
<attribute name="t-field">line.report_price_unit</attribute>
</xpath>
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id))" position="attributes">
<attribute name="t-out">', '.join(map(lambda x: (x.description or x.name), line.report_tax_id))</attribute>
</span>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" position="attributes">
<attribute name="t-value">current_subtotal + line.report_price_subtotal</attribute>
</t>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" position="attributes">
<attribute name="t-value">current_subtotal + line.report_price_subtotal</attribute>
</t>
<span groups="account.group_show_line_subtotals_tax_included" position="replace">
<span groups="account.group_show_line_subtotals_tax_included">Amount</span>
</span>
<span t-field="line.price_subtotal" position="attributes">
<attribute name="t-field">line.report_price_subtotal</attribute>
</span>
<span t-field="line.price_total" position="attributes">
<attribute name="t-field">line.report_price_subtotal</attribute>
</span>
<!-- use column vat instead of taxes and only if vat discriminated -->
<th name="th_taxes" position="replace">
<th t-if="doc.vat_discriminated" name="th_taxes" t-attf-class="text-left {{ 'd-md-table-cell' if report_type == 'html' else '' }}"><span>% VAT</span></th>
</th>
<!-- use column vat instead of taxes and only list vat taxes-->
<td name="td_taxes" class="text-end" position="replace">
<td t-if="doc.vat_discriminated" name="td_taxes" class="text-right">
<span t-out="', '.join(map(lambda x: (x.description or x.name), line.tax_id.filtered(lambda x: x.tax_group_id.l10n_ar_vat_afip_code)))" id="line_tax_ids"/>
</td>
</td>
<div id="informations" position="replace">
<div id="informations" class="row mt8 mb8">
<div class="col-6">
<!-- IDENTIFICACION (ADQUIRIENTE-LOCATARIO-PRESTARIO) -->
<!-- (14) Apellido uy Nombre: Denominicacion o Razon Soclial -->
<strong>Customer: </strong><span t-field="doc.partner_id.commercial_partner_id.name"/>
<!-- (15) Domicilio Comercial -->
<br/>
<span t-field="doc.partner_id" t-options="{"widget": "contact", "fields": ["address"], "no_marker": true, "no_tag_br": True}"/>
<!-- (16) Responsabilidad AFIP -->
<strong>VAT Cond: </strong><span t-field="doc.partner_id.l10n_ar_afip_responsibility_type_id"/>
<!-- (17) CUIT -->
<t t-if="doc.partner_id.vat and doc.partner_id.l10n_latam_identification_type_id.name and doc.partner_id.l10n_latam_identification_type_id.name != 'Sigd'">
<br/><strong><t t-out="doc.partner_id.l10n_latam_identification_type_id.name or doc.company_id.country_id.vat_label" id="inv_tax_id_label"/>:</strong> <span t-out="doc.partner_id.l10n_ar_formatted_vat or doc.partner_id.vat"/>
</t>
</div>
<div class="col-6">
<t t-if="doc.user_id">
<strong>Salesperson:</strong>
<span t-field="doc.user_id"/>
</t>
<t t-if="doc.validity_date">
<br/><strong>Expiration: </strong>
<span t-field="doc.validity_date"/>
</t>
<t t-if="doc.payment_term_id" name="payment_term">
<br/><strong>Payment Terms: </strong><span t-field="doc.payment_term_id.name"/>
</t>
<t t-if="doc.client_order_ref">
<br/><strong>Your Reference:</strong>
<span t-field="doc.client_order_ref"/>
</t>
</div>
</div>
</div>
<t t-call="account.document_tax_totals" position="attributes">
<attribute name="t-call">l10n_ar_sale.document_tax_totals</attribute>
</t>
</template>
<template id="sale_order_portal_content_discount" inherit_id="sale.sale_order_portal_content">
<xpath expr="//t[@t-out='(1-line.discount / 100.0) * line.price_unit']" position="attributes">
<attribute name="t-out">(1-line.discount / 100.0) * line.report_price_unit</attribute>
</xpath>
</template>
<template id="document_tax_totals" inherit_id="account.document_tax_totals" primary="True">
<xpath expr="//t[@t-foreach]/tr" position="attributes">
<!-- Solo mostramos el importe sin impuestos si corresponde discriminar iva -->
<attribute name="t-if">doc.vat_discriminated</attribute>
</xpath>
</template>
</odoo>