Skip to content
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

fix (grace_period): refactor how issuing date is set #2928

Merged
merged 4 commits into from
Dec 13, 2024

Conversation

lovrocolic
Copy link
Collaborator

@lovrocolic lovrocolic commented Dec 9, 2024

Context

When billing job is triggered in the past, issuing_date is not set correctly.

Description

issuing_date is set based on the billing job timestamp and grace period.

However, when we check if it is correct time to finalize invoice or in services that set grace period we calculate issuing date again based on invoice.created_at. If invoice.created_at is different than billing day timestamp, we could end-up with invalid issuing date. This especially affects when the draft invoice is finalized.

@vincent-pochet @rsempe Can you see any downside of this approach?

app/models/invoice.rb Outdated Show resolved Hide resolved
app/models/invoice.rb Outdated Show resolved Hide resolved
Copy link
Collaborator

@vincent-pochet vincent-pochet left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Just a comment regarding the timezone in the scope.

@lovrocolic lovrocolic force-pushed the fix-issuing-date-calc branch from d3b3712 to 71ec130 Compare December 13, 2024 10:01
@lovrocolic lovrocolic merged commit e8a3189 into main Dec 13, 2024
6 checks passed
@lovrocolic lovrocolic deleted the fix-issuing-date-calc branch December 13, 2024 10:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants