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

Vat on shipping - proportional tax based on product tax rate including in the cart #305

Open
tomekjordan opened this issue Jul 8, 2017 · 6 comments
Labels

Comments

@tomekjordan
Copy link

tomekjordan commented Jul 8, 2017

Hi. any option to allow proportional tax for shipping? now we can use the highest rate or fixed rate.
This makes the problem in European shops - because shipping can have strong impact on store margin. Regarding EU statements for tax on shipping - shipping tax can be split among products proportionally.
Any option to add this piece of code? Many stores could benefit from this. Example:
Customer buys 1 item for 10$ with 23% tax rate, and 1000 items for 10$ with 8% tax rate. If we use the highest rate - it will lower the store's margin.
But if we split this proportionally - as EU court and tax laws in many EU countries allows - major of shipping tax will be 8% proportionally.

To give an example, if your order is for £100, £30 being taxed and £70 untaxed, and your shipping is £10, then your shipping VAT would be calculated by the extension as £3 at 20% VAT and £7 at 0% VAT. The VAT from £3 is £0.50, so the total shipping VAT is £0.50. Note that the total charged the customer is still £110

Something like but not uisng weight, but product value based on tax rates proportionally

        $totalWeight = $address->getWeight();
        foreach ($items as $item) {
            $productTaxRequest->setProductClassId($item->getProduct()->getTaxClassId());
            $rate = $this->_calculator->getRate($productTaxRequest);
            $proportionalShipping = $item->getRowWeight() / $totalWeight;
            $tax = $this->_calculator->calcTaxAmount($proportionalShipping * $shipping, $rate, $inclTax, false);
            $baseTax = $this->_calculator->calcTaxAmount($proportionalShipping * $baseShipping, $rate, $inclTax, false);
            if ($this->_config->getAlgorithm($this->_store) == Mage_Tax_Model_Calculation::CALC_TOTAL_BASE) {
                $tax = $this->_deltaRound($tax, $rate, $inclTax);
                $baseTax = $this->_deltaRound($baseTax, $rate, $inclTax, 'base');
            } else {
                $tax = $this->_calculator->round($tax);
                $baseTax = $this->_calculator->round($baseTax);
            }
            $this->_addAmount($tax);
            $this->_addBaseAmount($baseTax);
            $applied = $this->_calculator->getAppliedRates($productTaxRequest);
            $this->_saveAppliedTaxes($address, $applied, $tax, $baseTax, $rate);
            $totalShippingTax += $tax;
            $totalBaseShippingTax += $baseTax;
@sprankhub
Copy link
Member

Thanks for your detailed feature request! This is probably a good addition.

Related to #108

@sprankhub
Copy link
Member

I assume this is quite tough to implement, because we cannot simply use an arbitrary tax rate. Usually, the tax rate comes from a specified tax class. See FireGento_MageSetup_Model_Tax_Config::getShippingTaxClass. Do you have a solution for this, @tomekjordan? Where is your code supposed to be used?

@tomekjordan
Copy link
Author

Hi. I gave it as example. I'm not a coder :) I saw 2 Magento extensions, but both have wrong implementations. Tax on shipping should be calculated as weighted proportion to quantity of products in the order.
It should be just added to Configuration > Tax
Example: http://prntscr.com/gxekh6

As I said in all EU countries tax on shipping should not be just 1 rate, but you can use the highest tax rate in the order, or weighted (which is great if you have products with reduced tax rates like supplements, food, vitamins, drugs). That's the way you don't pay full tax rate (19% or 23) for shipping but you pay just 7% or 8% similar to products you have in the order). The problem is that Magento is not working by default is uses 1 fixex tax rate for shipping, 2 extensions for it - are both buggy, weighted from Webshopapps is calculating shipping tax by product weight :) WEIRD, but other one calculate it near properly - but it doesn't split calculations for tax rates rows, and it just makes AVERAGE on tax total and produces custom tax rate like 16.35% - which is wrong for tax governments in EU, but correct if you just sum the taxes. The goal is to split tax on shipping on product tax rates and add this in tax breakdown rows. not just produce average rate

@sprankhub
Copy link
Member

I think this is quite hard to implement. I am not sure if anyone will implement it here for free. If it is important for you, you may consider sponsoring this feature.

@tomekjordan
Copy link
Author

OK, who can make it with $ ?
Of course, based on sources I got. (2 other extensions that are solving this in 90%).
Job is just to show separate tax breakdown instead of showing calculated average tax rate. 90% is already done. it just needs a bit tweaking

Thanks

@sprankhub
Copy link
Member

Ask your developer, search for Magento developers, ask any of the contributors. Good luck.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants