From d0b73d39204f1cc99e54092e0d907861bfa21f60 Mon Sep 17 00:00:00 2001 From: Aamir Shahzad Date: Wed, 30 Sep 2015 09:07:55 +0500 Subject: [PATCH 1/2] First test commit with some config language changes --- application/config/config.php | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/application/config/config.php b/application/config/config.php index 723f72c..95e61de 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -82,7 +82,10 @@ | than english. | */ -$config['language'] = 'english'; +/* SAS */ +// $config['language'] = 'english'; +$config['language'] = 'en'; +/* EAS */ /* |-------------------------------------------------------------------------- From 6805dc5d2aaa9f82aa5dcb9f4c7d8fa7ff1963e7 Mon Sep 17 00:00:00 2001 From: Aamir Shahzad Date: Wed, 30 Sep 2015 09:55:41 +0500 Subject: [PATCH 2/2] Added better navigation with TAB key on sales page i.e add item and press TAB key one time to edit quantity, TAB key two time to enter paid amount and finish the sale. --- application/config/config.php | 4 +- application/views/sales/register.php | 61 +++++++++++++++++++++++++--- 2 files changed, 57 insertions(+), 8 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index 95e61de..8220b34 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -82,10 +82,10 @@ | than english. | */ -/* SAS */ +// SAS - Because language has a en folder instead of english :( We may rename it or do like this. // $config['language'] = 'english'; $config['language'] = 'en'; -/* EAS */ +// EAS - Because language has a en folder instead of english :( We may rename it or do like this. /* |-------------------------------------------------------------------------- diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 6444afa..1bdd194 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -41,7 +41,12 @@ } ?> -'item','id'=>'item','size'=>'40'));?> +'item','id'=>'item','size'=>'40')); +echo form_input(array('name'=>'item','id'=>'item','size'=>'40','tabindex'=>'1')); +// EAS +?>
".$this->lang->line('sales_new_item')."
", @@ -75,8 +80,18 @@ } else { + // SAS + //$tabindex = count($cart) + 1; + $tabindex = 2; + // EAS foreach(array_reverse($cart, true) as $line=>$item) { + // SAS + if($tabindex == 3) + { + $tabindex = 5; + } + // EAS $cur_item_info = $this->Item->get_info($item['item_id']); echo form_open("sales/edit_item/$line"); ?> @@ -110,8 +125,11 @@ echo form_hidden('quantity',$item['quantity']); } else - { - echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2')); + { + // SAS + //echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2')); + echo form_input(array('name'=>'quantity','value'=>$item['quantity'],'size'=>'2','tabindex'=>$tabindex)); + // EAS } ?> @@ -172,6 +190,9 @@ @@ -259,8 +280,15 @@ } if ($payments_cover_total) - { - echo "
".$this->lang->line('sales_complete_sale')."
"; + { + // SAS + //echo "
".$this->lang->line('sales_complete_sale')."
"; + echo " +
+ ".$this->lang->line('sales_complete_sale')." + +
"; + // EAS } echo "
".$this->lang->line('sales_suspend_sale')."
"; ?> @@ -300,7 +328,12 @@ lang->line( 'sales_amount_tendered' ).': '; ?> - 'amount_tendered', 'id'=>'amount_tendered', 'value'=>to_currency_no_money($amount_due), 'size'=>'10' ) ); ?> + 'amount_tendered', 'id'=>'amount_tendered', 'value'=>to_currency_no_money($amount_due), 'size'=>'10' ) ); + echo form_input( array( 'name'=>'amount_tendered', 'id'=>'amount_tendered', 'value'=>to_currency_no_money($amount_due), 'size'=>'10','tabindex'=>4 ) ); + // EAS + ?> @@ -432,6 +465,22 @@ $('#finish_sale_form').submit(); } }); + // SAS + $( "#finish_sale_button" ).keypress(function( event ) { + if ( event.which == 13 ) { + if (confirm('lang->line("sales_confirm_finish_sale"); ?>')) + { + $('#finish_sale_form').submit(); + } + } + }); + + //$( "#amount_tendered" ).keypress(function( event ) { + //if ( event.which == 13 ) { + //$( "#finish_sale_button" ).trigger( "click" ); + //} + //}); + // EAS $("#suspend_sale_button").click(function() {