UK Shipping Tax based on delivered goods












0















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










share|improve this question



























    0















    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










    share|improve this question

























      0












      0








      0








      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










      share|improve this question














      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






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 19 '15 at 15:08









      Robert EggintonRobert Egginton

      618819




      618819






















          1 Answer
          1






          active

          oldest

          votes


















          1














          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






          share|improve this answer

























            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
            });


            }
            });














            draft saved

            draft discarded


















            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









            1














            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






            share|improve this answer






























              1














              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






              share|improve this answer




























                1












                1








                1







                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






                share|improve this answer















                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







                share|improve this answer














                share|improve this answer



                share|improve this answer








                edited 2 days ago









                SeStro

                760515




                760515










                answered Sep 11 '15 at 10:20









                Robert EggintonRobert Egginton

                618819




                618819






























                    draft saved

                    draft discarded




















































                    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.




                    draft saved


                    draft discarded














                    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





















































                    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







                    Popular posts from this blog

                    1300-talet

                    1300-talet

                    Has there ever been an instance of an active nuclear power plant within or near a war zone?