} //--------------------------------------------------------------------------------------------- if (!@$_GET['popup']) { start_form(); } start_table(TABLESTYLE_NOBORDER); start_row(); ref_cells(_("#:"), 'order_number', '', null, '', true); date_cells(_("from:"), 'OrdersAfterDate', '', null, -30); date_cells(_("to:"), 'OrdersToDate'); locations_list_cells(_("into location:"), 'StockLocation', null, true); end_row(); end_table(); start_table(TABLESTYLE_NOBORDER); start_row(); stock_items_list_cells(_("for item:"), 'SelectStockFromList', null, true); submit_cells('SearchOrders', _("Search"), '', _('Select documents'), 'default'); end_row(); end_table(1); //--------------------------------------------------------------------------------------------- if (isset($_POST['order_number'])) { $order_number = $_POST['order_number']; } if (isset($_POST['SelectStockFromList']) && $_POST['SelectStockFromList'] != "" && $_POST['SelectStockFromList'] != ALL_TEXT) { $selected_stock_item = $_POST['SelectStockFromList']; } else { unset($selected_stock_item); } //--------------------------------------------------------------------------------------------- function trans_view($trans) {
return true; } //------------------------------------------------------------------------------------ if (isset($_POST['delete']) && strlen($_POST['delete']) > 1) { if (can_delete($_POST['NewStockID'])) { $stock_id = $_POST['NewStockID']; delete_item($stock_id); meta_forward($_SERVER['PHP_SELF']); } } //------------------------------------------------------------------------------------ start_form(true); if (db_has_stock_items()) { start_table("class='tablestyle_noborder'"); start_row(); stock_items_list_cells(tr("Select an item:"), 'stock_id', null, null, null, null, 1); submit_cells('SelectStockItem', tr("Edit Item")); end_row(); end_table(); } hyperlink_params($_SERVER['PHP_SELF'], tr("Enter a new item"), "New=1"); echo "<br>"; start_table("{$table_style2} width=40%"); table_section_title(tr("Item")); //------------------------------------------------------------------------------------ $id = ""; // no stock item for image load if (!isset($_POST['NewStockID']) || isset($_POST['New'])) { /*If the page was called without $_POST['NewStockID'] passed to page then assume a new item is to be entered show a form with a part Code field other wise the form showing the fields with the existing entries against the part will show for editing with only a hidden stock_id field. New is set to flag that the page may have called itself and still be entering a new part, in which case the page needs to know not to go looking up details for an existing part*/ hidden('New', 'Yes'); text_row(tr("Item Code:"), 'NewStockID', null, 21, 20);
submit_center('addupdate', _("Insert New Item"), true, '', 'default'); } else { submit_center_first('addupdate', _("Update Item"), '', @$_REQUEST['popup'] ? true : 'default'); submit_return('select', get_post('stock_id'), _("Select this items and return to document entry."), 'default'); submit('clone', _("Clone This Item"), true, '', true); submit('delete', _("Delete This Item"), true, '', true); submit_center_last('cancel', _("Cancel"), _("Cancel Edition"), 'cancel'); } div_end(); } //-------------------------------------------------------------------------------------------- start_form(true); if (db_has_stock_items()) { start_table(TABLESTYLE_NOBORDER); start_row(); stock_items_list_cells(_("Select an item:"), 'stock_id', null, _('New item'), true, check_value('show_inactive')); $new_item = get_post('stock_id') == ''; check_cells(_("Show inactive:"), 'show_inactive', null, true); end_row(); end_table(); if (get_post('_show_inactive_update')) { $Ajax->activate('stock_id'); set_focus('stock_id'); } } else { hidden('stock_id', get_post('stock_id')); } div_start('details'); $stock_id = get_post('stock_id'); if (!$stock_id) { unset($_POST['_tabs_sel']);
if ($use_popup_windows) { $js .= get_js_open_window(800, 500); } if ($use_date_picker) { $js .= get_js_date_picker(); } page(tr("Inventory Item Movement"), false, false, "", $js); if (isset($_GET['stock_id'])) { $_POST['stock_id'] = $_GET['stock_id']; } start_form(false, true); if (!isset($_POST['stock_id'])) { $_POST['stock_id'] = get_global_stock_item(); } start_table("class='tablestyle_noborder'"); stock_items_list_cells(tr("Item:"), 'stock_id', $_POST['stock_id']); locations_list_cells(tr("From Location:"), 'StockLocation', null); date_cells(tr("From:"), 'AfterDate', null, -30); date_cells(tr("To:"), 'BeforeDate'); submit_cells('ShowMoves', tr("Show Movements")); end_table(); end_form(); set_global_stock_item($_POST['stock_id']); $before_date = date2sql($_POST['BeforeDate']); $after_date = date2sql($_POST['AfterDate']); $sql = "SELECT type, trans_no, tran_date, person_id, qty, reference\n\tFROM stock_moves\n\tWHERE loc_code='" . $_POST['StockLocation'] . "'\n\tAND tran_date >= '" . $after_date . "'\n\tAND tran_date <= '" . $before_date . "'\n\tAND stock_id = '" . $_POST['stock_id'] . "' ORDER BY tran_date,trans_id"; $result = db_query($sql, "could not query stock moves"); check_db_error("The stock movements for the selected criteria could not be retrieved", $sql); start_table("{$table_style} width=70%"); $th = array(tr("Type"), tr("#"), tr("Reference"), tr("Date"), tr("Detail"), tr("Quantity In"), tr("Quantity Out"), tr("Quantity On Hand")); table_header($th);
} elseif ($_POST['order_view_mode']=='DeliveryTemplates') { $action .= "?DeliveryTemplates=" . $_POST['InvoiceTemplates']; } */ start_form(false, false, $_SERVER['PHP_SELF'] . SID); start_table("class='tablestyle_noborder'"); start_row(); ref_cells(tr("#:"), 'OrderNumber'); if ($_POST['order_view_mode'] != 'DeliveryTemplates' && $_POST['order_view_mode'] != 'InvoiceTemplates') { date_cells(tr("from:"), 'OrdersAfterDate', null, -30); date_cells(tr("to:"), 'OrdersToDate', null, 1); } locations_list_cells(tr("Location:"), 'StockLocation', null, true); stock_items_list_cells(tr("Item:"), 'SelectStockFromList', null, true); submit_cells('SearchOrders', tr("Search")); hidden('order_view_mode', $_POST['order_view_mode']); end_row(); end_table(); end_form(); //--------------------------------------------------------------------------------------------- if (isset($_POST['SelectStockFromList']) && $_POST['SelectStockFromList'] != "" && $_POST['SelectStockFromList'] != reserved_words::get_all()) { $selected_stock_item = $_POST['SelectStockFromList']; } else { unset($selected_stock_item); } //--------------------------------------------------------------------------------------------- if (isset($_POST['ChangeTmpl']) && $_POST['ChangeTmpl'] != 0) { $sql = "UPDATE sales_orders SET type = !type WHERE order_no=" . $_POST['ChangeTmpl']; db_query($sql, "Can't change sales order type");