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;
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;
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');
<br>
<table cellspacing="0" cellpadding="4" width="100%" border="0">
<tr>
- <td align="center"> Anuko Time Tracker 1.16.0.3774 | Copyright © <a href="https://www.anuko.com/lp/tt_3.htm" target="_blank">Anuko</a> |
+ <td align="center"> Anuko Time Tracker 1.17.0.3775 | 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>
<table>
<tr>
<td><input type="button" onclick="chLocation('report_send.php');" value="{$i18n.button.send_by_email}"></td>
+{if $bean->getAttribute('paid_status') == 2}
+ <td><input type="button" onclick="chLocation('mark_paid.php');" value="{$i18n.button.mark_paid}"></td>
+{/if}
</tr>
</table>
</td>
setChange("ALTER TABLE `tt_log` ADD `paid` tinyint(4) NULL default '0' AFTER `billable`");
}
- if ($_POST["convert11400to11600"]) {
+ if ($_POST["convert11400to11700"]) {
setChange("ALTER TABLE `tt_teams` DROP `address`");
setChange("ALTER TABLE `tt_fav_reports` ADD `report_spec` text default NULL AFTER `user_id`");
setChange("ALTER TABLE `tt_fav_reports` ADD `paid_status` tinyint(4) default NULL AFTER `invoice`");
setChange("ALTER TABLE `tt_fav_reports` ADD `show_paid` tinyint(4) NOT NULL DEFAULT '0' AFTER `show_invoice`");
+ setChange("ALTER TABLE `tt_expense_items` ADD `paid` tinyint(4) NULL default '0' AFTER `invoice_id`");
}
if ($_POST["cleanup"]) {
<h2>DB Install</h2>
<table width="80%" border="1" cellpadding="10" cellspacing="0">
<tr>
- <td width="80%"><b>Create database structure (v1.16.0)</b>
+ <td width="80%"><b>Create database structure (v1.17.0)</b>
<br>(applies only to new installations, do not execute when updating)</br></td><td><input type="submit" name="crstructure" value="Create"></td>
</tr>
</table>
<td><input type="submit" name="convert1600to11400" value="Update"><br></td>
</tr>
<tr valign="top">
- <td>Update database structure (v1.14 to v1.16)</td>
- <td><input type="submit" name="convert11400to11600" value="Update"><br></td>
+ <td>Update database structure (v1.14 to v1.17)</td>
+ <td><input type="submit" name="convert11400to11700" value="Update"><br></td>
</tr>
</table>
`name` text NOT NULL, # expense item name (what is an expense for)
`cost` decimal(10,2) default '0.00', # item cost (including taxes, etc.)
`invoice_id` int(11) default NULL, # invoice id
+ `paid` tinyint(4) default '0', # whether the item is paid
`status` tinyint(4) default '1', # item status
PRIMARY KEY (`id`)
);
}
if ($request->isPost()) {
- foreach($_POST as $key => $val) {
- if ('log_id_' == substr($key, 0, 7))
- $time_log_ids[] = substr($key, 7);
- if ('item_id_' == substr($key, 0, 8))
- $expense_item_ids[] = substr($key, 8);
- if ('recent_invoice' == $key)
- $invoice_id = $val;
+ if ($request->getParameter('btn_submit')) {
+ // User clicked the Submit button to assign some items to a recent invoice.
+ foreach($_POST as $key => $val) {
+ if ('log_id_' == substr($key, 0, 7))
+ $time_log_ids[] = substr($key, 7);
+ if ('item_id_' == substr($key, 0, 8))
+ $expense_item_ids[] = substr($key, 8);
+ if ('recent_invoice' == $key)
+ $invoice_id = $val;
+ }
+ if ($time_log_ids || $expense_item_ids) {
+ // Some records are checked for invoice editing. Adjust their invoice accordingly.
+ ttReportHelper::assignToInvoice($invoice_id, $time_log_ids, $expense_item_ids);
+ }
+ // Re-display this form.
+ header('Location: report.php');
+ exit();
}
- if ($time_log_ids || $expense_item_ids) {
- // Some records are checked for invoice editing. Adjust their invoice accordingly.
- ttReportHelper::assignToInvoice($invoice_id, $time_log_ids, $expense_item_ids);
- }
- // Re-display this form.
- header('Location: report.php');
- exit();
} // isPost
$group_by = $bean->getAttribute('group_by');