diff --git a/account.move-agofer_invoice_format.py b/account.move-agofer_invoice_format.py new file mode 100755 index 0000000..b46a095 --- /dev/null +++ b/account.move-agofer_invoice_format.py @@ -0,0 +1,109 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""Modifica el formato QWeb de facturas y devoluciones.""" +import os +import sys +import base64 +import odooly + +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 main(): + odooly.Client._config_file = os.path.expanduser('~/.config/odooly.ini') + odoo = odooly.Client.from_config('Odoo14_Production') + #odoo = odooly.Client.from_config('odootest27') + + """Desactivar manualmente la vista: + * sale_stock.report_invoice_document_inherit_sale_stock + """ + + views = odoo.env['ir.ui.view'] + baseid = 'account.report_invoice_document' + viewname = 'report.invoice.factura_o_devolucion_agofer' + viewextid = 'agofer_view.factura_o_devolucion' + + reports = odoo.env['ir.actions.report'] + repextid = 'account.account_invoices' + + papers = odoo.env['report.paperformat'] + papextid = 'agofer_paper.factura_carta' + papextid_base = 'base.paperformat_us' + + attachments = odoo.env['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 = """ + + + {} + + + """.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-pdf', + } + papvalues = { + 'name': 'Tamaño carta para factura', + 'dpi': 90, + 'format': 'Letter', + 'header_line': False, + 'header_spacing': 33, + 'margin_bottom': 27, + 'margin_left': 7, + 'margin_right': 7, + 'margin_top': 43, + 'orientation': 'Portrait', + 'page_height': 0, + 'page_width': 0, + } + 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.env['res.document.type'].get(cc_extid).name = 'CC' + + reports.get(repextid).write(repvalues) + +if __name__ == "__main__": + use_local_resources() + main() + diff --git a/agofer_payslip.xml b/agofer_payslip.xml new file mode 100644 index 0000000..3a9e4d8 --- /dev/null +++ b/agofer_payslip.xml @@ -0,0 +1,291 @@ + + + +
+
+
+
+ + + +
+
+ NIT +
+
+
+

+ Borrador de + Comprobante de + + +

+
+
+

Período:

+

Fecha de liquidación:

+
+
+
+
+
+
+
+
+
+

+ + + + +

+
+
+
+
+

+

+ +

+ +

+ + Ah. + Cte. + +

+
+
+
+
+
+

+ Contrato +

+

+ +

+

+ Salario: + +

+
+
+
+ +
+
+
+
+
+
+
+ +
+
+ Devengos +
+
    + + + +
  • +
    +
    + + + + [ horas] + + + [ días] + + +
    +
    +
    +
  • +
    +
  • +
    +
    Total
    +
    + +
    +
    +
  • +
+
+
+ +
+
+ Seguridad Social y Parafiscales +
+
    +
  • + Fondo de pensiones y cesantías: + +
  • +
  • + Fondo de pensiones: + +
  • +
  • + Fondo de cesantías: + +
  • +
  • + Entidad promotora de salud: + +
  • +
  • + Caja de compensación: + +
  • +
  • + Administradora de riesgos laborales: + +
  • +
+
+
+
+ +
+
+ Deducciones +
+
    + + + +
  • +
    +
    +
    +
    +
  • +
    +
  • +
    +
    Total
    +
    + +
    +
    +
  • +
+
+
+
+
+
+
+ Neto a pagar +
+
+ +
+
+
+
+

+ + + +

+
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+ + , + + + +
+ +
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+ +
+
+
+
+
+ + , + + + +
+ +
+
+
+
+
+
diff --git a/factura_o_devolucion_v14.xml b/factura_o_devolucion_v14.xml index 1e28b6d..f551228 100644 --- a/factura_o_devolucion_v14.xml +++ b/factura_o_devolucion_v14.xml @@ -7,9 +7,9 @@ Factura borrador Factura anulada - Devolución - Devolución borrador - Devolución anulada + Nota crédito de una factura electrónica de venta + Nota crédito borrador + Nota crédito anulada de una factura electrónica de venta Devolución de proveedor @@ -18,42 +18,54 @@ + +
+ + +
+ +
-
-
-

+
+
+

+ https://github.com/OCA/reporting-engine/pull/476 + (merged en 2021-07-29) --> -

-
-
-

+

+
+
+

Fecha: - +

-

- Fecha de vencimiento: +

+ Vencimiento:

-
-

- Condición de pago: - +

+

+ + Condición de pago: + +

-

- +

+ Términos de negociación: - + : - + -

@@ -61,10 +73,13 @@
- - + + + + +
-
+
@@ -78,51 +93,52 @@
-
-
-

- +
+
+

+   - + - + -

+

-
-
-
-
-
Dirección:
-
Dirección de facturación:
-
-
-

+

+
+
+
+
Dirección:
+
Dirección de facturación:
+
+ -

+
+ -

- , - -

-

+
+ , + + +
-

-

+ + +
-

-
+ +
-
-
+
+
Dirección de envío:
@@ -151,89 +167,150 @@
-
-

- Agofer S.A.S. NIT 800.216.499–1 : -

-
    -
  • - - Autorretenedor Res. №0010 1994-02-11 -
  • -
  • - - Gran contribuyente Res.DIAN №9061 2020-12-10 -
  • -
  • - - Régimen Común y Agente Retenedor de IVA -
  • -
  • - - Actividad Económica CIIU 4752 -
  • - - +
    +
    +

    + Agofer S.A.S. NIT 800.216.499–1: +

    +
      +
    • + + Autorretenedor Res. №0010 1994-02-11 +
    • +
    • + + Gran contribuyente Res.DIAN №9061 2020-12-10 +
    • +
    • + + Régimen Común y Agente Retenedor de IVA +
    • +
    • + + Actividad Económica CIIU 4752 +
    • + + + + + + +
    • - +
    • + + +
    • + + +
    • +
      +
      -
      -
    - WhatsApp 310 674 4444 + +
+ WhatsApp 310 674 4444 +
- - -
-
+ +
+
+ Source: +

+ + + + + + + +

+ +

+

+ +

+

+ Description: +
+ +

+
+
+
+ Orden de compra: +

+

+
+ Ref.: + +
+

+
+
+ + Asesor comercial: +

+ + + . + + +
+ +
+

+
+
Peso teórico total:

kg

-
- Source: -

-

-
- Customer Code: -

-

-
- Reference: -

-

+ + - - - - - + + + + - - + + + + + + + + @@ -242,7 +319,13 @@ - + @@ -250,17 +333,20 @@ - + @@ -298,18 +384,48 @@
DescriptionQuantityUnit Price + DescriptionQuantityUnit Price Disc.% Taxes + Amount Total Price IVA
+ + + + + + - + - - - - + + + + + + +
- -
+ +
-
- +
+
+

+ Observaciones: +
+ + +

+

+ + +

+
+
+
+

+ Barras corrugadas para refuerzo de concreto +

+
+
+
    +
  • + + Revise y conserve las etiquetas; + lo exige la Res.1856 de 2017 +
  • +
+
+
+
+
+
- + + + + + @@ -345,7 +467,7 @@ Paid on @@ -353,7 +475,7 @@ @@ -363,18 +485,52 @@ + +
+
+ +
+
:
+
+
+
:
+
+
+
+
+
+ + Favor realizar sus pagos a la +
+ Cuenta Corriente 210-05341-9 +
+ Banco de Occidente +
+
+
+
+
+ +
+
+ +
+
+
+
+
-
+
-

- +

+ Ésta es una representación gráfica 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. - + Esta factura cumple, para todos sus efectos, con lo dispuesto en el Art. 774 del Código de Comercio. @@ -408,33 +564,133 @@ 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 . + jurisdicción de . El cierre de esta venta es realizado únicamente por el personal autorizado en nuestra sucursal en dicha ciudad.

-

- Please use the following communication for your payment : -

-

- -

-

- -

-

- -

-

- Incoterm: - -

-
-

- Scan me with your banking app.

- -

+ +
+
+
+

+ Al pagar esta factura exija recibo de caja o recibo + provisional de caja; sin éste no se aceptan reclamos. + Si paga con cheque, coloque sello restrictivo a nombre + de Agofer S.A.S. + Verifique la mercancía al momento de ser entregada; Agofer + no se hace responsable por faltantes o deterioro detectados + después de entregado el material o que no cuenten con su + correspondiente anotación o señalamiento en la factura o + remisión, ni por vicios sobre el mismo que sean suceptibles + de ser verificados a simple vista o con ayuda de + instrumentos de medición básicos. + +
+ Para aceptar o rechazar esta factura, consulte el mensaje enviado vía e-mail + junto con los documentos adjuntos. +
+

+
+
+
+
+
+

+ + Transportador: +
+
+ + + Empresa de transporte: +
+
+ + + Placa: + +

+
+ +
+
+
+
+
+ +
+ +
+
+
+
+
+
+
+ + Acepto esta factura y recibo conforme + +
+ +
+
+
+ +
+ diff --git a/hr_payslip_override.py b/hr_payslip_override.py new file mode 100755 index 0000000..d72d07f --- /dev/null +++ b/hr_payslip_override.py @@ -0,0 +1,79 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""Modifies all of the HR payslip format.""" +import os +import sys +import odooly + +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 main(): + odooly.Client._config_file = os.path.expanduser('~/.config/odooly.ini') + odoo = odooly.Client.from_config('Odoo14_Production') + + views = odoo.env['ir.ui.view'] + reports = odoo.env['ir.actions.report'] + papers = odoo.env['report.paperformat'] + + baseid = 'hr_avancys.print_report_payslip' + + qweb = open(os.path.join(__location__, 'agofer_payslip.xml')).read() + + viewextid = 'agofer_view.override_payslip' + viewname = 'override_payslip' + viewarch = """ + + + + {2} + + + """.format(viewname, baseid, qweb) + + repextid = 'hr_avancys.action_print_report_payslip' + papextid = 'agofer_paper.factura_carta' + + base_view = views.get(baseid) + assert base_view.name == 'print_report_payslip' + + viewvalues = { + 'arch': viewarch, + 'active': True, + 'mode': 'extension', + 'inherit_id': base_view.id, + 'name': viewname, + 'priority': 16, + 'type': 'qweb', + 'model': False, + } + repvalues = { + 'name': 'Comprobante de nómina', + 'report_type': 'qweb-pdf', + 'multi': False, + 'attachment_use': False, + 'attachment': False, + 'paperformat_id': papers.get(papextid).id, + } + + try: + reports.get(repextid).write(repvalues) + + newview = views.get(viewextid) + if newview: + newview.write(viewvalues) + else: + newview = views.create(viewvalues) + newview._set_external_id(viewextid) + except: + xt, xc, tb = sys.exc_info() + xm = ''.join(odooly.format_exception(xt, xc, tb, chain=False)) + print('### Error\n' + xm.strip()) + +if __name__ == "__main__": + use_local_resources() + main() + diff --git a/hr_payslip_remove_worked_days.py b/hr_payslip_remove_worked_days.py new file mode 100755 index 0000000..c49741d --- /dev/null +++ b/hr_payslip_remove_worked_days.py @@ -0,0 +1,51 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""Removes Worked Days from employee termination slip.""" +import os +import sys +import odooly + +def main(): + odooly.Client._config_file = os.path.expanduser('~/.config/odooly.ini') + odoo = odooly.Client.from_config('Odoo14_Production') + + views = odoo.env['ir.ui.view'] + + baseid = 'hr_avancys.print_report_payslip' + + viewextid = 'agofer_view.hide_worked_days' + viewname = 'hide_worked_days' + viewarch = """ + + + """.format(viewname, baseid) + + vista_base = views.get(baseid) + assert vista_base.name == 'print_report_payslip' + + viewvalues = { + 'arch': viewarch, + 'active': True, + 'mode': 'extension', + 'inherit_id': vista_base.id, + 'name': viewname, + 'priority': 16, + 'type': 'qweb', + 'model': False, + } + + try: + newview = views.get(viewextid) + if newview: + newview.write(viewvalues) + else: + newview = views.create(viewvalues) + newview._set_external_id(viewextid) + except: + xt, xc, tb = sys.exc_info() + xm = ''.join(odooly.format_exception(xt, xc, tb, chain=False)) + print('### Error\n' + xm.strip()) + +if __name__ == "__main__": + main() + diff --git a/hr_payslip_show_period.py b/hr_payslip_show_period.py new file mode 100755 index 0000000..b69cb76 --- /dev/null +++ b/hr_payslip_show_period.py @@ -0,0 +1,53 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""Shows period in employee payslip.""" +import os +import sys +import odooly + +def main(): + odooly.Client._config_file = os.path.expanduser('~/.config/odooly.ini') + odoo = odooly.Client.from_config('Odoo14_Production') + + views = odoo.env['ir.ui.view'] + + baseid = 'hr_avancys.print_report_payslip' + + viewextid = 'agofer_view.show_hr_period' + viewname = 'show_hr_period' + viewarch = """ + + +
Período: +
+
""".format(viewname, baseid) + + vista_base = views.get(baseid) + assert vista_base.name == 'print_report_payslip' + + viewvalues = { + 'arch': viewarch, + 'active': True, + 'mode': 'extension', + 'inherit_id': vista_base.id, + 'name': viewname, + 'priority': 16, + 'type': 'qweb', + 'model': False, + } + + try: + newview = views.get(viewextid) + if newview: + newview.write(viewvalues) + else: + newview = views.create(viewvalues) + newview._set_external_id(viewextid) + except: + xt, xc, tb = sys.exc_info() + xm = ''.join(odooly.format_exception(xt, xc, tb, chain=False)) + print('### Error\n' + xm.strip()) + +if __name__ == "__main__": + main() + diff --git a/pedido_o_cotizacion_agofer.xml b/pedido_o_cotizacion_agofer.xml new file mode 100644 index 0000000..bd47c6c --- /dev/null +++ b/pedido_o_cotizacion_agofer.xml @@ -0,0 +1,389 @@ + + +
+
+
+
+
+

