- if(isset($ret_tax_array[$index])) {
- 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));
- $ret_tax_array[$index]['Net'] += ($shipping_cost * 100 / ($item_tax['rate'] + 100));
- } else {
- //$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);
- $ret_tax_array[$index]['Net'] += $shipping_cost;
- }
+ if ($item_tax['rate'] !== null && $ret_tax_array[$index]['rate'] !== null) {
+ if($tax_included==1) {
+ $ret_tax_array[$index]['Value'] += round2($shipping_cost*$item_tax['rate']/(100+$tax_rate), $dec);
+ $ret_tax_array[$index]['Net'] += $shipping_net;
+ } else {
+ $ret_tax_array[$index]['Value'] += round2($shipping_cost * $item_tax['rate'] / 100, $dec);
+ $ret_tax_array[$index]['Net'] += $shipping_cost;
+ }