urgent - just gone live and tax problem with virtuemart 1.1.9


  • Default avatar
    SimonMC    
     12 years ago
    0

    Hi
    I'm using the free version of AWOCoupon. I was using target coupon but it messed up another component (VM emailsmanager) so we changed to AWOCoupon. Our problem is as follows ...
    With "Subtract payment discount before tax/shipping?" Ticked (or unticked; it makes no difference), coupons are still calculated on price WITH tax. According to our accountants, this is a major problem; we need to calculate discounts based on the price without TAX. I've found solutions for this problem on your site for some versions of VM but not for 1.1.9 which is the version we're using.
    Can you please, please help. We've just gone live and discovered this!!
  • Your avatar
    seyi    
     12 years ago
    0

    Hello,

    Have you already tried the things listed in the blog:
    https://awodev.com/blog/virtuemart-coupon-error-discount-before-tax

    Also can you be more specific, with example number of what you are seeing and what you should be?
  • Default avatar
    SimonMC    
     12 years ago
    0

    I haven't tried that yet since it was a different version of VM. Let me try it now; if it doesn't work, I'll get back to you with more details, If it works, I'll reply too.
    Thanks
  • Default avatar
    SimonMC    
     12 years ago
    0

    Seyi
    I just tried the fix on this page and it doesn't work for VM 1.1.9. The changes to basket.php didn't make any difference and when I substituted the other file I got a blank screen on all pages where the VM cart was activated.

    Here are more details of the problem. I have "Subtract payment discount before tax/shipping" checked but you can see in the example below that the coupon is discounting from the price with tax (495€) rather than the net price (419,5€).

    Product: €495.00 (18 % I.V.A. Incluído)
    Subtotal: €495.00
    Descuento del cupón (coupon discount): - €49.50

    TOTAL: €436.59
    Total IVA: €67.96

    I'm using AWOCoupon Version: 1.0.11
  • Your avatar
    seyi    
     12 years ago
    0

    The tax is correct:
    (419.49*.9)*.18 = 67.96

    Not sure where the total 436.59 is coming from, what screen is this?

    The total discount is also correct, it includes taxes
    Original total: 495
    minus
    New total: (419.49*.9)*1.18=445.50
    = 49.50
  • Default avatar
    SimonMC    
     12 years ago
    0

    Seyi
    This is the first "order" screen.
    The problem is that the discount (49.5) is based on the order price with tax (495). It should be based on the price BEFORE taxes and, try as I might, I can't get the order screen/purchase order etc to give me a discount based on the net price before tax ("Subtract payment discount before tax"). Unfortunately, this is an accounting requirement in Spain.
  • Your avatar
    seyi    
     12 years ago
    0

    In my solution, it shows the coupon discount after taxes.

    You could alter the coupon value to not include tax, but i do not know what effects that would have on the rest of your totals, or maybe just do it for display purposes.

    in www/administrator/components/com_virtuemart/html/basket.php and ro_basket.php, you could just alter the coupon value
    <?php
    if(!empty($_SESSION['coupon_discount'])) $_SESSION['coupon_discount'] = $_SESSION['coupon_discount']/1.18;
    ?>


    or if just for display:
    <?php
    if(!empty($_SESSION['coupon_discount'])) $coupon_display $_SESSION['coupon_discount']/1.18;
    ?>


  • Default avatar
    SimonMC    
     12 years ago
    0

    PS
    The URL is: http://www.greenwichnautica.es/index.php/patron-de-recreo/Curso-Teorico-Patron-de-Recreo.html
    The coupon "test_per" is a valid coupon (applied to the product the URL links to)
  • Default avatar
    SimonMC    
     12 years ago
    0

    Sorry. I've tried this and I get a blank screen when the cart is called. What seems to be happening is that the checkbox "Subtract payment discount before tax/shipping" simply does not work; I always get the coupon discount after tax. I can't honestly say if this problem started before/after installing AWOCoupon but I'm loathe to uninstall it. Any other suggestions?
  • Your avatar
    seyi    
     12 years ago
    0

    Sorry to hear you are having so many problems. As I explained in the background section of the blog, the "total" discount you receive with discount before or discount after tax is the same. Virtuemart displays the discount including tax no matter what you tick. What changes is the taxes calculated. In your example, with discount before tax, the tax is 67.96. With discount after tax, the tax is 75.51.

    As for what to do to display the coupon tax not including tax, the suggestion I gave in my last post would do it, Im not sure why you are getting a white screen. You are not including the <\?php or ?> right?
  • Default avatar
    SimonMC    
     12 years ago
    0

    I might well have done. Should I just put the following line at the very end of each document?

    if(!empty($_SESSION['coupon_discount'])) $_SESSION['coupon_discount'] = $_SESSION['coupon_discount']/1.18;
  • Your avatar
    seyi    
     12 years ago
    0

    I would put it right before the template variables are set
    <?php
        $tpl
    ->set_vars( Array(
    ?>



    And I would use the below, so as not to cause problems with calculation by changing the session's coupon_discount.

    if(!empty($_SESSION['coupon_discount'])) $coupon_display = $_SESSION['coupon_discount']/1.18;
  • Default avatar
    SimonMC    
     11 years ago
    0

    Ok, I tried this but the problem now is that the tax is omitted completely. Is there no way to simply force VM to subtract the discount before tax and then add tax to the new gross?
  • Your avatar
    seyi    
     11 years ago
    0

    There is nothing simple about taxes and how its treated with deductions, especially trying to code to accommodate for every country. Virtuemart use discount after tax in all its calculations. if you actually changed the discount globally, im pretty sure all your totals will be off. So all you can really do is alter what is shown to the customer.