X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=WEB-INF%2Flib%2FttReportHelper.class.php;h=0a8e727c8fa3a80de0e440a692a4a69c7ed81eed;hb=ee2998091119ee1662a0cd3c7b8e3e8555e19450;hp=ba8c9c92156e2455626890331f36a7e10aabce64;hpb=0a9cab0efe3edcabcf7b9c8994715bbd24450bf1;p=timetracker.git
diff --git a/WEB-INF/lib/ttReportHelper.class.php b/WEB-INF/lib/ttReportHelper.class.php
index ba8c9c92..0a8e727c 100644
--- a/WEB-INF/lib/ttReportHelper.class.php
+++ b/WEB-INF/lib/ttReportHelper.class.php
@@ -98,6 +98,8 @@ class ttReportHelper {
if ($report['billable']=='2') $dropdown_parts .= ' and l.billable = 0';
if ($report['invoice']=='1') $dropdown_parts .= ' and l.invoice_id is not NULL';
if ($report['invoice']=='2') $dropdown_parts .= ' and l.invoice_id is NULL';
+ if ($report['paid_status']=='1') $dropdown_parts .= ' and l.paid = 1';
+ if ($report['paid_status']=='2') $dropdown_parts .= ' and l.paid = 0';
// Prepare user list part.
$userlist = -1;
@@ -145,6 +147,8 @@ class ttReportHelper {
if ($bean->getAttribute('project')) $dropdown_parts .= ' and ei.project_id = '.$bean->getAttribute('project');
if ($bean->getAttribute('invoice')=='1') $dropdown_parts .= ' and ei.invoice_id is not NULL';
if ($bean->getAttribute('invoice')=='2') $dropdown_parts .= ' and ei.invoice_id is NULL';
+ if ($bean->getAttribute('paid_status')=='1') $dropdown_parts .= ' and ei.paid = 1';
+ if ($bean->getAttribute('paid_status')=='2') $dropdown_parts .= ' and ei.paid = 0';
// Prepare user list part.
$userlist = -1;
@@ -184,6 +188,8 @@ class ttReportHelper {
if ($report['project_id']) $dropdown_parts .= ' and ei.project_id = '.$report['project_id'];
if ($report['invoice']=='1') $dropdown_parts .= ' and ei.invoice_id is not NULL';
if ($report['invoice']=='2') $dropdown_parts .= ' and ei.invoice_id is NULL';
+ if ($report['paid_status']=='1') $dropdown_parts .= ' and ei.paid = 1';
+ if ($report['paid_status']=='2') $dropdown_parts .= ' and ei.paid = 0';
// Prepare user list part.
$userlist = -1;
@@ -348,6 +354,9 @@ class ttReportHelper {
array_push($fields, 'ei.name as note');
array_push($fields, 'ei.cost as cost');
array_push($fields, 'ei.cost as expense');
+ // Add paid status.
+ if ($user->canManageTeam() && $bean->getAttribute('chpaid'))
+ array_push($fields, 'ei.paid as paid');
// Add invoice name if it is selected.
if (($user->canManageTeam() || $user->isClient()) && $bean->getAttribute('chinvoice'))
array_push($fields, 'i.name as invoice');
@@ -1166,6 +1175,8 @@ class ttReportHelper {
$body .= '
'.$i18n->getKey('label.note').' | ';
if ($bean->getAttribute('chcost'))
$body .= ''.$i18n->getKey('label.cost').' | ';
+ if ($bean->getAttribute('chpaid'))
+ $body .= ''.$i18n->getKey('label.paid').' | ';
if ($bean->getAttribute('chinvoice'))
$body .= ''.$i18n->getKey('label.invoice').' | ';
$body .= '';
@@ -1207,6 +1218,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses'];
$body .= '';
}
+ if ($bean->getAttribute('chpaid')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
$body .= ' |
';
@@ -1239,6 +1251,11 @@ class ttReportHelper {
$body .= ''.htmlspecialchars($record['note']).' | ';
if ($bean->getAttribute('chcost'))
$body .= ''.$record['cost'].' | ';
+ if ($bean->getAttribute('chpaid')) {
+ $body .= '';
+ $body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no');
+ $body .= ' | ';
+ }
if ($bean->getAttribute('chinvoice'))
$body .= ''.htmlspecialchars($record['invoice']).' | ';
$body .= '';
@@ -1268,6 +1285,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$cur_grouped_by]['cost'] : $subtotals[$cur_grouped_by]['expenses'];
$body .= '';
}
+ if ($bean->getAttribute('chpaid')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
}
@@ -1290,6 +1308,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses'];
$body .= '';
}
+ if ($bean->getAttribute('chpaid')) $body .= ' | ';
if ($bean->getAttribute('chinvoice')) $body .= ' | ';
$body .= '';
@@ -1438,6 +1457,8 @@ class ttReportHelper {
$body .= ''.$i18n->getKey('label.note').' | ';
if ($report['show_cost'])
$body .= ''.$i18n->getKey('label.cost').' | ';
+ if ($report['show_paid'])
+ $body .= ''.$i18n->getKey('label.paid').' | ';
if ($report['show_invoice'])
$body .= ''.$i18n->getKey('label.invoice').' | ';
$body .= '';
@@ -1479,6 +1500,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$prev_grouped_by]['cost'] : $subtotals[$prev_grouped_by]['expenses'];
$body .= '';
}
+ if ($report['show_paid']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';
$body .= ' |
';
@@ -1511,6 +1533,11 @@ class ttReportHelper {
$body .= ''.htmlspecialchars($record['note']).' | ';
if ($report['show_cost'])
$body .= ''.$record['cost'].' | ';
+ if ($report['show_paid']) {
+ $body .= '';
+ $body .= $record['paid'] == 1 ? $i18n->getKey('label.yes') : $i18n->getKey('label.no');
+ $body .= ' | ';
+ }
if ($report['show_invoice'])
$body .= ''.htmlspecialchars($record['invoice']).' | ';
$body .= '';
@@ -1540,6 +1567,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $subtotals[$cur_grouped_by]['cost'] : $subtotals[$cur_grouped_by]['expenses'];
$body .= '';
}
+ if ($report['show_paid']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';
}
@@ -1562,6 +1590,7 @@ class ttReportHelper {
$body .= ($user->canManageTeam() || $user->isClient()) ? $totals['cost'] : $totals['expenses'];
$body .= '';
}
+ if ($report['show_paid']) $body .= ' | ';
if ($report['show_invoice']) $body .= ' | ';
$body .= '';