Fixes bug 0009389: Bankstatement with charge amount and different accounting date in lines and header is not properly posted
authorEduardo Argal Guibert <eduardo.argal@openbravo.com>
Mon, 08 Jun 2009 18:30:37 +0200
changeset 3987 4566a0142d2e
parent 3986 d7fc5e28a753
child 3988 eb284f20977d
child 4098 bffe8b0e5f57
Fixes bug 0009389: Bankstatement with charge amount and different accounting date in lines and header is not properly posted
src/org/openbravo/erpCommon/modules/ModuleReferenceDataClientTree_data.xsql
src/org/openbravo/erpCommon/modules/ModuleReferenceDataOrgTree_data.xsql
src/org/openbravo/erpCommon/modules/ModuleTree.java
src/org/openbravo/erpCommon/utility/GenericTree.java
--- a/src/org/openbravo/erpCommon/modules/ModuleReferenceDataClientTree_data.xsql	Mon Jun 08 18:27:48 2009 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleReferenceDataClientTree_data.xsql	Mon Jun 08 18:30:37 2009 +0200
@@ -19,7 +19,7 @@
 -->
 
 
-<SqlClass name="ModuleReferenceDataClientTreeData" package="org.openbravo.erpCommon.modules">
+<SqlClass name="ModuleReferenceDataClientTreeData" package="org.openbravo.erpCommon.modules" accessModifier="public">
    <SqlClassComment></SqlClassComment>
    <SqlMethod name="select" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
--- a/src/org/openbravo/erpCommon/modules/ModuleReferenceDataOrgTree_data.xsql	Mon Jun 08 18:27:48 2009 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleReferenceDataOrgTree_data.xsql	Mon Jun 08 18:30:37 2009 +0200
@@ -19,7 +19,7 @@
 -->
 
 
-<SqlClass name="ModuleReferenceDataOrgTreeData" package="org.openbravo.erpCommon.modules">
+<SqlClass name="ModuleReferenceDataOrgTreeData" package="org.openbravo.erpCommon.modules" accessModifier="public">
    <SqlClassComment></SqlClassComment>
    <SqlMethod name="select" type="preparedStatement" return="multiple">
       <SqlMethodComment></SqlMethodComment>
--- a/src/org/openbravo/erpCommon/modules/ModuleTree.java	Mon Jun 08 18:27:48 2009 +0200
+++ b/src/org/openbravo/erpCommon/modules/ModuleTree.java	Mon Jun 08 18:30:37 2009 +0200
@@ -4,15 +4,15 @@
  * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
  * Version 1.1  with a permitted attribution clause; you may not  use this
  * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
+ * the License at http://www.openbravo.com/legal/license.html
  * Software distributed under the License  is  distributed  on  an "AS IS"
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2008 Openbravo SL 
- * All Rights Reserved. 
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SL
+ * All portions are Copyright (C) 2008 Openbravo SL
+ * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
@@ -22,20 +22,21 @@
 
 import org.openbravo.base.HttpBaseServlet;
 import org.openbravo.data.FieldProvider;
