From: Thomas Mudrunka Date: Sat, 4 Aug 2012 16:18:46 +0000 (+0200) Subject: Obrana proti debilite X-Git-Url: https://git.harvie.cz/?a=commitdiff_plain;h=7c1f53f75b0c7fc77877f924ded2b37ac4c3ffad;p=mirrors%2FSokoMan.git Obrana proti debilite --- 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);