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: closed invoices with generated number #2646

Merged
merged 7 commits into from
Oct 2, 2024

Conversation

annvelents
Copy link
Contributor

@annvelents annvelents commented Oct 1, 2024

context
Before we were setting invoice status to finalized or draft before calculating fees (because before calculating fees we don't know if it will be 0-invoice or no, and as result we don't know if it will be :finalized or :closed)

but inside calculate_fees_service we save the invoice, so if it's in finalized status we would generate number for this invoice, which is not needed for closed invoices

as result we should set invoice to finalized or to closed after we calculated fees.

so the definition if the process is finalization or drafting of the invoice should be done not only by status, but also by the context.

what was done

  • instead of setting invoice status before calculating fees, set up context
  • define if the process is finalization for applying credit notes the same way we define it for tax reporting

@annvelents annvelents force-pushed the fix-closed-invoice-generating-number branch from b4f1edc to 1f1e42c Compare October 1, 2024 17:13
@annvelents annvelents marked this pull request as ready for review October 2, 2024 13:04
@annvelents annvelents changed the title Fix: set invoice status before calculating fees Fix: closed invoices with generated number Oct 2, 2024
@annvelents annvelents merged commit 46d5797 into main Oct 2, 2024
6 checks passed
@annvelents annvelents deleted the fix-closed-invoice-generating-number branch October 2, 2024 14:19
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