Announcement

Collapse
No announcement yet.

Miva 10.01 tax change - should I update my custom tax module?

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

    Miva 10.01 tax change - should I update my custom tax module?

    I use a custom tax module that calculates tax by zip code. It's set up to tax the overall cart subtotal, as well as any taxable order charges like shipping etc.

    I was reading the Customer Impact document about Miva 10.01 and it details a change where the built-in modules are calculating tax item-by-item and then adding up that total, instead of using the cart subtotal

    Should I make the same change to my module, for some compatibility reason or something?
    Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

    #2
    This should probably be moved to the "Online Merchants / Miva 10" forum. More module developers may see it there.
    William Gilligan - Orange Marmalade, Inc.
    www.OrangeMarmaladeinc.com

    Comment


      #3
      All set:

      https://www.miva.com/forums/forum/on...tom-tax-module

      If anyone with delete capabilities wants to delete this thread please do so
      Looking for work as of March 2024! I've been a web developer for going on 20 years, with most of that time spent on Miva sites.

      Comment


        #4
        (I do think this is the correct forum to discuss module functionality. But I will re-post this on the other forum thread for complete coverage.)

        Module authors need some details on how the new feature works.

        From the description given in the Customer Impact Statement, it looks like the only difference in the computed tax will be the result of rounding errors when computing the tax on the entire basket, as opposed to computing the tax separately on each item and then adding them up. Is that correct?

        Suppose the basket contains a quantity of two or more for some item. Should the tax module compute the tax on a single item and then multiply by the quantity? Or should it multiply the unit price by the quantity, and then compute the tax on that? A quick look at the latest LSK suggests the latter, but I'd like to get confirmation. Again, there could be rounding errors.

        Thanks --
        Kent Multer
        Magic Metal Productions
        http://TheMagicM.com
        * Web developer/designer
        * E-commerce and Miva
        * Author, The Official Miva Web Scripting Book -- available on-line:
        http://www.amazon.com/exec/obidos/IS...icmetalproducA

        Comment


          #5
          I believe (but I've asked Brennan to chime in) that the purpose of updating (even through they are backward compatible) would be for processing returns, etc... This way if an order changes the Sales Tax calculation stays up to date
          Thanks,

          Rick Wilson
          CEO
          Miva, Inc.
          [email protected]
          https://www.miva.com

          Comment


            #6
            The two reasons to support line item sales tax in your custom module would be:

            1. Easier integration with back end ERP system, which already stores tax at the item level
            2. Easier returns from within Miva as the item level tax is already calculated for you so you don't have to do it manually in the case of a partial return.

            If either if these things impact you I would recommend updating your module to support it.
            Brennan Heyde
            VP Product
            Miva, Inc.
            [email protected]
            https://www.miva.com

            Comment


              #7
              Kent Multer Here are the steps to add this to your module (or any tax module)

              Here are the high level steps:
              1. Load the basket contents using BasketItemList_Load_Basket
              2. Calculate and set l.basketitem:tax member with the item level tax
              3. Call [ g.Module_Library_DB ].BasketItem_Update_Tax( l.basketitem ) to save the item level sales tax for that item.

              The BasketItem_Update_Tax() function is just doing to query to update the tax column in the BasketItem database. It just needs the line_id and tax fields.

              The LSK has been updated with 10.01 too and most all the tax modules have been updated to use this method so they will be a good reference.

              There is also an optional new API function called TaxModule_Calculate_Order which is used in admin to calculate taxes for an order, but it is not required to support item level sales tax.

              Brennan Heyde
              VP Product
              Miva, Inc.
              [email protected]
              https://www.miva.com

              Comment


                #8
                Oh, so there's a new column in the BasketItems table to store the tax for each item. Thanks, I didn't notice that in my quick look at the LSK.

                How is the TaxModule_Calculate_Order() function optional? Does it depend on the api_ver value in the Module_Description()? I see that, in the new LSK, some of the tax modules have an api_ver of 10.01, but not all of them.
                Kent Multer
                Magic Metal Productions
                http://TheMagicM.com
                * Web developer/designer
                * E-commerce and Miva
                * Author, The Official Miva Web Scripting Book -- available on-line:
                http://www.amazon.com/exec/obidos/IS...icmetalproducA

                Comment


                  #9
                  TaxModule_Calculate_Order is a new API function which calculates taxes on a completed order and is only used in Admin. It does require a Module API version of 10.01 in order to be used in your module. It behaves identically to TaxModule_Calculate_Basket, except it operates on an order.
                  Brennan Heyde
                  VP Product
                  Miva, Inc.
                  [email protected]
                  https://www.miva.com

                  Comment


                    #10
                    Thanks, Brennan. I have one more question for you today.

                    I've written a handful of custom tax modules over the last 20 years. Which of my clients will need their modules upgraded to calculate the tax per-item? Is this needed for stores that use TaxJar, or for other types of third-party integrations?
                    Kent Multer
                    Magic Metal Productions
                    http://TheMagicM.com
                    * Web developer/designer
                    * E-commerce and Miva
                    * Author, The Official Miva Web Scripting Book -- available on-line:
                    http://www.amazon.com/exec/obidos/IS...icmetalproducA

                    Comment

                    Working...
                    X