Skip to content

Commit

Permalink
Added Contabilidad functions
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Apr 9, 2024
1 parent 3fa2cc6 commit b2bcbb3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion satcfdi/accounting/contabilidad.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,11 +51,13 @@ def output_file(file, folder, fiel=None, generate_pdf=False):


def calcular_saldos(cuentas, polizas):
max_level = 1
for c in cuentas.values():
# c['SaldoIni'] = 0
c['Debe'] = 0
c['Haber'] = 0
c['SaldoFin'] = 0
max_level = max(max_level, c['Nivel'])

for p in polizas:
for t in p["Transaccion"]:
Expand All @@ -65,7 +67,7 @@ def calcular_saldos(cuentas, polizas):
cuenta["Haber"] += t["Haber"]

# Fill Parents
for level in range(4, 1, -1):
for level in range(max_level, 1, -1):
for k, v in cuentas.items():
if v['Nivel'] == level:
parent = v['SubCtaDe']
Expand Down

0 comments on commit b2bcbb3

Please sign in to comment.