Fixes Issue 9446: After completing the Generate invoices process test case, system wrongly show 2 instead of 3 invoice ids in success message
authorRakhee Mohanlal <rakhee.mohanlal@openbravo.com>
Fri, 03 Jul 2009 09:54:49 +0530
changeset 4091 ea548cdfff91
parent 4090 16f2ebad805f
child 4092 802a8eb91eec
Fixes Issue 9446: After completing the Generate invoices process test case, system wrongly show 2 instead of 3 invoice ids in success message
src-db/database/model/functions/C_INVOICE_CREATE.xml
--- a/src-db/database/model/functions/C_INVOICE_CREATE.xml	Thu Jul 02 17:45:44 2009 +0200
+++ b/src-db/database/model/functions/C_INVOICE_CREATE.xml	Fri Jul 03 09:54:49 2009 +0530
@@ -1032,7 +1032,16 @@
                   DateAcct=v_DateInvoiced
                 WHERE C_Invoice_ID=p_Invoice_ID;
                 C_INVOICE_POST(NULL, p_Invoice_ID) ;
-              END IF;
+	            IF(p_Invoice_ID='0') THEN
+          	  	  RAISE_APPLICATION_ERROR(-20000, '@InvoiceCreateFailed@');
+			    ELSE
+			  	  SELECT documentno
+	    	  	  INTO v_DocumentNo
+	    	  	  FROM C_INVOICE
+	    	  	  WHERE C_INVOICE_ID = p_Invoice_ID;
+	    	  	  v_Message:=v_Message||', '||'@InvoiceDocumentno@ ' || v_DocumentNo;
+        	    END IF;
+			  END IF;
             END IF;--FINISH_PROCESS
           END; -- Block
         END IF; -- PInstance not null