From 8d714fab3ec1b97b645cf879a6bfd5ee174d05c8 Mon Sep 17 00:00:00 2001 From: Janusz Dobrowolski Date: Sun, 13 Feb 2011 08:55:37 +0000 Subject: [PATCH] Fixed credit processing errors handling. --- sales/customer_credit_invoice.php | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/sales/customer_credit_invoice.php b/sales/customer_credit_invoice.php index a88cdabe..24f70ce6 100644 --- a/sales/customer_credit_invoice.php +++ b/sales/customer_credit_invoice.php @@ -204,11 +204,13 @@ if (isset($_POST['ProcessCredit']) && can_process()) { if ($new_credit) new_doc_date($_SESSION['Items']->document_date); $credit_no = $_SESSION['Items']->write($_POST['WriteOffGLCode']); - processing_end(); - if ($new_credit) { - meta_forward($_SERVER['PHP_SELF'], "AddedID=$credit_no"); - } else { - meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$credit_no"); + if($credit_no) { + processing_end(); + if ($new_credit) { + meta_forward($_SERVER['PHP_SELF'], "AddedID=$credit_no"); + } else { + meta_forward($_SERVER['PHP_SELF'], "UpdatedID=$credit_no"); + } } } -- 2.30.2