From 87e8f9e042d7714c2679ce8d8e65e0cb9ffea06c Mon Sep 17 00:00:00 2001 From: o-psi Date: Fri, 22 Dec 2023 14:52:02 +0000 Subject: [PATCH 1/3] Fix email data assignment and select option bug in invoice.php and ticket_invoice_add_modal.php --- post/invoice.php | 8 ++++---- ticket_invoice_add_modal.php | 11 ++++++++--- 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/post/invoice.php b/post/invoice.php index 6b74699f..435383ee 100644 --- a/post/invoice.php +++ b/post/invoice.php @@ -686,14 +686,14 @@ if (isset($_POST['add_payment'])) { 'body' => $body ]; - $email_data = $email; + $email_data[] = $email; // Get Email ID for reference $email_id = mysqli_insert_id($mysqli); // Email Logging - $_SESSION['alert_message'] .= "Email receipt sent "; + $_SESSION['alert_message'] = "Email receipt sent "; mysqli_query($mysqli,"INSERT INTO history SET history_status = 'Sent', history_description = 'Emailed Receipt!', history_invoice_id = $invoice_id"); @@ -719,7 +719,7 @@ if (isset($_POST['add_payment'])) { 'body' => $body ]; - $email_data = $email; + $email_data[] = $email; // Get Email ID for reference $email_id = mysqli_insert_id($mysqli); @@ -736,7 +736,7 @@ if (isset($_POST['add_payment'])) { // Add emails to queue if (!empty($email)) { - addToMailQueue($mysqli, $email); + addToMailQueue($mysqli, $email_data); } //Update Invoice Status diff --git a/ticket_invoice_add_modal.php b/ticket_invoice_add_modal.php index e219564c..d3de8af3 100644 --- a/ticket_invoice_add_modal.php +++ b/ticket_invoice_add_modal.php @@ -121,10 +121,13 @@ $addToExistingInvoice = isset($_GET['ticket_id']) && isset($_GET['invoice_id']); $invoice_due = nullable_htmlentities($row['invoice_due']); $invoice_amount = floatval($row['invoice_amount']); + if (isset($invoice_id)) { ?> - - + @@ -150,7 +153,9 @@ $addToExistingInvoice = isset($_GET['ticket_id']) && isset($_GET['invoice_id']);
- +
From 7709627e5ba683780cb59130d0d47f79101c6962 Mon Sep 17 00:00:00 2001 From: o-psi Date: Fri, 22 Dec 2023 16:19:51 +0000 Subject: [PATCH 2/3] Accounting module disable ticket billable options --- ticket.php | 12 ++++++------ ticket_edit_modal.php | 5 ++++- tickets.php | 44 ++++++++++++++++++++++++++++--------------- 3 files changed, 39 insertions(+), 22 deletions(-) diff --git a/ticket.php b/ticket.php index 1179fb99..c9c82969 100644 --- a/ticket.php +++ b/ticket.php @@ -638,7 +638,7 @@ if (isset($_GET['ticket_id'])) { - +
Billable: @@ -830,7 +830,7 @@ if (isset($_GET['ticket_id'])) {
- + Invoice Ticket @@ -864,10 +864,10 @@ if (isset($_GET['ticket_id'])) { require_once "ticket_merge_modal.php"; - require_once "ticket_invoice_add_modal.php"; - - require_once "ticket_edit_billable_modal.php"; - + if ($config_module_enabled_accounting) { + require_once "ticket_edit_billable_modal.php"; + require_once "ticket_invoice_add_modal.php"; + } } diff --git a/ticket_edit_modal.php b/ticket_edit_modal.php index 63e35c14..48273dad 100644 --- a/ticket_edit_modal.php +++ b/ticket_edit_modal.php @@ -62,6 +62,8 @@
+
@@ -73,8 +75,9 @@
-
+ + diff --git a/tickets.php b/tickets.php index b4a27bc8..04ddafe3 100644 --- a/tickets.php +++ b/tickets.php @@ -243,30 +243,36 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']); } ?>"> Number + href="?&sort=ticket_number&order=">Number Subject + href="?&sort=ticket_subject&order=">Subject Client / Contact + href="?&sort=client_name&order=">Client / Contact + + + Billable + + + + Priority Billable + href="?&sort=ticket_status&order=">Status + Assigned Priority + href="?&sort=ticket_updated_at&order=">Last Response Status - Assigned - - Last Response - - Created + href="?&sort=ticket_created_at&order=">Created @@ -361,6 +367,8 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']);
+ X"; } ?> + @@ -390,7 +401,10 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']); require "ticket_edit_priority_modal.php"; - require "ticket_edit_billable_modal.php"; + + if ($config_module_enabled_accounting) { + require "ticket_edit_billable_modal.php"; + } } From eb29f74fab9189358ad68088f49a4adebb1d7065 Mon Sep 17 00:00:00 2001 From: o-psi Date: Fri, 22 Dec 2023 16:25:36 +0000 Subject: [PATCH 3/3] fix error messages in log --- ticket.php | 2 +- ticket_edit_modal.php | 2 +- tickets.php | 5 ++--- 3 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ticket.php b/ticket.php index c9c82969..ca898d4e 100644 --- a/ticket.php +++ b/ticket.php @@ -864,7 +864,7 @@ if (isset($_GET['ticket_id'])) { require_once "ticket_merge_modal.php"; - if ($config_module_enabled_accounting) { + if ($config_module_enable_accounting) { require_once "ticket_edit_billable_modal.php"; require_once "ticket_invoice_add_modal.php"; } diff --git a/ticket_edit_modal.php b/ticket_edit_modal.php index 48273dad..2313e61a 100644 --- a/ticket_edit_modal.php +++ b/ticket_edit_modal.php @@ -62,7 +62,7 @@ -
diff --git a/tickets.php b/tickets.php index 04ddafe3..8c70b8dd 100644 --- a/tickets.php +++ b/tickets.php @@ -251,7 +251,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']); Client / Contact - Billable @@ -401,8 +401,7 @@ $user_active_assigned_tickets = intval($row['total_tickets_assigned']); require "ticket_edit_priority_modal.php"; - - if ($config_module_enabled_accounting) { + if ($config_module_enable_accounting) { require "ticket_edit_billable_modal.php"; }