Tax Calculating Incorrectly


  • Default avatar
    austin    
     7 years ago
    0

    Hi, we are using Awo Coupon pro with rupostel one page checkout and the taxcloud plugin. Without discounts the tax is displaying correctly, I've tried different areas. I tried a buy x get y coupon where y is another product qty 2 and is 100% free. I want the tax to be on the subtotal of just the x product since the y product is free.

    My tax should be around $19.38, but is coming out around $21, I'm not sure where it is getting the amount that it is taxing but the x product is just $250 without shipping and with my 7.75% tax should be $19.38.

    I tried playing with tax settings in awo and onepage but nothing seems to change it. Can you tell me what the correct settings should be to get this going?
  • Your avatar
    seyi    
     7 years ago
    0

    Hello,

    Are you using the latest taxcloud?  If so, I believe there is an issue with the tax for coupons there.  You can test this by disabling AwoCoupon and using a Virtuemart coupon and amount discount (not percent).

    I have sent email to developer of taxcloud about the issue.  In the mean time, here is what I changed to get it working:

    in the file www\plugins\vmcalculation\taxcloud\taxcloud.php, around line 1169 is this:
    <?php
    $product
    ['coupon_percent'] = $coupon_percent;
    ?>


    Right before that add this:
    <?php
                    
    # seyi_code
                        $coupon_percent 0;
                        if(isset($prices['couponValue']) && abs($prices['couponValue']) != 0) {
                            $product_price 0;
                            if(!empty($product['prices']['discountedPriceWithoutTax'])) $product_price = (float)$product['prices']['discountedPriceWithoutTax'];
                            elseif(!empty($product['prices']['basePriceVariant'])) $product_price = (float)$product['prices']['basePriceVariant'];
                            if($product_price 0$coupon_percent = (($product_price $prices['couponValue'] / $prices['toTax']) / $product_price); //(product_price * total_discount / subtotal ) / product_price
                        }
                    }
    ?>


    That should work better


  • Default avatar
    austin    
     7 years ago
    0

    Yup, we are using the latest version of all three components. I added in the code you provided and it appears to be working, thanks for the fix.