***********************************************************************/
$page_security = 'SA_SUPPTRANSVIEW';
$path_to_root = "../..";
-include($path_to_root . "/includes/db_pager.inc");
-include($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/includes/db_pager.inc");
+include_once($path_to_root . "/includes/session.inc");
-include($path_to_root . "/purchasing/includes/purchasing_ui.inc");
-include($path_to_root . "/reporting/includes/reporting.inc");
-
-$js = "";
-if ($use_popup_windows)
- $js .= get_js_open_window(900, 500);
-if ($use_date_picker)
- $js .= get_js_date_picker();
-page(_($help_context = "Supplier Inquiry"), isset($_GET['supplier_id']), false, "", $js);
+include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
+include_once($path_to_root . "/reporting/includes/reporting.inc");
+if (!@$_GET['popup'])
+{
+ $js = "";
+ if ($use_popup_windows)
+ $js .= get_js_open_window(900, 500);
+ if ($use_date_picker)
+ $js .= get_js_date_picker();
+ page(_($help_context = "Supplier Inquiry"), isset($_GET['supplier_id']), false, "", $js);
+}
if (isset($_GET['supplier_id'])){
$_POST['supplier_id'] = $_GET['supplier_id'];
}
//------------------------------------------------------------------------------------------------
-start_form();
+if (!@$_GET['popup'])
+ start_form();
if (!isset($_POST['supplier_id']))
$_POST['supplier_id'] = get_global_supplier();
start_table(TABLESTYLE_NOBORDER);
start_row();
-supplier_list_cells(_("Select a supplier:"), 'supplier_id', null, true);
+if (!@$_GET['popup'])
+ supplier_list_cells(_("Select a supplier:"), 'supplier_id', null, true, false, false, !@$_GET['popup']);
date_cells(_("From:"), 'TransAfterDate', '', null, -30);
date_cells(_("To:"), 'TransToDate');
div_start('totals_tbl');
if (($_POST['supplier_id'] != "") && ($_POST['supplier_id'] != ALL_TEXT))
{
- $supplier_record = get_supplier_details($_POST['supplier_id']);
+ $supplier_record = get_supplier_details($_POST['supplier_id'], $_POST['TransToDate']);
display_supplier_summary($supplier_record);
}
div_end();
function credit_link($row)
{
+ if (@$_GET['popup'])
+ return '';
return $row['type'] == ST_SUPPINVOICE && $row["TotalAmount"] - $row["Allocated"] > 0 ?
pager_link(_("Credit This"),
"/purchasing/supplier_credit.php?New=1&invoice_no=".
display_db_pager($table);
-end_form();
-end_page();
-
+if (!@$_GET['popup'])
+{
+ end_form();
+ end_page(@$_GET['popup'], false, false);
+}
?>