- if (!$Refs->is_valid($_POST['ref'])) {
- display_error(_("You must enter a reference."));
- set_focus('ref');
- return false;
- }
-
- //Chaitanya : 13-OCT-2011 - To support Edit feature
- if (isset($_POST['trans_no']) && $_POST['trans_no'] == 0 && (!is_new_reference($_POST['ref'], ST_CUSTPAYMENT))) {
- display_error(_("The entered reference is already in use."));
- set_focus('ref');
- return false;
- }
- //Avoid duplicate reference while modifying
- elseif ($_POST['ref'] != $_POST['old_ref'] && !is_new_reference($_POST['ref'], ST_CUSTPAYMENT))
- {
- display_error( _("The entered reference is already in use."));