From 69c1af586e261b42699ded236aa6130d333e6faf Mon Sep 17 00:00:00 2001 From: FrancescoUK Date: Fri, 11 Mar 2016 14:35:22 +0000 Subject: [PATCH] relayout of sales/register right panel to follow a more logical flow (#116) --- application/controllers/Sales.php | 14 +- application/language/en/sales_lang.php | 8 +- application/views/sales/form.php | 2 +- application/views/sales/register.php | 275 ++++++++++++++----------- css/register.css | 21 +- dist/opensourcepos.min.css | 2 +- translations/sales_lang.csv | 8 +- 7 files changed, 179 insertions(+), 151 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index c930424fb..ee88c5f7b 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -679,8 +679,7 @@ class Sales extends Secure_area } /* Changed the conditional to account for floating point rounding */ - if ( ($this->sale_lib->get_mode() == 'sale') && - ( ( to_currency_no_money( $this->sale_lib->get_total() ) - $total_payments ) > 1e-6 ) ) + if ( ($this->sale_lib->get_mode() == 'sale') && ( ( to_currency_no_money( $this->sale_lib->get_total() ) - $total_payments ) > 1e-6 ) ) { return false; } @@ -710,11 +709,11 @@ class Sales extends Secure_area $data['amount_due'] = $this->sale_lib->get_amount_due(); $data['payments'] = $this->sale_lib->get_payments(); $data['payment_options'] = array( - $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), - $this->lang->line('sales_check') => $this->lang->line('sales_check'), - $this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'), $this->lang->line('sales_debit') => $this->lang->line('sales_debit'), - $this->lang->line('sales_credit') => $this->lang->line('sales_credit') + $this->lang->line('sales_credit') => $this->lang->line('sales_credit'), + $this->lang->line('sales_cash') => $this->lang->line('sales_cash'), + $this->lang->line('sales_giftcard') => $this->lang->line('sales_giftcard'), + $this->lang->line('sales_check') => $this->lang->line('sales_check') ); $customer_id = $this->sale_lib->get_customer(); @@ -759,9 +758,10 @@ class Sales extends Secure_area $this->load->view("sales/register", $data); } - function cancel_sale() + function cancel() { $this->sale_lib->clear_all(); + $this->_reload(); } diff --git a/application/language/en/sales_lang.php b/application/language/en/sales_lang.php index 59395c3e4..e03a77e61 100644 --- a/application/language/en/sales_lang.php +++ b/application/language/en/sales_lang.php @@ -4,14 +4,14 @@ $lang["sales_add_payment"] = "Add Payment"; $lang["sales_amount_due"] = "Amount Due"; $lang["sales_amount_tendered"] = "Amount Tendered"; $lang["sales_basic_information"] = "Sale information"; -$lang["sales_cancel_sale"] = "Cancel Sale"; +$lang["sales_cancel_sale"] = "Cancel"; $lang["sales_cash"] = "Cash"; $lang["sales_change_due"] = "Change Due"; $lang["sales_check"] = "Check"; $lang["sales_check_balance"] = "Check remainder"; $lang["sales_comment"] = "Comment"; $lang["sales_comments"] = "Comments"; -$lang["sales_complete_sale"] = "Complete Sale"; +$lang["sales_complete_sale"] = "Complete"; $lang["sales_confirm_cancel_sale"] = "Are you sure you want to clear this sale? All items will cleared."; $lang["sales_confirm_delete"] = "Are you sure you want to delete the selected sales?"; $lang["sales_confirm_finish_sale"] = "Are you sure you want to submit this sale? This cannot be undone."; @@ -102,9 +102,9 @@ $lang["sales_sub_total"] = "Sub Total"; $lang["sales_successfully_deleted"] = "You have successfully deleted"; $lang["sales_successfully_suspended_sale"] = "Your sale has been successfully suspended"; $lang["sales_successfully_updated"] = "Sale successfully updated"; -$lang["sales_suspend_sale"] = "Suspend Sale"; +$lang["sales_suspend_sale"] = "Suspend"; $lang["sales_suspended_sale_id"] = "ID"; -$lang["sales_suspended_sales"] = "Suspended Sales"; +$lang["sales_suspended_sales"] = "Suspended"; $lang["sales_tax"] = "Tax"; $lang["sales_tax_percent"] = "Tax %"; $lang["sales_total"] = "Total"; diff --git a/application/views/sales/form.php b/application/views/sales/form.php index e76b8f33d..53868596b 100755 --- a/application/views/sales/form.php +++ b/application/views/sales/form.php @@ -6,7 +6,7 @@
'sales_edit_form', 'class'=>'form-horizontal')); ?>
- lang->line('sales_receipt_number'), 'customer', array('class'=>'control-label col-xs-3')); ?> + lang->line('sales_receipt_number'), 'receipt_number', array('class'=>'control-label col-xs-3')); ?>
lang->line('sales_receipt_number') .$sale_info['sale_id'], array('target' => '_blank'));?>
diff --git a/application/views/sales/register.php b/application/views/sales/register.php index 6837cf0cd..5df08d983 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -20,6 +20,9 @@ if (isset($success)) ?>
+ + + 'mode_form', 'class'=>'form-horizontal panel panel-default')); ?>
    @@ -100,7 +103,7 @@ if (isset($success)) @@ -232,7 +235,7 @@ if (isset($success)) if(isset($customer)) { ?> - +
    @@ -271,6 +274,7 @@ if (isset($success)) } ?>
    lang->line("sales_customer"); ?>
    + lang->line('common_remove').' '.$this->lang->line('customers_customer'), array('class'=>'btn btn-danger btn-xs', 'id'=>'remove_customer_button', 'title'=>$this->lang->line('common_remove').' '.$this->lang->line('customers_customer'))); ?> - +
    @@ -320,36 +324,7 @@ if (isset($success)) if(count($cart) > 0) { ?> - 'cancel_sale_form', 'class'=>'form-horizontal')); ?> -
    -
    lang->line('sales_suspend_sale'); ?>
    - -
    lang->line('sales_cancel_sale'); ?>
    -
    - - - 0) - { - ?> - 'finish_sale_form', 'class'=>'form-horizontal')); ?> -
    - - 'comment', 'id'=>'comment', 'class'=>'form-control input-sm', 'value'=>$comment, 'rows'=>'2')); ?> - ".$this->lang->line('sales_complete_sale')."
    "; - } - ?> - - - - -
    lang->line('sales_sub_total'); ?> config->item('tax_included') ? $tax_exclusive_subtotal : $subtotal); ?>
    +
    @@ -360,74 +335,10 @@ if (isset($success))
    lang->line('sales_payments_total');?>
    -