Missing restriction on fiscal year in direct GRN and direct Supp Invoice
authorJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 30 Mar 2011 07:45:59 +0000 (09:45 +0200)
committerJoe Hunt <joe.hunt.consulting@gmail.com>
Wed, 30 Mar 2011 07:45:59 +0000 (09:45 +0200)
purchasing/po_entry_items.php
purchasing/po_receive_items.php

index 84fe0e38642443572beeab234325a99f3f0c905e..8cd68c21433f4662593ec8be87ed917204f7a86f 100644 (file)
@@ -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."));
index 85acc0adf0da063ad701cd2de6daca0d535e5dc2..3d09c3d8a3eac70fbadeb3d27e775f7c7e817c40 100644 (file)
@@ -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."));