Fixes issue 15761: Import Bank Statement process error
authorMikel Irurita <mikel.irurita@openbravo.com>
Tue, 25 Jan 2011 10:20:45 +0100
changeset 10114 be2ff14f49cb
parent 10113 ef76ba573a7d
child 10115 92a36f4c6787
Fixes issue 15761: Import Bank Statement process error
modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.html
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.java
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Jan 25 09:14:32 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Jan 25 10:20:45 2011 +0100
@@ -66,6 +66,17 @@
 <!--2118F382AC3646CA8D8F2EAE6504B876-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--2118F382AC3646CA8D8F2EAE6504B876--></AD_MESSAGE>
 
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F--><AD_MESSAGE>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <AD_MESSAGE_ID><![CDATA[2D4DB4272D2A4E23B6B2E16176FAC92F]]></AD_MESSAGE_ID>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <VALUE><![CDATA[APRM_WrongBankFileFormat]]></VALUE>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <MSGTEXT><![CDATA[The Java class name defined does not exist]]></MSGTEXT>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--2D4DB4272D2A4E23B6B2E16176FAC92F--></AD_MESSAGE>
+
 <!--2EE9E3A8A29044C5B6A1BCB77EB37B87--><AD_MESSAGE>
 <!--2EE9E3A8A29044C5B6A1BCB77EB37B87-->  <AD_MESSAGE_ID><![CDATA[2EE9E3A8A29044C5B6A1BCB77EB37B87]]></AD_MESSAGE_ID>
 <!--2EE9E3A8A29044C5B6A1BCB77EB37B87-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.html	Tue Jan 25 09:14:32 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.html	Tue Jan 25 10:20:45 2011 +0100
@@ -39,32 +39,46 @@
   var baseDirectory="../../../../../web/";
   </script>
   <script language="JavaScript" type="text/javascript" id="fieldWindowIDArray">
+  function validate() {
+    var frm = document.frmMain;
+    if (frm.inpFile.value==null || frm.inpFile.value=="") {
+      setWindowElementFocus(frm.inpFile);
+      showJSMessage(7);
+      return false;
+    } else if (frm.inpfinBankFileFormatId.value==null || frm.inpfinBankFileFormatId.value=="") {
+      setWindowElementFocus(frm.inpfinBankFileFormatId);
+      showJSMessage(7);
+      return false;
+    }
+	return true;
+  }
+  
   function closeThisPage() {
     window.close();
     return true;
   }
 
   function submitThisPage(strCommand) {
-    submitCommandForm(strCommand, false, null, null, '_top');
+	if (validate()) {
+      submitCommandForm(strCommand, false, null, null, '_top');
+	}
     return true;
   }
   </script>
-  	<script language="JavaScript" type="text/javascript">
-	function onLoadDo(){
-		this.windowTables = new Array(
-		  new windowTableId('client', 'buttonOK')
-		);
-		setWindowTableParentElement();
-		enableShortcuts('popup');
-		setBrowserAutoComplete(false);
-
-		setWindowElementFocus('firstElement');
-	}
-
+  <script language="JavaScript" type="text/javascript">
+    function onLoadDo(){
+	  this.windowTables = new Array(
+	    new windowTableId('client', 'buttonOK')
+	   );
+	   setWindowTableParentElement();
+	   enableShortcuts('popup');
+	   setBrowserAutoComplete(false);
+       setWindowElementFocus('firstElement');
+    }
+    
 	function onResizeDo(){
 	}
-	</script>
-
+  </script>
 </head>
 
 <body leftmargin="0" topmargin="0" marginwidth="0" marginheight="0" onload="onLoadDo();" onresize="onResizeDo();">
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.java	Tue Jan 25 09:14:32 2011 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ImportBankFile.java	Tue Jan 25 10:20:45 2011 +0100
@@ -78,7 +78,8 @@
         message.setType("Error");
         message.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
         message.setMessage(Utility.parseTranslation(this, vars, vars.getLanguage(),
-            "@WrongBankFileFormat@"));
+            "@APRM_WrongBankFileFormat@")
+            + ": " + bff.getJavaClassName());
       }
 
       if (strWindowPath.equals(""))