array_push($fields, 'i.name as invoice');
if ($options['show_timesheet'])
array_push($fields, 'null as timesheet_name');
+ // Add has_files.
+ if ($options['show_files'])
+ array_push($fields, 'if(Sub1.entity_id is null, 0, 1) as has_files');
// Prepare sql query part for left joins.
$left_joins = null;
$left_joins .= " left join tt_projects p on (p.id = ei.project_id)";
if (($canViewReports || $isClient) && $options['show_invoice'])
$left_joins .= " left join tt_invoices i on (i.id = ei.invoice_id and i.status = 1)";
+ if ($options['show_files']) {
+ $left_joins .= " left join (select distinct entity_id from tt_files".
+ " where entity_type = 'expense' and group_id = $group_id and org_id = $org_id and status = 1) Sub1".
+ " on (ei.id = Sub1.entity_id)";
+ }
$where = ttReportHelper::getExpenseWhere($options);
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.18.64.4927 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.18.64.4928 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
<a href="https://www.anuko.com/lp/tt_4.htm" target="_blank">{$i18n.footer.credits}</a> |
<a href="https://www.anuko.com/lp/tt_5.htm" target="_blank">{$i18n.footer.license}</a> |
<a href="https://www.anuko.com/lp/tt_7.htm" target="_blank">{$i18n.footer.improve}</a>