Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion pyboleto/data.py
Original file line number Diff line number Diff line change
Expand Up @@ -211,7 +211,13 @@ def barcode(self):
value,
len(value)))

due_date_days = (self.data_vencimento - _EPOCH).days
# reiniciar a contagem em 1000 se a data de vencimento for maior que 22/02/2025
if self.data_vencimento >= datetime.date(2025,2,22):
due_date_days = (self.data_vencimento - _EPOCH).days
due_date_days -= 9000
else:
due_date_days = (self.data_vencimento - _EPOCH).days

if not (9999 >= due_date_days >= 0):
raise TypeError(
"Invalid date, must be between 1997/07/01 and "
Expand Down