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

[BUGFIX] Proper storage of taxes for an order #529

Merged
merged 6 commits into from
Jun 8, 2024

Conversation

extcode
Copy link
Owner

@extcode extcode commented Jun 8, 2024

Render fields tax and orderTax in BE List module.

  • Remove obsolete TCA settings canNotCollapse.
  • Proper TCA configuration for taxes by introducing foreign_match_fields to correctly resolve relations.
  • Add EventListener to persist taxes during an order process.
  • Remove code which created unrelated tax records when ordering a product with BE variants.

Fixes: #312, #509

rintisch added 4 commits June 8, 2024 16:22
During an order the EventListener created tax
records. These records are never used and not even
configured in the TCA so they are not even related
to the orderProduct after there creation (field
`item` is `0` after persisting them in the table.)
This adds an EventListener which persists the
fields `tax` and `totalTax` for an orderItem so
that those values can be used for PDFs and of
course also to show them in the BE view.

Fixes: #509
An order has two different taxes:
* `tax`: That's the tax for all the products in
  the cart.
* `totalTax`: That's the tax for the whole order
  which includes the tax from above plus tax on
  services like shipping and/or payment.

Before this bugfix the taxes were not persisted
properly because the relation was not correct
implemented in TCA. By introducing the
`foreign_match_fields` the relations are correctly
resolved.

Fixes: #312
@extcode extcode self-assigned this Jun 8, 2024
@extcode extcode changed the title [BUGFIX] Fix TCA leading to duplicate tax entries in fields tax/total_tax [BUGFIX] Proper storage of taxes for an order Jun 8, 2024
@extcode extcode force-pushed the bugfix/312/multiple-tax-entries-v2 branch from d142b97 to 30b8b5c Compare June 8, 2024 15:15
@extcode extcode merged commit d2c8a9b into main Jun 8, 2024
10 checks passed
@extcode extcode deleted the bugfix/312/multiple-tax-entries-v2 branch October 8, 2024 19:12
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.

Multiple tax entries.
2 participants