diff --git a/application/controllers/Receivings.php b/application/controllers/Receivings.php index af59a0e47..b0224ad63 100644 --- a/application/controllers/Receivings.php +++ b/application/controllers/Receivings.php @@ -125,9 +125,9 @@ class Receivings extends Secure_Controller $serialnumber = $this->input->post('serialnumber'); $price = parse_decimals($this->input->post('price')); $quantity = parse_quantity($this->input->post('quantity')); - $discount = parse_decimals($this->input->post('discount')); $discount_type = $this->input->post('discount_type'); - $item_location = $this->input->post('location'); + $discount = $discount_type ? parse_quantity($this->input->post('discount')) : parse_decimals($this->input->post('discount')); + $receiving_quantity = $this->input->post('receiving_quantity'); if($this->form_validation->run() != FALSE) diff --git a/application/controllers/Sales.php b/application/controllers/Sales.php index ab62d00de..7c0c891ad 100644 --- a/application/controllers/Sales.php +++ b/application/controllers/Sales.php @@ -476,8 +476,8 @@ class Sales extends Secure_Controller $serialnumber = $this->input->post('serialnumber'); $price = parse_decimals($this->input->post('price')); $quantity = parse_quantity($this->input->post('quantity')); - $discount = parse_decimals($this->input->post('discount')); $discount_type = $this->input->post('discount_type'); + $discount = $discount_type ? parse_quantity($this->input->post('discount')) : parse_decimals($this->input->post('discount')); $item_location = $this->input->post('location'); $discounted_total = $this->input->post('discounted_total') != '' ? $this->input->post('discounted_total') : NULL; diff --git a/application/views/receivings/receiving.php b/application/views/receivings/receiving.php index 5a445caf1..4b7a0d931 100644 --- a/application/views/receivings/receiving.php +++ b/application/views/receivings/receiving.php @@ -167,7 +167,7 @@ if (isset($success)) ?>