mirror of
https://github.com/opensourcepos/opensourcepos.git
synced 2026-05-19 22:10:44 -04:00
Add grunt-cache-breaker plugin (#137)
Fix tax inclusive pricing for daily sales overview (#136) Fix table sorting when using search in daily sales overview (#131)
This commit is contained in:
17
Gruntfile.js
17
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']);
|
||||
|
||||
};
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
<!-- end js template tags -->
|
||||
<?php else : ?>
|
||||
<!-- start minjs template tags -->
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js" language="javascript"></script>
|
||||
<script type="text/javascript" src="dist/opensourcepos.min.js?rel=46b435ed1a" language="javascript"></script>
|
||||
<!-- end minjs template tags -->
|
||||
<?php endif; ?>
|
||||
<script type="text/javascript">
|
||||
|
||||
@@ -17,6 +17,7 @@
|
||||
"license": "MIT",
|
||||
"devDependencies": {
|
||||
"grunt": "~0.4.5",
|
||||
"grunt-cache-breaker": "^2.0.1",
|
||||
"grunt-contrib-concat": "~0.5.1",
|
||||
"grunt-contrib-jshint": "~0.6.3",
|
||||
"grunt-contrib-uglify": "~0.8.0",
|
||||
@@ -24,7 +25,7 @@
|
||||
"grunt-mocha-webdriver": "^1.2.2",
|
||||
"grunt-script-link-tags": "git://github.com/jekkos/grunt-script-link-tags.git#master",
|
||||
"mocha": "^2.2.1",
|
||||
"wd": "^0.3.3",
|
||||
"phantomjs": "~1.9.2"
|
||||
"phantomjs": "~1.9.2",
|
||||
"wd": "^0.3.3"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user