diff --git a/source/app/models/main.py b/source/app/models/main.py index ef82520..f51541e 100644 --- a/source/app/models/main.py +++ b/source/app/models/main.py @@ -10525,6 +10525,7 @@ def _import_clients(rfc, path): data = utils.read_csv(path) t = len(data) + ok = 0 for i, row in enumerate(data): msg = f'\tImportando cliente {i+1} de {t}' log.info(msg) @@ -10534,7 +10535,7 @@ def _import_clients(rfc, path): w = ((Socios.rfc==row['rfc']) & (Socios.slug==row['slug'])) if Socios.select().where(w).exists(): - msg = 'Ya existe el RFC y Razón Social' + msg = '\tYa existe el RFC y Razón Social' log.info(msg) continue @@ -10543,11 +10544,16 @@ def _import_clients(rfc, path): try: obj = Socios.create(**row) + ok += 1 except Exception as e: log.error(e) break desconectar() + msg = f'Total de clientes: {t}' + log.info(msg) + msg = f'Clientes nuevos: {ok}' + log.info(msg) log.info('Proceso terminado correctamente...') return