Closed (duplicate)
Project:
Commerce Discount
Version:
7.x-1.x-dev
Component:
Code
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
29 May 2014 at 13:05 UTC
Updated:
24 Sep 2016 at 11:21 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
geek-merlinPatch flying in.
Comment #2
geek-merlinComment #3
geek-merlinJust to note i use this patch happily in production for months now.
Note that it isn't possible to do correct tax calculation without this (except in special cases).
Comment #4
haggins commentedI just applied the patch but I don't see any change of the behavior. Do I have to change the price calculation rules order in any way?
This is what I get now:
Product price: 100€ (including 19% tax)
Discount: 10% (= 10€)
Calculated tax on checkout: 15,97€ (should be 14,37€)
If I weight the tax calculation rule higher than the dicount rule, then I get the correct tax (14,37€) but the displayed discount is only 8,40€ instead of 10€.
Comment #5
geek-merlinhi patrick, please look at the parent issue and apply all patches and install the module.
;-)
axel
Comment #6
haggins commentedHi Axel,
thank you. Unfortunately I'm using commerce_tax and not commerce_vat. Bad luck...I'll try to test it before DC next week.
Comment #7
sampaka commentedhi. thanks a lot for your patches. I had no problem to apply the patches to the vat commerce module. But the patch here (commerce_discount-2276335-1.patch) cannot be applied to current 7.x-1.x-dev. It seems more that the current 7.x-1.0-alpha4 and not 7.x-1.x-dev is the destination file.
Thanks in advance!
Comment #8
geek-merlinComment #9
geek-merlinOMG, forgot to attach the patch!
Comment #10
joelpittet@axel.rutz this seems like the answers to my prayers... just want to confirm the intent. If I wanted to make this pricing component of the discount non-inclusive in the line item's amount would this be where I should do the modifications?
Maybe something like this could be added to the api docs?
The the discount $type would be a bit more useful in my case than the $discount name. Though also the discount name is strange that it's not the machine name...
Comment #11
joelpittetTestbot
Comment #12
joelpittettestbot is being nice, retest
Comment #14
discipolo commentedjust a reroll to see if testbot likes it better.
Comment #15
joelpittetI've since found a different workaround for the use-case I mentioned in #10.
This needs a reasonable use-case added to the issue summary and just a general issue summary cleanup, hopefully using the template. @see https://www.drupal.org/issue-summaries or use dreditor has a button for that.
Comment #16
joelpittetThanks for the re-roll @discipolo
Comment #18
geek-merlinSeems a simple reroll did not suffice as the code paths have changed and we need to insert the hook in 2 places (create line item, updte line item). Updated patch flying in.
Comment #19
joelpittet@axel.rutz could you update the issue summary to explain how this is useful for VAT. Please explain how modifications in a post process hook will or could be used for VAT.
Comment #20
joelpittetI've put markers and cleaned up the issue summary to help you out with the template from http://dreditor.org
Comment #21
geek-merlin@joel: i'm a bit (too) hasty these days and can't do it as thorough as i like it.
Everything is described in the crosslinked meta issue #2276227: [META] Use order discount with VAT
Comment #22
damienmckennaThis needs documentation.
Comment #23
Scott Robertson commentedComment #24
vincentdemers commentedI've updated this patch so that it also lauch the postprocess hook after free_shipping, percent_off_shipping & shipping_upgrade price components have been added.
This was necessary for me to calculate negative tax on free_shipping price components.