Skip to content

Commit

Permalink
agrego correos
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Mar 27, 2024
1 parent aaf1bd8 commit 3f0a50a
Show file tree
Hide file tree
Showing 3 changed files with 48 additions and 1 deletion.
46 changes: 45 additions & 1 deletion satdigitalinvoice/facturacion.py
Original file line number Diff line number Diff line change
Expand Up @@ -504,6 +504,42 @@ def set_selected_satcfdis_recibidas(self, cfdis: list):
"".ljust(10), disabled=True, button_color=sg.theme_background_color()
)

is_active = \
bool(i) \
and i.estatus() == EstadoComprobante.VIGENTE

# Pendiente de Pago
is_pendientable = \
is_active \
and i["TipoDeComprobante"] == TipoDeComprobante.INGRESO \
and (i["MetodoPago"] == MetodoPago.PAGO_EN_UNA_SOLA_EXHIBICION or i.saldo_pendiente()) \
and i["Total"]
if is_pendientable:
self.window["pendiente_pago_recibidas"].update(
(("Pagada" if i["MetodoPago"] == MetodoPago.PAGO_EN_UNA_SOLA_EXHIBICION else "Ignorada")
if i.liquidated() else "Por Pagar").center(10),
disabled=False,
button_color=("dark green" if i["MetodoPago"] == MetodoPago.PAGO_EN_UNA_SOLA_EXHIBICION else "yellow4")
if i.liquidated() else "red4",
)
else:
is_ppd_pagada = is_active \
and i["TipoDeComprobante"] == TipoDeComprobante.INGRESO \
and i["MetodoPago"] == MetodoPago.PAGO_EN_PARCIALIDADES_O_DIFERIDO \
and i.saldo_pendiente() == 0
if is_ppd_pagada:
self.window["pendiente_pago_recibidas"].update(
"Pagada".center(10),
disabled=True,
button_color="dark green",
)
else:
self.window["pendiente_pago_recibidas"].update(
"".ljust(10),
disabled=True,
button_color=sg.theme_background_color()
)

def set_selected_satcfdis(self, cfdis: list):
i = cfdis[0] if len(cfdis) == 1 else None

Expand All @@ -519,10 +555,10 @@ def set_selected_satcfdis(self, cfdis: list):
"".ljust(10), disabled=True, button_color=sg.theme_background_color()
)

assert i["Emisor"]["Rfc"] in self.emisores
# Email
is_active = \
bool(i) \
and i["Emisor"]["Rfc"] in self.emisores \
and i.estatus() == EstadoComprobante.VIGENTE
if is_active:
self.window["email_notificada"].update(
Expand Down Expand Up @@ -1063,6 +1099,14 @@ def action(self, event, values):
# noinspection PyUnresolvedReferences
self.window['emitidas_table'].refresh()

case "pendiente_pago_recibidas":
# noinspection PyUnresolvedReferences
if i := self.window["recibidas_table"].selected_items()[0]:
i.liquidated_flip()
self.set_selected_satcfdis_recibidas([i])
# noinspection PyUnresolvedReferences
self.window['recibidas_table'].refresh()

case "email_notificada":
# noinspection PyUnresolvedReferences
if i := self.window["emitidas_table"].selected_items()[0]:
Expand Down
2 changes: 2 additions & 0 deletions satdigitalinvoice/file_data_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import re
from datetime import date
from decimal import Decimal
from uuid import UUID

import jsonschema as jsonschema
import yaml
Expand Down Expand Up @@ -204,3 +205,4 @@ def represent_str(dumper, data):
yaml.SafeDumper.add_representer(Decimal, represent_decimal)
yaml.SafeDumper.add_representer(Code, represent_str)
yaml.SafeDumper.add_representer(Xint, represent_str)
yaml.SafeDumper.add_representer(UUID, represent_str)
1 change: 1 addition & 0 deletions satdigitalinvoice/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,7 @@ def make_layout():
[
sg.Column([[
sg.Button("".ljust(10), key="status_sat_recibidas", border_width=0, button_color=sg.theme_background_color()),
sg.Button("".ljust(10), key="pendiente_pago_recibidas", border_width=0, button_color=sg.theme_background_color()),
]]),
],
[
Expand Down

0 comments on commit 3f0a50a

Please sign in to comment.