X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fpo_entry_items.php;h=a23b7a0754b94603dc9e8e1d22931b4d6df3f337;hb=207ae289c358ff57c1adc55304a65b17a5dc4132;hp=84fe0e38642443572beeab234325a99f3f0c905e;hpb=3a183a84b1ebb1b11ad6fdba08780f93dd04bf41;p=fa-stable.git diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 84fe0e38..a23b7a07 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.")); @@ -365,6 +372,13 @@ function can_commit() set_focus('supp_ref'); return false; } + if ($_SESSION['PO']->trans_type==ST_SUPPINVOICE + && is_reference_already_there($_SESSION['PO']->supplier_id, get_post('supp_ref'), $_SESSION['PO']->order_no)) + { + display_error(_("This invoice number has already been entered. It cannot be entered again.") . " (" . get_post('supp_ref') . ")"); + set_focus('supp_ref'); + return false; + } if ($_SESSION['PO']->trans_type == ST_PURCHORDER && get_post('delivery_address') == '') { display_error(_("There is no delivery address specified."));