Coupon tax not being calculated correctly


  • Default avatar
    daniel32    
     2 years ago
    0

    Joomla: 2.5.18
    Virtuemart: 2.6.10
    AWOCoupon: 2.3.3.1 pro

    This issue should probably be read with the other issue I posted "Infinite recursion/PHP Fatal error: Allowed memory size of 134217728 bytes exhausted" as my fix may have caused this problem.

    The site I'm working on is based in Australia so a 10% GST tax applies. This is similar to VAT. The coupon I'm using offers the customer free shipping.
    Before applying the discount, my order looks as follows.

    Product 1 (TaxAmount/SalesPrice)                    $4.09      $45.00     
    Product 2 (TaxAmount/SalesPrice)                   $10.00     $110.00     
    ---------------------------------------------------------------------
    Subtotal (TaxAmount/salesPrice)                    $14.09     $155.00
    Shipping (ShipmentTax/salesPriceShipment)           $1.82      $20.00
                                                      ===================
    Order Total (billTaxAmount/billTotal)              $15.91     $175.00


    when I apply the coupon I would expect

    Product 1 (TaxAmount/SalesPrice)                    $4.09      $45.00     
    Product 2 (TaxAmount/SalesPrice)                   $10.00     $110.00     
    ---------------------------------------------------------------------
    Subtotal (TaxAmount/salesPrice)                    $14.09     $155.00
    Shipping (ShipmentTax/salesPriceShipment)           $1.82      $20.00
    Coupon (couponTax/salesPriceCoupon)                -$1.82     -$20.00
                                                      ===================
    Order Total (billTaxAmount/billTotal)              $14.09     $155.00


    but what I get instead is

    Product 1 (TaxAmount/SalesPrice)                    $4.09      $45.00     
    Product 2 (TaxAmount/SalesPrice)                   $10.00     $110.00     
    ---------------------------------------------------------------------
    Subtotal (TaxAmount/salesPrice)                    $14.09     $155.00
    Shipping (ShipmentTax/salesPriceShipment)           $1.82      $20.00
    Coupon (couponTax/salesPriceCoupon)                 $0.00 **  -$20.00
                                                      ===================
    Order Total (billTaxAmount/billTotal)              $15.91 **  $155.00


    looking further into the cart object I see
    cart->pricesUnformatted["salesPriceCoupon"]               -20 
    cart->pricesUnformatted["couponTax"]                       -0 Incorrect, should be 1.82
    cart->pricesUnformatted["couponValue"]                 -18.18
    cart->pricesUnformatted["billTotal"]                      283
    cart->pricesUnformatted["billTaxAmount"]                15.91 Incorrect, should be 14.09
    cart->pricesUnformatted["basePrice"]                   140.91
    cart->pricesUnformatted["discountedPriceWithoutTax"]   140.91
    cart->pricesUnformatted["priceWithoutTax"]             140.91
  • Your avatar
    seyi    
     2 years ago
    0

    Hello,

    I ran some tests and it is working for me, even with your modifications from the other topic. Guess I should ask the obvious. In awocoupon->configuration, did you set 'Calculate discount before tax (coupons)" to "yes"? It is a no by default.