Fixed credit processing errors handling.
authorJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Feb 2011 08:55:37 +0000 (08:55 +0000)
committerJanusz Dobrowolski <janusz@frontaccounting.eu>
Sun, 13 Feb 2011 08:55:37 +0000 (08:55 +0000)
sales/customer_credit_invoice.php

index a88cdabed2aab5159d5070c458a9aa392b9bd28e..24f70ce6b2c876b288cddd5833077ddb8c240615 100644 (file)
@@ -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");
+               }
        }
 }