From 0cbd19353c56afcf48854be284ad1ec75405fc84 Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Wed, 6 Jul 2016 19:22:32 +0100 Subject: [PATCH] Rename temp table creation functions to simply be create_temp_table --- application/controllers/Sales.php | 8 ++++---- application/models/Item.php | 2 +- application/models/Receiving.php | 2 +- application/models/Sale.php | 2 +- application/models/reports/Report.php | 6 +++--- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 828cc0e23..8957b51e6 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -47,7 +47,7 @@ class Sales extends Secure_Controller public function get_row($row_id) { - $this->Sale->create_sales_items_temp_table(); + $this->Sale->create_temp_table(); $sale_info = $this->Sale->get_info($row_id)->row(); $data_row = $this->xss_clean(get_sale_data_row($sale_info, $this)); @@ -57,7 +57,7 @@ class Sales extends Secure_Controller public function search() { - $this->Sale->create_sales_items_temp_table(); + $this->Sale->create_temp_table(); $search = $this->input->get('search'); $limit = $this->input->get('limit'); @@ -575,7 +575,7 @@ class Sales extends Secure_Controller private function _load_sale_data($sale_id) { - $this->Sale->create_sales_items_temp_table(); + $this->Sale->create_temp_table(); $this->sale_lib->clear_all(); $sale_info = $this->Sale->get_info($sale_id)->row_array(); @@ -679,7 +679,7 @@ class Sales extends Secure_Controller $data['employees'][$employee->person_id] = $employee->first_name . ' ' . $employee->last_name; } - $this->Sale->create_sales_items_temp_table(); + $this->Sale->create_temp_table(); $sale_info = $this->xss_clean($this->Sale->get_info($sale_id)->row_array()); $data['selected_customer_name'] = $sale_info['customer_name']; diff --git a/application/models/Item.php b/application/models/Item.php index 66b55aecf..6e413a059 100644 --- a/application/models/Item.php +++ b/application/models/Item.php @@ -502,7 +502,7 @@ class Item extends CI_Model } //We create a temp table that allows us to do easy report queries - public function create_items_temp_table() + public function create_temp_table() { $this->db->query('CREATE TEMPORARY TABLE IF NOT EXISTS ' . $this->db->dbprefix('items_temp') . '( diff --git a/application/models/Receiving.php b/application/models/Receiving.php index a5c008879..ca2420f33 100644 --- a/application/models/Receiving.php +++ b/application/models/Receiving.php @@ -202,7 +202,7 @@ class Receiving extends CI_Model /* We create a temp table that allows us to do easy report/receiving queries */ - public function create_receivings_items_temp_table() + public function create_temp_table() { $this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS " . $this->db->dbprefix('receivings_items_temp') . " (SELECT diff --git a/application/models/Sale.php b/application/models/Sale.php index 5aaf391c4..aefd6c460 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -526,7 +526,7 @@ class Sale extends CI_Model } //We create a temp table that allows us to do easy report/sales queries - public function create_sales_items_temp_table() + public function create_temp_table() { if($this->config->item('tax_included')) { diff --git a/application/models/reports/Report.php b/application/models/reports/Report.php index 33673ceee..b450600c4 100644 --- a/application/models/reports/Report.php +++ b/application/models/reports/Report.php @@ -12,9 +12,9 @@ abstract class Report extends CI_Model $this->output->set_header('Pragma: no-cache'); //Create our temp tables to work with the data in our report - $this->Sale->create_sales_items_temp_table(); - $this->Receiving->create_receivings_items_temp_table(); - $this->Item->create_items_temp_table(); + $this->Sale->create_temp_table(); + $this->Receiving->create_temp_table(); + $this->Item->create_temp_table(); } //Returns the column names used for the report