UK Shipping Tax based on delivered goods
According to HMRC, "the VAT liability [of the shipping charge] is based on the liability of the goods being delivered"*
There does not seem to be a way in Magento of basing the shipping VAT on the tax class of the products in the cart. However, to get an accurate VAT total, that is how they should be calculated.
Is there an extension or workaround that anyone knows of for recent version of Magento CER (i.e. 1.7-1.9)?
- From https://www.gov.uk/government/publications/vat-notice-70024-postage-and-delivery-charges/vat-notice-70024-postage-and-delivery-charges
shipping tax tax-class shipping-tax
add a comment |
According to HMRC, "the VAT liability [of the shipping charge] is based on the liability of the goods being delivered"*
There does not seem to be a way in Magento of basing the shipping VAT on the tax class of the products in the cart. However, to get an accurate VAT total, that is how they should be calculated.
Is there an extension or workaround that anyone knows of for recent version of Magento CER (i.e. 1.7-1.9)?
- From https://www.gov.uk/government/publications/vat-notice-70024-postage-and-delivery-charges/vat-notice-70024-postage-and-delivery-charges
shipping tax tax-class shipping-tax
add a comment |
According to HMRC, "the VAT liability [of the shipping charge] is based on the liability of the goods being delivered"*
There does not seem to be a way in Magento of basing the shipping VAT on the tax class of the products in the cart. However, to get an accurate VAT total, that is how they should be calculated.
Is there an extension or workaround that anyone knows of for recent version of Magento CER (i.e. 1.7-1.9)?
- From https://www.gov.uk/government/publications/vat-notice-70024-postage-and-delivery-charges/vat-notice-70024-postage-and-delivery-charges
shipping tax tax-class shipping-tax
According to HMRC, "the VAT liability [of the shipping charge] is based on the liability of the goods being delivered"*
There does not seem to be a way in Magento of basing the shipping VAT on the tax class of the products in the cart. However, to get an accurate VAT total, that is how they should be calculated.
Is there an extension or workaround that anyone knows of for recent version of Magento CER (i.e. 1.7-1.9)?
- From https://www.gov.uk/government/publications/vat-notice-70024-postage-and-delivery-charges/vat-notice-70024-postage-and-delivery-charges
shipping tax tax-class shipping-tax
shipping tax tax-class shipping-tax
asked Feb 19 '15 at 15:08
Robert EggintonRobert Egginton
618819
618819
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
In the end we wrote an extension that changed the way Magento works for UK shipping, basing the VAT proportion based on the liability of the items in the order. This is how HMRC expects UK shipping tax to be worked out (see https://www.gov.uk/rates-of-vat-on-different-goods-and-services#postage)
The classes/functions that needed to be overridden to make this change were:
tax/sales_total_quote_tax::_calculateShippingTax
tax/ales_total_quote_shipping::collect
In these functions we took the rate calculated by:
$rate = $calc->getRate($addressTaxRequest);
We then multiplied this by a coefficient based on the proportion of taxable items:
// Iterate over all items with prices to get proportional rate
$items = $address->getAllItems();
$totalPrice = 0.0;
$totalTax = 0.0;
foreach ($items as $item) {
// Add to total tax and price
$totalTax += $item->getTaxAmount();
$totalPrice += $item->getRowTotalInclTax() - $item->getDiscountAmount();
}
// Divide total tax by price in order to get weighted tax rate
$weightedTaxRate = ($totalPrice > 0.0) ? ($totalTax / $totalPrice) : 0.0;
// Convert rate to shipping tax rate (invert tax)
$rate = (1.0 / (1.0 - $weightedTaxRate)) - 1.0;
return $rate * 100.0;
This should give the general approach, but note that there is some code to handle edge-cases not included here as it's rather more involved. Also, we had to use conditions in the functions overridden because these core functions have evolved over time so you'd need to base this on the particular version of Magento you are using.
The extension, which is not free, can be found here:
https://www.c3media.co.uk/c3-uk-shipping-tax.html
add a comment |
Your Answer
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "479"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f57905%2fuk-shipping-tax-based-on-delivered-goods%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
In the end we wrote an extension that changed the way Magento works for UK shipping, basing the VAT proportion based on the liability of the items in the order. This is how HMRC expects UK shipping tax to be worked out (see https://www.gov.uk/rates-of-vat-on-different-goods-and-services#postage)
The classes/functions that needed to be overridden to make this change were:
tax/sales_total_quote_tax::_calculateShippingTax
tax/ales_total_quote_shipping::collect
In these functions we took the rate calculated by:
$rate = $calc->getRate($addressTaxRequest);
We then multiplied this by a coefficient based on the proportion of taxable items:
// Iterate over all items with prices to get proportional rate
$items = $address->getAllItems();
$totalPrice = 0.0;
$totalTax = 0.0;
foreach ($items as $item) {
// Add to total tax and price
$totalTax += $item->getTaxAmount();
$totalPrice += $item->getRowTotalInclTax() - $item->getDiscountAmount();
}
// Divide total tax by price in order to get weighted tax rate
$weightedTaxRate = ($totalPrice > 0.0) ? ($totalTax / $totalPrice) : 0.0;
// Convert rate to shipping tax rate (invert tax)
$rate = (1.0 / (1.0 - $weightedTaxRate)) - 1.0;
return $rate * 100.0;
This should give the general approach, but note that there is some code to handle edge-cases not included here as it's rather more involved. Also, we had to use conditions in the functions overridden because these core functions have evolved over time so you'd need to base this on the particular version of Magento you are using.
The extension, which is not free, can be found here:
https://www.c3media.co.uk/c3-uk-shipping-tax.html
add a comment |
In the end we wrote an extension that changed the way Magento works for UK shipping, basing the VAT proportion based on the liability of the items in the order. This is how HMRC expects UK shipping tax to be worked out (see https://www.gov.uk/rates-of-vat-on-different-goods-and-services#postage)
The classes/functions that needed to be overridden to make this change were:
tax/sales_total_quote_tax::_calculateShippingTax
tax/ales_total_quote_shipping::collect
In these functions we took the rate calculated by:
$rate = $calc->getRate($addressTaxRequest);
We then multiplied this by a coefficient based on the proportion of taxable items:
// Iterate over all items with prices to get proportional rate
$items = $address->getAllItems();
$totalPrice = 0.0;
$totalTax = 0.0;
foreach ($items as $item) {
// Add to total tax and price
$totalTax += $item->getTaxAmount();
$totalPrice += $item->getRowTotalInclTax() - $item->getDiscountAmount();
}
// Divide total tax by price in order to get weighted tax rate
$weightedTaxRate = ($totalPrice > 0.0) ? ($totalTax / $totalPrice) : 0.0;
// Convert rate to shipping tax rate (invert tax)
$rate = (1.0 / (1.0 - $weightedTaxRate)) - 1.0;
return $rate * 100.0;
This should give the general approach, but note that there is some code to handle edge-cases not included here as it's rather more involved. Also, we had to use conditions in the functions overridden because these core functions have evolved over time so you'd need to base this on the particular version of Magento you are using.
The extension, which is not free, can be found here:
https://www.c3media.co.uk/c3-uk-shipping-tax.html
add a comment |
In the end we wrote an extension that changed the way Magento works for UK shipping, basing the VAT proportion based on the liability of the items in the order. This is how HMRC expects UK shipping tax to be worked out (see https://www.gov.uk/rates-of-vat-on-different-goods-and-services#postage)
The classes/functions that needed to be overridden to make this change were:
tax/sales_total_quote_tax::_calculateShippingTax
tax/ales_total_quote_shipping::collect
In these functions we took the rate calculated by:
$rate = $calc->getRate($addressTaxRequest);
We then multiplied this by a coefficient based on the proportion of taxable items:
// Iterate over all items with prices to get proportional rate
$items = $address->getAllItems();
$totalPrice = 0.0;
$totalTax = 0.0;
foreach ($items as $item) {
// Add to total tax and price
$totalTax += $item->getTaxAmount();
$totalPrice += $item->getRowTotalInclTax() - $item->getDiscountAmount();
}
// Divide total tax by price in order to get weighted tax rate
$weightedTaxRate = ($totalPrice > 0.0) ? ($totalTax / $totalPrice) : 0.0;
// Convert rate to shipping tax rate (invert tax)
$rate = (1.0 / (1.0 - $weightedTaxRate)) - 1.0;
return $rate * 100.0;
This should give the general approach, but note that there is some code to handle edge-cases not included here as it's rather more involved. Also, we had to use conditions in the functions overridden because these core functions have evolved over time so you'd need to base this on the particular version of Magento you are using.
The extension, which is not free, can be found here:
https://www.c3media.co.uk/c3-uk-shipping-tax.html
In the end we wrote an extension that changed the way Magento works for UK shipping, basing the VAT proportion based on the liability of the items in the order. This is how HMRC expects UK shipping tax to be worked out (see https://www.gov.uk/rates-of-vat-on-different-goods-and-services#postage)
The classes/functions that needed to be overridden to make this change were:
tax/sales_total_quote_tax::_calculateShippingTax
tax/ales_total_quote_shipping::collect
In these functions we took the rate calculated by:
$rate = $calc->getRate($addressTaxRequest);
We then multiplied this by a coefficient based on the proportion of taxable items:
// Iterate over all items with prices to get proportional rate
$items = $address->getAllItems();
$totalPrice = 0.0;
$totalTax = 0.0;
foreach ($items as $item) {
// Add to total tax and price
$totalTax += $item->getTaxAmount();
$totalPrice += $item->getRowTotalInclTax() - $item->getDiscountAmount();
}
// Divide total tax by price in order to get weighted tax rate
$weightedTaxRate = ($totalPrice > 0.0) ? ($totalTax / $totalPrice) : 0.0;
// Convert rate to shipping tax rate (invert tax)
$rate = (1.0 / (1.0 - $weightedTaxRate)) - 1.0;
return $rate * 100.0;
This should give the general approach, but note that there is some code to handle edge-cases not included here as it's rather more involved. Also, we had to use conditions in the functions overridden because these core functions have evolved over time so you'd need to base this on the particular version of Magento you are using.
The extension, which is not free, can be found here:
https://www.c3media.co.uk/c3-uk-shipping-tax.html
edited 2 days ago
SeStro
760515
760515
answered Sep 11 '15 at 10:20
Robert EggintonRobert Egginton
618819
618819
add a comment |
add a comment |
Thanks for contributing an answer to Magento Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fmagento.stackexchange.com%2fquestions%2f57905%2fuk-shipping-tax-based-on-delivered-goods%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown