From c4615fef6d0dafda72bc681ad16655a15d8fa28a Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Tue, 21 Jun 2011 15:36:45 +0200 Subject: [PATCH] Added supplier reference uniqueness check in Direct Supplier Invoice. --- purchasing/po_entry_items.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/purchasing/po_entry_items.php b/purchasing/po_entry_items.php index 8cd68c2..af5e3ee 100644 --- a/purchasing/po_entry_items.php +++ b/purchasing/po_entry_items.php @@ -372,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']->trans_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.")); -- 2.30.2