<?php

/* * ********************************************************************
  Copyright (C) FrontAccounting, LLC.
  Released under the terms of the GNU General Public License, GPL,
  as published by the Free Software Foundation, either version 3
  of the License, or (at your option) any later version.
  This program is distributed in the hope that it will be useful,
  but WITHOUT ANY WARRANTY; without even the implied warranty of
  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
  See the License here <http://www.gnu.org/licenses/gpl-3.0.html>.
 * ********************************************************************* */

$page_security = 'SA_DASHBOARD_PURCHASING_VIEW'; // A very low access level. The real access level is inside the routines.
$path_to_root = "..";

include_once($path_to_root . "/includes/session.inc");
include_once($path_to_root . "/includes/ui.inc");
include_once($path_to_root . "/reporting/includes/class.graphic.inc");
include_once($path_to_root . "/includes/dashboard.inc"); // here are all the dashboard routines.
include_once($path_to_root . "/admin/db/list_values_db.inc");
include_once($path_to_root . "/admin/db/months_db.inc");
include_once($path_to_root . "/includes/ui/ui_lists_custom.inc");
include_once($path_to_root . "/includes/ui/ui_lists.inc");
include_once($path_to_root . "/dashboard/includes/ui/dashboard_ui.inc");
include_once($path_to_root . "/dashboard/includes/db/dashboard_db.inc");
include_once($path_to_root . "/dashboard/includes/ui/dashboard_purchasing_ui.inc"); 


//include_once($path_to_root . "/dashboard/includes/db/summary_payrolls_db.inc");
//include_once($path_to_root . "/includes/ui/ui_lists_group_companies.inc");
//include_once($path_to_root . "/includes/db/group_companies_db.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_trade_discount_for_the_period_graph.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_new_suppliers_for_the_period_graph.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_grn_or_po_for_the_period_graph.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_delevary_lead_time_for_the_period_graph.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_top_suppliers_graph.inc");
//include_once($path_to_root . "/dashboard/includes/graphs/purchasing_top_iems_graph.inc");


global $Ajax;

$js = "";
$js .= get_js_open_window(800, 500);

page(_($help_context = "Dashboard Purchasing"), false, false, "", $js);

$Ajax->activate('level0');

start_form('level0');
    
    display_dashboard_purchasing_filtering_parameters();
    
    $Ajax->activate('display_detailss');
    div_start('display_detailss');
        if (isset($_POST['DashboardPurch'])) {
            display_dashboard_purchasing();
        }
    div_end();
            
end_form();

end_page();

?>