diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index bf3dddf5ba..674ecf4c8b 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -245,7 +245,7 @@ public function add_payment() if(($cur_rewards_value - $current_payments_with_rewards) <= 0) { - $data['error'] = $this->lang->line('rewards_remaining_balance', to_currency($cur_rewards_value)); + $data['error'] = $this->lang->line('rewards_remaining_balance'). to_currency($cur_rewards_value); } else { @@ -253,7 +253,7 @@ public function add_payment() $new_reward_value = $new_reward_value >= 0 ? $new_reward_value : 0; $this->sale_lib->set_rewards_remainder($new_reward_value); $new_reward_value = str_replace('$', '\$', to_currency($new_reward_value)); - $data['warning'] = $this->lang->line('rewards_remaining_balance', $new_reward_value); + $data['warning'] = $this->lang->line('rewards_remaining_balance'). $new_reward_value; $amount_tendered = min($this->sale_lib->get_amount_due(), $points); $this->sale_lib->add_payment($payment_type, $amount_tendered); @@ -878,7 +878,7 @@ private function _reload($data = array()) $data['payments_total'] = $this->sale_lib->get_payments_total(); $data['amount_due'] = $this->sale_lib->get_amount_due(); $data['payments'] = $this->sale_lib->get_payments(); - if($customer_info) + if($customer_info && $this->config->item('customer_reward_enable') == TRUE) $data['payment_options'] = $this->Sale->get_payment_options(TRUE,TRUE); else $data['payment_options'] = $this->Sale->get_payment_options(); diff --git a/application/language/en/sales_lang.php b/application/language/en/sales_lang.php index 8506a919f1..7f4e96c992 100644 --- a/application/language/en/sales_lang.php +++ b/application/language/en/sales_lang.php @@ -136,4 +136,4 @@ $lang["customers_available_points"] = "Available Points"; $lang["sales_rewards"] = "Reward Points"; $lang["sales_rewards_balance"] = "Reward Points Balance"; -$lang["rewards_remaining_balance"] = "Reward Points remaining value is %1!"; \ No newline at end of file +$lang["rewards_remaining_balance"] = "Reward Points remaining value is "; \ No newline at end of file diff --git a/application/models/Sale.php b/application/models/Sale.php index 978426d67f..e962a4608f 100644 --- a/application/models/Sale.php +++ b/application/models/Sale.php @@ -536,7 +536,7 @@ public function save($items, $customer_id, $employee_id, $comment, $invoice_numb $total_amount = floatval($total_amount) + floatval($payment['payment_amount']); } - if(isset($customer_id) && $customer_id!= NULL){ + if(isset($customer_id) && $customer_id!= NULL && $this->config->item('customer_reward_enable') == TRUE){ $package_id = $this->Customer->get_info($customer_id)->package_id; if(isset($package_id) && $package_id!=NULL){ $points_percent = $this->Customer_rewards->get_points_percent($package_id); diff --git a/application/views/customers/form.php b/application/views/customers/form.php index af1590821a..26fd2f924d 100644 --- a/application/views/customers/form.php +++ b/application/views/customers/form.php @@ -64,7 +64,7 @@ - + config->item('customer_reward_enable') == TRUE): ?>
lang->line('rewards_package'), 'rewards', array('class'=>'control-label col-xs-3')); ?>
@@ -84,7 +84,7 @@ );?>
- +
lang->line('customers_taxable'), 'taxable', array('class' => 'control-label col-xs-3')); ?>
diff --git a/application/views/sales/register.php b/application/views/sales/register.php index f4b1a1d076..2b16eeff5e 100644 --- a/application/views/sales/register.php +++ b/application/views/sales/register.php @@ -290,6 +290,7 @@ lang->line("sales_customer_discount"); ?> + config->item('customer_reward_enable') == TRUE): ?> + lang->line("sales_customer_total"); ?>