-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Use gross amount in return items #706
Conversation
I believe the opposite to be true, I'm 👍 and this looks good, but we'll need to be very clear in our release notes about what the behaviour change is as it will affect admin end-users. |
The reason I believe that
What about this as a release notes approach:
|
execute(<<-SQL) | ||
UPDATE spree_return_items | ||
SET pre_tax_amount = pre_tax_amount + included_tax_total; | ||
SQL |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need to be worried about included_tax_total ever being nil? I'd had to nullify pre_tax_amount from included_tax_total being nil. Should we switch to WHERE pre_tax_amount is null to be safe?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I added a safeguard clause that sets included_tax_total to 0 if NULL
. The pre_tax_amount
/ amount
column has a NOT NULL
db constraint set, so no worries on that side of the plus.
I'm 👍 on this, sorry, missed the feedback to my migration question. Hope the rebase isn't too brutal... cough |
I believe the notion of `pre_tax_amount` is only in the return items because someone from a sales tax country wanted to use something with additional taxes. This leads to unfortunate behaviour in VAT stores: While every other price or amount is entered including VAT, for returns a store admin has to enter the return amount excluding VAT. For most normal people, that's a complex, error-prone op, and one we shouldn't make them do. Unfortunately, this entails a lot of naming changes.
Use gross amount in return items
This PR has a close relationship with solidusio#706, and solidusio#706 was still missing a changelog entry.
I believe the notion of
pre_tax_amount
is only present in the return items becausesomeone from a sales tax country wanted to use something excluding sales (additional) taxes.
This leads to unfortunate behaviour in VAT stores: While every other price or amount
is entered including VAT, for returns a store admin has to enter the return amount
excluding VAT. For most normal people, that's a complex, error-prone op, and one we
shouldn't make them do.
This PR replaces the
pre_tax_amount
with one calledamount
that behaves like theamount
on line items: including included taxes, but excluding sales taxes.Unfortunately, this entails a lot of naming changes.
This ports spree/spree#6852 to Solidus.
It's one large commit because all the naming changes affects everything :(