/
report_payment_group.xml
216 lines (208 loc) · 13.5 KB
/
report_payment_group.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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
<?xml version="1.0" encoding="utf-8"?>
<odoo>
<template id="report_payment_group_document" inherit_id="account_payment_group.report_payment_group_document">
<t t-set="o" position="after">
<t t-set="custom_header" t-value="'l10n_ar.custom_header'"/>
<t t-set="report_date" t-value="o.payment_date"/>
<t t-set="document_letter" t-value="'X'"/>
<t t-set="document_legend" t-value="'Doc. no válido como factura'"/>
<t t-set="report_number" t-value="o.document_number"/>
<t t-set="report_name" t-value="o.partner_type == 'supplier' and 'Orden de pago' or 'Recibo'"/>
<t t-set="header_address" t-value="o.receiptbook_id.report_partner_id or o.company_id.partner_id"/>
<t t-set="custom_footer">
<div class="row">
<div name="footer_left_column" class="col-8">
<t t-if="not o.company_id.l10n_ar_report_signature">
Observaciones: <span t-field="o.notes"/>
</t>
</div>
<div name="footer_right_column" class="col-4">
<t t-if="not o.company_id.l10n_ar_report_signature">
<span class="text-center">Firma y Aclaración</span>
</t>
<div class="text-right" name="pager" t-if="report_type == 'pdf'">
Page: <span class="page"/> / <span class="topage"/>
</div>
</div>
</div>
</t>
</t>
<div id="informations" position="inside">
<div class="col-6">
<!-- IDENTIFICACION (ADQUIRIENTE-LOCATARIO-PRESTARIO) -->
<!-- (14) Apellido uy Nombre: Denominicacion o Razon Soclial -->
<strong><span t-out="o.partner_type == 'supplier' and 'Proveedor: ' or 'Cliente: '"/></strong><span t-field="o.partner_id.commercial_partner_id.name"/>
<!-- (15) Domicilio Comercial -->
<br/>
<span t-out="o.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="o.partner_id.l10n_ar_afip_responsibility_type_id"/>
<!-- (17) CUIT -->
<t t-if="o.partner_id.vat and o.partner_id.l10n_latam_identification_type_id.name and o.partner_id.l10n_latam_identification_type_id.name != 'Sigd'">
<br/><strong><t t-out="o.partner_id.l10n_latam_identification_type_id.name or o.company_id.country_id.vat_label" id="inv_tax_id_label"/>:</strong> <span t-out="o.partner_id.l10n_ar_formatted_vat or o.partner_id.vat"/>
</t>
</div>
</div>
<div id="informations" position="after">
<br/>
<table class="table table-sm o_main_table" name="payments_table">
<thead>
<tr>
<th><span>Pagos</span></th>
<th class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))"><span>Importe divisa</span></th>
<th class="text-right"><span>Importe</span></th>
</tr>
</thead>
<tbody>
<!-- TODO podriamos unir todos los pagos en un foreach y cambiar la descripción segun el tipo de pago, deberiamos hacer un sort acorde al inicio -->
<t t-foreach="o.payment_ids.filtered(lambda x: x.payment_method_code in ['check_printing', 'new_third_party_checks', 'in_third_party_checks', 'out_third_party_checks']).sorted(key=lambda r:r.l10n_latam_check_payment_date or r.date)" t-as="line">
<t t-set="check" t-value="line.l10n_latam_check_id or line"/>
<tr>
<td>
<span t-out='"Cheque nro %s - %s - (%s)" % (check.check_number, check.l10n_latam_check_bank_id.name or check.journal_id.name, check.payment_method_line_id.name)'/><span t-if="check.l10n_latam_check_payment_date"> - Venc. <span t-field="check.l10n_latam_check_payment_date"/></span>
</td>
<td class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))">
<t t-if="check.currency_id">
<span class="text-nowrap" t-field="check.amount_signed" t-field-options='{"widget": "monetary", "display_currency": "check.currency_id"}'/>
</t>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="check.l10n_ar_amount_company_currency_signed"/>
</td>
</tr>
</t>
<t t-foreach="o.payment_ids.filtered(lambda x: x.tax_withholding_id)" t-as="line">
<tr>
<td>
<span t-out='"%s - %s" % (line.tax_withholding_id.name, line.withholding_number or line.name)'/>
</td>
<td class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))">
<t t-if="line.other_currency">
<span class="text-nowrap" t-field="line.amount_signed" t-field-options='{"widget": "monetary", "display_currency": "line.currency_id"}'/>
</t>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.l10n_ar_amount_company_currency_signed"/>
</td>
</tr>
</t>
<t t-foreach="o.payment_ids.filtered(lambda x: not x.tax_withholding_id and x.payment_method_code not in ['check_printing', 'new_third_party_checks', 'in_third_party_checks', 'out_third_party_checks'])" t-as="line">
<tr>
<td>
<span t-field="line.journal_id.name"/>
</td>
<td class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))">
<t t-if="line.other_currency">
<span class="text-nowrap" t-field="line.amount_signed" t-field-options='{"widget": "monetary", "display_currency": "line.currency_id"}'/>
</t>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.l10n_ar_amount_company_currency_signed"/>
</td>
</tr>
</t>
</tbody>
<tfoot>
<tr>
<td><strong><span>Total Pagado</span></strong></td>
<td class="text-right" t-if="any(o.mapped('payment_ids.other_currency'))">
<strong t-if="len(o.payment_ids.mapped('currency_id')) == 1 and o.payment_ids.mapped('currency_id') != o.currency_id"> <span class="text-nowrap" t-out="sum(o.payment_ids.mapped('amount_signed'))" t-options="{'widget': 'monetary', 'display_currency': o.payment_ids.mapped('currency_id')}"/></strong>
</td>
<td class="text-right">
<strong><span class="text-nowrap" t-field="o.payments_amount"/></strong>
</td>
</tr>
</tfoot>
</table>
<br/>
<table class="table table-sm o_main_table" name="matching_table">
<thead>
<tr>
<th><span>Comprobantes Imputados</span></th>
<th class="text-center"><span>Fecha Venc.</span></th>
<th class="text-right"><span>Importe Original</span></th>
<th class="text-right"><span>Importe Imputado</span></th>
</tr>
</thead>
<tbody>
<t t-foreach="o.with_context(payment_group_id=o.id).matched_move_line_ids" t-as="line">
<tr>
<td><span t-field='line.move_id.display_name'/></td>
<td class="text-center">
<span class="text-nowrap" t-field="line.date_maturity"/>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-out="(o.partner_type == 'supplier' and -1.0 or 1.0) * line.balance" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-out="(o.partner_type == 'supplier' and -1.0 or 1.0) * line.payment_group_matched_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/>
</td>
</tr>
</t>
<tr t-if="o.unmatched_amount">
<td>A cuenta</td>
<td class="text-center"/>
<td class="text-right o_price_total"/>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="o.unmatched_amount"/>
</td>
</tr>
</tbody>
<tfoot>
<tr>
<td colspan="3"><strong><span>Total Imputado</span></strong></td>
<td class="text-right">
<strong><span class="text-nowrap" t-out="o.unmatched_amount + o.matched_amount" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/></strong>
</td>
</tr>
</tfoot>
</table>
<br/>
<table class="table table-sm o_main_table" name="open_table" t-if="o.partner_type=='customer'" groups="l10n_ar_ux.group_include_pending_receivable_documents">
<thead>
<tr>
<th><span>Comprobantes Pendientes al</span><span t-out="datetime.datetime.today()" t-options='{"widget": "date"}'/></th>
<th class="text-center"><span>Fecha Venc.</span></th>
<th class="text-right"><span>Importe Original</span></th>
<th class="text-right"><span>Saldo</span></th>
</tr>
</thead>
<tbody>
<t t-foreach="o.env['account.move.line'].search([('partner_id', '=', o.partner_id.commercial_partner_id.id), ('account_id.account_type', '=', o.partner_type=='customer' and 'asset_receivable' or 'liability_payable'), ('reconciled', '=', False), ('account_id.deprecated', '=', False), ('move_id.state', '=', 'posted'), ('company_id', '=', o.company_id.id)])" t-as="line">
<tr>
<td><span t-field='line.move_id.display_name'/></td>
<td class="text-center">
<span class="text-nowrap" t-field="line.date_maturity"/>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.balance"/>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.amount_residual"/>
</td>
</tr>
</t>
</tbody>
<tfoot>
<tr>
<td colspan="3"><strong><span>Total Pendiente</span></strong></td>
<td class="text-right">
<strong><span class="text-nowrap" t-out="sum(o.env['account.move.line'].search([('partner_id', '=', o.partner_id.commercial_partner_id.id), ('account_id.account_type', '=', o.partner_type=='customer' and 'asset_receivable' or 'liability_payable'), ('reconciled', '=', False), ('account_id.deprecated', '=', False), ('move_id.state', '=', 'posted'), ('company_id', '=', o.company_id.id)]).mapped('amount_residual'))" t-options='{"widget": "monetary", "display_currency": o.currency_id}'/></strong>
</td>
</tr>
</tfoot>
</table>
<table>
<div class="float-left">
<span t-if="o.company_id.l10n_ar_report_signature" t-field="o.notes"/>
</div>
<div class="float-right" style="heigth:100px;width:200px;text-align:center;">
<t t-if="o.company_id.l10n_ar_report_signature">
<span t-field="o.company_id.l10n_ar_report_signature" t-options='{"widget": "image"}'/>
<span t-field="o.company_id.l10n_ar_report_signed_by"/>
</t>
</div>
</table>
</div>
</template>
</odoo>