From: Joe Hunt Date: Thu, 24 Jan 2013 12:53:06 +0000 (+0100) Subject: In case of document reference already in use, FA suggest the next number (if possible... X-Git-Tag: 2.3-final~333 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=18ce16fd14342f897111c66b40295af4d351ef58;p=fa-stable.git In case of document reference already in use, FA suggest the next number (if possible) ready to save again. --- diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 23410132..98cf5411 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -439,6 +439,13 @@ if (isset($_POST['ProcessOrder']) && can_process()) { if ($ret == -1) { display_error(_("The entered reference is already in use.")); + $ref = get_next_reference($_SESSION['Items']->trans_type); + if ($ref != $_SESSION['Items']->reference) + { + display_error(_("The reference number field has been increased. Please save the document again.")); + $_POST['ref'] = $_SESSION['Items']->reference = $ref; + $Ajax->activate('ref'); + } set_focus('ref'); } else