I need to tax shipping according to 23% VAT. Thus I have to enter shipping costs without taxes when configuring shipping.
The problem is that calculated shipping costs show up without taxes. Taxes are added correctly after shipping which is fine but the problem is that calculated shipping costs aren't taxes inclusive where every other price is. This leads to lots of confusion, is there a way to show shipping costs taxes inclusive?
This still needs implementing as part of the inclusive taxes feature, so remains a feature request.
- Checkbox for "Include tax when displaying shipping quotes" added to Configuration » Shipping quotes
- Tax applied to shipping quote if checkbox enabled (default: FALSE) and tax applied for shipping
Updated patch file
- Tax applied to shipping quote displayed in Estimated shipping cost pane in Shopping cart
- Checking added to check whether uc_taxes module enabled or not
We have a large number of test cases included with Ubercart to ensure inclusive taxes on products work properly. There should be additional test cases written as part of this patch to test inclusive taxes on shipping. Marking as "needs work" because of this.
thanks for your work, it is work, but i found one problem.
The value price in function uc_quote_get_shipping_price_with_tax has this format, example 4,56€.
After the number 4 is a coma and not a point.
Problem is, calculation considered not the numbers after coma, in example 56.
in germany decimal marker is comma, not dot.
In the code snippes from #7, i give the float value to your function uc_quote_get_shipping_price_with_tax and after the calculation i build the real currency string.
I think this is a better solution.
In Ubercart you can define currency format in Configuration - Store - Currency Format (Select Decimal Marker to be comma, instead of dot)
... and as you stated already in #7, uc_quote_get_shipping_price_with_tax() function should return price as return uc_currency_format($price); in order to follow correct currency format set in the configuration.
Thank you for pointing that out.
Getting this feature to 7.x-3.x code line will take some time as pin-pointed in #6, but hopefully patch helps you to go forward with you site installation.
your patch was very helpful, i'm not a real php programmer and worked with this code is hard for me.
The problem is, TR will the patch only insert then this is in correct format and have test cases.
Can you help, create a fully functional patch, from your code, with my changes and a test case?
Or TR can you help us, so the feature come in the dev version of ubercart, please?
Waiting for this aswell, as this is one of deal breakers in our store as we need to inform that all others prices are tax inclusive but shipping is tax 0%... It seems as scam to some according to feedback
Ok, I did some more changes while I was at it, so that uc_quote_get_shipping_price_with_tax() behaves more in the same way that uc_taxes_get_included_tax() does.
Patch with all the changes (including the ones in uc_quote.admin) is attached.
#17 also worked for me as far as calculating shipping goes. However, the line items are shown without tax. This is confusing because the same description is used in both instances. So, for example on my invoice, the customer expects to see Shipping including tax ( 2 EUR) but sees Shipping without tax added (1,68 EUR). Both have the label "Shipping in Germany". This means I would need to rearrange or customize the line items. The problem is that the shipping line item comes before the subtotal where tax is added so from this logic it is correct that the tax isn't included. I could work around this by structuring my invoice template as follows:
List of products with prices including tax
Shipping including tax
Grand Total
-------------
Line items with the breakdown
Is there a token that would spit out the "Shipping including tax"? Any help would be greatly appreciated.
Confirming the #17 patch to still work on Ubercart 7.x-3.6. It does not update the line item shipping price to tax inclusive, but this is better than nothing.
Even if the patch worked it’s out of date by now with 7.x-3.11. Any chance someone could give this some love since it’s pretty important for VAT countries? I can’t code, but I can test.
Comments
Comment #1
rar9 commented+1
Comment #2
longwaveClosed #1433954: Calculate shipping doesn't take into account taxes that apply to shipping costs as duplicate
This still needs implementing as part of the inclusive taxes feature, so remains a feature request.
Comment #3
mitrpaka commentedOne way of doing above feature request:
- Checkbox for "Include tax when displaying shipping quotes" added to Configuration » Shipping quotes
- Tax applied to shipping quote if checkbox enabled (default: FALSE) and tax applied for shipping
Comment #4
mitrpaka commentedComment #5
mitrpaka commentedUpdated patch file
- Tax applied to shipping quote displayed in Estimated shipping cost pane in Shopping cart
- Checking added to check whether uc_taxes module enabled or not
Comment #6
tr commentedPlease remove the tabs and trailing whitespace in your patch. See http://drupal.org/coding-standards
We have a large number of test cases included with Ubercart to ensure inclusive taxes on products work properly. There should be additional test cases written as part of this patch to test inclusive taxes on shipping. Marking as "needs work" because of this.
Comment #7
christian death commentedHi mitrpaka,
thanks for your work, it is work, but i found one problem.
The value price in function uc_quote_get_shipping_price_with_tax has this format, example 4,56€.
After the number 4 is a coma and not a point.
Problem is, calculation considered not the numbers after coma, in example 56.
This is my changes:
to
and in function uc_checkout_pane_quotes
to
I hope this feature coming soon.
Comment #8
mitrpaka commented#7: Patch doesn't take any side to decimal format. Please have a look at your format settings (By default decimal marker is . [dot], not comma)
Comment #9
christian death commentedHi mitrpaka,
in germany decimal marker is comma, not dot.
In the code snippes from #7, i give the float value to your function uc_quote_get_shipping_price_with_tax and after the calculation i build the real currency string.
I think this is a better solution.
Comment #10
mitrpaka commentedIn Ubercart you can define currency format in Configuration - Store - Currency Format (Select Decimal Marker to be comma, instead of dot)
... and as you stated already in #7, uc_quote_get_shipping_price_with_tax() function should return price as return uc_currency_format($price); in order to follow correct currency format set in the configuration.
Thank you for pointing that out.
Getting this feature to 7.x-3.x code line will take some time as pin-pointed in #6, but hopefully patch helps you to go forward with you site installation.
Comment #11
christian death commentedyour patch was very helpful, i'm not a real php programmer and worked with this code is hard for me.
The problem is, TR will the patch only insert then this is in correct format and have test cases.
Can you help, create a fully functional patch, from your code, with my changes and a test case?
Or TR can you help us, so the feature come in the dev version of ubercart, please?
Comment #12
demoshane commentedWaiting for this aswell, as this is one of deal breakers in our store as we need to inform that all others prices are tax inclusive but shipping is tax 0%... It seems as scam to some according to feedback
Comment #13
bendikrb commentedThe function uc_quote_get_shipping_price_with_tax() needs to filter the taxes based on the context of the order.
I have changed the function to:
And have done the changes as mentioned in #7, except of course passing both $price and $order to uc_quote_get_shipping_price_with_tax().
Comment #14
bendikrb commentedOk, I did some more changes while I was at it, so that uc_quote_get_shipping_price_with_tax() behaves more in the same way that uc_taxes_get_included_tax() does.
Patch with all the changes (including the ones in uc_quote.admin) is attached.
Comment #15
tr commentedStill need to address #6 ...
Comment #16
bendikrb commentedOh, sorry about that. Taken care of.
Comment #17
bendikrb commentedAtleast now it is (fixed a typo on line 719)...
Comment #18
mandreato commented#17 worked for me.
Comment #19
tr commentedStill needs tests.
Comment #20
christian death commented#17 also worked for me.
Comment #21
ebo1958 commented#17 also worked for me as far as calculating shipping goes. However, the line items are shown without tax. This is confusing because the same description is used in both instances. So, for example on my invoice, the customer expects to see Shipping including tax ( 2 EUR) but sees Shipping without tax added (1,68 EUR). Both have the label "Shipping in Germany". This means I would need to rearrange or customize the line items. The problem is that the shipping line item comes before the subtotal where tax is added so from this logic it is correct that the tax isn't included. I could work around this by structuring my invoice template as follows:
List of products with prices including tax
Shipping including tax
Grand Total
-------------
Line items with the breakdown
Is there a token that would spit out the "Shipping including tax"? Any help would be greatly appreciated.
Comment #22
mandreato commentedJust to say that #17 is on my live site since 4 months with no problems.
Comment #23
dfrt commentedConfirming the #17 patch to still work on Ubercart 7.x-3.6. It does not update the line item shipping price to tax inclusive, but this is better than nothing.
Comment #24
mcdoolz commented#17 seems to work tickety boo.
Comment #26
tr commentedEven though the patch still applied, this issue should be needs work because of #6, #21, and #23.
Comment #27
grabby commentedEven if the patch worked it’s out of date by now with 7.x-3.11. Any chance someone could give this some love since it’s pretty important for VAT countries? I can’t code, but I can test.