include_once($path_to_root . "/includes/ui.inc");
$js = "";
-if ($use_popup_windows)
+if ($SysPrefs->use_popup_windows)
$js .= get_js_open_window(800, 500);
if (user_use_date_picker())
$js .= get_js_date_picker();
$_POST['stock_id'] = $_GET['stock_id'];
}
-start_form();
+if (!@$_GET['popup'])
+ start_form();
if (!isset($_POST['stock_id']))
$_POST['stock_id'] = get_global_stock_item();
locations_list_cells(_("From Location:"), 'StockLocation', null, true);
-date_cells(_("From:"), 'AfterDate', '', null, -$_SESSION["wa_current_user"]->prefs->transaction_days());
+date_cells(_("From:"), 'AfterDate', '', null, -user_transaction_days());
date_cells(_("To:"), 'BeforeDate');
submit_cells('ShowMoves',_("Show Movements"),'',_('Refresh Inquiry'), 'default');
div_start('doc_tbl');
start_table(TABLESTYLE);
$th = array(_("Type"), _("#"), _("Reference"));
-if($display_location) array_push($th, _("Location"));
-array_push($th, _("Date"), _("Detail"), _("Quantity In"), _("Quantity Out"), _("Quantity On Hand"));
+if ($display_location)
+ array_push($th, _("Location"));
+
+array_push($th, _("Date"), _("Detail"), _("Quantity In"), _("Quantity Out"), _("Quantity On Hand"));
table_header($th);
-$before_qty = get_stock_movements_before($_POST['stock_id'], $_POST['StockLocation'], $_POST['AfterDate']);
-
+$before_qty = get_qoh_on_date($_POST['stock_id'], $_POST['StockLocation'], add_days($_POST['AfterDate'], -1));
+
$after_qty = $before_qty;
/*
label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"]));
label_cell(get_trans_view_str($myrow["type"], $myrow["trans_no"], $myrow["reference"]));
+
if($display_location) {
label_cell($myrow['loc_code']);
}
label_cell($trandate);
- $person = $myrow["person_id"];
$gl_posting = "";
- if (($myrow["type"] == ST_CUSTDELIVERY) || ($myrow["type"] == ST_CUSTCREDIT))
- {
- $cust_row = get_customer_details_from_trans($myrow["type"], $myrow["trans_no"]);
-
- if (strlen($cust_row['name']) > 0)
- $person = $cust_row['name'] . " (" . $cust_row['br_name'] . ")";
-
- }
- elseif ($myrow["type"] == ST_SUPPRECEIVE || $myrow['type'] == ST_SUPPCREDIT)
- {
- // get the supplier name
- $supp_name = get_supplier_name($myrow["person_id"]);
-
- if (strlen($supp_name) > 0)
- $person = $supp_name;
- }
- elseif ($myrow["type"] == ST_LOCTRANSFER || $myrow["type"] == ST_INVADJUST)
- {
- // get the adjustment type
- $movement_type = get_movement_type($myrow["person_id"]);
- $person = $movement_type["name"];
- }
- elseif ($myrow["type"]==ST_WORKORDER || $myrow["type"] == ST_MANUISSUE ||
- $myrow["type"] == ST_MANURECEIVE)
- {
- $person = "";
- }
-
- label_cell($person);
+ label_cell($myrow['name']);
label_cell((($myrow["qty"] >= 0) ? $quantity_formatted : ""), "nowrap align=right");
label_cell((($myrow["qty"] < 0) ? $quantity_formatted : ""), "nowrap align=right");
qty_cell($after_qty, false, $dec);
end_row();
+
$j++;
- If ($j == 12)
+ if ($j == 12)
{
$j = 1;
table_header($th);
}
-//end of page full new headings if
}
-//end of while loop
start_row("class='inquirybg'");
label_cell("<b>"._("Quantity on hand after") . " " . $_POST['BeforeDate']."</b>", "align=center colspan=$header_span");
div_end();
end_page();
-?>