foreach($invoice_items as $item)
$subtotal += $item['cost'];
if ($tax_percent) {
- $tax_expenses = in_array('et', explode(',', $user->plugins));
+ $tax_expenses = $user->isPluginEnabled('et');
foreach($invoice_items as $item) {
- if ($item['type'] == 2 && !$tax_expenses)
- continue;
- $tax += round($item['cost'] * $tax_percent / 100, 2);
+ if ($item['type'] == 2 && !$tax_expenses)
+ continue;
+ $tax += round($item['cost'] * $tax_percent / 100, 2);
}
}
$total = $subtotal + $tax;
if ('.' != $user->decimal_mark) {
foreach ($invoice_items as &$item)
- $item['cost'] = str_replace('.', $user->decimal_mark, $item['cost']);
+ $item['cost'] = str_replace('.', $user->decimal_mark, $item['cost']);
}
// Calculate colspan for invoice summary.
$colspan = 4;
if (MODE_PROJECTS == $user->tracking_mode)
$colspan++;
-else if (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
+elseif (MODE_PROJECTS_AND_TASKS == $user->tracking_mode)
$colspan += 2;
$smarty->assign('invoice_id', $invoice_id);