+ + Cotización + Pedido de Venta + anulada + anulado + + [⚠ Excepción en envío] + [⚠ Excepción en facturación] + (…continúa) +

+
+
+
+

+ Fecha: + +

+
+ Expiration: +

+

+ +
+
+

+ Condición de pago: + +

+

+ + Términos de negociación: + : + + +

+
+
+
+
+
+ + +
+
+
+
+ +
+
+
+
+

+ +   + + + +

+
+
+
+
+

Dirección:

+

Dirección de facturación:

+

+ +

+ +

,

+

+

+
+
+
+
+

+ Dirección de envío: +

+

+ +

+ +

,

+

+

+
+
+
+
+
+
+

+ Agofer S.A.S. NIT 800.216.499–1 : +

+
    +
  • + Autorretenedor Res. №0010 1994-02-11 +
  • +
  • + Gran contribuyente Res. №000076 2016-12-01 +
  • +
  • + Régimen Común y Agente Retenedor de IVA +
  • +
  • + Actividad Económica CIIU 4752 +
  • +
+
+
+
+
+ + comercial: + +

+ + + . + + +
+ +
+ + + ( ) + + +

+ +
+
+ Peso teórico total: +

kg

+
+
+ Orden de compra: +

+

+
+ Origen: +

+ + +