+import org.openbravo.erpCommon.utility.FieldProviderFactory;
 import org.openbravo.erpCommon.utility.GenericTree;
 import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.xmlEngine.XmlDocument;
 
 /**
  * Manages the tree of installed modules.
- * 
+ *
  * It implements GenericTree, detailed description is in that API doc.
  */
 public class ModuleTree extends GenericTree {
 
   /**
    * Constructor to generate a root tree
-   * 
+   *
    * @param base
    */
   public ModuleTree(HttpBaseServlet base) {
@@ -45,7 +46,7 @@
 
   /**
    * Constructor to generate a root tree
-   * 
+   *
    * @param base
    * @param bSmall
    *          Normal size or small size (true)
@@ -78,7 +79,7 @@
 
   /**
    * Generates a subtree with nodeId as root node
-   * 
+   *
    * @param nodeId
    */
   public void setSubTree(String nodeId, String level) {
@@ -96,7 +97,7 @@
 
   /**
    * Returns a HTML with the description for the given node
-   * 
+   *
    * @param node
    * @return a HTML String with the description for the given node
    */
@@ -162,7 +163,7 @@
 
   /**
    * Set the icons (module type) and subicons (update available) for each node
-   * 
+   *
    * @param modules
    */
   private void setIcons(FieldProvider[] modules) {
@@ -170,11 +171,11 @@
       return;
     for (int i = 0; i < modules.length; i++) {
       if (modules[i].getField("type").equals("M"))
-        ((ModuleTreeData) modules[i]).icon = "Tree_Icon_Module";
+    	  FieldProviderFactory.setField(modules[i], "icon", "Tree_Icon_Module");
       if (modules[i].getField("type").equals("P"))
-        ((ModuleTreeData) modules[i]).icon = "Tree_Icon_Pack";
+    	  FieldProviderFactory.setField(modules[i], "icon", "Tree_Icon_Pack");
       if (modules[i].getField("type").equals("T"))
-        ((ModuleTreeData) modules[i]).icon = "Tree_Icon_Template";
+    	  FieldProviderFactory.setField(modules[i], "icon", "Tree_Icon_Template");
 
       boolean updateAvailable = modules[i].getField("updateAvailable") != null
           && !modules[i].getField("updateAvailable").equals("");
@@ -188,7 +189,7 @@
 
   /**
    * Returns true in case one of the descendant of the current node has an update available
-   * 
+   *
    * @param node
    * @return
    */
@@ -235,7 +236,7 @@
 
   /**
    * Returns the node id for the parent of the passed node
-   * 
+   *
    * @param node
    * @return
    */
--- a/src/org/openbravo/erpCommon/utility/GenericTree.java	Mon Jun 08 18:27:48 2009 +0200
+++ b/src/org/openbravo/erpCommon/utility/GenericTree.java	Mon Jun 08 18:30:37 2009 +0200
@@ -4,15 +4,15 @@
  * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
  * Version 1.1  with a permitted attribution clause; you may not  use this
  * file except in compliance with the License. You  may  obtain  a copy of
- * the License at http://www.openbravo.com/legal/license.html 
+ * the License at http://www.openbravo.com/legal/license.html
  * Software distributed under the License  is  distributed  on  an "AS IS"
  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
  * License for the specific  language  governing  rights  and  limitations
- * under the License. 
- * The Original Code is Openbravo ERP. 
- * The Initial Developer of the Original Code is Openbravo SL 
- * All portions are Copyright (C) 2008 Openbravo SL 
- * All Rights Reserved. 
+ * under the License.
+ * The Original Code is Openbravo ERP.
+ * The Initial Developer of the Original Code is Openbravo SL
+ * All portions are Copyright (C) 2008 Openbravo SL
+ * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
  */
@@ -26,21 +26,21 @@
 
 /**
  * Manages a generic tree, this class is abstract, for concrete trees subclasses are needed.
- * 
+ *
  * It is able to show a HTML component with the tree, to expand nodes Ajax calls are used, these
  * calls are managed by GenericTreeServlet.
- * 
+ *
  * <br>
  * Usage</br> This class cannot be directly used, instead a subclass implementing the abstract
  * method must be used.
- * 
+ *
  * The purpose is to set the toHml directly in the HTML where the tree is going to be displayed,
  * additionally genericTree.js must be imported in that page. These java classes will show the tree
  * and manage the ajax requests.
- * 
+ *
  * <br>
  * To take into account</br>
- * 
+ *
  * -data is a FieldProvider that must have the following fields: -nodeID : It is the unique
  * identifier for the node -name : It is the short name for the node (it will be displayed in the
  * tree) -display : It indicates whether the node has child elements in order to show or not the
@@ -56,7 +56,7 @@
  * the tree in order to allow keyboard navigation -It is necessary to implement in subclasses apart
  * of the abstract method a constructor without parameters, this constructor is used by
  * GenericTreeServlet.
- * 
+ *
  */
 public abstract class GenericTree {
   protected XmlEngine xmlEngine;
@@ -76,7 +76,7 @@
 
   /**
    * This method will assign to data the child nodes (just one level) for the nodeId
-   * 
+   *
    * @param nodeId
    *          Root node for the subtree
    */
@@ -84,7 +84,7 @@
 
   /**
    * This method returns a String with the description for the node
-   * 
+   *
    * @param node
    *          Node ID to retrieve description
    * @return The String with the HTML for the description
@@ -93,7 +93,7 @@
 
   /**
    * Returns true in case the node is the last one at its level
-   * 
+   *
    * @param nodeID
    * @return
    */
@@ -101,7 +101,7 @@
 
   /**
    * Returns the position relative to the rest of nodes at the same level
-   * 
+   *
    * @param nodeID
    * @return
    */
@@ -109,7 +109,7 @@
 
   /**
    * Returns the node id for the parent of the passed node
-   * 
+   *
    * @param node
    * @return
    */
@@ -124,7 +124,7 @@
 
   /**
    * This constructor receives a HttpBaseServlet object to set the infrastructure parameters
-   * 
+   *
    * @param base
    */
   public GenericTree(HttpBaseServlet base) {
@@ -133,7 +133,7 @@
 
   /**
    * This constructor receives a HttpBaseServlet object to set the infrastructure parameters
-   * 
+   *
    * @param base
    * @param bSmall
    *          Normal size or small size (true)
@@ -148,7 +148,7 @@
 
   /**
    * Sets the infrastructure parameters from the HttpBaseServlet object passed.
-   * 
+   *
    * @param base
    *          HttpBaseServlet object to obtain the parameters from
    */
@@ -161,7 +161,7 @@
   /**
    * Sets the isSubTree variable to the passed value. Subtrees have different treatment in
    * interface.
-   * 
+   *
    * @param value
    */
   protected void setIsSubTree(boolean value) {
@@ -201,7 +201,7 @@
 
   /**
    * Sets the language
-   * 
+   *
    * @param lang
    */
   public void setLanguage(String lang) {
@@ -217,7 +217,7 @@
 
   /**
    * Set the deep level for the current set of nodes
-   * 
+   *
    * @param l
    */
   protected void setLevel(int l) {
@@ -226,11 +226,11 @@
     for (int i = 0; i < data.length; i++) {
       // endline: set the spotted right line with angles
       if (!isSubTree && i == 0) {
-        FieldProviderFactory.setField(data[i], "endline", "Tree_FirstNode_Spots");
+        FieldProviderFactory.setField((FieldProvider)data[i], "endline", "Tree_FirstNode_Spots");
       } else if (i == (data.length - 1)) {
-        FieldProviderFactory.setField(data[i], "endline", "Tree_LastNode_Spots");
+        FieldProviderFactory.setField((FieldProvider)data[i], "endline", "Tree_LastNode_Spots");
       } else {
-        FieldProviderFactory.setField(data[i], "endline", "Tree_MiddleNode_Spots");
+        FieldProviderFactory.setField((FieldProvider)data[i], "endline", "Tree_MiddleNode_Spots");
       }
 
       // Level tree: sets the spotted left lines
@@ -263,7 +263,7 @@
 
   /**
    * Sets information for the notifications area.
-   * 
+   *
    * @param notifications
    *          HTML string with the text and link
    */