Skip to content

Commit

Permalink
updated
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Mar 15, 2024
1 parent 092b1e0 commit 014f64f
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 15 deletions.
4 changes: 2 additions & 2 deletions satdigitalinvoice/localdb.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def status_merge(self, uuid: str | UUID, estatus: str, es_cancelable: str = None
current_value = self.status(uuid)

value = {
"Estatus": Code(code=estatus, description=EstadoComprobante(estatus).name),
"Estatus": estatus,
}
if es_cancelable:
value["EsCancelable"] = es_cancelable
Expand All @@ -94,7 +94,7 @@ def status_export(self, uuid: UUID):
if i := self.status(uuid):
return [
uuid,
i["Estatus"].code,
i["Estatus"],
i.get("EsCancelable"),
i.get("EstatusCancelacion"),
i.get("FechaCancelacion"),
Expand Down
6 changes: 1 addition & 5 deletions satdigitalinvoice/mycfdi.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,11 +49,7 @@ class MyCFDI(SatCFDI):
pagar_a_partir = None

def estatus(self) -> EstadoComprobante:
res = self.status_sat().get('Estatus', EstadoComprobante.VIGENTE)
if isinstance(res, EstadoComprobante):
return res
else:
return EstadoComprobante(res)
return EstadoComprobante(self.status_sat().get('Estatus', '1'))

def status_sat(self, update=False) -> dict:
if update:
Expand Down
14 changes: 7 additions & 7 deletions tests/test_localdb.py
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
from datetime import datetime

from satdigitalinvoice.localdb import LocalDB, LocalDBSatCFDI
from satdigitalinvoice.localdb import LocalDB
from satdigitalinvoice.utils import random_string


def test_localdb():
db = LocalDBSatCFDI(
db = LocalDB(
base_path=".data",
enviar_a_partir=datetime(2020, 1, 1),
pagar_a_partir={
"PUE": datetime(2020, 1, 1),
"PPD": datetime(2020, 1, 1),
}
# enviar_a_partir=datetime(2020, 1, 1),
# pagar_a_partir={
# "PUE": datetime(2020, 1, 1),
# "PPD": datetime(2020, 1, 1),
# }
)

db.folio_set(10)
Expand Down
2 changes: 1 addition & 1 deletion tests/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ def test_layout_unique_keys():
except ImportError:
return

layout = make_layout(emisores=["CACX7605101P8"], local_db=None)
layout = make_layout()

def elements(layout):
for e in layout:
Expand Down

0 comments on commit 014f64f

Please sign in to comment.