From: Joe Date: Fri, 4 Apr 2014 21:51:03 +0000 (+0200) Subject: When canceling a non finished sales quotation FA should not try to delete record. X-Git-Tag: 2.3-final~147 X-Git-Url: https://delta.frontaccounting.com/gitweb/?a=commitdiff_plain;h=8558b7ef375c62ea2c7bd057beb468ba4aeef376;p=fa-stable.git When canceling a non finished sales quotation FA should not try to delete record. --- diff --git a/sales/sales_order_entry.php b/sales/sales_order_entry.php index 9b7e46b4..0511097a 100644 --- a/sales/sales_order_entry.php +++ b/sales/sales_order_entry.php @@ -595,7 +595,8 @@ function handle_cancel_order() submenu_option(_("Enter a New Sales Invoice"), "/sales/sales_order_entry.php?NewInvoice=1"); } elseif ($_SESSION['Items']->trans_type == ST_SALESQUOTE) { - delete_sales_order(key($_SESSION['Items']->trans_no), $_SESSION['Items']->trans_type); + if ($_SESSION['Items']->trans_no != 0) + delete_sales_order(key($_SESSION['Items']->trans_no), $_SESSION['Items']->trans_type); display_notification(_("This sales quotation has been cancelled as requested."), 1); submenu_option(_("Enter a New Sales Quotation"), "/sales/sales_order_entry.php?NewQuotation=Yes"); } else { // sales order