From ce52a2dd6cb28234935d002d661a2ee3c3d96ccb Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Wed, 23 Mar 2011 18:42:37 +0100 Subject: [PATCH] Blocked purchase invoice and delivery entry for closed date. --- purchasing/po_entry_items.php | 7 ++++++- purchasing/po_receive_items.php | 5 +++++ purchasing/supplier_invoice.php | 2 +- 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index a6ca4c33..294d4be5 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -337,7 +337,12 @@ function can_commit() set_focus('OrderDate'); return false; } - + if (($_SESSION['PO']->trans_type == ST_SUPPRECEIVE || $_SESSION['PO']->trans_type == ST_SUPPINVOICE) + && !is_date_in_fiscalyear($_POST['OrderDate'])) { + display_error(_("The entered date is out of fiscal year or is closed for further data entry.")); + 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 85acc0ad..83900c86 100644 --- a/purchasing/po_receive_items.php +++ b/purchasing/po_receive_items.php @@ -175,6 +175,11 @@ function can_process() set_focus('DefaultReceivedDate'); return false; } + if (!is_date_in_fiscalyear($_POST['DefaultReceivedDate'])) { + display_error(_("The entered date is out of fiscal year or is closed for further data entry.")); + set_focus('DefaultReceivedDate'); + return false; + } if (!$Refs->is_valid($_POST['ref'])) { diff --git a/purchasing/supplier_invoice.php b/purchasing/supplier_invoice.php index 28fb7215..90b86a94 100644 --- a/purchasing/supplier_invoice.php +++ b/purchasing/supplier_invoice.php @@ -171,7 +171,7 @@ function check_data() } elseif (!is_date_in_fiscalyear($_SESSION['supp_trans']->tran_date)) { - display_error(_("The entered date is not in fiscal year.")); + display_error(_("The entered date is out of fiscal year or is closed for further data entry.")); set_focus('trans_date'); return false; } -- 2.30.2