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 8bcee89 commit 5e13753
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 4 additions & 1 deletion satdigitalinvoice/file_data_managers.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import logging
import os
import re
from datetime import date
from datetime import date, datetime
from decimal import Decimal
from uuid import UUID

Expand Down Expand Up @@ -148,6 +148,9 @@ def __init__(self, dp: DatePeriod | date | None, file_source=None):

def loading_function(loader, node):
cases = loader.construct_mapping(node, deep=True)
cases = {
datetime.strptime(k, '%Y-%m').date() if isinstance(k, str) else k: v for k, v in cases.items()
}
if dp is None:
return cases
return find_best_match(
Expand Down
4 changes: 2 additions & 2 deletions satdigitalinvoice/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,8 +69,8 @@ def cert_info(signer: Signer):
def find_best_match(cases, dp: DatePeriod | date) -> (date, object):
best_date, best_value = (None, None)
for k, v in cases.items():
if isinstance(k, str):
k = datetime.strptime(k, '%Y-%m').date()
# if isinstance(k, str):
# k = datetime.strptime(k, '%Y-%m').date()
if k <= dp:
if best_date is None or k > best_date:
best_date, best_value = k, v
Expand Down

0 comments on commit 5e13753

Please sign in to comment.