Fixes issue 19919 when you void a gl journal, the system allow post it.
authorIoritz Cia <ioritz.cia@openbravo.com>
Tue, 10 Apr 2012 10:55:31 +0200
changeset 9863 d4cf826705bf
parent 9862 7fc73f97cb62
child 9864 a687de381f06
Fixes issue 19919 when you void a gl journal, the system allow post it.
src/org/openbravo/erpCommon/ad_forms/DocGLJournal.java
--- a/src/org/openbravo/erpCommon/ad_forms/DocGLJournal.java	Wed Mar 28 17:17:31 2012 +0200
+++ b/src/org/openbravo/erpCommon/ad_forms/DocGLJournal.java	Tue Apr 10 10:55:31 2012 +0200
@@ -24,9 +24,11 @@
 
 import org.apache.log4j.Logger;
 import org.openbravo.base.secureApp.VariablesSecureApp;
+import org.openbravo.dal.service.OBDal;
 import org.openbravo.data.FieldProvider;
 import org.openbravo.database.ConnectionProvider;
 import org.openbravo.erpCommon.utility.SequenceIdData;
+import org.openbravo.model.financialmgmt.gl.GLJournal;
 
 public class DocGLJournal extends AcctServer {
   private static final long serialVersionUID = 1L;
@@ -259,6 +261,12 @@
    * not used
    */
   public boolean getDocumentConfirmation(ConnectionProvider conn, String strRecordId) {
+    final String STATUS_VOIDED = "VO";
+    if (STATUS_VOIDED.equals(OBDal.getInstance().get(GLJournal.class, strRecordId)
+        .getDocumentStatus())) {
+      setStatus(STATUS_DocumentDisabled);
+      return false;
+    }
     return true;
   }