From c41daab0c9f8082c01a9816fb5021f2e7d8b6dbe Mon Sep 17 00:00:00 2001 From: johnnyq Date: Fri, 7 Jan 2022 22:19:46 -0500 Subject: [PATCH] Tidy DB file --- clients.php | 1 - db.sql | 42 ++++++++++++++++++++++-------------------- ticket.php | 2 ++ 3 files changed, 24 insertions(+), 21 deletions(-) diff --git a/clients.php b/clients.php index f41ff650..15114ac8 100644 --- a/clients.php +++ b/clients.php @@ -221,7 +221,6 @@ $num_rows = mysqli_fetch_row(mysqli_query($mysqli,"SELECT FOUND_ROWS()")); } $client_tags_display = implode('', $client_tag_name_display_array); - //Add up all the payments for the invoice and get the total amount paid to the invoice $sql_invoice_amounts = mysqli_query($mysqli,"SELECT SUM(invoice_amount) AS invoice_amounts FROM invoices WHERE invoice_client_id = $client_id AND invoice_status NOT LIKE 'Draft' AND invoice_status NOT LIKE 'Cancelled' "); $row = mysqli_fetch_array($sql_invoice_amounts); diff --git a/db.sql b/db.sql index 9b3abb81..c97acf47 100644 --- a/db.sql +++ b/db.sql @@ -857,25 +857,27 @@ CREATE TABLE `roles` ( -- DROP TABLE IF EXISTS `scheduled_tickets`; -CREATE TABLE IF NOT EXISTS `scheduled_tickets` ( - `scheduled_ticket_id` int(11) NOT NULL AUTO_INCREMENT, - `scheduled_ticket_category` varchar(200) DEFAULT NULL, - `scheduled_ticket_subject` varchar(200) NOT NULL, - `scheduled_ticket_details` longtext NOT NULL, - `scheduled_ticket_priority` varchar(200) DEFAULT NULL, - `scheduled_ticket_frequency` varchar(10) NOT NULL, - `scheduled_ticket_start_date` date NOT NULL, - `scheduled_ticket_next_run` date NOT NULL, - `scheduled_ticket_created_at` datetime NOT NULL, - `scheduled_ticket_updated_at` datetime DEFAULT NULL, - `scheduled_ticket_created_by` int(11) NOT NULL, - `scheduled_ticket_client_id` int(11) DEFAULT NULL, - `scheduled_ticket_contact_id` int(11) DEFAULT NULL, - `scheduled_ticket_asset_id` int(11) DEFAULT NULL, - `company_id` int(11) NOT NULL, - PRIMARY KEY (`scheduled_ticket_id`) -) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4; -COMMIT; +/*!40101 SET @saved_cs_client = @@character_set_client */; +/*!40101 SET character_set_client = utf8 */; +CREATE TABLE `scheduled_tickets` ( + `scheduled_ticket_id` int(11) NOT NULL AUTO_INCREMENT, + `scheduled_ticket_category` varchar(200) DEFAULT NULL, + `scheduled_ticket_subject` varchar(200) NOT NULL, + `scheduled_ticket_details` longtext NOT NULL, + `scheduled_ticket_priority` varchar(200) DEFAULT NULL, + `scheduled_ticket_frequency` varchar(10) NOT NULL, + `scheduled_ticket_start_date` date NOT NULL, + `scheduled_ticket_next_run` date NOT NULL, + `scheduled_ticket_created_at` datetime NOT NULL, + `scheduled_ticket_updated_at` datetime DEFAULT NULL, + `scheduled_ticket_created_by` int(11) NOT NULL, + `scheduled_ticket_client_id` int(11) DEFAULT NULL, + `scheduled_ticket_contact_id` int(11) DEFAULT NULL, + `scheduled_ticket_asset_id` int(11) DEFAULT NULL, + `company_id` int(11) NOT NULL, + PRIMARY KEY (`scheduled_ticket_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8; +/*!40101 SET character_set_client = @saved_cs_client */; -- -- Table structure for table `settings` @@ -1208,4 +1210,4 @@ CREATE TABLE `vendors` ( /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */; /*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */; --- Dump completed on 2022-01-05 21:36:40 +-- Dump completed on 2022-01-07 22:19:17 diff --git a/ticket.php b/ticket.php index 7875460d..b28e38e7 100644 --- a/ticket.php +++ b/ticket.php @@ -30,6 +30,8 @@ if(isset($_GET['ticket_id'])){ if($client_net_terms == 0){ $client_net_terms = $config_default_net_terms; } + + $ticket_prefix = $row['ticket_prefix']; $ticket_number = $row['ticket_number']; $ticket_category = $row['ticket_category'];