From c0ff849c0f494a4e20bc6af89070b736f929ec42 Mon Sep 17 00:00:00 2001 From: Jeroen Peelaerts Date: Tue, 13 Oct 2020 21:27:09 +0200 Subject: [PATCH] Do not cast quantity change to int in sale delete (#2964) --- application/models/Item_quantity.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/application/models/Item_quantity.php b/application/models/Item_quantity.php index f248b2994..403452327 100644 --- a/application/models/Item_quantity.php +++ b/application/models/Item_quantity.php @@ -59,7 +59,7 @@ class Item_quantity extends CI_Model public function change_quantity($item_id, $location_id, $quantity_change) { $quantity_old = $this->get_item_quantity($item_id, $location_id); - $quantity_new = $quantity_old->quantity + intval($quantity_change); + $quantity_new = $quantity_old->quantity + $quantity_change; $location_detail = array('item_id' => $item_id, 'location_id' => $location_id, 'quantity' => $quantity_new); return $this->save($location_detail, $item_id, $location_id);