diff --git a/client_tickets.php b/client_tickets.php index 8a02804d..bc838a13 100644 --- a/client_tickets.php +++ b/client_tickets.php @@ -18,6 +18,15 @@ if (isset($_GET['status']) && ($_GET['status']) == 'Open') { $ticket_status_snippet = "ticket_status != 'Closed'"; } +if (isset($_GET['billable']) && ($_GET['billable']) == '1') { + $billable = 1; + $ticket_billable_snippet = "ticket_billable = 1"; + $ticket_status_snippet = '1 = 1'; +} else { + $billable = 0; + $ticket_billable_snippet = '1 = 1'; +} + //Rebuild URL $url_query_strings_sort = http_build_query($get_copy); @@ -31,6 +40,7 @@ $sql = mysqli_query( LEFT JOIN vendors ON ticket_vendor_id = vendor_id WHERE ticket_client_id = $client_id AND $ticket_status_snippet + AND $ticket_billable_snippet AND (CONCAT(ticket_prefix,ticket_number) LIKE '%$q%' OR ticket_subject LIKE '%$q%' OR ticket_status LIKE '%$q%' OR ticket_priority LIKE '%$q%' OR user_name LIKE '%$q%' OR contact_name LIKE '%$q%' OR asset_name LIKE '%$q%' OR vendor_name LIKE '%$q%' OR ticket_vendor_ticket_number LIKE '%q%') ORDER BY $sort $order LIMIT $record_from, $record_to" ); diff --git a/report_tickets_unbilled.php b/report_tickets_unbilled.php new file mode 100644 index 00000000..1ff4ba8a --- /dev/null +++ b/report_tickets_unbilled.php @@ -0,0 +1,183 @@ + (int)$days, + 'hour' => (int)$hours, + 'minute' => (int)$minutes, + 'second' => (int)$seconds, + ]; + + foreach ($sections as $name => $value){ + if ($value > 0){ + $timeParts[] = $value. ' '.$name.($value == 1 ? '' : 's'); + } + } + + return implode(', ', $timeParts); +} + +if (isset($_GET['year'])) { + $year = intval($_GET['year']); +} else { + $year = date('Y'); +} + +$sql_ticket_years = mysqli_query($mysqli, "SELECT DISTINCT YEAR(ticket_created_at) AS ticket_year FROM tickets ORDER BY ticket_year DESC"); + +$sql_clients = mysqli_query($mysqli, "SELECT client_id, client_name FROM clients ORDER BY client_name ASC"); + +$rows = 0; + + +?> + +
+
+

Unbilled Tickets By Client

+
+ +
+
+
+
+ +
+ +
+ + + + + + + + + + + 0) { + $rows = $rows++; + + ?> + + + + + + + + + + + + + +
ClientTickets RaisedBillable TicketsUnbilled Tickets
+ +
You are all caught up! There are no unbilled tickets for this year. +
+
+
+
+ +Collections

+ @@ -92,6 +98,7 @@

Tickets

+