From 591da46e761650ae93d10de91e76d2e92f9f161d Mon Sep 17 00:00:00 2001 From: pappastech Date: Tue, 7 Aug 2012 23:35:33 +0000 Subject: [PATCH] Code clean up, fix for not being able to delete payment types with spaces in the name. Updated to version 2.0_RC8. Tom git-svn-id: svn+ssh://jekkos@svn.code.sf.net/p/opensourcepos/code/@54 c3eb156b-1dc0-44e1-88ae-e38439141b53 --- application/config/config.php | 2 +- application/controllers/sales.php | 4 ++-- application/libraries/Sale_lib.php | 12 ++++++------ application/views/sales/register.php | 13 ++++++------- 4 files changed, 15 insertions(+), 16 deletions(-) diff --git a/application/config/config.php b/application/config/config.php index e1741afb8..969fe7128 100644 --- a/application/config/config.php +++ b/application/config/config.php @@ -9,7 +9,7 @@ | | */ -$config['application_version'] = '2.0_RC7'; +$config['application_version'] = '2.0_RC8'; /* |-------------------------------------------------------------------------- diff --git a/application/controllers/sales.php b/application/controllers/sales.php index 45da72a40..4d93e163d 100644 --- a/application/controllers/sales.php +++ b/application/controllers/sales.php @@ -100,9 +100,9 @@ class Sales extends Secure_area } //Alain Multiple Payments - function delete_payment($payment_id) + function delete_payment( $payment_id ) { - $this->sale_lib->delete_payment($payment_id); + $this->sale_lib->delete_payment( $payment_id ); $this->_reload(); } diff --git a/application/libraries/Sale_lib.php b/application/libraries/Sale_lib.php index 8f83a5147..3240b0e76 100644 --- a/application/libraries/Sale_lib.php +++ b/application/libraries/Sale_lib.php @@ -24,8 +24,8 @@ class Sale_lib //Alain Multiple Payments function get_payments() { - if(!$this->CI->session->userdata('payments')) - $this->set_payments(array()); + if( !$this->CI->session->userdata( 'payments' ) ) + $this->set_payments( array( ) ); return $this->CI->session->userdata('payments'); } @@ -107,11 +107,11 @@ class Sale_lib } //Alain Multiple Payments - function delete_payment($payment_id) + function delete_payment( $payment_id ) { - $payments=$this->get_payments(); - unset($payments[$payment_id]); - $this->set_payments($payments); + $payments = $this->get_payments(); + unset( $payments[urldecode( $payment_id )] ); + $this->set_payments( $payments ); } //Alain Multiple Payments diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 1853117e8..d206ede20 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -292,15 +292,15 @@ else lang->line('sales_payment').': ';?> - + - lang->line('sales_amount_tendered').': ';?> + 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' ) ); ?> @@ -332,11 +332,10 @@ else echo form_open("sales/edit_payment/$payment_id",array('id'=>'edit_payment_form'.$payment_id)); ?> - lang->line('common_delete').']');?> + lang->line('common_delete').']' ); ?> - - - + +