+
+
+
Subtotal - +
IVA + +
Total - +
- +
Amount Due - +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + +
DescriptionQuantityUnit PriceDiscount (%)ValorIVA
+ + + + + + + + + + + + + + +
+
+
+
+
+

+ Observaciones
+ +

+

+ Fiscal Position Remark: + +

+
+

+ Este pedido de venta recoge las + condiciones comerciales pactadas entre Agofer y el + cliente; Agofer emitirá factura de venta al momento + de entregar la mercancía. + No se aceptan reclamos después de 10 días de emitida la + factura. + Consulte nuestra Promesa Comercial en + agofer.co/politicas/ +

+
+
+
+
+ + + + + + + + + + + + + +
Total Without Taxes + +
Taxes + +
+ + Total + + + +
+
+

+  Pesos. +

+
+
+
+
+
+
+
+
+

+ + + + +

+

+ +

+

+ +

+
+
+

+ +

+

+ +

+

+ +

+
+
+ Placa: + +
+
+ Dirección autorizada de envío: + +
+ +
+ +
+
+
+
+
+ + + Acepto esta cotización y autorizo se elabore + Pedido de Venta + + + + Acepto las condiciones contenidas en este + pedido de venta, y autorizo a las pesonas aquí + detalladas a recoger la mercancía en mi nombre. + + +
+ +
+
+
+
+
+ Signature +
+
+ +
+
+

