//if (!isset($_POST['ref']))
//	$_POST['ref'] = $Refs->get_next(ST_CUSTDELIVERY);
if ($_SESSION['Items']->trans_no == 0) {
    ref_cells(_("Reference"), 'ref', '', null, "class='tableheader2'");
} else {
    label_cells(_("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
label_cells(_("For Sales Order"), get_customer_trans_view_str(ST_SALESORDER, $_SESSION['Items']->order_no), "class='tableheader2'");
label_cells(_("Sales Type"), $_SESSION['Items']->sales_type_name, "class='tableheader2'");
end_row();
start_row();
if (!isset($_POST['Location'])) {
    $_POST['Location'] = $_SESSION['Items']->Location;
}
label_cell(_("Delivery From"), "class='tableheader2'");
locations_list_cells(null, 'Location', null, false, true);
if (!isset($_POST['ship_via'])) {
    $_POST['ship_via'] = $_SESSION['Items']->ship_via;
}
label_cell(_("Shipping Company"), "class='tableheader2'");
shippers_list_cells(null, 'ship_via', $_POST['ship_via']);
// set this up here cuz it's used to calc qoh
if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {
    $_POST['DispatchDate'] = new_doc_date();
    if (!is_date_in_fiscalyear($_POST['DispatchDate'])) {
        $_POST['DispatchDate'] = end_fiscalyear();
    }
}
date_cells(_("Date"), 'DispatchDate', '', $_SESSION['Items']->trans_no == 0, 0, 0, 0, "class='tableheader2'");
end_row();
end_table();
Esempio n. 2
0
        $Ajax->addFocus(true, 'order_number');
    } else {
        $Ajax->addFocus(true, 'OrdersAfterDate');
    }
    $Ajax->activate('orders_tbl');
}
//---------------------------------------------------------------------------------------------
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 {
Esempio n. 3
0
  	$action .= "?InvoiceTemplates=" . $_POST['InvoiceTemplates'];
}
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'];
Esempio n. 4
0
    $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);
$sql = "SELECT SUM(qty) FROM stock_moves WHERE stock_id='" . $_POST['stock_id'] . "'\n\tAND loc_code='" . $_POST['StockLocation'] . "'\n\tAND tran_date < '" . $after_date . "'";
Esempio n. 5
0
//if (!isset($_POST['ref']))
//	$_POST['ref'] = references::get_next(13);
if ($_SESSION['Items']->trans_no == 0) {
    ref_cells(tr("Reference"), 'ref', $_SESSION['Items']->reference, "class='tableheader2'");
} else {
    label_cells(tr("Reference"), $_SESSION['Items']->reference, "class='tableheader2'");
}
label_cells(tr("For Sales Order"), get_customer_trans_view_str(systypes::sales_order(), $_SESSION['Items']->order_no), "class='tableheader2'");
label_cells(tr("Sales Type"), $_SESSION['Items']->sales_type_name, "class='tableheader2'");
end_row();
start_row();
if (!isset($_POST['Location'])) {
    $_POST['Location'] = $_SESSION['Items']->Location;
}
label_cell(tr("Delivery From"), "class='tableheader2'");
locations_list_cells(null, 'Location', $_POST['Location'], false, true);
if (!isset($_POST['ship_via'])) {
    $_POST['ship_via'] = $_SESSION['Items']->ship_via;
}
label_cell(tr("Shipping Company"), "class='tableheader2'");
shippers_list_cells(null, 'ship_via', $_POST['ship_via']);
// set this up here cuz it's used to calc qoh
if (!isset($_POST['DispatchDate']) || !is_date($_POST['DispatchDate'])) {
    $_POST['DispatchDate'] = Today();
    if (!is_date_in_fiscalyear($_POST['DispatchDate'])) {
        $_POST['DispatchDate'] = end_fiscalyear();
    }
}
date_cells(tr("Date"), 'DispatchDate', $_POST['DispatchDate'], 0, 0, 0, "class='tableheader2'");
end_row();
end_table();