X-Git-Url: https://git.harvie.cz/?a=blobdiff_plain;f=assistants%2Fstore.inc.php;h=361174e33b37c94d3b840317ca1dc2d0182e0d56;hb=4ce8a610a00475bd0bc883ccdc56c9e3eec87f57;hp=a4dcbe8b1b3eb6cf143386b825b4defebdf4a996;hpb=274c2053a765e8b3cfecd046f60cc4b057971d35;p=mirrors%2FSokoMan.git diff --git a/assistants/store.inc.php b/assistants/store.inc.php index a4dcbe8..361174e 100644 --- a/assistants/store.inc.php +++ b/assistants/store.inc.php @@ -15,13 +15,15 @@ switch($SUBPATH[0]) { $model_price_in = $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_price_in', 'model'); $model_price_out = $this->db->map_unique('model_barcode', $_GET['barcode'], 'model_price_out', 'model'); - $disable_cols = array('status_id','item_price_out','item_customer', 'model_id','item_quantity'); + $disable_cols = array('status_id','item_price_out','item_customer', 'model_id','item_quantity','item_date_sold'); if($this->db->map_unique('model_barcode', $_GET['barcode'], 'model_countable', 'model')) { + $multi_insert = true; //$disable_cols[] = 'item_quantity'; $item_serial = ''; $item_quantity = $quantity_added = 1; $action = $_SERVER['SCRIPT_NAME'].'/item/new'; } else { + $multi_insert = false; $quantity_added = $_GET['quantity']; if($quantity_added <= 0) $this->post_redirect_get("$URL_INTERNAL/1","Can't store non-possitive amount of items!"); if(!is_numeric($quantity_added)) $quantity_added = 1; @@ -47,9 +49,10 @@ switch($SUBPATH[0]) { 'status_id' => 1, 'item_price_in' => $item_price_in + ($quantity_added * $model_price_in), 'item_price_out' => $item_price_out + ($quantity_added * $model_price_out), - 'item_author' => $this->db->auth->get_user_id() + 'item_author' => $this->db->auth->get_user_id(), + 'item_date_bought' => date('Y-m-d') )); - echo $this->html->render_insert_form('item', $columns, $selectbox, $current, $disable_cols, $action); + echo $this->html->render_insert_form('item', $columns, $selectbox, $current, $disable_cols, $action, $multi_insert); break; }