Tax calculations on coupon use


  • Default avatar
    rick26    
     7 years ago
    0

    Hi,


    I had some issues a few years back with tax calculations when coupons were used and you helped me get through them.  Recently I had to reinstall AWO and whatever change we manually made seems to have been lost though you stated that the change we made would be put in the next version update.


    See sample below to get an idea of the problem



    AWO - Configuration - Calculate the discount before tax (Coupons) OFF

    The discount is wrong, the tax is correct, the total is wrong


    AWO - Configuration - Calculate the discount before tax (Coupons) ON

    Exactly the same issue


    AWO - Configuration - Calculate the discount before tax (Coupons) ON, use injection mode ON

    Discount is correct, the tax is wrong, the total is wrong


    Look forward to your solution

    Thanks


    Rick

  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Looking at the previous post:
    https://awodev.com/forum/awocoupon/help-section/coupon-discount-amount-incorrect

    The tax rate for hst is 13%.  Looking at the cart image, this does not seem to be the case any more, otherwise the tax in the first image should be 14.08.  What is the tax rate?
  • Default avatar
    rick26    
     7 years ago
    0

    The tax is 13% and is applied after the discount coupon so in the first image the amount is correct
  • Your avatar
    seyi    
     7 years ago  last edited 7 years ago
    0

    Hello,

    Ok, I see now.  Not really getting these issues when I test locally.

    Possible to send a private message with temp admin and ftp access to debug?

    Thanks for the access.  I see you had a checkout extension enabled, so I disabled it and tested it with:
    - calculate discount before tax set to 'yes'
    - injection mode set to 'yes'
    In this case the totals came out correctly:


    So it seems the checkout extension is changing the totals somehow.  I tried looking through its configuration and did not find anything that would help.
  • Default avatar
    rick26    
     7 years ago  last edited 7 years ago
    0

    Thanks, I didnt thing to check to see if it was the checkout extension as it worked with it before.
    Okay; just heard back from VP One Page, they have asked me to turn off injection mode which I did and then compared results with VP enabled and disabled, they are the same.


    They mentioned that no calculations are done with their extension, does this help shed some light on the issue?

  • Your avatar
    seyi    
     7 years ago
    0

    Yes, but the values are wrong, which is why injection mode is there, to deal with configurations that do not work through normal virtuemart coupon system as it does not account for it.

    If no calculations are done through vp, then I do not understand why the order total would be different.  The injection should not affect vp since its just calling virtuemart for the total.

    Really not sure, but happy to look more into it if you can send temp ftp access.
  • Default avatar
    rick26    
     7 years ago
    0

    Appreciate the help to look into it, I will email you the ftp access
  • Your avatar
    seyi    
     7 years ago
    0

    Thanks for the access.

    This is hard to explain: the virtuemart total function is called multiple times, and sometimes it comes in with different totals than what AwoCoupon expects it to be causing the calculation to be off.  Looking at the tax above, it is calculating at 11.23, when it should be 12.67.  The wrong value is subtracting the coupon tax twice:
       14.08 - 1.41 - 1.41 = 11.26

    So the solution I implemented is to do the calculations once and cache it.  And when it is called again, used the cached data instead of recalculating. 

    Seems to work well, but please test all your coupons in every situation and let me know if you have any issue.
  • Default avatar
    rick26    
     7 years ago
    0

    Thanks Seyi,


    I will keep an eye on it


    Rick