Skip to content

Commit

Permalink
agrego correos
Browse files Browse the repository at this point in the history
  • Loading branch information
satcfdi committed Mar 31, 2024
1 parent 2495d20 commit 8bcee89
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions satdigitalinvoice/file_data_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -157,8 +157,8 @@ def loading_function(loader, node):

DuplicateKeySafeLoader.add_constructor("!case", loading_function)
super().__init__()
if dup := first_duplicate(json.dumps(x, sort_keys=True, default=str) for x in self["Facturas"]):
raise Exception("Factura Duplicada: {}".format(dup))
# if dup := first_duplicate(json.dumps(x, sort_keys=True, default=str) for x in self["Facturas"]):
# raise Exception("Factura Duplicada: {}".format(dup))

if file_source:
fp = os.path.join(os.path.dirname(file_source), "productos.yaml")
Expand Down
11 changes: 6 additions & 5 deletions satdigitalinvoice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,13 +67,14 @@ def cert_info(signer: Signer):


def find_best_match(cases, dp: DatePeriod | date) -> (date, object):
fk, fv = (None, None)
best_date, best_value = (None, None)
for k, v in cases.items():
k = datetime.strptime(k, '%Y-%m').date()
if isinstance(k, str):
k = datetime.strptime(k, '%Y-%m').date()
if k <= dp:
if fk is None or k > fk:
fk, fv = k, v
return fk, fv
if best_date is None or k > best_date:
best_date, best_value = k, v
return best_date, best_value


def clear_directory(directory):
Expand Down

0 comments on commit 8bcee89

Please sign in to comment.