+

+
+
+
+ + diff --git a/sale.order-formato_agofer.py b/sale.order-formato_agofer.py new file mode 100755 index 0000000..cc903f3 --- /dev/null +++ b/sale.order-formato_agofer.py @@ -0,0 +1,86 @@ +#!/usr/bin/env python3 +# -*- coding: utf-8 -*- +"""Modificar todo el formato QWeb de un pedido de venta / cotización.""" +import os +import sys +import odooly + +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 main(): + odooly.Client._config_file = os.path.expanduser('~/.config/odooly.ini') + odoo = odooly.Client.from_config('odootest26') + + baseid = 'sale.report_saleorder_document' + viewname = 'report.saleorder.cotizacion_o_pedido_agofer' + viewextid = 'agofer_view.cotizacion_o_pedido' + viewmodel = 'ir.ui.view' + + repmodel = 'ir.actions.report' + repextid = 'sale.action_report_saleorder' + + papmodel = 'report.paperformat' + papextid = 'agofer_paper.factura_carta' + + vista_base = odoo.env[viewmodel].get(baseid) + assert vista_base.name == 'report_saleorder_document' + reporte = open(os.path.join(__location__, + 'pedido_o_cotizacion_agofer.xml')).read() + + formato_carta = odoo.env['report.paperformat'].get('report.paperformat_us') + + destino_arch = """ + + + + {1} + + + """.format(baseid,reporte) + + viewvalues = { + 'active': True, + 'arch': destino_arch, + 'inherit_id': vista_base.id, + 'mode': 'extension', + 'name': viewname, + 'priority': 15, + 'type': 'qweb', + } + repvalues = { + 'name': 'Cotización / Pedido de Venta', + 'attachment': False, + 'attachment_use': False, + 'report_type': 'qweb-html', + } + + try: + destino_vista = odoo.env[viewmodel].get(viewextid) + if destino_vista: + destino_vista.write(viewvalues) + else: + destino_vista = odoo.env[viewmodel].create(viewvalues) + destino_vista._set_external_id(viewextid) + + paper = odoo.env[papmodel].get(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.env['res.document.type'].get(cc_extid).name = 'CC' + + odoo.env[repmodel].get(repextid).write(repvalues) + + except: + xt, xc, tb = sys.exc_info() + xm = ''.join(odooly.format_exception(xt, xc, tb, chain=False)) + print('### Error\n' + (xm.strip())) + +if __name__ == "__main__": + use_local_resources() + main() +