X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fpo_entry_items.php;h=988c90faf3a1b15af98e82d0c8eb5af3af9484cb;hb=20a783f75445c8889335b8a51cf5723b3b19cdb2;hp=b0d116995a73507ee649bfb39c2d5aab08bee265;hpb=cf7be1f00c6abe59755286e0c3108d9d3c0356da;p=fa-stable.git diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index b0d11699..988c90fa 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -9,8 +9,8 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the License here . ***********************************************************************/ -$page_security = 4; -$path_to_root=".."; +$page_security = 'SA_PURCHASEORDER'; +$path_to_root = ".."; 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"); @@ -24,11 +24,11 @@ if ($use_date_picker) if (isset($_GET['ModifyOrderNumber'])) { - page(_("Modify Purchase Order #") . $_GET['ModifyOrderNumber'], false, false, "", $js); + page(_($help_context = "Modify Purchase Order #") . $_GET['ModifyOrderNumber'], false, false, "", $js); } else { - page(_("Purchase Order Entry"), false, false, "", $js); + page(_($help_context = "Purchase Order Entry"), false, false, "", $js); } //--------------------------------------------------------------------------------------------------- @@ -42,15 +42,17 @@ check_db_has_purchasable_items(_("There are no purchasable inventory items defin if (isset($_GET['AddedID'])) { $order_no = $_GET['AddedID']; - $trans_type = systypes::po(); + $trans_type = ST_PURCHORDER; if (!isset($_GET['Updated'])) display_notification_centered(_("Purchase Order has been entered")); else display_notification_centered(_("Purchase Order has been updated") . " #$order_no"); - display_note(get_trans_view_str($trans_type, $order_no, _("&View this order"))); - echo '
'; - display_note(print_document_link($order_no, _("&Print This Order"), true, $trans_type)); + display_note(get_trans_view_str($trans_type, $order_no, _("&View this order")), 0, 1); + + display_note(print_document_link($order_no, _("&Print This Order"), true, $trans_type), 0, 1); + + display_note(print_document_link($order_no, _("&Email This Order"), true, $trans_type, false, "", "", 1)); hyperlink_params($path_to_root . "/purchasing/po_receive_items.php", _("&Receive Items on this Purchase Order"), "PONumber=$order_no"); @@ -226,7 +228,7 @@ function handle_add_new_item() if ($allow_update == true) { $sql = "SELECT description, units, mb_flag - FROM ".TB_PREF."stock_master WHERE stock_id = '". $_POST['stock_id'] . "'"; + FROM ".TB_PREF."stock_master WHERE stock_id = ".db_escape($_POST['stock_id']); $result = db_query($sql,"The stock details for " . $_POST['stock_id'] . " could not be retrieved"); @@ -259,6 +261,8 @@ function handle_add_new_item() function can_commit() { + global $Refs; + if (!is_date($_POST['OrderDate'])) { display_error(_("The entered order date is invalid.")); @@ -268,14 +272,14 @@ function can_commit() if (!$_SESSION['PO']->order_no) { - if (!references::is_valid(get_post('ref'))) + if (!$Refs->is_valid(get_post('ref'))) { display_error(_("There is no reference entered for this purchase order.")); set_focus('ref'); return false; } - if (!is_new_reference(get_post('ref'), systypes::po())) + if (!is_new_reference(get_post('ref'), ST_PURCHORDER)) { display_error(_("The entered reference is already in use.")); set_focus('ref');