From c6cf33c4c4b609c3997af9b6c5dc2e26ecd1bebf Mon Sep 17 00:00:00 2001 From: El Mau Date: Mon, 18 Apr 2022 21:45:30 -0500 Subject: [PATCH] Obtener datos de periodicidad para factura glbal --- source/app/models/main.py | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/source/app/models/main.py b/source/app/models/main.py index 9d7030c..faee953 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -3711,7 +3711,6 @@ class Sucursales(BaseModel): def _create(cls, args): try: values = utils.loads(args) - print(values) Sucursales.create(**values) result = {'ok': True} except Exception as e: @@ -5624,7 +5623,15 @@ class Facturas(BaseModel): tax_decimals = Configuracion.get_bool('chk_config_tax_decimals') decimales_precios = Configuracion.get_bool('chk_config_decimales_precios') invoice_by_ticket = Configuracion.get_bool('chk_config_invoice_by_ticket') - is_global = (invoice.cliente.rfc == RFCS['PUBLIC']) and invoice_by_ticket + # ~ is_global = (invoice.cliente.rfc == RFCS['PUBLIC']) and invoice_by_ticket + + is_global = bool(invoice.periodicidad) + data_global = {} + if is_global: + now = utils.now() + data_global['Periodicidad'] = invoice.periodicidad + data_global['Meses'] = now.strftime('%m') + data_global['Año'] = now.strftime('%Y') frm_vu = FORMAT if decimales_precios: @@ -5913,6 +5920,7 @@ class Facturas(BaseModel): 'donativo': donativo, 'edu': is_edu, 'complementos': complementos, + 'global': data_global, } return utils.make_xml(data, certificado) @@ -10672,7 +10680,6 @@ def get_cp(cp): 'municipio': rows[0][1], 'key_municipio': str(rows[0][3]).zfill(3), } - print(data) if len(rows) == 1: data['colonia'] = rows[0][0] else: