/
report_payment_group.xml
181 lines (173 loc) · 10.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
<?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">
Observaciones: <span t-field="o.notes"/>
</div>
<div name="footer_right_column" class="col-4">
<span class="text-center">Firma y Aclaración</span>
<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-raw="o.partner_type == 'supplier' and 'Proveedor: ' or 'Cliente: '"/></strong><span t-field="o.partner_id.name"/>
<!-- (15) Domicilio Comercial -->
<br/>
<span t-esc="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-esc="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-esc="o.partner_id.l10n_ar_formatted_vat if o.partner_id.l10n_latam_identification_type_id.is_vat else 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"><span>Importe</span></th>
</tr>
</thead>
<tbody>
<t t-foreach="o.mapped('payment_ids.check_ids').sorted(key=lambda r:r.payment_date or r.issue_date)" t-as="line">
<tr>
<td><span t-raw='"Cheque nro %s - %s" % (line.name, line.bank_id.name or line.journal_id.name)'/><span t-if="line.payment_date"> - Venc. <span t-field="line.payment_date"/></span></td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.amount_company_currency"/>
</td>
</tr>
</t>
<t t-foreach="o.payment_ids.filtered(lambda x: x.tax_withholding_id)" t-as="line">
<tr>
<td><span t-raw='"%s - %s" % (line.tax_withholding_id.name, line.withholding_number or line.name)'/></td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.signed_amount_company_currency"/>
</td>
</tr>
</t>
<t t-foreach="o.payment_ids.filtered(lambda x: not x.tax_withholding_id and not x.check_ids)" t-as="line">
<tr>
<td>
<span t-field="line.journal_id.name"/>
<t t-if="line.other_currency">
<span> (</span>
<span t-field="line.signed_amount" t-field-options='{"widget": "monetary", "display_currency": "line.currency_id"}'/>
<span>)</span>
</t>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.signed_amount_company_currency"/>
</td>
</tr>
</t>
</tbody>
<tfoot>
<tr>
<td><strong><span>Total Pagado</span></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-raw="(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-raw="(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-raw="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-raw="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.internal_type', '=', o.partner_type=='customer' and 'receivable' or '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-raw="sum(o.env['account.move.line'].search([('partner_id', '=', o.partner_id.commercial_partner_id.id), ('account_id.internal_type', '=', o.partner_type=='customer' and 'receivable' or '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>
</div>
</template>
</odoo>