Changed popup to tabs in customers, suppliers, items for transactions.
[fa-stable.git] / purchasing / inquiry / supplier_inquiry.php
index 822654ecbd1ce126f7cd5c6acf3fa61d5c003418..ffb264b523420876cef4ae6fe3ca936e884faa09 100644 (file)
 ***********************************************************************/
 $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'];
 }
@@ -36,7 +38,8 @@ if (isset($_GET['ToDate'])){
 
 //------------------------------------------------------------------------------------------------
 
-start_form();
+if (!@$_GET['popup'])
+       start_form();
 
 if (!isset($_POST['supplier_id']))
        $_POST['supplier_id'] = get_global_supplier();
@@ -44,7 +47,8 @@ if (!isset($_POST['supplier_id']))
 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');
@@ -89,7 +93,7 @@ function display_supplier_summary($supplier_record)
 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();
@@ -123,6 +127,8 @@ function gl_view($row)
 
 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=".
@@ -190,7 +196,9 @@ $table->width = "85%";
 
 display_db_pager($table);
 
-end_form();
-end_page();
-
+if (!@$_GET['popup'])
+{
+       end_form();
+       end_page(@$_GET['popup'], false, false);
+}
 ?>