From 7d7ca4eebafe803e46d26ab7992efbbcbd6181db Mon Sep 17 00:00:00 2001 From: Mauricio Baeza Date: Sun, 9 Feb 2020 22:34:36 -0600 Subject: [PATCH] Fix stamp nomina --- CHANGELOG.md | 5 +++++ source/app/models/main.py | 17 +++++++++++++++-- source/app/settings.py | 2 +- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 333a2a9..452b21d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,4 +1,9 @@ +v 1.34.1 [09-feb-2020] +---------------------- + - Error: Al timbrar nómina de asimilados + + v 1.34.0 [29-ene-2020] ---------------------- - Error: Al timbrar nómina diff --git a/source/app/models/main.py b/source/app/models/main.py index 2ab50a5..70cdd3f 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -8437,19 +8437,26 @@ class CfdiNomina(BaseModel): otros_pagos = [] for row in rows: concepto = row.concepto or row.tipo_otro_pago.nombre or row.tipo_otro_pago.name + + if nomina_receptor['TipoRegimen'] != '02' and \ + row.tipo_otro_pago.key in ('002', '007', '008'): + continue + p = { 'TipoOtroPago': row.tipo_otro_pago.key, 'Clave': row.tipo_otro_pago.clave or row.tipo_otro_pago.key, 'Concepto': concepto[:100], 'Importe': FORMAT.format(row.importe), } - # ~ if row.tipo_otro_pago.key == '002' and row.subsidio_causado: if row.tipo_otro_pago.key == '002': p['subsidio'] = { 'SubsidioCausado': FORMAT.format(row.subsidio_causado) } otros_pagos.append(p) + if not otros_pagos: + del nomina['TotalOtrosPagos'] + rows = CfdiNominaIncapacidad.select().where(CfdiNominaIncapacidad.cfdi==cfdi) incapacidades = [] for row in rows: @@ -9876,7 +9883,7 @@ def _import_from_folder(path): return -def _exportar_documentos(): +def _export_documents(): rfc = input('Introduce el RFC: ').strip().upper() if not rfc: msg = 'El RFC es requerido' @@ -10154,6 +10161,8 @@ def _process_command_line_arguments(): action='store_true', default=False, required=False) parser.add_argument('-bk', '--backup', dest='backup', action='store_true', default=False, required=False) + parser.add_argument('-ed', '--export-documents', dest='export_documents', + action='store_true', default=False, required=False) parser.add_argument('-r', '--rfc', dest='rfc', default='') return parser.parse_args() @@ -10190,6 +10199,10 @@ def main(args): if args.backup: utils.db_backup(IS_MV, URL['SEAFILE']) + return + + if args.export_documents: + _export_documents() return diff --git a/source/app/settings.py b/source/app/settings.py index f95c8e9..0a07311 100644 --- a/source/app/settings.py +++ b/source/app/settings.py @@ -47,7 +47,7 @@ except ImportError: DEBUG = DEBUG -VERSION = '1.34.0' +VERSION = '1.34.1' EMAIL_SUPPORT = ('soporte@empresalibre.mx',) TITLE_APP = '{} v{}'.format(TITLE_APP, VERSION)