diff --git a/Gruntfile.js b/Gruntfile.js
index 4fc76c950..e85a83789 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -74,6 +74,20 @@ module.exports = function(grunt) {
watch: {
files: ['<%= jshint.files %>'],
tasks: ['jshint']
+ },
+ cachebreaker: {
+ dev: {
+ options: {
+ match: ['opensourcepos.min.js'],
+ src: {
+ path: 'dist/opensourcepos.min.js'
+ },
+ replacement: 'md5'
+ },
+ files: {
+ src: ['application/views/partial/header.php']
+ }
+ }
}
});
@@ -83,7 +97,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks('grunt-contrib-concat');
grunt.loadNpmTasks('grunt-script-link-tags');
grunt.loadNpmTasks('grunt-mocha-webdriver');
+ grunt.loadNpmTasks('grunt-cache-breaker');
- grunt.registerTask('default', ['tags:js', 'concat', 'uglify', 'tags:minjs']);
+ grunt.registerTask('default', ['tags:js', 'concat', 'uglify', 'tags:minjs', 'cachebreaker']);
};
diff --git a/application/controllers/sales.php b/application/controllers/sales.php
index 86d65d59b..f3cc6a24e 100644
--- a/application/controllers/sales.php
+++ b/application/controllers/sales.php
@@ -7,7 +7,6 @@ class Sales extends Secure_area
parent::__construct('sales');
$this->load->library('sale_lib');
$this->load->library('barcode_lib');
- $this->Sale->create_sales_items_temp_table();
}
function index()
@@ -17,6 +16,8 @@ class Sales extends Secure_area
function manage($only_invoices = FALSE, $only_cash = FALSE, $limit_from = 0)
{
+ $this->Sale->create_sales_items_temp_table();
+
$data['controller_name'] = strtolower($this->uri->segment(1));
$data['only_invoices'] = array($this->lang->line('sales_no_filter'), $this->lang->line('sales_invoice'));
$data['search_section_state'] = $this->input->post('search_section_state');
@@ -66,6 +67,8 @@ class Sales extends Secure_area
function search()
{
+ $this->Sale->create_sales_items_temp_table();
+
$only_invoices = $this->input->post('only_invoices', TRUE);
$only_cash = $this->input->post('only_cash', TRUE);
$lines_per_page = $this->Appconfig->get('lines_per_page');
diff --git a/application/models/receiving.php b/application/models/receiving.php
index 00585041d..01d24ad08 100644
--- a/application/models/receiving.php
+++ b/application/models/receiving.php
@@ -211,7 +211,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()
+ function create_receivings_items_temp_table()
{
$this->db->query("CREATE TEMPORARY TABLE IF NOT EXISTS ".$this->db->dbprefix('receivings_items_temp')."
(SELECT date(receiving_time) as receiving_date, ".$this->db->dbprefix('receivings_items').".receiving_id, comment, item_location, invoice_number, payment_type, employee_id,
diff --git a/application/models/sale.php b/application/models/sale.php
index 50c565e47..98a5b15b1 100644
--- a/application/models/sale.php
+++ b/application/models/sale.php
@@ -425,7 +425,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()
+ function create_sales_items_temp_table()
{
if ($this->config->item('tax_included'))
{
@@ -475,7 +475,7 @@ class Sale extends CI_Model
$this->db->query('UPDATE '.$this->db->dbprefix('sales_items_temp'). ' SET total=subtotal WHERE total IS NULL');
}
- public function get_giftcard_value( $giftcardNumber )
+ function get_giftcard_value( $giftcardNumber )
{
if ( !$this->Giftcard->exists( $this->Giftcard->get_giftcard_id($giftcardNumber)))
return 0;
diff --git a/application/views/partial/header.php b/application/views/partial/header.php
index b8a247716..b2fe1da5e 100644
--- a/application/views/partial/header.php
+++ b/application/views/partial/header.php
@@ -32,7 +32,7 @@
-
+