X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;ds=sidebyside;f=taxes%2Ftax_calc.inc;h=acc8f0f0633d468aadd47b528f3ad2262b717bd9;hb=604d89ac6d18712d8b55bed821afe07b7106db3d;hp=6ca9fbbfc53d4155847ce2eb62f308ce3814d920;hpb=a5bdb4cb5a7b4ed58ac02192b5cf814f99f1a6b7;p=fa-stable.git diff --git a/taxes/tax_calc.inc b/taxes/tax_calc.inc index 6ca9fbbf..acc8f0f0 100644 --- a/taxes/tax_calc.inc +++ b/taxes/tax_calc.inc @@ -67,7 +67,7 @@ function get_tax_free_price_for_item($stock_id, $price, $tax_group, $tax_include $tax_multiplier += $taxitem["rate"]; } - return $price / (1 + ($tax_multiplier / 100)); + return round($price / (1 + ($tax_multiplier / 100)), user_price_dec()); } // // Full price (incl. VAT) for item $stock_id with line price $price, @@ -103,7 +103,7 @@ function get_full_price_for_item($stock_id, $price, $tax_group, $tax_included, $ $tax_multiplier += $taxitem["rate"]; } - return $price * (1 + ($tax_multiplier / 100)); + return round($price * (1 + ($tax_multiplier / 100)), user_price_dec()); } //--------------------------------------------------------------------------------- @@ -175,11 +175,14 @@ function get_tax_for_items($items, $prices, $shipping_cost, $tax_group, $tax_inc foreach ($item_taxes as $item_tax) { $index = $item_tax['tax_type_id']; - if($tax_included==1) - $ret_tax_array[$index]['Value'] += $prices[$i] * $item_tax['rate'] - / ($item_tax['rate'] + 100); + if($tax_included==1) // 2008-11-26 Joe Hunt Taxes are stored without roundings + //$ret_tax_array[$index]['Value'] += round($prices[$i] * $item_tax['rate'] + // / ($item_tax['rate'] + 100), user_price_dec()); + $ret_tax_array[$index]['Value'] += ($prices[$i] * $item_tax['rate'] / ($item_tax['rate'] + 100)); else - $ret_tax_array[$index]['Value'] += $prices[$i] * $item_tax['rate'] / 100; + //$ret_tax_array[$index]['Value'] += + // round($prices[$i] * $item_tax['rate'] / 100, user_price_dec()); + $ret_tax_array[$index]['Value'] += ($prices[$i] * $item_tax['rate'] / 100); } } } @@ -194,11 +197,14 @@ function get_tax_for_items($items, $prices, $shipping_cost, $tax_group, $tax_inc { $index = $item_tax['tax_type_id']; if(isset($ret_tax_array[$index])) { - if($tax_included==1) - $ret_tax_array[$index]['Value'] += $shipping_cost * $item_tax['rate'] - / ($item_tax['rate'] + 100); + if($tax_included==1) // 2008-11-26 Joe Hunt Taxes are stored without roundings + //$ret_tax_array[$index]['Value'] += round($shipping_cost * $item_tax['rate'] + // / ($item_tax['rate'] + 100), user_price_dec()); + $ret_tax_array[$index]['Value'] += ($shipping_cost * $item_tax['rate'] / ($item_tax['rate'] + 100)); else - $ret_tax_array[$index]['Value'] += $shipping_cost * $item_tax['rate'] / 100; + //$ret_tax_array[$index]['Value'] += + // round($shipping_cost * $item_tax['rate'] / 100, user_price_dec()); + $ret_tax_array[$index]['Value'] += ($shipping_cost * $item_tax['rate'] / 100); } } }