+/**********************************************************************
+ 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>.
+***********************************************************************/
+$path_to_root = "..";
+$page_security = 'SA_PURCHASEORDER';
+include_once($path_to_root . "/purchasing/includes/po_class.inc");
+include_once($path_to_root . "/includes/session.inc");
+include_once($path_to_root . "/purchasing/includes/purchasing_ui.inc");
+include_once($path_to_root . "/purchasing/includes/db/suppliers_db.inc");
+include_once($path_to_root . "/reporting/includes/reporting.inc");
+
+set_page_security( @$_SESSION['PO']->trans_type,
+ array( ST_PURCHORDER => 'SA_PURCHASEORDER',
+ ST_SUPPRECEIVE => 'SA_GRN',
+ ST_SUPPINVOICE => 'SA_SUPPLIERINVOICE'),
+ array( 'NewOrder' => 'SA_PURCHASEORDER',
+ 'ModifyOrderNumber' => 'SA_PURCHASEORDER',
+ 'AddedID' => 'SA_PURCHASEORDER',
+ 'NewGRN' => 'SA_GRN',
+ 'AddedGRN' => 'SA_GRN',
+ 'NewInvoice' => 'SA_SUPPLIERINVOICE',
+ 'AddedPI' => 'SA_SUPPLIERINVOICE')
+);
+
+$js = '';
+if ($SysPrefs->use_popup_windows)
+ $js .= get_js_open_window(900, 500);
+if (user_use_date_picker())
+ $js .= get_js_date_picker();