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

Feat(anrok<>credit_notes) refactor CreditNotes::AppliedTax to search taxes by tax_code #2536

Merged
merged 10 commits into from
Sep 13, 2024

Conversation

annvelents
Copy link
Contributor

@annvelents annvelents commented Sep 5, 2024

Context
When we apply taxes on credit_notes, we're applying taxes that are stored for invoice - Invoice::AppliedTax. (and then we select taxes applied on fees, related to the credit_note_items)

Previous taxes implementation suggested that we should have a tax, saved in the db, so when iterating through taxes we were using tax.id, but currently taxes received from tax provider don't have a corresponding tax in the db, but we have tax_code, identifying the tax. the same is with stored in the db taxes: within the organization the tax_code will not be repeated, so if we start looking for taxes by tax_code instead of tax.id, we won't break existing logic and will adapt it to the new applied taxes that do not have taxes, stored in the db.

What was done:
Updated algorythm of searching taxes to apply on credit note, to search them by tax_code instead of tax_id

@annvelents annvelents changed the base branch from main to feat-anrok-cn-model-changes September 10, 2024 13:33
Base automatically changed from feat-anrok-cn-model-changes to main September 11, 2024 08:45
@annvelents annvelents marked this pull request as ready for review September 11, 2024 08:45
@annvelents annvelents changed the title POC refactor CreditNotes::AppliedTax to search taxes by tax_code Feat(anrok<>credit_notes) refactor CreditNotes::AppliedTax to search taxes by tax_code Sep 11, 2024
@annvelents annvelents merged commit d40bf27 into main Sep 13, 2024
6 checks passed
@annvelents annvelents deleted the feat-anrok-refactor-try branch September 13, 2024 09:13
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.

2 participants