fix_views_14_extended/factura_o_devolucion_v14.xml
2021-06-02 19:32:37 -05:00

442 lines
27 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<t t-name="account.report_invoice_document">
<t t-call="web.basic_layout">
<t t-set="o" t-value="o.with_context(lang=lang)"/>
<t t-set="is_einvoice" t-value="o.state == 'posted' and o.move_type in ['out_invoice', 'out_refund']" />
<t t-set="document_title">
<span t-if="o.move_type == 'out_invoice' and is_einvoice">Factura electrónica de venta</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'draft'">Factura borrador</span>
<span t-if="o.move_type == 'out_invoice' and o.state == 'cancel'">Factura anulada</span>
<span t-if="o.move_type == 'out_refund' and o.state == 'posted'">Devolución</span>
<span t-if="o.move_type == 'out_refund' and o.state == 'draft'">Devolución borrador</span>
<span t-if="o.move_type == 'out_refund' and o.state == 'cancel'">Devolución anulada</span>
<span t-if="o.move_type == 'in_refund'">Devolución de proveedor</span>
<span t-if="o.move_type == 'in_invoice'">
<span t-if="o.journal_id.code == 'NFR'">Soporte en adquisición efectuada a no-obligados a facturar</span>
<span t-if="o.journal_id.code != 'NFR'">Factura de proveedor</span>
</span>
<span t-if="o.name != '/'" t-field="o.name"/>
</t>
<div class="header">
<div class="row">
<div t-attf-class="{{ is_einvoice and 'col-8 col-sm-auto' or 'col-9 col-sm-auto' }}">
<div class="card card-info">
<div class="card-body">
<h4 class="card-title text-dark">
<strong t-raw="document_title"/>
<!-- Descomentar cuando cierren
https://github.com/OCA/reporting-engine/pull/476 -->
<!-- small class="not-first-page"> (…continúa)</small -->
</h4>
<div class="row">
<div class="col-5 col-sm-12">
<p>
<strong>Fecha:</strong>
<span t-field="o.invoice_date" />
<small t-esc="o.create_date.strftime('%H:%M:%S')" />
</p>
<p t-if="o.move_type == 'out_invoice' and o.state != 'cancel'">
<strong>Fecha de vencimiento:</strong>
<span t-field="o.invoice_date_due" />
</p>
</div>
<div class="col-7 col-sm-12">
<p t-if="o.move_type in ['out_invoice','in_invoice'] and o.invoice_payment_term_id.note">
<strong>Condición de pago:</strong>
<span t-field="o.invoice_payment_term_id.note" style="font-weight:normal;" />
</p>
<p>
<t t-if="o.invoice_incoterm_id">
<strong>Términos de negociación: </strong>
<code t-esc="o.invoice_incoterm_id.name" />
:
<t t-esc="o.invoice_incoterm_id.description" />
</t>
</p>
</div>
</div>
</div>
</div>
</div>
<div t-if="is_einvoice" class="col-2 col-sm-auto">
<!-- img t-att-src="'/report/barcode/?move_type=QR&amp;value=%s&amp;width=%s&amp;height=%s' % (is_old_einvoice and o.ei_qr_text or o.ei_qr.replace('&amp;', '%26'), 153, 153)" / -->
<img t-att-src="'/report/barcode/?type=QR&amp;value=%s&amp;width=%s&amp;height=%s' % (o.company_id.website, 153, 153)" t-if="o.ei_qr" />
</div>
<div class="col-2 col-sm-4">
<img t-if="o.company_id.logo" t-att-src="'data:image/png;base64,%s' % to_text(o.company_id.logo)" width="153" height="80" class="img-fluid w-100" />
</div>
</div>
</div>
<div class="page">
<t t-set="weight" t-value="'{:,.2f}'.format(sum((l.product_id.weight &gt; 0 and l.product_id.weight * l.quantity or 0) for l in o.invoice_line_ids))" />
<!-- Data for PDF Outline only -->
<div style="position: absolute; left: -999px;">
<h1 class="h6" t-raw="document_title"/>
</div>
<!-- / Data for PDF Outline only -->
<div class="row">
<div class="col-9">
<div class="card card-info">
<div class="card-header">
<h3 class="card-title text-dark">
<strong t-field="o.partner_id.name" />
&#160;
<span class="text-nowrap">
<!-- Reemplazar por abbr cuando se cree el campo -->
<span t-field="o.partner_id.ref_type_id.code" />
<span t-field="o.partner_id.ref_num" />
<span t-if="o.partner_id.ref_type_id.code == 'NI'">
<span t-field="o.partner_id.verification_code" />
</span>
</span>
</h3>
</div>
<div class="card-body">
<div class="row">
<div t-attf-class="{{ o.partner_shipping_id and (o.partner_shipping_id != o.partner_id) and 'col-xs-6' or 'col-xs-12' }}">
<div class="mb0">
<div class="h5 mb-1" t-if="not o.partner_shipping_id or o.partner_shipping_id == o.partner_id">Dirección:</div>
<div class="h5 mb-1" t-if="o.partner_shipping_id and o.partner_shipping_id != o.partner_id">Dirección de facturación:</div>
<address/>
<div class="list-group">
<p class="list-group-item" t-field="o.partner_id.street" itemprop="name" />
<t t-if="o.partner_id.street2">
<p class="list-group-item" t-field="o.partner_id.street2" />
</t>
<p class="list-group-item">
<span t-field="o.partner_id.city_id.name" />,
<span t-field="o.partner_id.state_id.name" />
</p>
<p class="list-group-item" t-if="o.partner_id.phone" itemprop="telephone">
<i class="fa fa-phone" />
<span t-field="o.partner_id.phone" />
</p>
<p class="list-group-item" t-if="o.partner_id.email" itemprop="email">
<i class="fa fa-envelope-o" />
<small t-esc="o.partner_id.email.split(';')[0]" />
</p>
</div>
</div>
</div>
<div t-if="o.partner_shipping_id and o.partner_shipping_id != o.partner_id" class="col-xs-6">
<div class="list-group mb0">
<h5 t-if="o.move_type not in ['out_refund','in_invoice']">
Dirección de envío:
</h5>
<h5 t-if="o.move_type in ['out_refund','in_invoice']">
Dirección de recepción:
</h5>
<p t-field="o.partner_shipping_id.street" />
<t t-if="o.partner_id.street2">
<p t-field="o.partner_shipping_id.street2" />
</t>
<p>
<span t-field="o.partner_shipping_id.city_id.name" />,
<span t-field="o.partner_shipping_id.state_id.name" />
</p>
<p t-if="o.partner_shipping_id.phone" itemprop="telephone">
<i class="fa fa-phone" />
<span t-field="o.partner_shipping_id.phone" />
</p>
<p t-if="o.partner_shipping_id.email" itemprop="email">
<span t-field="o.partner_shipping_id.email" />
</p>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="col-3 card border-0">
<p style="font-size:9t; line-height:10pt;">
Agofer S.A.S. NIT 800.216.4991 :
</p>
<ul class="fa-ul" style="font-size:8pt; line-height:9pt; margin-left:1.2em;">
<li>
<i class="fa-li fa fa-caret-right" />
Autorretenedor Res. №0010 1994-02-11
</li>
<li>
<i class="fa-li fa fa-caret-right" />
Gran contribuyente Res.DIAN №9061 2020-12-10
</li>
<li>
<i class="fa-li fa fa-caret-right" />
Régimen Común y Agente Retenedor de IVA
</li>
<li>
<i class="fa-li fa fa-caret-right" />
Actividad Económica CIIU 4752
</li>
<t t-if="o.journal_id.resolution_id.number">
<t t-foreach="o.journal_id.resolution_id.description.split('|')" t-as="res">
<li>
<i class="fa-li fa fa-caret-right" />
<t t-esc="res" />
</li>
</t>
</t>
</ul>
<i class="fa fa-whatsapp" /><small><strong>WhatsApp 310 674 4444</strong></small>
</div>
</div>
<div id="informations" class="row mt32 mb32">
<div class="col-auto col-3 mw-100 mb-2">
<strong>Peso teórico total:</strong>
<p>
<t t-raw="weight" />
kg
</p>
</div>
<div class="col-auto col-3 mw-100 mb-2" t-if="o.invoice_origin" name="origin">
<strong>Source:</strong>
<p class="m-0" t-field="o.invoice_origin"/>
</div>
<div class="col-auto col-3 mw-100 mb-2" t-if="o.partner_id.ref" name="customer_code">
<strong>Customer Code:</strong>
<p class="m-0" t-field="o.partner_id.ref"/>
</div>
<div class="col-auto col-3 mw-100 mb-2" t-if="o.ref" name="reference">
<strong>Reference:</strong>
<p class="m-0" t-field="o.ref"/>
</div>
</div>
<t t-set="display_discount" t-value="any(l.discount for l in o.invoice_line_ids)"/>
<table class="table table-sm o_main_table" name="invoice_line_table">
<thead>
<tr>
<th></th>
<th name="th_description" class="text-left"><span>Description</span></th>
<th name="th_quantity" class="text-center" colspan="2"><span>Quantity</span></th>
<th name="th_priceunit" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Unit Price</span></th>
<th name="th_price_unit" t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span>Disc.%</span>
</th>
<th name="th_taxes" t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}"><span>Taxes</span></th>
<th name="th_subtotal" class="text-right">
<span groups="account.group_show_line_subtotals_tax_excluded">Amount</span>
<span groups="account.group_show_line_subtotals_tax_included">Total Price</span>
</th>
</tr>
</thead>
<tbody class="invoice_tbody">
<t t-set="current_subtotal" t-value="0"/>
<t t-set="lines" t-value="o.invoice_line_ids.sorted(key=lambda l: (-l.sequence, l.date, l.move_name, -l.id), reverse=True)"/>
<t t-foreach="lines" t-as="line">
<t t-set="current_subtotal" t-value="current_subtotal + line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<t t-set="current_subtotal" t-value="current_subtotal + line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
<tr t-att-class="'bg-200 font-weight-bold o_line_section' if line.display_type == 'line_section' else 'font-italic o_line_note' if line.display_type == 'line_note' else ''">
<t t-if="not line.display_type" name="account_invoice_line_accountable">
<td>
<tt>
<small t-esc="line_index + 1" />
</tt>
</td>
<td name="account_invoice_line_name"><span t-field="line.name" t-options="{'widget': 'text'}"/></td>
<td class="text-right">
<span t-field="line.quantity"/>
</td>
<td class="text-left">
<span t-field="line.product_uom_id" />
</td>
<td t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span class="text-nowrap" t-field="line.price_unit"/>
</td>
<td t-if="display_discount" t-attf-class="text-right {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span class="text-nowrap" t-field="line.discount"/>
</td>
<td t-attf-class="text-left {{ 'd-none d-md-table-cell' if report_type == 'html' else '' }}">
<span t-esc="', '.join(map(lambda x: (x.description or x.name), line.tax_ids))" id="line_tax_ids"/>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-field="line.price_subtotal" groups="account.group_show_line_subtotals_tax_excluded"/>
<span class="text-nowrap" t-field="line.price_total" groups="account.group_show_line_subtotals_tax_included"/>
</td>
</t>
<t t-if="line.display_type == 'line_section'">
<td colspan="99">
<span t-field="line.name" t-options="{'widget': 'text'}"/>
</td>
<t t-set="current_section" t-value="line"/>
<t t-set="current_subtotal" t-value="0"/>
</t>
<t t-if="line.display_type == 'line_note'">
<td colspan="99">
<span t-field="line.name" t-options="{'widget': 'text'}"/>
</td>
</t>
</tr>
<t t-if="current_section and (line_last or lines[line_index+1].display_type == 'line_section')">
<tr class="is-subtotal text-right">
<td colspan="99">
<strong class="mr16">Subtotal</strong>
<span t-esc="current_subtotal" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</t>
</t>
</tbody>
<tfoot>
<tr>
<td colspan="2">
<small>
<t t-esc="len(lines)" />
<t t-esc="len(lines) == 1 and 'ítem' or 'ítems'" />
</small>
</td>
</tr>
</tfoot>
</table>
<div class="clearfix">
<div id="total" class="row">
<div t-attf-class="#{'col-6' if report_type != 'html' else 'col-sm-7 col-md-6'} ml-auto">
<table class="table table-sm" style="page-break-inside: avoid;">
<tr class="border-black o_subtotal" style="">
<td><strong>Subtotal</strong></td>
<td class="text-right">
<span t-field="o.amount_untaxed"/>
</td>
</tr>
<t t-foreach="o.amount_by_group" t-as="amount_by_group">
<tr style="">
<t t-if="len(o.line_ids.filtered(lambda line: line.tax_line_id)) in [0, 1] and o.amount_untaxed == amount_by_group[2]">
<td><span class="text-nowrap" t-esc="amount_by_group[0]"/></td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-esc="amount_by_group[3]"/>
</td>
</t>
<t t-else="">
<td>
<span t-esc="amount_by_group[0]"/>
<span class="text-nowrap"> on
<t t-esc="amount_by_group[4]"/>
</span>
</td>
<td class="text-right o_price_total">
<span class="text-nowrap" t-esc="amount_by_group[3]"/>
</td>
</t>
</tr>
</t>
<tr class="border-black o_total">
<td><strong>Total</strong></td>
<td class="text-right">
<span class="text-nowrap" t-field="o.amount_total"/>
</td>
</tr>
<t t-if="print_with_payments">
<t t-if="o.payment_state != 'invoicing_legacy'">
<t t-set="payments_vals" t-value="o.sudo()._get_reconciled_info_JSON_values()"/>
<t t-foreach="payments_vals" t-as="payment_vals">
<tr>
<td>
<i class="oe_form_field text-right oe_payment_label">Paid on <t t-esc="payment_vals['date']" t-options="{&quot;widget&quot;: &quot;date&quot;}"/></i>
</td>
<td class="text-right">
<span t-esc="payment_vals['amount']" t-options="{&quot;widget&quot;: &quot;monetary&quot;, &quot;display_currency&quot;: o.currency_id}"/>
</td>
</tr>
</t>
<t t-if="len(payments_vals) &gt; 0">
<tr class="border-black">
<td><strong>Amount Due</strong></td>
<td class="text-right">
<span t-field="o.amount_residual"/>
</td>
</tr>
</t>
</t>
</t>
</table>
</div>
</div>
</div>
<div class="row" t-if="o.move_type == 'out_invoice'">
<div class="col-xs-12">
<div class="alert alert-info mb8" style="padding:8px;">
<p class="text-justify text-default" style="font-size:9pt;line-height:9pt;color:black;">
<span t-if="is_einvoice">
Ésta es una <strong><em>representación gráfica</em></strong>
de la factura electrónica, que para todos sus
efectos cumple con lo dispuesto en el
Art.&#160;774 del Código de Comercio, y en el
Decreto 2242 de 2015.
</span>
<span t-if="not is_einvoice">
Esta factura cumple, para todos sus
efectos, con lo dispuesto en el
Art.&#160;774 del Código de Comercio.
</span>
Las mercancías viajan por cuenta y riesgo del comprador
salvo estipulación al contrario en esta misma factura.
Solo se aceptan devoluciones dentro de los
diez días calendario siguientes a la recepción de
la mercancía, conforme al Art.&#160;2 de la
Ley&#160;1231 de 2008, y no se aceptan reclamos
después de diez días de recibida la factura.
Esta factura causará intereses moratorios a la tasa
máxima permitida por la ley, a partir de la fecha de
vencimiento.
Se hace constar que la firma de una persona distinta al
comprador indica que dicha persona se encuentra
autorizada expresamente por el comprador para recibir
la mercancía y firmar el documento como dependiente
suyo, acorde al Art.&#160;640 del Código de Comercio.
Firmada la presente, el cliente autoriza a ser
consultado y reportado en bases de datos y
centrales de riesgos, y confirma la autorización
dada a Agofer para almacenar y tratar sus datos
personales según la Ley&#160;1581 de 2012.
La celebración del presente contrato se realiza
únicamente en las jurisdicciones donde Agofer está
matriculado ante cámara de comercio. Todo
material es entregado al cliente en las instalaciones
de Agofer. La actividad de transporte de mercancías no
es ejecutada por Agofer: es asumida por el cliente a
través de terceros no vinculados a la Compañía.
Este documento es prueba de la negociación
realizada entre el cliente y Agofer S.A.S. en la
jurisdicción de <t t-esc="o.journal_id.name.rsplit(' ',1)[-1]" />.
El cierre de esta venta es realizado únicamente por el
personal autorizado en nuestra sucursal en dicha ciudad.
</p>
</div>
</div>
</div>
<p t-if="o.move_type in ('out_invoice', 'in_refund') and o.payment_reference" name="payment_communication">
Please use the following communication for your payment : <b><span t-field="o.payment_reference"/></b>
</p>
<p t-if="o.invoice_payment_term_id" name="payment_term">
<span t-field="o.invoice_payment_term_id.note"/>
</p>
<p t-if="o.narration and o.narration!='false'" name="comment">
<span t-field="o.narration"/>
</p>
<p t-if="o.fiscal_position_id.note" name="note">
<span t-field="o.fiscal_position_id.note"/>
</p>
<p t-if="o.invoice_incoterm_id" name="incoterm">
<strong>Incoterm: </strong><span t-field="o.invoice_incoterm_id.code"/> - <span t-field="o.invoice_incoterm_id.name"/>
</p>
<div id="qrcode" t-if="o.display_qr_code">
<p t-if="qr_code_urls.get(o.id)">
<strong class="text-center">Scan me with your banking app.</strong><br/><br/>
<img class="border border-dark rounded" t-att-src="qr_code_urls[o.id]"/>
</p>
</div>
</div>
</t>
</t>