Commit 71216407 by Javier

Errata

parent caf4ba71
...@@ -170,7 +170,7 @@ def update_balance(target_clis: list[str]) -> Tuple[int, int]: ...@@ -170,7 +170,7 @@ def update_balance(target_clis: list[str]) -> Tuple[int, int]:
def add_cdrs(accounts: list[dict]) -> 'list[dict]': def add_cdrs(accounts: list[dict]) -> 'list[dict]':
cdrs = [] cdrs = []
for account in (accounts.keys()): for account in (accounts.keys()):
cdrs.extend(get_cdrs(phone_number=account,since=accounts[account])) cdrs.extend(get_cdrs(phone_number=account, since=accounts[account]))
with typer.progressbar(cdrs, label='Sincronizando CDRs') as cdr_data: with typer.progressbar(cdrs, label='Sincronizando CDRs') as cdr_data:
with pyodbc.connect(SQL_SERVER_CNX_STRING) as cnx: with pyodbc.connect(SQL_SERVER_CNX_STRING) as cnx:
...@@ -192,7 +192,7 @@ def add_cdrs(accounts: list[dict]) -> 'list[dict]': ...@@ -192,7 +192,7 @@ def add_cdrs(accounts: list[dict]) -> 'list[dict]':
return cdrs return cdrs
def process_refills() -> Tuple[int,float]: def process_refills() -> Tuple[int, float]:
"""Ejecuta las Recargas pendientes """Ejecuta las Recargas pendientes
""" """
...@@ -316,21 +316,21 @@ def synchronize(): ...@@ -316,21 +316,21 @@ def synchronize():
new_plataform_activate(*fully_ported_clis()) new_plataform_activate(*fully_ported_clis())
typer.echo('Verificación de Plataformas Finalizada') typer.echo('Verificación de Plataformas Finalizada')
# Actualización de Estado
updated, non_updated = update_balance(update_target_clis())
msg = "Se han actualizado "
msg = msg + typer.style(updated, fg=typer.colors.GREEN, bold=True)
msg = msg + f" de un total de {updated + non_updated} líneas."
typer.echo(msg)
# Recargas # Recargas
total_refills, amount = process_refills() total_refills, amount = process_refills()
msg = f"Se han procesado " msg = f"Se han procesado "
msg = msg + typer.style(total_refills, fg=typer.colors.GREEN, bold=True) msg = msg + typer.style(total_refills, fg=typer.colors.GREEN, bold=True)e
msg = msg + " recargas con un importe total de " msg = msg + " recargas con un importe total de "
msg = msg + typer.style(f'{amount}€', fg=typer.colors.GREEN, bold=True) msg = msg + typer.style(f'{amount}€', fg=typer.colors.GREEN, bold=True)
typer.echo(msg) typer.echo(msg)
# Actualización de Estado
updated, non_updated = update_balance(update_target_clis())
msg = "Se han actualizado "
msg = msg + typer.style(updated, fg=typer.colors.GREEN, bold=True)
msg = msg + f" de un total de {updated + non_updated} líneas."
typer.echo(msg)
# Actualización de CDRs # Actualización de CDRs
accounts = get_last_updated_cdr() accounts = get_last_updated_cdr()
cdrs = add_cdrs(accounts) cdrs = add_cdrs(accounts)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment