Bug fix: [1874503] Added message: skiping accounting configuration
authorIván Perdomo <ivan.perdomo@openbravo.com>
Mon, 28 Jan 2008 17:42:44 +0000
changeset 377 f07721b007a4
parent 376 7608a8f726e9
child 378 5c93458e2916
Bug fix: [1874503] Added message: skiping accounting configuration
database/sourcedata/AD_MESSAGE.xml
database/sourcedata/AD_MESSAGE_TRL.xml
src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.html
src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java
--- a/database/sourcedata/AD_MESSAGE.xml	Mon Jan 28 14:41:31 2008 +0000
+++ b/database/sourcedata/AD_MESSAGE.xml	Mon Jan 28 17:42:44 2008 +0000
@@ -5483,6 +5483,7 @@
   <AD_MESSAGE AD_MESSAGE_ID="1000300009" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:05:16.0" CREATEDBY="100" UPDATED="2008-01-22 18:05:16.0" UPDATEDBY="100" VALUE="DL_CREATED" MSGTEXT="Created" MSGTYPE="C" ENTITYTYPE="U" />
   <AD_MESSAGE AD_MESSAGE_ID="1000300010" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:05:34.0" CREATEDBY="100" UPDATED="2008-01-22 18:05:34.0" UPDATEDBY="100" VALUE="DL_TABLE" MSGTEXT="Table" MSGTYPE="I" ENTITYTYPE="U" />
   <AD_MESSAGE AD_MESSAGE_ID="1000300011" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:33:34.0" CREATEDBY="100" UPDATED="2008-01-22 18:33:34.0" UPDATEDBY="100" VALUE="DL_ENDED" MSGTEXT="Direct Launch process ended" MSGTYPE="I" ENTITYTYPE="U" />
+  <AD_MESSAGE AD_MESSAGE_ID="1000300012" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2008-01-28 18:19:34.0" CREATEDBY="100" UPDATED="2008-01-28 18:20:07.0" UPDATEDBY="100" VALUE="SkippingAccounting" MSGTEXT="Accounting file not inserted: Skipping accounting configuration" MSGTYPE="I" ENTITYTYPE="U" />
   <AD_MESSAGE AD_MESSAGE_ID="1000600000" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:24:53.0" CREATEDBY="100" UPDATED="2007-10-21 19:24:53.0" UPDATEDBY="100" VALUE="ReportSummary" MSGTEXT="Report Summary" MSGTYPE="I" ENTITYTYPE="U" />
   <AD_MESSAGE AD_MESSAGE_ID="1000600001" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:25:55.0" CREATEDBY="100" UPDATED="2007-10-21 19:25:55.0" UPDATEDBY="100" VALUE="StartingClient" MSGTEXT="Starting create client" MSGTYPE="I" ENTITYTYPE="U" />
   <AD_MESSAGE AD_MESSAGE_ID="1000600002" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:26:57.0" CREATEDBY="100" UPDATED="2007-10-21 19:26:57.0" UPDATEDBY="100" VALUE="StartingAccounting" MSGTEXT="Starting create accounting" MSGTYPE="I" ENTITYTYPE="U" />
--- a/database/sourcedata/AD_MESSAGE_TRL.xml	Mon Jan 28 14:41:31 2008 +0000
+++ b/database/sourcedata/AD_MESSAGE_TRL.xml	Mon Jan 28 17:42:44 2008 +0000
@@ -5480,6 +5480,7 @@
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000300009" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:05:16.0" CREATEDBY="100" UPDATED="2008-01-22 18:05:16.0" UPDATEDBY="100" MSGTEXT="Creados" ISTRANSLATED="N" />
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000300010" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:05:34.0" CREATEDBY="100" UPDATED="2008-01-22 18:05:34.0" UPDATEDBY="100" MSGTEXT="Tabla" ISTRANSLATED="N" />
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000300011" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="N" CREATED="2008-01-22 18:33:34.0" CREATEDBY="100" UPDATED="2008-01-22 18:33:34.0" UPDATEDBY="100" MSGTEXT="Proceso Manual finalizado" ISTRANSLATED="N" />
+  <AD_MESSAGE_TRL AD_MESSAGE_ID="1000300012" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2008-01-28 18:19:34.0" CREATEDBY="100" UPDATED="2008-01-28 18:31:54.0" UPDATEDBY="100" MSGTEXT="Archivo de cuentas no insertado: Saltando la configuración contable" ISTRANSLATED="N" />
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000600000" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:24:53.0" CREATEDBY="100" UPDATED="2007-10-21 19:25:15.0" UPDATEDBY="100" MSGTEXT="Resumen de proceso" ISTRANSLATED="Y" />
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000600001" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:25:55.0" CREATEDBY="100" UPDATED="2007-10-21 19:26:18.0" UPDATEDBY="100" MSGTEXT="Comenzando la creación de la entidad" ISTRANSLATED="Y" />
   <AD_MESSAGE_TRL AD_MESSAGE_ID="1000600002" AD_LANGUAGE="es_ES" AD_CLIENT_ID="0" AD_ORG_ID="0" ISACTIVE="Y" CREATED="2007-10-21 19:26:57.0" CREATEDBY="100" UPDATED="2007-10-21 19:27:13.0" UPDATEDBY="100" MSGTEXT="Comenzando la creación de la contabilidad" ISTRANSLATED="Y" />
--- a/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.html	Mon Jan 28 14:41:31 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.html	Mon Jan 28 17:42:44 2008 +0000
@@ -65,8 +65,7 @@
   if (frm.inpOrganizacion.value==null || frm.inpOrganizacion.value=="") {frm.inpOrganizacion.focus(); mensaje(7); return false; }
   if (frm.inpClienteUsuario.value==null || frm.inpClienteUsuario.value=="") {frm.inpClienteUsuario.focus(); mensaje(7); return false; }
   if (frm.inpOrganizacionUsuario.value==null || frm.inpOrganizacionUsuario.value=="") {frm.inpOrganizacionUsuario.focus();  mensaje(7); return false; }
-  if (frm.inpCiudad.value==null || frm.inpCiudad.value=="") {frm.inpCiudad.focus(); mensaje(7); return false; }
-	if (frm.inpArchivo.value==null || frm.inpArchivo.value=="") { frm.inpArchivo.focus(); mensaje(7);return false;}
+  if (frm.inpCiudad.value==null || frm.inpCiudad.value=="") {frm.inpCiudad.focus(); mensaje(7); return false; }
 	return true;
 }
 
--- a/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java	Mon Jan 28 14:41:31 2008 +0000
+++ b/src/org/openbravo/erpCommon/ad_forms/InitialClientSetup.java	Mon Jan 28 17:42:44 2008 +0000
@@ -160,16 +160,16 @@
     }
     OBError myMessage = new OBError();
     myMessage.setTitle("");
-    log4j.debug("InitialClientSetup - before setMessage");
+    if(log4j.isDebugEnabled()) log4j.debug("InitialClientSetup - before setMessage");
     if(strError!=null && !strError.equals("")) {
       myMessage = Utility.translateError(this, vars, vars.getLanguage(), strError);
     }
-    log4j.debug("InitialClientSetup - isOK: " + isOK);
+    if(log4j.isDebugEnabled()) log4j.debug("InitialClientSetup - isOK: " + isOK);
     if(isOK) myMessage.setType("Success");
     else myMessage.setType("Error");
-    log4j.debug("InitialClientSetup - Message Type: " + myMessage.getType());
+    if(log4j.isDebugEnabled()) log4j.debug("InitialClientSetup - Message Type: " + myMessage.getType());
     vars.setMessage("InitialClientSetup", myMessage);
-    log4j.debug("InitialClientSetup - after setMessage");
+    if(log4j.isDebugEnabled()) log4j.debug("InitialClientSetup - after setMessage");
     if (myMessage!=null) {
       xmlDocument.setParameter("messageType", myMessage.getType());
       xmlDocument.setParameter("messageTitle", myMessage.getTitle());
@@ -241,27 +241,32 @@
         releaseRollbackConnection(conn);
       } catch (Exception ignored) {}
     }
-    try {
-      m_info.append(SALTO_LINEA).append("*****************************************************").append(SALTO_LINEA);
-      m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "StartingAccounting", vars.getLanguage())).append(SALTO_LINEA);
-      if (!createAccounting(vars, strMoneda, InitialClientSetupData.moneda(this, strMoneda), bProducto, bTercero, bProyecto, bCampana, bZonaVentas, avData)){
-        releaseRollbackConnection(conn);
-        m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
-        strSummary.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
-        isOK = false;
-        return m_info.toString();
-      }
-    } catch (Exception err){
-      log4j.warn(err);
-      m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
-      strSummary.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
-      strError = err.toString();
-      strError = strError.substring( strError.lastIndexOf("@ORA-") ,strError.length());
-      log4j.debug("InitialClientSetup - after strError: " + strError);
-      isOK = false;
-      try {
-        releaseRollbackConnection(conn);
-      } catch (Exception ignored) {}
+    m_info.append(SALTO_LINEA).append("*****************************************************").append(SALTO_LINEA);
+    if(avData.length == 0) {    	
+	    m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "SkippingAccounting", vars.getLanguage())).append(SALTO_LINEA);	    
+    }
+    else {
+	    try {	      
+	      m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "StartingAccounting", vars.getLanguage())).append(SALTO_LINEA);
+	      if (!createAccounting(vars, strMoneda, InitialClientSetupData.moneda(this, strMoneda), bProducto, bTercero, bProyecto, bCampana, bZonaVentas, avData)){
+	        releaseRollbackConnection(conn);
+	        m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
+	        strSummary.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
+	        isOK = false;
+	        return m_info.toString();
+	      }
+	    } catch (Exception err){
+	      log4j.warn(err);
+	      m_info.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
+	      strSummary.append(SALTO_LINEA).append(Utility.messageBD(this, "CreateAccountingFailed", vars.getLanguage())).append(SALTO_LINEA);
+	      strError = err.toString();
+	      strError = strError.substring( strError.lastIndexOf("@ORA-") ,strError.length());
+	      log4j.debug("InitialClientSetup - after strError: " + strError);
+	      isOK = false;
+	      try {
+	        releaseRollbackConnection(conn);
+	      } catch (Exception ignored) {}
+	    }
     }
     try {
       m_info.append(SALTO_LINEA).append("*****************************************************").append(SALTO_LINEA);