From 7c1f53f75b0c7fc77877f924ded2b37ac4c3ffad Mon Sep 17 00:00:00 2001 From: Thomas Mudrunka Date: Sat, 4 Aug 2012 18:18:46 +0200 Subject: [PATCH] Obrana proti debilite --- assistants/sell.inc.php | 1 + 1 file changed, 1 insertion(+) diff --git a/assistants/sell.inc.php b/assistants/sell.inc.php index 73e096e..268f88f 100644 --- a/assistants/sell.inc.php +++ b/assistants/sell.inc.php @@ -50,6 +50,7 @@ switch($SUBPATH[0]) { $quantity_stored = $this->db->map_unique('item_serial', $item_serial, 'item_quantity', 'item', false); if(!is_numeric($quantity_stored)) $quantity_stored = 0; $item_quantity = $quantity_stored - $quantity_removed; + if($item_quantity < 0) $this->post_redirect_get("$URL_INTERNAL/1","You don't have enough stored items!"); echo("Stock: ".$quantity_stored."
Disposing/Selling: ".$quantity_removed."
Keeping: ".$item_quantity); -- 2.30.2