X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=invoice_view.php;h=e94c04b72bba78ef28cd5d01fa1e42133ed320a8;hb=e897b5c63d2e36b018970e1305760fc14976d7d3;hp=a91ddf1b4a316c0dc0a9a8a984c07e9528468724;hpb=098a79f0819ebb89b7d48df4a6b154af4560f68e;p=timetracker.git diff --git a/invoice_view.php b/invoice_view.php index a91ddf1b..e94c04b7 100644 --- a/invoice_view.php +++ b/invoice_view.php @@ -32,7 +32,7 @@ import('ttInvoiceHelper'); import('ttClientHelper'); // Access check. -if (!ttAccessCheck(right_view_invoices)) { +if (!ttAccessCheck(right_view_invoices) || !$user->isPluginEnabled('iv')) { header('Location: access_denied.php'); exit(); } @@ -52,11 +52,11 @@ $tax = 0; 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; @@ -67,14 +67,14 @@ $smarty->assign('total', $user->currency.' '.str_replace('.', $user->decimal_mar 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); @@ -86,5 +86,4 @@ $smarty->assign('invoice_items', $invoice_items); $smarty->assign('colspan', $colspan); $smarty->assign('title', $i18n->getKey('title.view_invoice')); $smarty->assign('content_page_name', 'invoice_view.tpl'); -$smarty->display('index.tpl'); -?> \ No newline at end of file +$smarty->display('index.tpl');