forked from Agofer/fix_views_14
first commit
This commit is contained in:
commit
f800728f89
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
firma_factura.png
|
||||||
8
README.md
Normal file
8
README.md
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
# Modificar vistas Odoo v14
|
||||||
|
|
||||||
|
Estos programas modifican las vistas de Odoo (modelo `ir.ui.view`),
|
||||||
|
utilizando las propiedades de herencia entre vistas para ocultar campos,
|
||||||
|
o añadir restricciones sobre los mismos.
|
||||||
|
|
||||||
|
Aplica también para la modificación de formatos impresos PDF.
|
||||||
|
|
||||||
BIN
_firma_factura.png
Normal file
BIN
_firma_factura.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 13 KiB |
176
account.move-agofer_e_invoice.py
Executable file
176
account.move-agofer_e_invoice.py
Executable file
@ -0,0 +1,176 @@
|
|||||||
|
#!/usr/bin/env python3
|
||||||
|
# -*- coding: utf-8 -*-
|
||||||
|
"""Modifica el formato QWeb de facturas y devoluciones."""
|
||||||
|
import os
|
||||||
|
import sys
|
||||||
|
import base64
|
||||||
|
import erppeek
|
||||||
|
|
||||||
|
def stringifyImage(archivo):
|
||||||
|
"""Convierte archivo en el mismo directorio a una cadena en base64."""
|
||||||
|
with open(os.path.join(__location__, archivo), 'rb') as f:
|
||||||
|
img = base64.b64encode(f.read()).decode('ascii')
|
||||||
|
return img
|
||||||
|
|
||||||
|
def use_local_resources():
|
||||||
|
"""Facilita usar recursos en el mismo directorio del script."""
|
||||||
|
global __location__
|
||||||
|
__location__ = os.path.realpath(
|
||||||
|
os.path.join(os.getcwd(), os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
def replace_extid(objeto, modelo, nuevo_extid):
|
||||||
|
"""Reemplaza el id externo de un objeto."""
|
||||||
|
if objeto._external_id == nuevo_extid:
|
||||||
|
return
|
||||||
|
id_extid = odoo.model('ir.model.data').get(
|
||||||
|
[('model', '=', modelo), ('res_id', '=', objeto.id)])
|
||||||
|
if id_extid:
|
||||||
|
try:
|
||||||
|
id_extid.unlink()
|
||||||
|
except:
|
||||||
|
xt, xc, tb = sys.exc_info()
|
||||||
|
xm = ''.join(erppeek.format_exception(xt, xc, tb, chain=False))
|
||||||
|
print('### Error\n' + (xm.strip()))
|
||||||
|
try:
|
||||||
|
objeto._set_external_id(nuevo_extid)
|
||||||
|
print('{} (#{}) -> {}'.format(objeto.name, objeto.id, nuevo_extid))
|
||||||
|
except:
|
||||||
|
xt, xc, tb = sys.exc_info()
|
||||||
|
xm = ''.join(erppeek.format_exception(xt, xc, tb, chain=False))
|
||||||
|
print('### Error\n' + (xm.strip()))
|
||||||
|
return
|
||||||
|
|
||||||
|
def main():
|
||||||
|
odoo = erppeek.Client.from_config('Odoo14_6c60')
|
||||||
|
context = {'lang':'es_CO'}
|
||||||
|
|
||||||
|
"""Por ahora, desactivar (manualmente)
|
||||||
|
account_extended.report_invoice_document_agofer.
|
||||||
|
"""
|
||||||
|
|
||||||
|
views = odoo.model('ir.ui.view')
|
||||||
|
baseid = 'account.report_invoice_document'
|
||||||
|
viewname = 'report.invoice.factura_o_devolucion_agofer'
|
||||||
|
viewextid = 'agofer_view.factura_o_devolucion'
|
||||||
|
|
||||||
|
reports = odoo.model('ir.actions.report')
|
||||||
|
repextid = 'account.account_invoices'
|
||||||
|
|
||||||
|
papers = odoo.model('report.paperformat')
|
||||||
|
papextid = 'agofer_paper.factura_carta'
|
||||||
|
papextid_base = 'base.paperformat_us'
|
||||||
|
|
||||||
|
attachments = odoo.model('ir.attachment')
|
||||||
|
attextid_ff = 'agofer_adjunto.firma_factura'
|
||||||
|
attextid_iw = 'agofer_adjunto.icono_whatsapp'
|
||||||
|
|
||||||
|
vista_base = views.get(baseid)
|
||||||
|
assert vista_base.name == 'report_invoice_document'
|
||||||
|
reporte = open(os.path.join(__location__,
|
||||||
|
'factura_o_devolucion_v14.xml')).read()
|
||||||
|
|
||||||
|
formato_carta = papers.get(papextid_base)
|
||||||
|
|
||||||
|
destino_arch = """<?xml version="1.0"?>
|
||||||
|
<data name="{}" inherit_id="{}">
|
||||||
|
<xpath expr="//t[@t-name='account.report_invoice_document']" position="replace">
|
||||||
|
{}
|
||||||
|
</xpath>
|
||||||
|
</data>
|
||||||
|
""".format(viewname,baseid,reporte)
|
||||||
|
|
||||||
|
viewvalues = {
|
||||||
|
'active': True,
|
||||||
|
'inherit_id': vista_base.id,
|
||||||
|
'mode': 'extension',
|
||||||
|
'name': viewname,
|
||||||
|
'priority': 15,
|
||||||
|
'type': 'qweb',
|
||||||
|
}
|
||||||
|
repvalues = {
|
||||||
|
'name': 'Factura/Devolución',
|
||||||
|
'attachment': False,
|
||||||
|
'attachment_use': False,
|
||||||
|
'report_type': 'qweb-html',
|
||||||
|
}
|
||||||
|
papvalues = {
|
||||||
|
'name': 'Tamaño carta para factura',
|
||||||
|
'dpi': 120,
|
||||||
|
'format': 'Letter',
|
||||||
|
'header_line': False,
|
||||||
|
'header_spacing': 33,
|
||||||
|
'margin_bottom': 17,
|
||||||
|
'margin_left': 7,
|
||||||
|
'margin_right': 7,
|
||||||
|
'margin_top': 43,
|
||||||
|
'orientation': 'Portrait',
|
||||||
|
'page_height': 0,
|
||||||
|
'page_width': 0,
|
||||||
|
}
|
||||||
|
attvalues_ff = {
|
||||||
|
'datas': stringifyImage('firma_factura.png'),
|
||||||
|
'store_fname': 'firma_factura.png',
|
||||||
|
'db_datas': False,
|
||||||
|
'description': False,
|
||||||
|
'index_content': 'image',
|
||||||
|
'mimetype': 'image/png',
|
||||||
|
'name': 'firma_factura.png',
|
||||||
|
'res_id': 0,
|
||||||
|
'res_model': 'ir.ui.view',
|
||||||
|
'type': 'binary',
|
||||||
|
}
|
||||||
|
attvalues_iw = {
|
||||||
|
'datas': stringifyImage('WhatsApp_Number.png'),
|
||||||
|
'store_fname': 'WhatsApp_Number.png',
|
||||||
|
'db_datas': False,
|
||||||
|
'description': False,
|
||||||
|
'index_content': 'image',
|
||||||
|
'mimetype': 'image/png',
|
||||||
|
'name': 'WhatsApp_Number.png',
|
||||||
|
'res_id': 0,
|
||||||
|
'res_model': 'ir.ui.view',
|
||||||
|
'type': 'binary',
|
||||||
|
}
|
||||||
|
|
||||||
|
adjunto_ff = attachments.get(attextid_ff)
|
||||||
|
if adjunto_ff:
|
||||||
|
adjunto_ff.write(attvalues_ff)
|
||||||
|
else:
|
||||||
|
adjunto_ff = attachments.create(attvalues_ff)
|
||||||
|
adjunto_ff._set_external_id(attextid_ff)
|
||||||
|
#destino_arch = destino_arch.replace('firmaurl', adjunto_ff.website_url)
|
||||||
|
viewvalues['arch'] = destino_arch
|
||||||
|
|
||||||
|
adjunto_iw = attachments.get(attextid_iw)
|
||||||
|
if adjunto_iw:
|
||||||
|
adjunto_iw.write(attvalues_iw)
|
||||||
|
else:
|
||||||
|
adjunto_iw = attachments.create(attvalues_iw)
|
||||||
|
adjunto_iw._set_external_id(attextid_iw)
|
||||||
|
viewvalues['arch'] = destino_arch
|
||||||
|
|
||||||
|
destino_vista = views.get(viewextid)
|
||||||
|
if destino_vista:
|
||||||
|
destino_vista.write(viewvalues)
|
||||||
|
else:
|
||||||
|
destino_vista = views.create(viewvalues)
|
||||||
|
destino_vista._set_external_id(viewextid)
|
||||||
|
|
||||||
|
paper = papers.get(papextid)
|
||||||
|
if paper:
|
||||||
|
paper.write(papvalues)
|
||||||
|
else:
|
||||||
|
paper = papers.create(papvalues)
|
||||||
|
paper._set_external_id(papextid)
|
||||||
|
repvalues['paperformat_id'] = paper.id
|
||||||
|
|
||||||
|
# Asegurarse que el nombre de la Cedula de Ciudadania este abreviado:
|
||||||
|
# cc_extid = 'partner_extended_co.partner_co_document_type_CC'
|
||||||
|
# odoo.model('res.document.type').get(cc_extid).name = 'CC'
|
||||||
|
|
||||||
|
reports.get(repextid).write(repvalues)
|
||||||
|
|
||||||
|
if __name__ == "__main__":
|
||||||
|
use_local_resources()
|
||||||
|
main()
|
||||||
|
|
||||||
441
factura_o_devolucion_v14.xml
Normal file
441
factura_o_devolucion_v14.xml
Normal file
@ -0,0 +1,441 @@
|
|||||||
|
<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&value=%s&width=%s&height=%s' % (is_old_einvoice and o.ei_qr_text or o.ei_qr.replace('&', '%26'), 153, 153)" / -->
|
||||||
|
<img t-att-src="'/report/barcode/?type=QR&value=%s&width=%s&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 > 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" />
|
||||||
|
 
|
||||||
|
<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.499–1 :
|
||||||
|
</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="{"widget": "monetary", "display_currency": 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="{"widget": "date"}"/></i>
|
||||||
|
</td>
|
||||||
|
<td class="text-right">
|
||||||
|
<span t-esc="payment_vals['amount']" t-options="{"widget": "monetary", "display_currency": o.currency_id}"/>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</t>
|
||||||
|
<t t-if="len(payments_vals) > 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. 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. 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. 2 de la
|
||||||
|
Ley 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. 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 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>
|
||||||
Loading…
Reference in New Issue
Block a user