X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=purchasing%2Fsupplier_credit.php;h=9335c1f1e81348ceb72e96cda1858cd3698264ce;hb=refs%2Ftags%2Fv2.4.4;hp=08040582a3b7dec469eec0a7c5ab6f6a5554bd45;hpb=5b6858588fc878c18aeb26c6b495aca7b32a5a43;p=fa-stable.git diff --git a/purchasing/supplier_credit.php b/purchasing/supplier_credit.php index 08040582..9335c1f1 100644 --- a/purchasing/supplier_credit.php +++ b/purchasing/supplier_credit.php @@ -28,8 +28,6 @@ if (user_use_date_picker()) //---------------------------------------------------------------------------------------- -check_db_has_suppliers(_("There are no suppliers defined in the system.")); - if (isset($_GET['ModifyCredit'])) check_is_editable(ST_SUPPINVOICE, $_GET['ModifyCredit']); @@ -64,6 +62,8 @@ if (isset($_GET['New'])) } page($_SESSION['page_title'], false, false, "", $js); +check_db_has_suppliers(_("There are no suppliers defined in the system.")); + //--------------------------------------------------------------------------------------------------------------- if (isset($_GET['AddedID'])) @@ -194,6 +194,20 @@ function check_data() return false; } + if (trim(get_post('supp_reference')) == false) + { + display_error(_("You must enter a supplier's invoice reference.")); + set_focus('supp_reference'); + return false; + } + + if (is_reference_already_there($_SESSION['supp_trans']->supplier_id, $_POST['supp_reference'], $_SESSION['supp_trans']->trans_no)) + { /*Transaction reference already entered */ + display_error(_("This invoice number has already been entered. It cannot be entered again.") . " (" . $_POST['supp_reference'] . ")"); + set_focus('supp_reference'); + return false; + } + if (!$SysPrefs->allow_negative_stock()) { foreach ($_SESSION['supp_trans']->grn_items as $n => $item) { if (is_inventory_item($item->item_code))