Skip to content

Corrigindo bug do vencimento do boleto para datas após 22/02/2025 #43

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master3
Choose a base branch
from
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