From 6dc49ca00ea9a994f8cac018c2f0f93a93d7a1af Mon Sep 17 00:00:00 2001 From: Joshua Fernandes Date: Sat, 22 Apr 2017 12:20:32 +0530 Subject: [PATCH] sales fixes --- application/controllers/Sales.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index 0624fa8fb..9814999f5 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -195,10 +195,12 @@ class Sales extends Secure_Controller public function add_payment() { $data = array(); - $this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required|callback_numeric'); $payment_type = $this->input->post('payment_type'); - + if($payment_type != $this->lang->line('sales_giftcard')) + $this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required|callback_numeric'); + else + $this->form_validation->set_rules('amount_tendered', 'lang:sales_amount_tendered', 'trim|required'); if($this->form_validation->run() == FALSE) { if($payment_type == $this->lang->line('sales_giftcard'))