array_push($fields, "cast(l.billable * coalesce(upb.rate, 0) * time_to_sec(l.duration)/3600 as decimal(10,2)) as cost"); // Use project rate for user.
array_push($fields, "null as expense");
}
+ // Add paid status.
+ if ($user->canManageTeam() && $bean->getAttribute('chpaid'))
+ array_push($fields, 'l.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');
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.15.2.3765 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.15.2.3766 | 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>
{if $bean->getAttribute('chduration')}<td class="tableHeaderCentered" width="5%">{$i18n.label.duration}</td>{/if}
{if $bean->getAttribute('chnote')}<td class="tableHeader">{$i18n.label.note}</td>{/if}
{if $bean->getAttribute('chcost')}<td class="tableHeaderCentered" width="5%">{$i18n.label.cost}</td>{/if}
+ {if $bean->getAttribute('chpaid')}<td class="tableHeader">{$i18n.label.paid}</td>{/if}
{if $bean->getAttribute('chinvoice')}<td class="tableHeader">{$i18n.label.invoice}</td>{/if}
</tr>
{foreach $report_items as $item}
{if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$prev_grouped_by]['time']}</td>{/if}
{if $bean->getAttribute('chnote')}<td></td>{/if}
{if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->canManageTeam() || $user->isClient()}{$subtotals[$prev_grouped_by]['cost']}{else}{$subtotals[$prev_grouped_by]['expenses']}{/if}</td>{/if}
+ {if $bean->getAttribute('chpaid')}<td></td>{/if}
{if $bean->getAttribute('chinvoice')}<td></td>{/if}
</tr>
<tr><td> </td></tr>
{if $bean->getAttribute('chduration')}<td class="cellRightAligned">{$item.duration}</td>{/if}
{if $bean->getAttribute('chnote')}<td class="cellLeftAligned">{$item.note|escape}</td>{/if}
{if $bean->getAttribute('chcost')}<td class="cellRightAligned">{if $user->canManageTeam() || $user->isClient()}{$item.cost}{else}{$item.expense}{/if}</td>{/if}
+ {if $bean->getAttribute('chpaid')}<td class="cellRightAligned">{if $item.paid == 1}{$i18n.label.yes}{else}{$i18n.label.no}{/if}{/if}
{if $bean->getAttribute('chinvoice')}
<td class="cellRightAligned">{$item.invoice|escape}</td>
{if $use_checkboxes}
{if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$subtotals[$cur_grouped_by]['time']}</td>{/if}
{if $bean->getAttribute('chnote')}<td></td>{/if}
{if $bean->getAttribute('chcost')}<td class="cellRightAlignedSubtotal">{if $user->canManageTeam() || $user->isClient()}{$subtotals[$cur_grouped_by]['cost']}{else}{$subtotals[$cur_grouped_by]['expenses']}{/if}</td>{/if}
+ {if $bean->getAttribute('chpaid')}<td></td>{/if}
{if $bean->getAttribute('chinvoice')}<td></td>{/if}
</tr>
{/if}
{if $bean->getAttribute('chduration')}<td class="cellRightAlignedSubtotal">{$totals['time']}</td>{/if}
{if $bean->getAttribute('chnote')}<td></td>{/if}
{if $bean->getAttribute('chcost')}<td nowrap class="cellRightAlignedSubtotal">{$user->currency|escape} {if $user->canManageTeam() || $user->isClient()}{$totals['cost']}{else}{$totals['expenses']}{/if}</td>{/if}
+ {if $bean->getAttribute('chpaid')}<td></td>{/if}
{if $bean->getAttribute('chinvoice')}<td></td>{/if}
</tr>
{/if}
{/if}
{if ($user->canManageTeam() || $user->isClient()) && $user->isPluginEnabled('iv')}
<td width="25%"><label>{$forms.reportForm.chinvoice.control} {$i18n.label.invoice}</label></td>
+ {/if}
+ {if ($user->canManageTeam() && $user->isPluginEnabled('ps'))}
+ <td width="25%"><label>{$forms.reportForm.chpaid.control} {$i18n.label.paid}</label></td>
{/if}
</tr>
{/if}
'data'=>$include_options,
'empty'=>array(''=>$i18n->getKey('dropdown.all'))));
-if ($user->isPluginEnabled('ps')) {
+if ($user->canManageTeam() && $user->isPluginEnabled('ps')) {
$form->addInput(array('type'=>'combobox',
'name'=>'paid_status',
'style'=>'width: 250px;',
// If we have a custom field - add a checkbox for it.
if ($custom_fields && $custom_fields->fields[0])
$form->addInput(array('type'=>'checkbox','name'=>'chcf_1'));
-
+if ($user->canManageTeam() && $user->isPluginEnabled('ps'))
+ $form->addInput(array('type'=>'checkbox','name'=>'chpaid'));
// Add group by control.
$group_by_options['no_grouping'] = $i18n->getKey('form.reports.group_by_no');
$group_by_options['date'] = $i18n->getKey('form.reports.group_by_date');
$form->setValueByElement('chfinish', '1');
$form->setValueByElement('chnote', '1');
$form->setValueByElement('chcf_1', '0');
+ $form->setValueByElement('chpaid', '0');
$form->setValueByElement('chtotalsonly', '0');
}