Fixed payments reallocation for prepayment orders; blocked edition for open prepaymen...
[fa-stable.git] / sales / sales_order_entry.php
index 618030a450d3a3855a42d386ef9e3778228232ef..58958eb15ecd70b72e2b11137d0c8a472486867d 100644 (file)
@@ -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']))