X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=blobdiff_plain;f=sales%2Fsales_order_entry.php;h=07f51d3bacaeb4890c7da93eea8b70ec9f5437e5;hb=e771cab507c120f329e50a71807dd4c53c0ace96;hp=618030a450d3a3855a42d386ef9e3778228232ef;hpb=95ff74b5722826544743a01daf527aa3c9efe11a;p=fa-stable.git diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 618030a4..07f51d3b 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -101,6 +101,11 @@ if (isset($_GET['NewDelivery']) && is_numeric($_GET['NewDelivery'])) { page($_SESSION['page_title'], false, false, "", $js); +if (isset($_GET['ModifyOrderNumber']) && is_prepaid_order_open($_GET['ModifyOrderNumber'])) +{ + display_error(_("This order cannot be edited because there are invoices or payments related to it, and prepayment terms were used.")); + end_page(); exit; +} if (isset($_GET['ModifyOrderNumber'])) check_is_editable(ST_SALESORDER, $_GET['ModifyOrderNumber']); elseif (isset($_GET['ModifyQuotationNumber'])) @@ -470,10 +475,9 @@ if (isset($_POST['ProcessOrder']) && can_process()) { $ref = $Refs->get_next($_SESSION['Items']->trans_type, null, array('date' => Today())); if ($ref != $_SESSION['Items']->reference) { + unset($_POST['ref']); // force refresh 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