From 63fa3f67bb359c02a947efca8b69bb8a16074d06 Mon Sep 17 00:00:00 2001 From: Joe Hunt Date: Wed, 30 Mar 2011 09:45:59 +0200 Subject: [PATCH] Missing restriction on fiscal year in direct GRN and direct Supp Invoice --- purchasing/po_entry_items.php | 7 +++++++ purchasing/po_receive_items.php | 7 +++++++ 2 files changed, 14 insertions(+) diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 84fe0e3..8cd68c2 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -335,6 +335,13 @@ function can_commit() return false; } + if ($_SESSION['PO']->trans_type != ST_PURCHORDER && !is_date_in_fiscalyear($_POST['OrderDate'])) + { + display_error(_("The entered date is not in fiscal year")); + set_focus('OrderDate'); + return false; + } + if (($_SESSION['PO']->trans_type==ST_SUPPINVOICE) && !is_date($_POST['due_date'])) { display_error(_("The entered due date is invalid.")); diff --git a/purchasing/po_receive_items.php b/purchasing/po_receive_items.php index 85acc0a..3d09c3d 100644 --- a/purchasing/po_receive_items.php +++ b/purchasing/po_receive_items.php @@ -176,6 +176,13 @@ function can_process() return false; } + if (!is_date_in_fiscalyear($_POST['DefaultReceivedDate'])) + { + display_error(_("The entered date is not in fiscal year")); + set_focus('DefaultReceivedDate'); + return false; + } + if (!$Refs->is_valid($_POST['ref'])) { display_error(_("You must enter a reference.")); -- 2.30.2