osCmax v2.5 User Manual
Results 1 to 4 of 4

Need Help Related to tax calculation

This is a discussion on Need Help Related to tax calculation within the osCmax v2 Customization/Mods forums, part of the osCmax v2.0 Forums category; Let us assume there are two tax class class A and class B tax rate for class A is 4 ...

      
  1. #1
    Lurker
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0


    Default Need Help Related to tax calculation

    Let us assume there are two tax class

    class A and class B

    tax rate for class A is 4 % and Tax rate for Class B is 5%

    Now , product 1 belongs to tax class a and product B belongs to class B.

    Let us assume that both of these tax class is applicable for all country all zone.

    Suppose price of Product 1 is 100 and price of product B is 200.


    Now i installed specials offer module where we can offer special offer on the

    combination of two products either by offering some percentage deduction on their sum of

    price or by flat discount in terms of rupees from their sum of price ,that is if we

    purchase two products together then price will be less than if we purchase them

    separately.


    special offer of 10% off on their sum of price is offered on the combination Product A

    and Product B . so after special offer their together price is now

    [ { 200 + 100 } -(300 *10%) ]=270



    Now a customer opt this special offer and add this combination of product a and product b

    in his shopping cat. so now in his cart [Product A + Product B] and he now continue

    shopping and add Product A in his cart.

    so now in his cart special offer product ( i.e Product A + product b] And another

    Product A .SO his cart Is like this [ (Product A + Product B ) + Product A ]

    Now at the time of checkout how the tax will be calculated ? can any one help me ,i am

    getting confuse what will be the logic for the tax calculation .Please help me if u show

    the calculation logic in equation format then it will be very help full for me.

  2. #2
    Lurker
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0


    Default need this information

    For the above example if we use discount coupon then the tax for individual product was calculated on the deduced price after using the discount coupon.that is for example product A base price was 100 but as we use discount coupon (10% off) so its deduced price is 90 and that why tax for the Product a is 4% of 90 and it is 3.6 and tax for product B is also calculated in the same way.

    so my question is that ,As the [ product A+ Product B ] are in a special offer ,

    that is if we purchase two products together then price will be less than if we purchase them separately.

    so in case of special offer product [ product A+ Product B ] is there any formula to calculate tax of individual product or the tax will be calculated on their base price. i need this information.

  3. #3
    osCMax Development Team
    pgmarshall's Avatar
    Join Date
    Feb 2009
    Location
    London
    Posts
    2,678
    Rep Power
    49


    Smile Re: Need Help Related to tax calculation

    Hi there - and welcome to osCmax!

    I suspect your issue is not to do with the tax setup. Assuming you have set up your taxes and zones correctly the tax should work fine - it is the order in which you have executing the total that is the issue.

    Go to your admin panel -> Modules -> Order totals.

    There you should see some settings which determine the ORDER in which different parts of the total are combined.

    Read this in the wiki to get you started.

    Regards,
    pgmarshall
    _______________________________

  4. #4
    Lurker
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0


    Default Re: Need Help Related to tax calculation

    The name of the add on is 2gether discount , the code is below.

    function process() {
    global $order, $currencies, $ot_subtotal, $cart, $together_product_names;

    $od_amount = $this->calculate_2gether_discount();

    if ($od_amount > 0) {
    $this->deduction = $od_amount;
    $this->output[] = array('title' => sprintf(MODULE_2GETHER_DISCOUNT_FORMATED_TITLE, $together_product_names),
    'text' => sprintf(MODULE_2GETHER_DISCOUNT_FORMATED_TEXT, $currencies->format($od_amount)),
    'value' => $od_amount);

    /*****START_TAX_CALCULATIONS*****/
    $discount_percentage = ($od_amount/$order->info['subtotal']);

    if ($order->info['tax'] > 0) {

    $tod_amount = ($order->info['tax'] * $discount_percentage);
    reset($order->info['tax_groups']);

    while (list($key, $value) = each($order->info['tax_groups'])) {

    $god_amount = $value * $discount_percentage;
    $order->info['tax_groups'][$key] = $order->info['tax_groups'][$key] - $god_amount;
    }
    }

    // $order->info['total'] -= $order->info['tax'];
    $order->info['total'] -= $this->deduction;
    $order->info['tax'] -= $tod_amount;
    // $order->info['total'] = ($order->info['total'] - $od_amount) + $order->info['tax'];
    /*****END_TAX_CALCULATIONS*****/

    if ($this->sort_order < $ot_subtotal->sort_order) $order->info['subtotal'] -= $this->deduction;
    }
    }


    ------------

    can any one explain me the code of the tax calculation section . how the tax are getting calculated .

Similar Threads

  1. shipping calculation problem
    By judas-online in forum Per Item
    Replies: 1
    Last Post: 04-04-2007, 02:55 PM
  2. Tax Calculation , Net and Gross Price Issues
    By winerack in forum osCmax v2 Installation issues
    Replies: 1
    Last Post: 03-26-2007, 09:56 AM
  3. table shipping calculation
    By neil in forum osCMax v2 Features Discussion
    Replies: 4
    Last Post: 02-24-2006, 10:08 AM
  4. Wrong weight calculation in Checkout_shipping.php
    By kmazumdar in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 10-11-2005, 10:35 AM
  5. Tax Calculation wrong with Attributes
    By ron54 in forum osCmax v1.7 Discussion
    Replies: 1
    Last Post: 01-29-2005, 11:43 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •