Menu

#43 Tax 2 Rate not calculating correctly in new release 2.3.2

v2.3.2
closed
nobody
None
9
2015-03-21
2015-03-21
Anonymous
No

Hi,
I am trying to add 2 taxes with different percentage. For example Tax1= 12.5% and Tax2 = 2%. But during sales for both TAX it calculate same value. If cost price is $100 then $12.5 calculated for both the tax and Total amount returned as $125.
Kindly look at my attachment for more clarification.

1 Attachments

Discussion

  • Anonymous

    Anonymous - 2015-03-21

    Sorry. I have added wrong screen shot. Please look at below screen shot

     
  • Anonymous

    Anonymous - 2015-03-21

    I got an solution.
    I have updated function get_taxes() in Sale_lib.php under pos/application/libraries/Sale_lib.php to

    function get_taxes()
    {
    //Do not charge sales tax if we have a customer that is not taxable
    if (!$this->is_customer_taxable())
    {
    return array();
    }

        $taxes = array();
        foreach($this->get_cart() as $line=>$item)
        {
            $tax_info = $this->CI->Item_taxes->get_info($item['item_id']);
    
            foreach($tax_info as $tax)
            {
                $name = $tax['percent'].'% ' . $tax['name'];
                $tax_amount=($item['price']*$item['quantity']-$item['price']*$item['quantity']*$item['discount']/100)*(($tax['percent'])/100);
    
                if (!isset($taxes[$name]))
                {
                    $taxes[$name] = 0;
                }
                $taxes[$name] += $tax_amount;
            }
        }
    
        return $taxes;
    }
    

    it's working fine now

     
  • jekkos

    jekkos - 2015-03-21

    This bug was solved some time ago already, in the latest github build.

     
  • jekkos

    jekkos - 2015-03-21
    • status: open --> closed