Skip to content

Fix calculation of base total in magento report with discount #555

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

Merged
merged 2 commits into from
Jun 1, 2019

Conversation

kpitn
Copy link
Contributor

@kpitn kpitn commented Oct 17, 2018

Actually magento store discount with negative value : - 10

If you have an order with subtotal = 90 and base_discount_invoiced = -10

When Magento do base_subtotal_invoiced - base_discount_invoiced => 90 -- 10 => 90 +10 => 100

Actually magento store discount with negative value :  - 10

If you have an order with subtotal = 90 and base_discount_invoiced = -10

When Magento do base_subtotal_invoiced  - base_discount_invoiced => 90 -- 10 => 90 +10 => 100
@tmotyl
Copy link
Contributor

tmotyl commented Oct 18, 2018

@kpitn Can you please provide steps to reproduce the issue, so we can test the patch during review?

@kpitn
Copy link
Contributor Author

kpitn commented Oct 18, 2018

  1. Make an order with some coupon with discount amount.
  2. In admin goes to > Report > Sales > Coupon
  3. Display your order : with the correct date / order status

You will see the last column name "Total amount" with incorect values.
discount

I think it's clearer with ABS value, like magento do for the other columns
@colinmollenhour
Copy link
Member

colinmollenhour commented Oct 23, 2018

Would + not be more correct? E.g. if there was somehow a negative price rule? Googling around I see several people trying to do this by changing the validation class names to allow negative values.

@kpitn
Copy link
Contributor Author

kpitn commented Oct 25, 2018

Actually magento use ABS() for other sum (look in the main file)

@tbaden
Copy link

tbaden commented Jun 1, 2019

@LeeSaferite @Flyingmana @drobinson
seems ready to merge

@Flyingmana Flyingmana merged commit d4016e7 into OpenMage:1.9.3.x Jun 1, 2019
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.

6 participants