diff --git a/agent/invoice.php b/agent/invoice.php index da87319da..4ceee375e 100644 --- a/agent/invoice.php +++ b/agent/invoice.php @@ -141,7 +141,7 @@ if (isset($_GET['invoice_id'])) { //Get billable, and unbilled tickets to add to invoice $sql_tickets_billable = mysqli_query( $mysqli, " - SELECT 1 + SELECT ticket_id, ticket_subject, ticket_number, ticket_prefix, ticket_status FROM tickets WHERE @@ -151,10 +151,9 @@ if (isset($_GET['invoice_id'])) { AND ticket_invoice_id = 0 AND - ticket_status = 5; + ticket_status IN (4, 5); "); - //Add up all the payments for the invoice and get the total amount paid to the invoice $sql_amount_paid = mysqli_query($mysqli, "SELECT SUM(payment_amount) AS amount_paid FROM payments WHERE payment_invoice_id = $invoice_id"); $row = mysqli_fetch_assoc($sql_amount_paid); @@ -697,7 +696,7 @@ if (isset($_GET['invoice_id'])) { -
| # | Date | Subject | Time Worked | +|
|---|---|---|---|---|
| = "$ticket_prefix$ticket_number" ?> | = $ticket_created_at ?> | = $ticket_subject ?> | = $ticket_total_time_worked ?> | ++ | = $ticket_subject ?> | -- | ++ + |