Pridani pruvodci pro vyskladneni do firmy a vyskladneni k zakaznikovi, upraveno ...
[mirrors/SokoMan.git] / assistants / sell.inc.php
diff --git a/assistants/sell.inc.php b/assistants/sell.inc.php
new file mode 100644 (file)
index 0000000..ab60c7d
--- /dev/null
@@ -0,0 +1,26 @@
+<?php
+//TODO: Merge SELL and DISPOSE to single file with parameter!
+//TODO: Add support for selling/disposing multiple items at once...
+//TODO: Reuse /item/$item_id/edit
+$script = $_SERVER['SCRIPT_NAME'].'/assistant/sell';
+switch($step) {
+       default: case 1:
+?>
+<form action="<?=$script?>/2" method="GET">
+       item_serial: <input type="text" name="serial" />
+       <input type="submit" value="SELL" />
+</form>
+<?php
+               break;
+       case 2:
+               $item_id = $this->db->map_unique('item_serial', $_GET['serial'], 'item_id', 'item');
+               $columns = $this->db->get_columns('item');
+    $selectbox = $this->db->columns_get_selectbox($columns, 'item');
+
+               $current = $this->db->get_listing('item', $item_id, 1);
+               $current[$item_id]['status_id'] = 3;
+
+               $action = $_SERVER['SCRIPT_NAME']."/item/$item_id/edit";
+    echo $this->html->render_insert_form('item', $columns, $selectbox, $current, false, $action);
+               break;
+}
This page took 0.227888 seconds and 4 git commands to generate.