diff --git a/application/controllers/Reports.php b/application/controllers/Reports.php index 7bb5b2ae1..788eb5a2e 100644 --- a/application/controllers/Reports.php +++ b/application/controllers/Reports.php @@ -21,13 +21,8 @@ class Reports extends Secure_Controller { redirect('no_access/reports/reports_' . $submodule_id); } - - //Create our temp tables to work with the data in our report - $this->Sale->create_temp_table(); - $this->Receiving->create_temp_table(); - $this->Item->create_temp_table(); } - + $this->load->helper('report'); } diff --git a/application/models/reports/Report.php b/application/models/reports/Report.php index 53d29f2e2..b450600c4 100644 --- a/application/models/reports/Report.php +++ b/application/models/reports/Report.php @@ -10,6 +10,11 @@ abstract class Report extends CI_Model $this->output->set_header('Cache-Control: no-store, no-cache, must-revalidate'); $this->output->set_header('Cache-Control: post-check=0, pre-check=0', FALSE); $this->output->set_header('Pragma: no-cache'); + + //Create our temp tables to work with the data in our report + $this->Sale->create_temp_table(); + $this->Receiving->create_temp_table(); + $this->Item->create_temp_table(); } //Returns the column names used for the report