From 22d1a1809ca106df263bbd6f87b3c6f8ac3d301e Mon Sep 17 00:00:00 2001 From: wrongecho Date: Thu, 9 Jan 2025 16:29:07 +0000 Subject: [PATCH] Tickets created via portal/email not being marked as billable --- CHANGELOG.md | 1 + portal/portal_post.php | 2 +- scripts/cron_ticket_email_parser.php | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 66ee6d02..13aca7ae 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,6 +9,7 @@ All notable changes to ITFlow will be documented in this file. - Bugfix: Editing / creating recurring expenses results in error 500 due to incorrect var name - Bugfix: Recurring tickets no longer require a contact - Bugfix: Stripe online payment setup now prompts you to set the income/expense account +- Bugfix: Tickets created via portal/email not being marked as billable - Admin pages now once again use the new admin role-check - Debug now shows the current git branch - Individual POST handler logic pages can no longer be accessed directly diff --git a/portal/portal_post.php b/portal/portal_post.php index 37855e0d..d576bbad 100644 --- a/portal/portal_post.php +++ b/portal/portal_post.php @@ -34,7 +34,7 @@ if (isset($_POST['add_ticket'])) { $new_config_ticket_next_number = $config_ticket_next_number + 1; mysqli_query($mysqli, "UPDATE settings SET config_ticket_next_number = $new_config_ticket_next_number WHERE company_id = 1"); - mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_created_by = 0, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id"); + mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$config_ticket_prefix', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$details', ticket_priority = '$priority', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = 0, ticket_contact_id = $session_contact_id, ticket_url_key = '$url_key', ticket_client_id = $session_client_id"); $ticket_id = mysqli_insert_id($mysqli); // Notify agent DL of the new ticket, if populated with a valid email diff --git a/scripts/cron_ticket_email_parser.php b/scripts/cron_ticket_email_parser.php index fbc805ef..d74e2912 100644 --- a/scripts/cron_ticket_email_parser.php +++ b/scripts/cron_ticket_email_parser.php @@ -111,7 +111,7 @@ function addTicket($contact_id, $contact_name, $contact_email, $client_id, $date //Generate a unique URL key for clients to access $url_key = randomString(156); - mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$ticket_prefix_esc', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$message_esc', ticket_priority = 'Low', ticket_status = 1, ticket_created_by = 0, ticket_contact_id = $contact_id, ticket_url_key = '$url_key', ticket_client_id = $client_id"); + mysqli_query($mysqli, "INSERT INTO tickets SET ticket_prefix = '$ticket_prefix_esc', ticket_number = $ticket_number, ticket_subject = '$subject', ticket_details = '$message_esc', ticket_priority = 'Low', ticket_status = 1, ticket_billable = $config_ticket_default_billable, ticket_created_by = 0, ticket_contact_id = $contact_id, ticket_url_key = '$url_key', ticket_client_id = $client_id"); $id = mysqli_insert_id($mysqli); // Logging