Fixed issue 15379. Merge extend navigation model project.
authorGorka Ion Damián <gorkaion.damian@openbravo.com>
Tue, 04 Aug 2015 10:02:42 +0200
changeset 27207 1f572104e426
parent 27206 228d3d579ebe (current diff)
parent 27160 dd85e72e7847 (diff)
child 27208 6e2c71e5a843
Fixed issue 15379. Merge extend navigation model project.

Added ability to define navigation rules to tables. Hardcoded navigations to
some core tables are removed and reimplemented with navigation rules. Forced
link preference continue working as 1st priority to define the windowd that
needs to be opened.

More information of the project in the wiki:
http://wiki.openbravo.com/wiki/Projects:Extend_Navigation_Model
lib/runtime/iText-2.1.7.jar
lib/runtime/jasperreports-4.0.1.jar
lib/runtime/jasperreports-fonts-4.0.1.jar
modules/org.openbravo.base.weld/lib/test/arquillian-api-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-impl-base-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-junit-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-protocol-local-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-spi-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-testenricher-cdi-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/arquillian-weld-ee-embedded-1.1-1.0.0.Alpha4.jar
modules/org.openbravo.base.weld/lib/test/shrinkwrap-api-1.0.0-alpha-11.jar
modules/org.openbravo.base.weld/lib/test/shrinkwrap-extension-classloader-1.0.0-alpha-11.jar
modules/org.openbravo.base.weld/lib/test/shrinkwrap-impl-base-1.0.0-alpha-11.jar
modules/org.openbravo.base.weld/lib/test/shrinkwrap-spi-1.0.0-alpha-11.jar
modules/org.openbravo.client.application/src/org/openbravo/client/application/window/OBViewFieldHandler.java
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/grid/ob-view-grid.js
modules/org.openbravo.service.integration.google/src-db/database/model/functions/OBSEIG_UPDATE_ACCESS.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_EP_PROCEDURES.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_FIELD.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MENU.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MESSAGE.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODEL_OBJECT.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_MODEL_OBJECT_MAPPING.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_TAB.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_TREENODE.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/AD_WINDOW.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/OBUIAPP_MENU_PARAMETERS.xml
modules/org.openbravo.service.integration.google/src-db/database/sourcedata/OBUIAPP_VIEW_IMPL.xml
modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleAuthServlet.java
modules/org.openbravo.service.integration.google/src/org/openbravo/service/integration/google/GoogleIntegrationComponentProvider.java
modules/org.openbravo.service.integration.google/web/images/google.png
modules/org.openbravo.service.integration.google/web/org.openbravo.service.integration.google/js/obsegi-account-association-view.js
modules/org.openbravo.service.integration.openid/lib/runtime/guice-2.0.jar
modules/org.openbravo.service.integration.openid/lib/runtime/httpclient-4.0.jar
modules/org.openbravo.service.integration.openid/lib/runtime/httpcore-4.0.1.jar
modules/org.openbravo.service.integration.openid/lib/runtime/httpmime-4.1.jar
modules/org.openbravo.service.integration.openid/lib/runtime/openid4java-0.9.6.jar
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_FIELD.xml
modules/org.openbravo.service.integration.openid/src-db/database/sourcedata/AD_TAB.xml
modules/org.openbravo.service.integration.openid/src/org/openbravo/service/integration/openid/OpenIDManager.java
referencedata/sampledata/F_B_International_Group/AD_PINSTANCE.xml
referencedata/sampledata/F_B_International_Group/AD_PINSTANCE_PARA.xml
referencedata/sampledata/QA_Testing/C_INVOICE.xml
referencedata/sampledata/QA_Testing/C_INVOICELINE.xml
referencedata/sampledata/QA_Testing/C_INVOICELINETAX.xml
referencedata/sampledata/QA_Testing/C_INVOICETAX.xml
referencedata/sampledata/QA_Testing/C_ORDER.xml
referencedata/sampledata/QA_Testing/C_ORDERLINE.xml
referencedata/sampledata/QA_Testing/C_ORDERLINETAX.xml
referencedata/sampledata/QA_Testing/C_ORDERTAX.xml
referencedata/sampledata/QA_Testing/FACT_ACCT.xml
referencedata/sampledata/QA_Testing/FIN_PAYMENT_SCHEDULE.xml
referencedata/sampledata/QA_Testing/FIN_PAYMENT_SCHEDULEDETAIL.xml
referencedata/sampledata/QA_Testing/M_INOUT.xml
referencedata/sampledata/QA_Testing/M_INOUTLINE.xml
referencedata/sampledata/QA_Testing/M_STORAGE_DETAIL.xml
referencedata/sampledata/QA_Testing/M_STORAGE_PENDING.xml
referencedata/sampledata/QA_Testing/M_TRANSACTION.xml
src-db/.ant-targets-build.xml
src-db/.classpath
src-db/.project
src-db/database/model/triggers/A_AMORTIZATIONLINE_TRG2.xml
src-db/database/model/triggers/C_CONVERSION_RATE_TRG2.xml
src-db/database/sourcedata/AD_AUXILIARINPUT.xml
src-db/database/sourcedata/AD_COLUMN.xml
src-db/database/sourcedata/AD_DATASET_TABLE.xml
src-db/database/sourcedata/AD_ELEMENT.xml
src-db/database/sourcedata/AD_FIELD.xml
src-db/database/sourcedata/AD_MESSAGE.xml
src-db/database/sourcedata/AD_REFERENCE.xml
src-db/database/sourcedata/AD_TAB.xml
src-db/database/sourcedata/AD_TABLE.xml
src-db/database/sourcedata/OBUISEL_SELECTOR.xml
src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml
src-test/src/org/openbravo/test/AllWebserviceTests.java
src-util/modulescript/src/org/openbravo/modulescript/OpenbravoVersion.java
src/org/openbravo/erpCommon/utility/ReferencedLink.java
--- a/.classpath.template	Mon May 04 09:06:54 2015 +0200
+++ b/.classpath.template	Tue Aug 04 10:02:42 2015 +0200
@@ -19,8 +19,6 @@
 	<classpathentry kind="src" path="modules/org.openbravo.userinterface.selector/src"/>
 	<classpathentry kind="src" path="modules/org.openbravo.userinterface.smartclient/src"/>
 	<classpathentry kind="src" path="modules/org.openbravo.service.datasource/src"/>
-	<classpathentry kind="src" path="modules/org.openbravo.service.integration.openid/src"/>
-	<classpathentry kind="src" path="modules/org.openbravo.service.integration.google/src"/>
 	<classpathentry kind="src" path="modules/org.openbravo.utility.cleanup.log/src"/>
 	<classpathentry including="quartz.properties" kind="src" path="config"/>
 	<classpathentry kind="src" path="src-gen"/>
--- a/.hgsigs	Mon May 04 09:06:54 2015 +0200
+++ b/.hgsigs	Tue Aug 04 10:02:42 2015 +0200
@@ -162,6 +162,14 @@
 84cf6c6fe9b1028b39e631dfaa9819525353ac1b 0 iEYEABECAAYFAlSz9ogACgkQCX/oGf+2qkMWZwCdG/tS4LF6c3mnfKN2b/cQUUxyQKAAoIY7jjkcR03KUm1XWZO04hop8NS4
 784c2b3f13bbc448cbdfbe6d3ec39902f1494084 0 iEYEABECAAYFAlTR2L0ACgkQCX/oGf+2qkMXJgCfUMI4/BdRtigj6/OwaZsdtRjrma4An1evjoyeGFw3/TEXf3GISaVl8vfk
 eeb46276317756eba9ce33726a75bdcd84c46dcb 0 iEYEABECAAYFAlTqux0ACgkQCX/oGf+2qkPhjQCfY8oeJAhiwzhK//iw4rMbvWgbnG0AoNYprOSntv5/c4HxkZ3lnERuv6x3
+3e694db637e239816da0e105c5f7ef08c6d94e32 0 iEYEABECAAYFAlURIUEACgkQCX/oGf+2qkNJZACgqpUHlQSxuRLL6J6MMcZCLAzHofQAoMSlYPqMLiHgW1/8nU7zKSrlYr0x
 53cc6ea75bb1d2065e367fa065b540334d4d514d 0 iEYEABECAAYFAlSYSdYACgkQCX/oGf+2qkPl4wCggC4EzYsyVitSyhbL2kWJlTZ2XXcAmwU0F1jbBoVlgyENCdW93qsA/uUF
 8651cad68d86877ad8a90a0f16ce994daca4c2c3 0 iEYEABECAAYFAlTLW8EACgkQCX/oGf+2qkPEPQCghnkxkVcLRQ5txQCvPqDfmX3OpWAAoOt8wvHw9mJLINJfaStIwhdZ062z
 831f7c3e542951b324cd9880b198bb4751bfd251 0 iEYEABECAAYFAlTm9ToACgkQCX/oGf+2qkPpFgCgzIKSAc1CMJoGRySzaUNdjoiyXyUAn2N/WoGlO000oJ6LcEcBldIz3+iT
+295e0a259f619311101efee9f1d31aede5bdaa95 0 iEYEABECAAYFAlUZK3oACgkQCX/oGf+2qkOrywCdFORG9mDgA9SMY95tQrtMYtUftS0AoK6d8rFNeUz9xDvAP/y0B+2myvoN
+4d63b001f63758b1b79b9502621754878acdfdff 0 iEYEABECAAYFAlUwx7cACgkQCX/oGf+2qkOn2gCcCxKfDDCR1P8qYR9bNtxTIs81JY8AniiMcNvRgeOQ6DOF+jHHVksUM4eO
+ac3537eef819b48dc9888d5ab0d4fec470158bef 0 iEYEABECAAYFAlVbMyIACgkQCX/oGf+2qkPRzwCfYI94AYb2DYsvojxmVtqMVqKjGiQAoIfADynxGuktv9GHEwfJOnnLCxv3
+370bc533058038007007c659c47de628c4bdcfd6 0 iEYEABECAAYFAlWCjH4ACgkQCX/oGf+2qkP10wCgmhrDxV+DCix0YGwG3nzoCyoug9kAoMoxktPF74eqwpkmVy3uyn5RYT5O
+ac761ac78f576cee64046e115ac42d2a3b227682 0 iEYEABECAAYFAlVItlgACgkQCX/oGf+2qkPgSACeNz58xoUWpTvMywmncbWx7+r7bnUAn1Ba1al80Q9HMY/wiMNu1Vfpd9Jo
+fdb1e0cd936d09381ae1aa87be98cc4f0f334f31 0 iEYEABECAAYFAlVbM8QACgkQCX/oGf+2qkO+wACfTbKub/UT0e2V2iyIB21716NAn/oAoIHu7PYZ7w/BkTQDZWR0PXDdYkty
+bd0e758ae44eb624d8af403fb4764629c1a45b21 0 iEYEABECAAYFAlWChbsACgkQCX/oGf+2qkM6xACfXP4M7zXaih+uqkIpGHMqGPTzxD8An0r58zI1YN3gKOT9t0kZ3IdaNA7c
--- a/.hgtags	Mon May 04 09:06:54 2015 +0200
+++ b/.hgtags	Tue Aug 04 10:02:42 2015 +0200
@@ -173,6 +173,14 @@
 6861ab13dc527af0dc41945a0d855de511b4c04c 3.0PR14Q3.5
 628cb1400c023f5f5695f896a1a58319ff423289 3.0PR14Q3.6
 949be1b4825e10f4ba7a50216afa19e63d82abcf 3.0PR14Q3.7
+5eac2dd74fd7d4129c991e60550d6709a958d052 3.0PR14Q3.8
 ed3565630685be1107627816bfd88379e174d7a7 3.0PR14Q4
 17ffddb263ab6fcea496938be6eb10b8c5c53729 3.0PR15Q1
 39f3bed2ed0eaa2a7e69a46d7bf417c346e25a6a 3.0PR15Q1.1
+31dfe7896f8fcd9390b979d7c6972f5aea00d199 3.0PR15Q1.2
+ad409516bfa0b1c6f7ab128cab4526dd5058c787 3.0PR15Q1.3
+d5ec99ff8e8e301cf4bf673f37b9c04ea1758f98 3.0PR15Q1.4
+d2f1dd0d0b4c2e493c26a4b9cbdb20fdc50c5f13 3.0PR15Q1.5
+4239774eb8de8f0740bfbd6e3e36c075ee2a5a91 3.0PR15Q2
+e861122b0b1d2aa2ca6e177bfbb9ddf939e33dd7 3.0PR15Q2.1
+a28a880b5aeb9208eaf0ce569fd51b7a5fc2b48e 3.0PR15Q2.2
--- a/build.xml	Mon May 04 09:06:54 2015 +0200
+++ b/build.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -597,6 +597,10 @@
     <ant dir="${base.src.test}" target="run.quick.tests" inheritAll="true" inheritRefs="true" />
   </target>
 
+  <target name="run.test" depends="init">
+    <ant dir="${base.src.test}" target="run.test" inheritAll="true" inheritRefs="true" />
+  </target>
+
   <target name="run.api.test.javascript">
     <ant dir="${base.src.test}" target="run.api.test.javascript" inheritAll="true" inheritRefs="true" />
   </target>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/legal/Apache_poi_license.txt	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,507 @@
+
+                                 Apache License
+                           Version 2.0, January 2004
+                        http://www.apache.org/licenses/
+
+   TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
+
+   1. Definitions.
+
+      "License" shall mean the terms and conditions for use, reproduction,
+      and distribution as defined by Sections 1 through 9 of this document.
+
+      "Licensor" shall mean the copyright owner or entity authorized by
+      the copyright owner that is granting the License.
+
+      "Legal Entity" shall mean the union of the acting entity and all
+      other entities that control, are controlled by, or are under common
+      control with that entity. For the purposes of this definition,
+      "control" means (i) the power, direct or indirect, to cause the
+      direction or management of such entity, whether by contract or
+      otherwise, or (ii) ownership of fifty percent (50%) or more of the
+      outstanding shares, or (iii) beneficial ownership of such entity.
+
+      "You" (or "Your") shall mean an individual or Legal Entity
+      exercising permissions granted by this License.
+
+      "Source" form shall mean the preferred form for making modifications,
+      including but not limited to software source code, documentation
+      source, and configuration files.
+
+      "Object" form shall mean any form resulting from mechanical
+      transformation or translation of a Source form, including but
+      not limited to compiled object code, generated documentation,
+      and conversions to other media types.
+
+      "Work" shall mean the work of authorship, whether in Source or
+      Object form, made available under the License, as indicated by a
+      copyright notice that is included in or attached to the work
+      (an example is provided in the Appendix below).
+
+      "Derivative Works" shall mean any work, whether in Source or Object
+      form, that is based on (or derived from) the Work and for which the
+      editorial revisions, annotations, elaborations, or other modifications
+      represent, as a whole, an original work of authorship. For the purposes
+      of this License, Derivative Works shall not include works that remain
+      separable from, or merely link (or bind by name) to the interfaces of,
+      the Work and Derivative Works thereof.
+
+      "Contribution" shall mean any work of authorship, including
+      the original version of the Work and any modifications or additions
+      to that Work or Derivative Works thereof, that is intentionally
+      submitted to Licensor for inclusion in the Work by the copyright owner
+      or by an individual or Legal Entity authorized to submit on behalf of
+      the copyright owner. For the purposes of this definition, "submitted"
+      means any form of electronic, verbal, or written communication sent
+      to the Licensor or its representatives, including but not limited to
+      communication on electronic mailing lists, source code control systems,
+      and issue tracking systems that are managed by, or on behalf of, the
+      Licensor for the purpose of discussing and improving the Work, but
+      excluding communication that is conspicuously marked or otherwise
+      designated in writing by the copyright owner as "Not a Contribution."
+
+      "Contributor" shall mean Licensor and any individual or Legal Entity
+      on behalf of whom a Contribution has been received by Licensor and
+      subsequently incorporated within the Work.
+
+   2. Grant of Copyright License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      copyright license to reproduce, prepare Derivative Works of,
+      publicly display, publicly perform, sublicense, and distribute the
+      Work and such Derivative Works in Source or Object form.
+
+   3. Grant of Patent License. Subject to the terms and conditions of
+      this License, each Contributor hereby grants to You a perpetual,
+      worldwide, non-exclusive, no-charge, royalty-free, irrevocable
+      (except as stated in this section) patent license to make, have made,
+      use, offer to sell, sell, import, and otherwise transfer the Work,
+      where such license applies only to those patent claims licensable
+      by such Contributor that are necessarily infringed by their
+      Contribution(s) alone or by combination of their Contribution(s)
+      with the Work to which such Contribution(s) was submitted. If You
+      institute patent litigation against any entity (including a
+      cross-claim or counterclaim in a lawsuit) alleging that the Work
+      or a Contribution incorporated within the Work constitutes direct
+      or contributory patent infringement, then any patent licenses
+      granted to You under this License for that Work shall terminate
+      as of the date such litigation is filed.
+
+   4. Redistribution. You may reproduce and distribute copies of the
+      Work or Derivative Works thereof in any medium, with or without
+      modifications, and in Source or Object form, provided that You
+      meet the following conditions:
+
+      (a) You must give any other recipients of the Work or
+          Derivative Works a copy of this License; and
+
+      (b) You must cause any modified files to carry prominent notices
+          stating that You changed the files; and
+
+      (c) You must retain, in the Source form of any Derivative Works
+          that You distribute, all copyright, patent, trademark, and
+          attribution notices from the Source form of the Work,
+          excluding those notices that do not pertain to any part of
+          the Derivative Works; and
+
+      (d) If the Work includes a "NOTICE" text file as part of its
+          distribution, then any Derivative Works that You distribute must
+          include a readable copy of the attribution notices contained
+          within such NOTICE file, excluding those notices that do not
+          pertain to any part of the Derivative Works, in at least one
+          of the following places: within a NOTICE text file distributed
+          as part of the Derivative Works; within the Source form or
+          documentation, if provided along with the Derivative Works; or,
+          within a display generated by the Derivative Works, if and
+          wherever such third-party notices normally appear. The contents
+          of the NOTICE file are for informational purposes only and
+          do not modify the License. You may add Your own attribution
+          notices within Derivative Works that You distribute, alongside
+          or as an addendum to the NOTICE text from the Work, provided
+          that such additional attribution notices cannot be construed
+          as modifying the License.
+
+      You may add Your own copyright statement to Your modifications and
+      may provide additional or different license terms and conditions
+      for use, reproduction, or distribution of Your modifications, or
+      for any such Derivative Works as a whole, provided Your use,
+      reproduction, and distribution of the Work otherwise complies with
+      the conditions stated in this License.
+
+   5. Submission of Contributions. Unless You explicitly state otherwise,
+      any Contribution intentionally submitted for inclusion in the Work
+      by You to the Licensor shall be under the terms and conditions of
+      this License, without any additional terms or conditions.
+      Notwithstanding the above, nothing herein shall supersede or modify
+      the terms of any separate license agreement you may have executed
+      with Licensor regarding such Contributions.
+
+   6. Trademarks. This License does not grant permission to use the trade
+      names, trademarks, service marks, or product names of the Licensor,
+      except as required for reasonable and customary use in describing the
+      origin of the Work and reproducing the content of the NOTICE file.
+
+   7. Disclaimer of Warranty. Unless required by applicable law or
+      agreed to in writing, Licensor provides the Work (and each
+      Contributor provides its Contributions) on an "AS IS" BASIS,
+      WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
+      implied, including, without limitation, any warranties or conditions
+      of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
+      PARTICULAR PURPOSE. You are solely responsible for determining the
+      appropriateness of using or redistributing the Work and assume any
+      risks associated with Your exercise of permissions under this License.
+
+   8. Limitation of Liability. In no event and under no legal theory,
+      whether in tort (including negligence), contract, or otherwise,
+      unless required by applicable law (such as deliberate and grossly
+      negligent acts) or agreed to in writing, shall any Contributor be
+      liable to You for damages, including any direct, indirect, special,
+      incidental, or consequential damages of any character arising as a
+      result of this License or out of the use or inability to use the
+      Work (including but not limited to damages for loss of goodwill,
+      work stoppage, computer failure or malfunction, or any and all
+      other commercial damages or losses), even if such Contributor
+      has been advised of the possibility of such damages.
+
+   9. Accepting Warranty or Additional Liability. While redistributing
+      the Work or Derivative Works thereof, You may choose to offer,
+      and charge a fee for, acceptance of support, warranty, indemnity,
+      or other liability obligations and/or rights consistent with this
+      License. However, in accepting such obligations, You may act only
+      on Your own behalf and on Your sole responsibility, not on behalf
+      of any other Contributor, and only if You agree to indemnify,
+      defend, and hold each Contributor harmless for any liability
+      incurred by, or claims asserted against, such Contributor by reason
+      of your accepting any such warranty or additional liability.
+
+   END OF TERMS AND CONDITIONS
+
+   APPENDIX: How to apply the Apache License to your work.
+
+      To apply the Apache License to your work, attach the following
+      boilerplate notice, with the fields enclosed by brackets "[]"
+      replaced with your own identifying information. (Don't include
+      the brackets!)  The text should be enclosed in the appropriate
+      comment syntax for the file format. We also recommend that a
+      file or class name and description of purpose be included on the
+      same "printed page" as the copyright notice for easier
+      identification within third-party archives.
+
+   Copyright [yyyy] [name of copyright owner]
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" BASIS,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+
+APACHE POI SUBCOMPONENTS:
+
+Apache POI includes subcomponents with separate copyright notices and
+license terms. Your use of these subcomponents is subject to the terms
+and conditions of the following licenses:
+
+
+Office Open XML schemas (ooxml-schemas-1.0.jar)
+
+    The Office Open XML schema definitions used by Apache POI are
+    a part of the Office Open XML ECMA Specification (ECMA-376, [1]).
+    As defined in section 9.4 of the ECMA bylaws [2], this specification
+    is available to all interested parties without restriction:
+
+        9.4 All documents when approved shall be made available to
+            all interested parties without restriction.
+
+    Furthermore, both Microsoft and Adobe have granted patent licenses
+    to this work [3,4,5].
+
+    [1] http://www.ecma-international.org/publications/standards/Ecma-376.htm
+    [2] http://www.ecma-international.org/memento/Ecmabylaws.htm
+    [3] http://www.microsoft.com/interop/osp/
+    [4] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/ECMA-376%20Edition%201%20Microsoft%20Patent%20Declaration.pdf
+    [5] http://www.ecma-international.org/publications/files/ECMA-ST/Ecma%20PATENT/ga-2006-191.pdf
+
+
+DOM4J library (dom4j-1.6.1.jar)
+
+    Copyright 2001-2005 (C) MetaStuff, Ltd. All Rights Reserved.
+
+    Redistribution and use of this software and associated documentation
+    ("Software"), with or without modification, are permitted provided
+    that the following conditions are met:
+
+    1. Redistributions of source code must retain copyright
+       statements and notices.  Redistributions must also contain a
+       copy of this document.
+
+    2. Redistributions in binary form must reproduce the
+       above copyright notice, this list of conditions and the
+       following disclaimer in the documentation and/or other
+       materials provided with the distribution.
+
+    3. The name "DOM4J" must not be used to endorse or promote
+       products derived from this Software without prior written
+       permission of MetaStuff, Ltd.  For written permission,
+       please contact dom4j-info@metastuff.com.
+
+    4. Products derived from this Software may not be called "DOM4J"
+       nor may "DOM4J" appear in their names without prior written
+       permission of MetaStuff, Ltd. DOM4J is a registered
+       trademark of MetaStuff, Ltd.
+
+    5. Due credit should be given to the DOM4J Project - 
+       http://www.dom4j.org
+ 
+    THIS SOFTWARE IS PROVIDED BY METASTUFF, LTD. AND CONTRIBUTORS
+    ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT
+    NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+    FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL
+    METASTUFF, LTD. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
+    INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+    (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+    SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+    HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
+    STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+    ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED
+    OF THE POSSIBILITY OF SUCH DAMAGE.
+
+
+JUnit test library (junit-3.8.1.jar)
+
+    Common Public License - v 1.0
+
+    THE ACCOMPANYING PROGRAM IS PROVIDED UNDER THE TERMS OF THIS COMMON
+    PUBLIC LICENSE ("AGREEMENT"). ANY USE, REPRODUCTION OR DISTRIBUTION
+    OF THE PROGRAM CONSTITUTES RECIPIENT'S ACCEPTANCE OF THIS AGREEMENT.
+
+    1. DEFINITIONS
+
+    "Contribution" means:
+
+    a) in the case of the initial Contributor, the initial code and
+       documentation distributed under this Agreement, and
+
+    b) in the case of each subsequent Contributor:
+
+       i)  changes to the Program, and
+
+       ii) additions to the Program;
+
+       where such changes and/or additions to the Program originate from
+       and are distributed by that particular Contributor. A Contribution
+       'originates' from a Contributor if it was added to the Program by
+       such Contributor itself or anyone acting on such Contributor's behalf.
+       Contributions do not include additions to the Program which: (i) are
+       separate modules of software distributed in conjunction with the
+       Program under their own license agreement, and (ii) are not derivative
+       works of the Program.
+
+    "Contributor" means any person or entity that distributes the Program.
+
+    "Licensed Patents " mean patent claims licensable by a Contributor which
+    are necessarily infringed by the use or sale of its Contribution alone
+    or when combined with the Program.
+
+    "Program" means the Contributions distributed in accordance with this
+    Agreement.
+
+    "Recipient" means anyone who receives the Program under this Agreement,
+    including all Contributors.
+
+    2. GRANT OF RIGHTS
+
+    a) Subject to the terms of this Agreement, each Contributor hereby grants
+       Recipient a non-exclusive, worldwide, royalty-free copyright license
+       to reproduce, prepare derivative works of, publicly display, publicly
+       perform, distribute and sublicense the Contribution of such
+       Contributor, if any, and such derivative works, in source code and
+       object code form.
+
+    b) Subject to the terms of this Agreement, each Contributor hereby grants
+       Recipient a non-exclusive, worldwide, royalty-free patent license under
+       Licensed Patents to make, use, sell, offer to sell, import and
+       otherwise transfer the Contribution of such Contributor, if any, in
+       source code and object code form. This patent license shall apply to
+       the combination of the Contribution and the Program if, at the time
+       the Contribution is added by the Contributor, such addition of the
+       Contribution causes such combination to be covered by the Licensed
+       Patents. The patent license shall not apply to any other combinations
+       which include the Contribution. No hardware per se is licensed
+       hereunder.
+
+    c) Recipient understands that although each Contributor grants the
+       licenses to its Contributions set forth herein, no assurances are
+       provided by any Contributor that the Program does not infringe the
+       patent or other intellectual property rights of any other entity.
+       Each Contributor disclaims any liability to Recipient for claims
+       brought by any other entity based on infringement of intellectual
+       property rights or otherwise. As a condition to exercising the rights
+       and licenses granted hereunder, each Recipient hereby assumes sole
+       responsibility to secure any other intellectual property rights
+       needed, if any. For example, if a third party patent license is
+       required to allow Recipient to distribute the Program, it is
+       Recipient's responsibility to acquire that license before
+       distributing the Program.
+
+    d) Each Contributor represents that to its knowledge it has sufficient
+       copyright rights in its Contribution, if any, to grant the copyright
+       license set forth in this Agreement.
+
+    3. REQUIREMENTS
+
+    A Contributor may choose to distribute the Program in object code form
+    under its own license agreement, provided that:
+
+    a) it complies with the terms and conditions of this Agreement; and
+
+    b) its license agreement:
+
+       i)   effectively disclaims on behalf of all Contributors all warranties
+            and conditions, express and implied, including warranties or
+            conditions of title and non-infringement, and implied warranties
+            or conditions of merchantability and fitness for a particular
+            purpose;
+
+       ii)  effectively excludes on behalf of all Contributors all liability
+            for damages, including direct, indirect, special, incidental and
+            consequential damages, such as lost profits;
+
+       iii) states that any provisions which differ from this Agreement are
+            offered by that Contributor alone and not by any other party; and
+
+       iv)  states that source code for the Program is available from such
+            Contributor, and informs licensees how to obtain it in a
+            reasonable manner on or through a medium customarily used for
+            software exchange.
+
+    When the Program is made available in source code form:
+
+    a) it must be made available under this Agreement; and
+
+    b) a copy of this Agreement must be included with each copy of
+       the Program.
+
+    Contributors may not remove or alter any copyright notices contained
+    within the Program.
+
+    Each Contributor must identify itself as the originator of its
+    Contribution, if any, in a manner that reasonably allows subsequent
+    Recipients to identify the originator of the Contribution.
+
+    4. COMMERCIAL DISTRIBUTION
+
+    Commercial distributors of software may accept certain responsibilities
+    with respect to end users, business partners and the like. While this
+    license is intended to facilitate the commercial use of the Program,
+    the Contributor who includes the Program in a commercial product offering
+    should do so in a manner which does not create potential liability for
+    other Contributors. Therefore, if a Contributor includes the Program
+    in a commercial product offering, such Contributor ("Commercial
+    Contributor") hereby agrees to defend and indemnify every other
+    Contributor ("Indemnified Contributor") against any losses, damages
+    and costs (collectively "Losses") arising from claims, lawsuits and
+    other legal actions brought by a third party against the Indemnified
+    Contributor to the extent caused by the acts or omissions of such
+    Commercial Contributor in connection with its distribution of the
+    Program in a commercial product offering. The obligations in this
+    section do not apply to any claims or Losses relating to any actual
+    or alleged intellectual property infringement. In order to qualify,
+    an Indemnified Contributor must: a) promptly notify the Commercial
+    Contributor in writing of such claim, and b) allow the Commercial
+    Contributor to control, and cooperate with the Commercial Contributor
+    in, the defense and any related settlement negotiations. The Indemnified
+    Contributor may participate in any such claim at its own expense.
+
+    For example, a Contributor might include the Program in a commercial
+    product offering, Product X. That Contributor is then a Commercial
+    Contributor. If that Commercial Contributor then makes performance
+    claims, or offers warranties related to Product X, those performance
+    claims and warranties are such Commercial Contributor's responsibility
+    alone. Under this section, the Commercial Contributor would have to
+    defend claims against the other Contributors related to those
+    performance claims and warranties, and if a court requires any other
+    Contributor to pay any damages as a result, the Commercial Contributor
+    must pay those damages.
+
+    5. NO WARRANTY
+
+    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS PROVIDED
+    ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, EITHER
+    EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY WARRANTIES OR
+    CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR
+    A PARTICULAR PURPOSE. Each Recipient is solely responsible for
+    determining the appropriateness of using and distributing the Program
+    and assumes all risks associated with its exercise of rights under this
+    Agreement, including but not limited to the risks and costs of program
+    errors, compliance with applicable laws, damage to or loss of data,
+    programs or equipment, and unavailability or interruption of operations.
+
+    6. DISCLAIMER OF LIABILITY
+
+    EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT NOR
+    ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT, INDIRECT,
+    INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING
+    WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED AND ON ANY THEORY OF
+    LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
+    NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OR
+    DISTRIBUTION OF THE PROGRAM OR THE EXERCISE OF ANY RIGHTS GRANTED
+    HEREUNDER, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGES.
+
+    7. GENERAL
+
+    If any provision of this Agreement is invalid or unenforceable under
+    applicable law, it shall not affect the validity or enforceability of
+    the remainder of the terms of this Agreement, and without further
+    action by the parties hereto, such provision shall be reformed to the
+    minimum extent necessary to make such provision valid and enforceable.
+
+    If Recipient institutes patent litigation against a Contributor with
+    respect to a patent applicable to software (including a cross-claim or
+    counterclaim in a lawsuit), then any patent licenses granted by that
+    Contributor to such Recipient under this Agreement shall terminate as of
+    the date such litigation is filed. In addition, if Recipient institutes
+    patent litigation against any entity (including a cross-claim or
+    counterclaim in a lawsuit) alleging that the Program itself (excluding
+    combinations of the Program with other software or hardware) infringes
+    such Recipient's patent(s), then such Recipient's rights granted under
+    Section 2(b) shall terminate as of the date such litigation is filed.
+
+    All Recipient's rights under this Agreement shall terminate if it fails
+    to comply with any of the material terms or conditions of this Agreement
+    and does not cure such failure in a reasonable period of time after
+    becoming aware of such noncompliance. If all Recipient's rights under
+    this Agreement terminate, Recipient agrees to cease use and distribution
+    of the Program as soon as reasonably practicable. However, Recipient's
+    obligations under this Agreement and any licenses granted by Recipient
+    relating to the Program shall continue and survive.
+
+    Everyone is permitted to copy and distribute copies of this Agreement,
+    but in order to avoid inconsistency the Agreement is copyrighted and may
+    only be modified in the following manner. The Agreement Steward reserves
+    the right to publish new versions (including revisions) of this Agreement
+    from time to time. No one other than the Agreement Steward has the right
+    to modify this Agreement. IBM is the initial Agreement Steward. IBM may
+    assign the responsibility to serve as the Agreement Steward to a suitable
+    separate entity. Each new version of the Agreement will be given a
+    distinguishing version number. The Program (including Contributions) may
+    always be distributed subject to the version of the Agreement under which
+    it was received. In addition, after a new version of the Agreement is
+    published, Contributor may elect to distribute the Program (including
+    its Contributions) under the new version. Except as expressly stated in
+    Sections 2(a) and 2(b) above, Recipient receives no rights or licenses
+    to the intellectual property of any Contributor under this Agreement,
+    whether expressly, by implication, estoppel or otherwise. All rights in
+    the Program not expressly granted under this Agreement are reserved.
+
+    This Agreement is governed by the laws of the State of New York and the
+    intellectual property laws of the United States of America. No party to
+    this Agreement will bring a legal action under this Agreement more than
+    one year after the cause of action arose. Each party waives its rights
+    to a jury trial in any resulting litigation.
--- a/legal/Licensing.txt	Mon May 04 09:06:54 2015 +0200
+++ b/legal/Licensing.txt	Tue Aug 04 10:02:42 2015 +0200
@@ -3,7 +3,7 @@
 This license file applies to the Openbravo ERP software (the "Openbravo
 Software"), except as described below.
 
-This product is Copyright 2001-2011 Openbravo S.L.U.  For other detailed notice,
+This product is Copyright 2001-2015 Openbravo S.L.U.  For other detailed notice,
 see the "NOTICE" file with this distribution.
 
 This product is free software; you can redistribute it and/or modify
@@ -136,16 +136,28 @@
 # Dynarch DHTML/Javascript calendar at web/js/jscalendar (Copyright Mihai
   Bazon, 2002, 2003 - http://dynarch.com/mishoo/)
 
-# itext-2.1.7.jar  
-# jasperreports-4.0.1.jar 
-# jasperreports-fonts-4.0.1.jar
+# itextpdf-5.5.0.jar
+# itext-pdfa-5.5.0.jar
+Both files under AGPL V3 license with LGPL Exception (included as iTextpdf_license.txt in this folder)
+
+# jackson-core-2.1.4.jar
+# jackson-databind-2.1.4.jar
+# jackson-annotations-2.1.4.jar
+All files under the Apache 2.0 license (included as Apache_license-2.0.txt in this folder)
+
+# jasperreports-6.0.0.jar
+Under the terms of the LGPL 3.0, available at http://www.gnu.org/licenses/lgpl-3.0.html
+
+# jasperreports-fonts-6.0.0.jar
+License is contained in the jar file itself (path: net/sf/jasperreports/fonts/dejavu/LICENSE)
+
 # jcommon-1.0.15.jar 
 # jfreechart-1.0.12.jar
 # jxl-2.6.10.jar
 All files under the LGPL 2.1 (available at http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html)
 
-# jasperreports-fonts-4.0.1.jar
-License is contained in the jar file itself (path: net/sf/jasperreports/fonts/dejavu/LICENSE)
+# poi-3.10.1.jar
+Under the Apache 2.0 license (included as Apache_poi_license.txt in this folder)
 
 # hibernate3.jar
 All files under the LGPL 2.1 (available at www.gnu.org/licenses/lgpl.html)
@@ -170,9 +182,6 @@
 # javassist-3.14.0-GA.jar
 Under MPL License (included as MPL-1.1.txt in this folder)
 
-# iText-2.1.7.jar
-Under MPL/GPL License (included as MPL-1.1.txt in this folder)
-
 # slf4j-api-1.6.1.jar
 # slf4j-log4j12-1.6.1.jar
 Under MIT license. (available at http://www.slf4j.org/license.html)
@@ -203,6 +212,7 @@
 # ejb-api-3.0.jar
 # jboss-interceptor-api-3.1.0-CR3.jar
 # jboss-ejb3-api-3.1.0.jar
+# jboss-el-api_2.2_spec-1.0.0.Final.jar
 Under the LGPL license (included as LGPL-2.1.txt in this folder)
 
 # cal10n-api-0.7.4.jar
@@ -218,24 +228,34 @@
 # weld-core-1.1.24.Final.jar
 # weld-servlet-core-1.1.24.Final.jar
 # weld-spi.jar
-# arquillian-api-1.0.0.Alpha4.jar
-# arquillian-impl-base-1.0.0.Alpha4.jar
-# arquillian-junit-1.0.0.Alpha4.jar
-# arquillian-protocol-local-1.0.0.Alpha4.jar
-# arquillian-spi-1.0.0.Alpha4.jar
-# arquillian-testenricher-cdi-1.0.0.Alpha4.jar
-# arquillian-weld-ee-embedded-1.1-1.0.0.Alpha4.jar
-# shrinkwrap-api-1.0.0-alpha-11.jar
-# shrinkwrap-extension-classloader-1.0.0-alpha-11.jar
-# shrinkwrap-impl-base-1.0.0-alpha-11.jar
-# shrinkwrap-spi-1.0.0-alpha-11.jar
+# arquillian-config-api-1.1.8.Final.jar
+# arquillian-config-impl-base-1.1.8.Final.jar
+# arquillian-container-impl-base-1.1.8.Final.jar
+# arquillian-container-spi-1.1.8.Final.jar
+# arquillian-container-test-api-1.1.8.Final.jar
+# arquillian-container-test-impl-base-1.1.8.Final.jar
+# arquillian-container-test-spi-1.1.8.Final.jar
+# arquillian-core-api-1.1.8.Final.jar
+# arquillian-core-impl-base-1.1.8.Final.jar
+# arquillian-core-spi-1.1.8.Final.jar
+# arquillian-junit-container-1.1.8.Final.jar
+# arquillian-junit-core-1.1.8.Final.jar
+# arquillian-test-api-1.1.8.Final.jar
+# arquillian-testenricher-cdi-1.0.2.Final.jar
+# arquillian-test-impl-base-1.1.8.Final.jar
+# arquillian-test-spi-1.1.8.Final.jar
+# arquillian-weld-ee-embedded-1.1-1.0.0.CR8.jar
+# shrinkwrap-api-1.2.2.jar
+# shrinkwrap-descriptors-api-base-2.0.0-alpha-7.jar
+# shrinkwrap-descriptors-spi-2.0.0-alpha-7.jar
+# shrinkwrap-impl-base-1.2.2.jar
+# shrinkwrap-spi-1.2.2.jar
 # validation-api-1.0.0.GA.jar
 # jsmin.0.2.4.jar
 # httpcore-4.0.1.jar
 # httpclient-4.0.jar
 # httpmime-4.1.jar
 # guice-2.0.jar
-# openid4java-0.9.6.jar
 Under the Apache 2.0 license (included as Apache_license-2.0.txt in this folder)
 
 # jslint4java-1.4.7.jar
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/legal/iTextpdf_license.txt	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,452 @@
+
+iText Version 5 LGPL Exception
+
+As a special exception, the copyright holders of this library 
+give you permission to use this library only in connection with 
+the Jaspersoft LGPL Library and may only be distributed as part of the 
+Jaspersoft LGPL Library. You may only call the library through interfaces 
+provided in the Jaspersoft LGPL Library and not in any way use this library 
+except through the Jaspersoft LGPL Library. If you redistribute the 
+Jaspersoft LGPL Library with this library, you must extend this exception 
+to your version of the library. If you choose to remove this library from 
+the Jaspersoft LGPL Library, you may remove this restriction.
+
+---------------------------------------------------------------------------
+
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+		       Version 2, June 1991
+
+ Copyright (C) 1991 Free Software Foundation, Inc.
+    		    59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+[This is the first released version of the library GPL.  It is
+ numbered 2 because it goes with version 2 of the ordinary GPL.]
+
+			    Preamble
+
+  The licenses for most software are designed to take away your
+freedom to share and change it.  By contrast, the GNU General Public
+Licenses are intended to guarantee your freedom to share and change
+free software--to make sure the software is free for all its users.
+
+  This license, the Library General Public License, applies to some
+specially designated Free Software Foundation software, and to any
+other libraries whose authors decide to use it.  You can use it for
+your libraries, too.
+
+  When we speak of free software, we are referring to freedom, not
+price.  Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+  To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if
+you distribute copies of the library, or if you modify it.
+
+  For example, if you distribute copies of the library, whether gratis
+or for a fee, you must give the recipients all the rights that we gave
+you.  You must make sure that they, too, receive or can get the source
+code.  If you link a program with the library, you must provide
+complete object files to the recipients so that they can relink them
+with the library, after making changes to the library and recompiling
+it.  And you must show them these terms so they know their rights.
+
+  Our method of protecting your rights has two steps: (1) copyright
+the library, and (2) offer you this license which gives you legal
+permission to copy, distribute and/or modify the library.
+
+  Also, for each distributor's protection, we want to make certain
+that everyone understands that there is no warranty for this free
+library.  If the library is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original
+version, so that any problems introduced by others will not reflect on
+the original authors' reputations.
+.
+  Finally, any free program is threatened constantly by software
+patents.  We wish to avoid the danger that companies distributing free
+software will individually obtain patent licenses, thus in effect
+transforming the program into proprietary software.  To prevent this,
+we have made it clear that any patent must be licensed for everyone's
+free use or not licensed at all.
+
+  Most GNU software, including some libraries, is covered by the ordinary
+GNU General Public License, which was designed for utility programs.  This
+license, the GNU Library General Public License, applies to certain
+designated libraries.  This license is quite different from the ordinary
+one; be sure to read it in full, and don't assume that anything in it is
+the same as in the ordinary license.
+
+  The reason we have a separate public license for some libraries is that
+they blur the distinction we usually make between modifying or adding to a
+program and simply using it.  Linking a program with a library, without
+changing the library, is in some sense simply using the library, and is
+analogous to running a utility program or application program.  However, in
+a textual and legal sense, the linked executable is a combined work, a
+derivative of the original library, and the ordinary General Public License
+treats it as such.
+
+  Because of this blurred distinction, using the ordinary General
+Public License for libraries did not effectively promote software
+sharing, because most developers did not use the libraries.  We
+concluded that weaker conditions might promote sharing better.
+
+  However, unrestricted linking of non-free programs would deprive the
+users of those programs of all benefit from the free status of the
+libraries themselves.  This Library General Public License is intended to
+permit developers of non-free programs to use free libraries, while
+preserving your freedom as a user of such programs to change the free
+libraries that are incorporated in them.  (We have not seen how to achieve
+this as regards changes in header files, but we have achieved it as regards
+changes in the actual functions of the Library.)  The hope is that this
+will lead to faster development of free libraries.
+
+  The precise terms and conditions for copying, distribution and
+modification follow.  Pay close attention to the difference between a
+"work based on the library" and a "work that uses the library".  The
+former contains code derived from the library, while the latter only
+works together with the library.
+
+  Note that it is possible for a library to be covered by the ordinary
+General Public License rather than by this special one.
+.
+		  GNU LIBRARY GENERAL PUBLIC LICENSE
+   TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+  0. This License Agreement applies to any software library which
+contains a notice placed by the copyright holder or other authorized
+party saying it may be distributed under the terms of this Library
+General Public License (also called "this License").  Each licensee is
+addressed as "you".
+
+  A "library" means a collection of software functions and/or data
+prepared so as to be conveniently linked with application programs
+(which use some of those functions and data) to form executables.
+
+  The "Library", below, refers to any such software library or work
+which has been distributed under these terms.  A "work based on the
+Library" means either the Library or any derivative work under
+copyright law: that is to say, a work containing the Library or a
+portion of it, either verbatim or with modifications and/or translated
+straightforwardly into another language.  (Hereinafter, translation is
+included without limitation in the term "modification".)
+
+  "Source code" for a work means the preferred form of the work for
+making modifications to it.  For a library, complete source code means
+all the source code for all modules it contains, plus any associated
+interface definition files, plus the scripts used to control compilation
+and installation of the library.
+
+  Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope.  The act of
+running a program using the Library is not restricted, and output from
+such a program is covered only if its contents constitute a work based
+on the Library (independent of the use of the Library in a tool for
+writing it).  Whether that is true depends on what the Library does
+and what the program that uses the Library does.
+  
+  1. You may copy and distribute verbatim copies of the Library's
+complete source code as you receive it, in any medium, provided that
+you conspicuously and appropriately publish on each copy an
+appropriate copyright notice and disclaimer of warranty; keep intact
+all the notices that refer to this License and to the absence of any
+warranty; and distribute a copy of this License along with the
+Library.
+
+  You may charge a fee for the physical act of transferring a copy,
+and you may at your option offer warranty protection in exchange for a
+fee.
+.
+  2. You may modify your copy or copies of the Library or any portion
+of it, thus forming a work based on the Library, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+    a) The modified work must itself be a software library.
+
+    b) You must cause the files modified to carry prominent notices
+    stating that you changed the files and the date of any change.
+
+    c) You must cause the whole of the work to be licensed at no
+    charge to all third parties under the terms of this License.
+
+    d) If a facility in the modified Library refers to a function or a
+    table of data to be supplied by an application program that uses
+    the facility, other than as an argument passed when the facility
+    is invoked, then you must make a good faith effort to ensure that,
+    in the event an application does not supply such function or
+    table, the facility still operates, and performs whatever part of
+    its purpose remains meaningful.
+
+    (For example, a function in a library to compute square roots has
+    a purpose that is entirely well-defined independent of the
+    application.  Therefore, Subsection 2d requires that any
+    application-supplied function or table used by this function must
+    be optional: if the application does not supply it, the square
+    root function must still compute square roots.)
+
+These requirements apply to the modified work as a whole.  If
+identifiable sections of that work are not derived from the Library,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works.  But when you
+distribute the same sections as part of a whole which is a work based
+on the Library, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote
+it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Library.
+
+In addition, mere aggregation of another work not based on the Library
+with the Library (or with a work based on the Library) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+  3. You may opt to apply the terms of the ordinary GNU General Public
+License instead of this License to a given copy of the Library.  To do
+this, you must alter all the notices that refer to this License, so
+that they refer to the ordinary GNU General Public License, version 2,
+instead of to this License.  (If a newer version than version 2 of the
+ordinary GNU General Public License has appeared, then you can specify
+that version instead if you wish.)  Do not make any other change in
+these notices.
+.
+  Once this change is made in a given copy, it is irreversible for
+that copy, so the ordinary GNU General Public License applies to all
+subsequent copies and derivative works made from that copy.
+
+  This option is useful when you wish to copy part of the code of
+the Library into a program that is not a library.
+
+  4. You may copy and distribute the Library (or a portion or
+derivative of it, under Section 2) in object code or executable form
+under the terms of Sections 1 and 2 above provided that you accompany
+it with the complete corresponding machine-readable source code, which
+must be distributed under the terms of Sections 1 and 2 above on a
+medium customarily used for software interchange.
+
+  If distribution of object code is made by offering access to copy
+from a designated place, then offering equivalent access to copy the
+source code from the same place satisfies the requirement to
+distribute the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+  5. A program that contains no derivative of any portion of the
+Library, but is designed to work with the Library by being compiled or
+linked with it, is called a "work that uses the Library".  Such a
+work, in isolation, is not a derivative work of the Library, and
+therefore falls outside the scope of this License.
+
+  However, linking a "work that uses the Library" with the Library
+creates an executable that is a derivative of the Library (because it
+contains portions of the Library), rather than a "work that uses the
+library".  The executable is therefore covered by this License.
+Section 6 states terms for distribution of such executables.
+
+  When a "work that uses the Library" uses material from a header file
+that is part of the Library, the object code for the work may be a
+derivative work of the Library even though the source code is not.
+Whether this is true is especially significant if the work can be
+linked without the Library, or if the work is itself a library.  The
+threshold for this to be true is not precisely defined by law.
+
+  If such an object file uses only numerical parameters, data
+structure layouts and accessors, and small macros and small inline
+functions (ten lines or less in length), then the use of the object
+file is unrestricted, regardless of whether it is legally a derivative
+work.  (Executables containing this object code plus portions of the
+Library will still fall under Section 6.)
+
+  Otherwise, if the work is a derivative of the Library, you may
+distribute the object code for the work under the terms of Section 6.
+Any executables containing that work also fall under Section 6,
+whether or not they are linked directly with the Library itself.
+.
+  6. As an exception to the Sections above, you may also compile or
+link a "work that uses the Library" with the Library to produce a
+work containing portions of the Library, and distribute that work
+under terms of your choice, provided that the terms permit
+modification of the work for the customer's own use and reverse
+engineering for debugging such modifications.
+
+  You must give prominent notice with each copy of the work that the
+Library is used in it and that the Library and its use are covered by
+this License.  You must supply a copy of this License.  If the work
+during execution displays copyright notices, you must include the
+copyright notice for the Library among them, as well as a reference
+directing the user to the copy of this License.  Also, you must do one
+of these things:
+
+    a) Accompany the work with the complete corresponding
+    machine-readable source code for the Library including whatever
+    changes were used in the work (which must be distributed under
+    Sections 1 and 2 above); and, if the work is an executable linked
+    with the Library, with the complete machine-readable "work that
+    uses the Library", as object code and/or source code, so that the
+    user can modify the Library and then relink to produce a modified
+    executable containing the modified Library.  (It is understood
+    that the user who changes the contents of definitions files in the
+    Library will not necessarily be able to recompile the application
+    to use the modified definitions.)
+
+    b) Accompany the work with a written offer, valid for at
+    least three years, to give the same user the materials
+    specified in Subsection 6a, above, for a charge no more
+    than the cost of performing this distribution.
+
+    c) If distribution of the work is made by offering access to copy
+    from a designated place, offer equivalent access to copy the above
+    specified materials from the same place.
+
+    d) Verify that the user has already received a copy of these
+    materials or that you have already sent this user a copy.
+
+  For an executable, the required form of the "work that uses the
+Library" must include any data and utility programs needed for
+reproducing the executable from it.  However, as a special exception,
+the source code distributed need not include anything that is normally
+distributed (in either source or binary form) with the major
+components (compiler, kernel, and so on) of the operating system on
+which the executable runs, unless that component itself accompanies
+the executable.
+
+  It may happen that this requirement contradicts the license
+restrictions of other proprietary libraries that do not normally
+accompany the operating system.  Such a contradiction means you cannot
+use both them and the Library together in an executable that you
+distribute.
+.
+  7. You may place library facilities that are a work based on the
+Library side-by-side in a single library together with other library
+facilities not covered by this License, and distribute such a combined
+library, provided that the separate distribution of the work based on
+the Library and of the other library facilities is otherwise
+permitted, and provided that you do these two things:
+
+    a) Accompany the combined library with a copy of the same work
+    based on the Library, uncombined with any other library
+    facilities.  This must be distributed under the terms of the
+    Sections above.
+
+    b) Give prominent notice with the combined library of the fact
+    that part of it is a work based on the Library, and explaining
+    where to find the accompanying uncombined form of the same work.
+
+  8. You may not copy, modify, sublicense, link with, or distribute
+the Library except as expressly provided under this License.  Any
+attempt otherwise to copy, modify, sublicense, link with, or
+distribute the Library is void, and will automatically terminate your
+rights under this License.  However, parties who have received copies,
+or rights, from you under this License will not have their licenses
+terminated so long as such parties remain in full compliance.
+
+  9. You are not required to accept this License, since you have not
+signed it.  However, nothing else grants you permission to modify or
+distribute the Library or its derivative works.  These actions are
+prohibited by law if you do not accept this License.  Therefore, by
+modifying or distributing the Library (or any work based on the
+Library), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Library or works based on it.
+
+  10. Each time you redistribute the Library (or any work based on the
+Library), the recipient automatically receives a license from the
+original licensor to copy, distribute, link with or modify the Library
+subject to these terms and conditions.  You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+.
+  11. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License.  If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Library at all.  For example, if a patent
+license would not permit royalty-free redistribution of the Library by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Library.
+
+If any portion of this section is held invalid or unenforceable under any
+particular circumstance, the balance of the section is intended to apply,
+and the section as a whole is intended to apply in other circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system which is
+implemented by public license practices.  Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+  12. If the distribution and/or use of the Library is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Library under this License may add
+an explicit geographical distribution limitation excluding those countries,
+so that distribution is permitted only in or among countries not thus
+excluded.  In such case, this License incorporates the limitation as if
+written in the body of this License.
+
+  13. The Free Software Foundation may publish revised and/or new
+versions of the Library General Public License from time to time.
+Such new versions will be similar in spirit to the present version,
+but may differ in detail to address new problems or concerns.
+
+Each version is given a distinguishing version number.  If the Library
+specifies a version number of this License which applies to it and
+"any later version", you have the option of following the terms and
+conditions either of that version or of any later version published by
+the Free Software Foundation.  If the Library does not specify a
+license version number, you may choose any version ever published by
+the Free Software Foundation.
+.
+  14. If you wish to incorporate parts of the Library into other free
+programs whose distribution conditions are incompatible with these,
+write to the author to ask for permission.  For software which is
+copyrighted by the Free Software Foundation, write to the Free
+Software Foundation; we sometimes make exceptions for this.  Our
+decision will be guided by the two goals of preserving the free status
+of all derivatives of our free software and of promoting the sharing
+and reuse of software generally.
+
+			    NO WARRANTY
+
+  15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO
+WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW.
+EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR
+OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY
+KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE
+IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+PURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE
+LIBRARY IS WITH YOU.  SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME
+THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
+
+  16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN
+WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY
+AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU
+FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR
+CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE
+LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING
+RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A
+FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF
+SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES.
+
+		     END OF TERMS AND CONDITIONS
Binary file lib/runtime/iText-2.1.7.jar has changed
Binary file lib/runtime/itext-pdfa-5.5.0.jar has changed
Binary file lib/runtime/itextpdf-5.5.0.jar has changed
Binary file lib/runtime/jackson-annotations-2.1.4.jar has changed
Binary file lib/runtime/jackson-core-2.1.4.jar has changed
Binary file lib/runtime/jackson-databind-2.1.4.jar has changed
Binary file lib/runtime/jasperreports-4.0.1.jar has changed
Binary file lib/runtime/jasperreports-6.0.0.jar has changed
Binary file lib/runtime/jasperreports-fonts-4.0.1.jar has changed
Binary file lib/runtime/jasperreports-fonts-6.0.0.jar has changed
Binary file lib/runtime/poi-3.10.1.jar has changed
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/AlertsForWrongOrdersData.class has changed
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_GEN_PAYMENTSCHEDULE_INV.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -95,6 +95,10 @@
 cur_update_scheddetails RECORD;
 cur_invoicepaid RECORD;
 
+v_paymentamt NUMBER:=0;
+v_depositamt NUMBER:=0;
+v_transactiontype VARCHAR2(32);
+
 BEGIN
 
   FOR Cur_Params IN (
@@ -900,7 +904,7 @@
                   END IF;
                 END IF;
                 
-                  IF (cur_finaccpaymentmethod.ExecutionType<>'A') THEN
+                IF (cur_finaccpaymentmethod.ExecutionType<>'A') THEN
                   UPDATE FIN_PAYMENT_SCHEDULE
                   SET PAIDAMT = (SELECT COALESCE(sum(amount + COALESCE(writeoffamt, 0)), 0)
                                  FROM fin_payment_scheduledetail
@@ -915,13 +919,7 @@
                       OUTSTANDINGAMT = (SELECT COALESCE(sum(amount), 0)
                                         FROM fin_payment_scheduledetail
                                         WHERE fin_payment_schedule_order=cur_PaymentScheduleOrder.FIN_PAYMENT_SCHEDULE_ORDER AND
-                                              (fin_payment_detail_id is null OR
-                                       exists (SELECT 1
-                                               FROM fin_payment, fin_payment_detail
-                                               WHERE fin_payment.fin_payment_id = fin_payment_detail.fin_payment_id
-                                                      and fin_payment.processed='Y' 
-                                                      and fin_payment_scheduledetail.isinvoicepaid='Y'
-                                                      and fin_payment_detail.fin_payment_detail_id = fin_payment_scheduledetail.fin_payment_detail_id)))
+                                        (fin_payment_detail_id is null OR isinvoicepaid='N'))
 
                   WHERE FIN_PAYMENT_SCHEDULE_ID = cur_PaymentScheduleOrder.FIN_PAYMENT_SCHEDULE_ORDER;
                 END IF;
@@ -932,16 +930,15 @@
               UPDATE FIN_PAYMENT SET DESCRIPTION = v_finpayment_desc
                 WHERE FIN_PAYMENT_ID = v_FIN_PAYMENT_ID;
 
-              FOR cur_invoicepaid IN (
-                select isinvoicepaid from fin_payment_scheduledetail fpsd
-               left join fin_payment_detail fpd on fpsd.fin_payment_detail_id=fpd.fin_payment_detail_id
-               left join fin_payment fp on fpd.fin_payment_id=fp.fin_payment_id
-               left join fin_payment_schedule ps ON ps.fin_payment_schedule_id = fpsd.fin_payment_schedule_invoice
-                 WHERE ps.c_invoice_id =p_record_id
-              )
-             LOOP
+	      SELECT count(*) INTO v_count
+	      FROM fin_payment_schedule fps
+	      WHERE exists(select 1
+			   from fin_payment_scheduledetail fpsd
+		           where fps.fin_payment_schedule_id = fpsd.fin_payment_schedule_invoice
+		           and fpsd.isinvoicepaid='N')
+              AND FIN_PAYMENT_SCHEDULE_ID = cur_paymentschedule.FIN_PAYMENT_SCHEDULE_ID;
 
-              IF ((cur_finaccpaymentmethod.ExecutionType<>'A') AND (cur_invoicepaid.isinvoicepaid='Y')) THEN 
+              IF (cur_finaccpaymentmethod.ExecutionType<>'A' AND v_count = 0) THEN
                 UPDATE FIN_PAYMENT_SCHEDULE
                 SET PAIDAMT = PAIDAMT + COALESCE(cur_paymentschedule.OUTSTANDINGAMT,0),
                     OUTSTANDINGAMT = OUTSTANDINGAMT - COALESCE(cur_paymentschedule.OUTSTANDINGAMT, 0)
@@ -990,13 +987,26 @@
                 SET SO_CREDITUSED = COALESCE(SO_CREDITUSED,0) - v_ConvertedAmount
                 WHERE C_BPARTNER_ID = v_BPartner_ID;
               END IF;
-            END LOOP;
               -- Automatic creation of financial transaction
               IF(cur_finaccpaymentmethod.CreateFinTransaction = 'Y' AND cur_finaccpaymentmethod.ExecutionType = 'M') THEN
                 v_ResultStr:='Generating FIN_FINACC_TRANSACTION';
                 v_FIN_FINACC_TRANSACTION_ID := GET_UUID();
                 SELECT COALESCE(MAX(LINE),0) INTO v_Line FROM FIN_FINACC_TRANSACTION WHERE FIN_FINANCIAL_ACCOUNT_ID = v_Financial_Account_ID;
-                --check the currency of the invoice and the currency of the financial account
+		IF (v_IsSOTrx='Y') THEN
+		 IF (cur_paymentschedule.OUTSTANDINGAMT>0) THEN v_depositamt:=cur_paymentschedule.OUTSTANDINGAMT; 
+		 ELSE v_paymentamt:=abs(cur_paymentschedule.OUTSTANDINGAMT); 
+		 END IF;				
+		ELSE
+		 IF (cur_paymentschedule.OUTSTANDINGAMT<0) THEN v_depositamt:=abs(cur_paymentschedule.OUTSTANDINGAMT); 
+		 ELSE  v_paymentamt:=cur_paymentschedule.OUTSTANDINGAMT; END IF;			
+		END IF;
+
+		IF (v_paymentamt> 0) THEN
+		 v_transactiontype:='BPW';
+		ELSE
+		 v_transactiontype:='BPD';
+		END IF;                 
+               --check the currency of the invoice and the currency of the financial account
                 select c_currency_id into v_finacct_currency from FIN_Financial_Account where FIN_Financial_Account_id =v_Financial_Account_ID;
                 IF (v_finacct_currency<>cur_paymentschedule.C_CURRENCY_ID AND cur_finaccpaymentmethod.multicurrency='Y') THEN
                   v_rate := C_CURRENCY_RATE(cur_paymentschedule.C_CURRENCY_ID, v_finacct_currency, cur_paymentschedule.DUEDATE, NULL, v_client_id, cur_paymentschedule.AD_ORG_ID );
@@ -1010,9 +1020,9 @@
                     fin_reconciliation_id, foreign_currency_id, foreign_convert_rate, foreign_amount, c_bpartner_id)
                   VALUES (v_FIN_FINACC_TRANSACTION_ID, v_client_id, cur_paymentschedule.AD_ORG_ID, now(), p_user,
                     now(), p_user, 'Y', v_finacct_currency, v_Financial_Account_ID,
-                    v_Line, v_FIN_PAYMENT_ID, cur_paymentschedule.DUEDATE, NULL, CASE WHEN v_IsSOTrx='Y' THEN 'RDNC' ELSE 'PWNC' END, CASE WHEN v_IsSOTrx='N' THEN ROUND(cur_paymentschedule.OUTSTANDINGAMT*v_rate, v_PricePr) ELSE 0 END,
-                    CASE WHEN v_IsSOTrx='Y' THEN ROUND(cur_paymentschedule.OUTSTANDINGAMT*v_rate, v_PricePr) ELSE 0 END, 'Y', 'N', 'N', v_project_id, v_campaign_id, v_costcenter,
-                    v_activity_id, v_user1, v_user2, CASE WHEN v_IsSOTrx='N' THEN 'BPW' ELSE 'BPD' END, cur_paymentschedule.DUEDATE, 'Invoice No.: ' || v_documentno,
+                    v_Line, v_FIN_PAYMENT_ID, cur_paymentschedule.DUEDATE, NULL, CASE WHEN v_IsSOTrx='Y' THEN 'RDNC' ELSE 'PWNC' END, ROUND(v_paymentamt*v_rate, v_PricePr) , ROUND(v_depositamt*v_rate, v_PricePr) ,
+                   'Y', 'N', 'N', v_project_id, v_campaign_id, v_costcenter,
+                    v_activity_id, v_user1, v_user2, v_transactiontype , cur_paymentschedule.DUEDATE, 'Invoice No.: ' || v_documentno,
                     NULL, cur_paymentschedule.C_CURRENCY_ID, v_rate , CASE WHEN v_IsSOTrx='N' THEN cur_paymentschedule.OUTSTANDINGAMT ELSE cur_paymentschedule.OUTSTANDINGAMT END, v_BPartner_ID);
                 ELSE
                   INSERT INTO fin_finacc_transaction(
@@ -1024,9 +1034,9 @@
                     fin_reconciliation_id, c_bpartner_id)
                   VALUES (v_FIN_FINACC_TRANSACTION_ID, v_client_id, cur_paymentschedule.AD_ORG_ID, now(), p_user,
                     now(), p_user, 'Y', cur_paymentschedule.C_CURRENCY_ID, v_Financial_Account_ID,
-                    v_Line, v_FIN_PAYMENT_ID, cur_paymentschedule.DUEDATE, NULL, CASE WHEN v_IsSOTrx='Y' THEN 'RDNC' ELSE 'PWNC' END, CASE WHEN v_IsSOTrx='N' THEN cur_paymentschedule.OUTSTANDINGAMT ELSE 0 END,
-                    CASE WHEN v_IsSOTrx='Y' THEN cur_paymentschedule.OUTSTANDINGAMT ELSE 0 END, 'Y', 'N', 'N', v_project_id, v_campaign_id, v_costcenter,
-                    v_activity_id, v_user1, v_user2, CASE WHEN v_IsSOTrx='N' THEN 'BPW' ELSE 'BPD' END, cur_paymentschedule.DUEDATE, 'Invoice No.: ' || v_documentno,
+                    v_Line, v_FIN_PAYMENT_ID, cur_paymentschedule.DUEDATE, NULL, CASE WHEN v_IsSOTrx='Y' THEN 'RDNC' ELSE 'PWNC' END,v_paymentamt, v_depositamt,
+                    'Y', 'N', 'N', v_project_id, v_campaign_id, v_costcenter,
+                    v_activity_id, v_user1, v_user2, v_transactiontype , cur_paymentschedule.DUEDATE, 'Invoice No.: ' || v_documentno,
                     NULL, v_BPartner_ID);
                 END IF;
                 
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_ISPAYMENTCONFIRMED.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -19,7 +19,7 @@
 * under the License.
 * The Original Code is Openbravo ERP.
 * The Initial Developer of the Original Code is Openbravo SLU
-* All portions are Copyright (C) 2011-2014 Openbravo SLU
+* All portions are Copyright (C) 2011-2015 Openbravo SLU
 * All Rights Reserved.
 * Contributor(s):  ______________________________________.
 ************************************************************************/
@@ -33,6 +33,7 @@
   TYPE RECORD IS REF CURSOR;
   Cur_Dbprefix RECORD;
   v_invoicepaidstatus  VARCHAR2(32);
+  v_fin_payment_schedule_order VARCHAR(32);
   v_fin_payment_schedule_invoice VARCHAR(32);
   v_p_fin_psd_id VARCHAR(32);
 BEGIN
@@ -52,13 +53,13 @@
   END IF;
   
   IF (v_p_fin_psd_id is not null ) THEN
-  select isinvoicepaid , fin_payment_schedule_invoice
-  into v_isinvoicepaid , v_fin_payment_schedule_invoice
+  select isinvoicepaid, fin_payment_schedule_order, fin_payment_schedule_invoice
+  into v_isinvoicepaid, v_fin_payment_schedule_order, v_fin_payment_schedule_invoice
   from fin_payment_scheduledetail
   where fin_payment_scheduledetail_id=v_p_fin_psd_id;
   END IF;
 
-  IF (v_fin_payment_schedule_invoice is not null)THEN
+  IF (v_fin_payment_schedule_order is not null OR v_fin_payment_schedule_invoice is not null) THEN
     IF(v_isinvoicepaid='Y')THEN
     -- core intermediate statuses
     v_isPaymentConfirmed := 'Y';
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/functions/APRM_SEQNOINVPAIDSTATUS.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,49 @@
+<?xml version="1.0"?>
+  <database name="FUNCTION APRM_SEQNOINVPAIDSTATUS">
+    <function name="APRM_SEQNOINVPAIDSTATUS" type="VARCHAR">
+      <parameter name="p_paymentmethod_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_financialaccount_id" type="VARCHAR" mode="in">
+        <default/>
+      </parameter>
+      <parameter name="p_isreceipt" type="CHAR" mode="in">
+        <default/>
+      </parameter>
+      <body><![CDATA[/*************************************************************************
+* The contents of this file are subject to the Openbravo  Public  License
+* Version  1.1  (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
+* 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 SLU
+* All portions are Copyright (C) 2015 Openbravo SLU
+* All Rights Reserved.
+* Contributor(s):  ______________________________________.
+************************************************************************/
+  v_invoicepaidstatus fin_finacc_paymentmethod.payin_invoicepaidstatus%TYPE;
+
+BEGIN
+
+  SELECT CASE p_isReceipt WHEN 'Y' THEN payin_invoicepaidstatus
+       ELSE payout_invoicepaidstatus END AS invoicepaidstatus
+  INTO v_invoicepaidstatus
+  FROM fin_finacc_paymentmethod
+  WHERE fin_financial_account_id = p_financialaccount_id
+  and fin_paymentmethod_id = p_paymentmethod_id;
+
+  RETURN aprm_seqnumberpaymentstatus(v_invoicepaidstatus);
+
+EXCEPTION
+WHEN OTHERS THEN
+  DBMS_OUTPUT.PUT_LINE('aprm_seqnumberinvoicepaidstatus exception');
+  RAISE;
+END APRM_SEQNOINVPAIDSTATUS
+]]></body>
+    </function>
+  </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/model/modifiedTables/FIN_FINANCIAL_ACCOUNT.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -29,5 +29,9 @@
         <default/>
         <onCreateDefault/>
       </column>
+      <column name="EM_APRM_ADDMULTIPLEPAYMENTS" primaryKey="false" required="false" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
     </table>
   </database>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_COLUMN.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -407,7 +407,7 @@
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--0F5C7245380C4C96841D3452F3C1FE47-->  <POSITION><![CDATA[41]]></POSITION>
+<!--0F5C7245380C4C96841D3452F3C1FE47-->  <POSITION><![CDATA[40]]></POSITION>
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--0F5C7245380C4C96841D3452F3C1FE47-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -1830,7 +1830,7 @@
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--394FD1143C904A8C9E6A2AD42085CB9B-->  <POSITION><![CDATA[43]]></POSITION>
+<!--394FD1143C904A8C9E6A2AD42085CB9B-->  <POSITION><![CDATA[41]]></POSITION>
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--394FD1143C904A8C9E6A2AD42085CB9B-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -6909,7 +6909,7 @@
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--9DC8500B414640E09BF61A3D14FE13D1-->  <POSITION><![CDATA[40]]></POSITION>
+<!--9DC8500B414640E09BF61A3D14FE13D1-->  <POSITION><![CDATA[39]]></POSITION>
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--9DC8500B414640E09BF61A3D14FE13D1-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -7082,7 +7082,7 @@
 <!--A028C07508878CB9E040007F01007210-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A028C07508878CB9E040007F01007210-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A028C07508878CB9E040007F01007210-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A028C07508878CB9E040007F01007210-->  <POSITION><![CDATA[36]]></POSITION>
+<!--A028C07508878CB9E040007F01007210-->  <POSITION><![CDATA[35]]></POSITION>
 <!--A028C07508878CB9E040007F01007210-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A028C07508878CB9E040007F01007210-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A028C07508878CB9E040007F01007210-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -7115,7 +7115,7 @@
 <!--A04179EAC69DF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69DF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69DF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69DF848E040007F01004523-->  <POSITION><![CDATA[37]]></POSITION>
+<!--A04179EAC69DF848E040007F01004523-->  <POSITION><![CDATA[36]]></POSITION>
 <!--A04179EAC69DF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69DF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69DF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -7150,7 +7150,7 @@
 <!--A04179EAC69EF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69EF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69EF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69EF848E040007F01004523-->  <POSITION><![CDATA[38]]></POSITION>
+<!--A04179EAC69EF848E040007F01004523-->  <POSITION><![CDATA[37]]></POSITION>
 <!--A04179EAC69EF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69EF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69EF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -7186,7 +7186,7 @@
 <!--A04179EAC69FF848E040007F01004523-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
 <!--A04179EAC69FF848E040007F01004523-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
 <!--A04179EAC69FF848E040007F01004523-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--A04179EAC69FF848E040007F01004523-->  <POSITION><![CDATA[39]]></POSITION>
+<!--A04179EAC69FF848E040007F01004523-->  <POSITION><![CDATA[38]]></POSITION>
 <!--A04179EAC69FF848E040007F01004523-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
 <!--A04179EAC69FF848E040007F01004523-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
 <!--A04179EAC69FF848E040007F01004523-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
@@ -10127,6 +10127,43 @@
 <!--CBAF582C3F674FEEB1D38C2A10E03E2F-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
 <!--CBAF582C3F674FEEB1D38C2A10E03E2F--></AD_COLUMN>
 
+<!--CD644D952B4945158005088D474CC529--><AD_COLUMN>
+<!--CD644D952B4945158005088D474CC529-->  <AD_COLUMN_ID><![CDATA[CD644D952B4945158005088D474CC529]]></AD_COLUMN_ID>
+<!--CD644D952B4945158005088D474CC529-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--CD644D952B4945158005088D474CC529-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--CD644D952B4945158005088D474CC529-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--CD644D952B4945158005088D474CC529-->  <NAME><![CDATA[EM_Aprm_AddMultiplePayments]]></NAME>
+<!--CD644D952B4945158005088D474CC529-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--CD644D952B4945158005088D474CC529-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--CD644D952B4945158005088D474CC529-->  <COLUMNNAME><![CDATA[EM_Aprm_AddMultiplePayments]]></COLUMNNAME>
+<!--CD644D952B4945158005088D474CC529-->  <AD_TABLE_ID><![CDATA[B129E53BC0E747879F7BA17F0AECEC32]]></AD_TABLE_ID>
+<!--CD644D952B4945158005088D474CC529-->  <AD_REFERENCE_ID><![CDATA[28]]></AD_REFERENCE_ID>
+<!--CD644D952B4945158005088D474CC529-->  <FIELDLENGTH><![CDATA[1]]></FIELDLENGTH>
+<!--CD644D952B4945158005088D474CC529-->  <DEFAULTVALUE><![CDATA[N]]></DEFAULTVALUE>
+<!--CD644D952B4945158005088D474CC529-->  <ISKEY><![CDATA[N]]></ISKEY>
+<!--CD644D952B4945158005088D474CC529-->  <ISPARENT><![CDATA[N]]></ISPARENT>
+<!--CD644D952B4945158005088D474CC529-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--CD644D952B4945158005088D474CC529-->  <ISUPDATEABLE><![CDATA[Y]]></ISUPDATEABLE>
+<!--CD644D952B4945158005088D474CC529-->  <ISIDENTIFIER><![CDATA[N]]></ISIDENTIFIER>
+<!--CD644D952B4945158005088D474CC529-->  <SEQNO><![CDATA[500]]></SEQNO>
+<!--CD644D952B4945158005088D474CC529-->  <ISTRANSLATED><![CDATA[N]]></ISTRANSLATED>
+<!--CD644D952B4945158005088D474CC529-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--CD644D952B4945158005088D474CC529-->  <ISSELECTIONCOLUMN><![CDATA[N]]></ISSELECTIONCOLUMN>
+<!--CD644D952B4945158005088D474CC529-->  <AD_ELEMENT_ID><![CDATA[FC01C8BFAB68409497398AB4C6D923F1]]></AD_ELEMENT_ID>
+<!--CD644D952B4945158005088D474CC529-->  <ISSESSIONATTR><![CDATA[N]]></ISSESSIONATTR>
+<!--CD644D952B4945158005088D474CC529-->  <ISSECONDARYKEY><![CDATA[N]]></ISSECONDARYKEY>
+<!--CD644D952B4945158005088D474CC529-->  <ISDESENCRYPTABLE><![CDATA[N]]></ISDESENCRYPTABLE>
+<!--CD644D952B4945158005088D474CC529-->  <DEVELOPMENTSTATUS><![CDATA[RE]]></DEVELOPMENTSTATUS>
+<!--CD644D952B4945158005088D474CC529-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--CD644D952B4945158005088D474CC529-->  <POSITION><![CDATA[42]]></POSITION>
+<!--CD644D952B4945158005088D474CC529-->  <ISTRANSIENT><![CDATA[N]]></ISTRANSIENT>
+<!--CD644D952B4945158005088D474CC529-->  <ISAUTOSAVE><![CDATA[Y]]></ISAUTOSAVE>
+<!--CD644D952B4945158005088D474CC529-->  <VALIDATEONNEW><![CDATA[Y]]></VALIDATEONNEW>
+<!--CD644D952B4945158005088D474CC529-->  <IMAGESIZEVALUESACTION><![CDATA[N]]></IMAGESIZEVALUESACTION>
+<!--CD644D952B4945158005088D474CC529-->  <ISUSEDSEQUENCE><![CDATA[N]]></ISUSEDSEQUENCE>
+<!--CD644D952B4945158005088D474CC529-->  <EM_OBUIAPP_PROCESS_ID><![CDATA[4CE463C04CA0412CAC57EF58FE0F8498]]></EM_OBUIAPP_PROCESS_ID>
+<!--CD644D952B4945158005088D474CC529--></AD_COLUMN>
+
 <!--D06818A44BBB4E2CA7463CB4F03F8C04--><AD_COLUMN>
 <!--D06818A44BBB4E2CA7463CB4F03F8C04-->  <AD_COLUMN_ID><![CDATA[D06818A44BBB4E2CA7463CB4F03F8C04]]></AD_COLUMN_ID>
 <!--D06818A44BBB4E2CA7463CB4F03F8C04-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_ELEMENT.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -1502,6 +1502,18 @@
 <!--EDB9CF491555465382F828F48291A0C0-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--EDB9CF491555465382F828F48291A0C0--></AD_ELEMENT>
 
+<!--EF3508748A6A42C186F6709D68728306--><AD_ELEMENT>
+<!--EF3508748A6A42C186F6709D68728306-->  <AD_ELEMENT_ID><![CDATA[EF3508748A6A42C186F6709D68728306]]></AD_ELEMENT_ID>
+<!--EF3508748A6A42C186F6709D68728306-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--EF3508748A6A42C186F6709D68728306-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--EF3508748A6A42C186F6709D68728306-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--EF3508748A6A42C186F6709D68728306-->  <COLUMNNAME><![CDATA[actions]]></COLUMNNAME>
+<!--EF3508748A6A42C186F6709D68728306-->  <NAME><![CDATA[Actions]]></NAME>
+<!--EF3508748A6A42C186F6709D68728306-->  <PRINTNAME><![CDATA[Actions]]></PRINTNAME>
+<!--EF3508748A6A42C186F6709D68728306-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--EF3508748A6A42C186F6709D68728306-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--EF3508748A6A42C186F6709D68728306--></AD_ELEMENT>
+
 <!--F109FCAF8CC1462AB2A94F73F4E51EA7--><AD_ELEMENT>
 <!--F109FCAF8CC1462AB2A94F73F4E51EA7-->  <AD_ELEMENT_ID><![CDATA[F109FCAF8CC1462AB2A94F73F4E51EA7]]></AD_ELEMENT_ID>
 <!--F109FCAF8CC1462AB2A94F73F4E51EA7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1608,6 +1620,20 @@
 <!--F8CF71B37C84442EB5526AF3998BEBBF-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
 <!--F8CF71B37C84442EB5526AF3998BEBBF--></AD_ELEMENT>
 
+<!--FC01C8BFAB68409497398AB4C6D923F1--><AD_ELEMENT>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <AD_ELEMENT_ID><![CDATA[FC01C8BFAB68409497398AB4C6D923F1]]></AD_ELEMENT_ID>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <COLUMNNAME><![CDATA[EM_Aprm_AddMultiplePayments]]></COLUMNNAME>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <NAME><![CDATA[Add Multiple Payments]]></NAME>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <PRINTNAME><![CDATA[Add Multiple Payments]]></PRINTNAME>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--FC01C8BFAB68409497398AB4C6D923F1-->  <ISGLOSSARY><![CDATA[N]]></ISGLOSSARY>
+<!--FC01C8BFAB68409497398AB4C6D923F1--></AD_ELEMENT>
+
 <!--FC780C136EFA4D98B2435A9448FA44AD--><AD_ELEMENT>
 <!--FC780C136EFA4D98B2435A9448FA44AD-->  <AD_ELEMENT_ID><![CDATA[FC780C136EFA4D98B2435A9448FA44AD]]></AD_ELEMENT_ID>
 <!--FC780C136EFA4D98B2435A9448FA44AD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_FIELD.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -583,6 +583,34 @@
 <!--07EC2EF3577B4AAC84EBABCC8DA7C292-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--07EC2EF3577B4AAC84EBABCC8DA7C292--></AD_FIELD>
 
+<!--07FA7810A55745B8BCC4BC590253DA6A--><AD_FIELD>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_FIELD_ID><![CDATA[07FA7810A55745B8BCC4BC590253DA6A]]></AD_FIELD_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <NAME><![CDATA[Amount]]></NAME>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_COLUMN_ID><![CDATA[7891269C83DD655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <PROPERTY><![CDATA[amount]]></PROPERTY>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <SEQNO><![CDATA[60]]></SEQNO>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <GRID_SEQNO><![CDATA[60]]></GRID_SEQNO>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--07FA7810A55745B8BCC4BC590253DA6A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--07FA7810A55745B8BCC4BC590253DA6A--></AD_FIELD>
+
 <!--0820A1FC00504292BC9280D5CBA30BB5--><AD_FIELD>
 <!--0820A1FC00504292BC9280D5CBA30BB5-->  <AD_FIELD_ID><![CDATA[0820A1FC00504292BC9280D5CBA30BB5]]></AD_FIELD_ID>
 <!--0820A1FC00504292BC9280D5CBA30BB5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -3166,6 +3194,35 @@
 <!--2FF77BE337D74C23BE0AF89A815C2FD3-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--2FF77BE337D74C23BE0AF89A815C2FD3--></AD_FIELD>
 
+<!--30B197597EBD41FE98B013F412583A6F--><AD_FIELD>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_FIELD_ID><![CDATA[30B197597EBD41FE98B013F412583A6F]]></AD_FIELD_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--30B197597EBD41FE98B013F412583A6F-->  <NAME><![CDATA[Currency]]></NAME>
+<!--30B197597EBD41FE98B013F412583A6F-->  <DESCRIPTION><![CDATA[An accepted medium of monetary exchange that may vary across countries.]]></DESCRIPTION>
+<!--30B197597EBD41FE98B013F412583A6F-->  <HELP><![CDATA[Indicates the currency to be used when processing this document.]]></HELP>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_COLUMN_ID><![CDATA[7891269C83DC655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--30B197597EBD41FE98B013F412583A6F-->  <DISPLAYLENGTH><![CDATA[3]]></DISPLAYLENGTH>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--30B197597EBD41FE98B013F412583A6F-->  <SEQNO><![CDATA[70]]></SEQNO>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--30B197597EBD41FE98B013F412583A6F-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--30B197597EBD41FE98B013F412583A6F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--30B197597EBD41FE98B013F412583A6F-->  <GRID_SEQNO><![CDATA[70]]></GRID_SEQNO>
+<!--30B197597EBD41FE98B013F412583A6F-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--30B197597EBD41FE98B013F412583A6F-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--30B197597EBD41FE98B013F412583A6F-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--30B197597EBD41FE98B013F412583A6F-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--30B197597EBD41FE98B013F412583A6F--></AD_FIELD>
+
 <!--3146FC101A9E422E93BE575164E758D6--><AD_FIELD>
 <!--3146FC101A9E422E93BE575164E758D6-->  <AD_FIELD_ID><![CDATA[3146FC101A9E422E93BE575164E758D6]]></AD_FIELD_ID>
 <!--3146FC101A9E422E93BE575164E758D6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -7593,6 +7650,35 @@
 <!--6A187B6CB94548AAA3ABE7629099D1A1-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--6A187B6CB94548AAA3ABE7629099D1A1--></AD_FIELD>
 
+<!--6AACBA272E5347899B134AD4FEBADB9A--><AD_FIELD>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_FIELD_ID><![CDATA[6AACBA272E5347899B134AD4FEBADB9A]]></AD_FIELD_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <NAME><![CDATA[Add Multiple Payments]]></NAME>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_TAB_ID><![CDATA[2845D761A8394468BD3BA4710AA888D4]]></AD_TAB_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_COLUMN_ID><![CDATA[CD644D952B4945158005088D474CC529]]></AD_COLUMN_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <SEQNO><![CDATA[265]]></SEQNO>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <SHOWINRELATION><![CDATA[N]]></SHOWINRELATION>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <GRID_SEQNO><![CDATA[90]]></GRID_SEQNO>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--6AACBA272E5347899B134AD4FEBADB9A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--6AACBA272E5347899B134AD4FEBADB9A--></AD_FIELD>
+
 <!--6AC5E4662B404E019E4B610AFBCC309D--><AD_FIELD>
 <!--6AC5E4662B404E019E4B610AFBCC309D-->  <AD_FIELD_ID><![CDATA[6AC5E4662B404E019E4B610AFBCC309D]]></AD_FIELD_ID>
 <!--6AC5E4662B404E019E4B610AFBCC309D-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -8323,6 +8409,36 @@
 <!--76314390FC424317A60214DBD7DE8882-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--76314390FC424317A60214DBD7DE8882--></AD_FIELD>
 
+<!--7646717C13CA46B18B80E6F6D9CDE888--><AD_FIELD>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_FIELD_ID><![CDATA[7646717C13CA46B18B80E6F6D9CDE888]]></AD_FIELD_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <NAME><![CDATA[Financial Account]]></NAME>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <DESCRIPTION><![CDATA[Financial account used to deposit / withdrawal money such as bank accounts or petty cash]]></DESCRIPTION>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <HELP><![CDATA[Financial account used to deposit / withdrawal money such as bank accounts or petty cash]]></HELP>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_COLUMN_ID><![CDATA[03276FB53CC54CC1829E0AA6EC0F2EE6]]></AD_COLUMN_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <PROPERTY><![CDATA[account]]></PROPERTY>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <GRID_SEQNO><![CDATA[10]]></GRID_SEQNO>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7646717C13CA46B18B80E6F6D9CDE888-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--7646717C13CA46B18B80E6F6D9CDE888--></AD_FIELD>
+
 <!--7722431F4C9C4A9E9BAA150686682D57--><AD_FIELD>
 <!--7722431F4C9C4A9E9BAA150686682D57-->  <AD_FIELD_ID><![CDATA[7722431F4C9C4A9E9BAA150686682D57]]></AD_FIELD_ID>
 <!--7722431F4C9C4A9E9BAA150686682D57-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -12181,6 +12297,35 @@
 <!--8A0E2CF96C0E48D69B2652BB355AA6A6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--8A0E2CF96C0E48D69B2652BB355AA6A6--></AD_FIELD>
 
+<!--8AA33C2BAE2F447680A672A3B8C16837--><AD_FIELD>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_FIELD_ID><![CDATA[8AA33C2BAE2F447680A672A3B8C16837]]></AD_FIELD_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <NAME><![CDATA[Status]]></NAME>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <DESCRIPTION><![CDATA[A defined state or position of a payment.]]></DESCRIPTION>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <HELP><![CDATA[Current status of a debt/payment.]]></HELP>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_COLUMN_ID><![CDATA[7891269C83E2655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <DISPLAYLENGTH><![CDATA[15]]></DISPLAYLENGTH>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <SEQNO><![CDATA[90]]></SEQNO>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <GRID_SEQNO><![CDATA[90]]></GRID_SEQNO>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--8AA33C2BAE2F447680A672A3B8C16837-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--8AA33C2BAE2F447680A672A3B8C16837--></AD_FIELD>
+
 <!--8AFD30956A0E4A079AA0D80B41A0A494--><AD_FIELD>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_FIELD_ID><![CDATA[8AFD30956A0E4A079AA0D80B41A0A494]]></AD_FIELD_ID>
 <!--8AFD30956A0E4A079AA0D80B41A0A494-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -16663,6 +16808,36 @@
 <!--B2010E9A0AC95338E040A8C0280132CB-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--B2010E9A0AC95338E040A8C0280132CB--></AD_FIELD>
 
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A--><AD_FIELD>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_FIELD_ID><![CDATA[B283607F4D9A4EE6BF2FF2BB7ADCF36A]]></AD_FIELD_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <NAME><![CDATA[Document No.]]></NAME>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <DESCRIPTION><![CDATA[An often automatically generated identifier for all documents.]]></DESCRIPTION>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <HELP><![CDATA[The document number is usually automatically generated by the system and determined by the document type of the document. If the document is not saved, the preliminary number is displayed in "<>". If the document type of your document has no automatic document sequence defined, the field will be empty when creating a new document. This is for documents which usually have an external number (like vendor invoice).  If you leave the field empty, the system will generate a document number for you. The document sequence used for this fallback number is defined in the "Document Sequence" window with the name "DocumentNo_<TableName>", where TableName is the actual name of the table inside the database (e.g. C_Order).]]></HELP>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_COLUMN_ID><![CDATA[7891269C83E0655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <PROPERTY><![CDATA[documentNo]]></PROPERTY>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <GRID_SEQNO><![CDATA[30]]></GRID_SEQNO>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B283607F4D9A4EE6BF2FF2BB7ADCF36A--></AD_FIELD>
+
 <!--B29D7911F878431EA9434EA4FACBA023--><AD_FIELD>
 <!--B29D7911F878431EA9434EA4FACBA023-->  <AD_FIELD_ID><![CDATA[B29D7911F878431EA9434EA4FACBA023]]></AD_FIELD_ID>
 <!--B29D7911F878431EA9434EA4FACBA023-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -16723,6 +16898,35 @@
 <!--B2F1D76CA33240B69A4012D5CA370476-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--B2F1D76CA33240B69A4012D5CA370476--></AD_FIELD>
 
+<!--B3035C3662CF4A33B574693E8AB317C6--><AD_FIELD>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_FIELD_ID><![CDATA[B3035C3662CF4A33B574693E8AB317C6]]></AD_FIELD_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <NAME><![CDATA[Document Type]]></NAME>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <DESCRIPTION><![CDATA[A value defining what sequence and process setup are used to handle this document.]]></DESCRIPTION>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <HELP><![CDATA[The Document Type determines document sequence and processing rules]]></HELP>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_COLUMN_ID><![CDATA[8032E178607750D5E040007F01004282]]></AD_COLUMN_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <DISPLAYLENGTH><![CDATA[20]]></DISPLAYLENGTH>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <GRID_SEQNO><![CDATA[20]]></GRID_SEQNO>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--B3035C3662CF4A33B574693E8AB317C6-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--B3035C3662CF4A33B574693E8AB317C6--></AD_FIELD>
+
 <!--B30DFFA1BDD8442DA159BC24117DA96C--><AD_FIELD>
 <!--B30DFFA1BDD8442DA159BC24117DA96C-->  <AD_FIELD_ID><![CDATA[B30DFFA1BDD8442DA159BC24117DA96C]]></AD_FIELD_ID>
 <!--B30DFFA1BDD8442DA159BC24117DA96C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -17598,6 +17802,35 @@
 <!--BB0C947FC413441D98D676868EC89D94-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--BB0C947FC413441D98D676868EC89D94--></AD_FIELD>
 
+<!--BB3881C8631049FDB8BCB0176C2D8D21--><AD_FIELD>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_FIELD_ID><![CDATA[BB3881C8631049FDB8BCB0176C2D8D21]]></AD_FIELD_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <NAME><![CDATA[Received (Financial Account)]]></NAME>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <DESCRIPTION><![CDATA[Amount received in currency of financial account]]></DESCRIPTION>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <HELP><![CDATA[The total amount of the payment, converted to the currency of the financial account.]]></HELP>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_COLUMN_ID><![CDATA[4028C9BC2DA5C491012DA689D11F03BD]]></AD_COLUMN_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <SEQNO><![CDATA[80]]></SEQNO>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <GRID_SEQNO><![CDATA[80]]></GRID_SEQNO>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--BB3881C8631049FDB8BCB0176C2D8D21-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--BB3881C8631049FDB8BCB0176C2D8D21--></AD_FIELD>
+
 <!--BB7E2DFBDCF94FBCA31B53E736CF9D57--><AD_FIELD>
 <!--BB7E2DFBDCF94FBCA31B53E736CF9D57-->  <AD_FIELD_ID><![CDATA[BB7E2DFBDCF94FBCA31B53E736CF9D57]]></AD_FIELD_ID>
 <!--BB7E2DFBDCF94FBCA31B53E736CF9D57-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -19569,6 +19802,33 @@
 <!--D75020C6BCC34E84ACDB10F8C95983AF-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--D75020C6BCC34E84ACDB10F8C95983AF--></AD_FIELD>
 
+<!--D82958A43B8D4FC18F9C24467ED00115--><AD_FIELD>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_FIELD_ID><![CDATA[D82958A43B8D4FC18F9C24467ED00115]]></AD_FIELD_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <NAME><![CDATA[Payment Date]]></NAME>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_COLUMN_ID><![CDATA[7891269C83DB655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <DISPLAYLENGTH><![CDATA[9]]></DISPLAYLENGTH>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <SEQNO><![CDATA[40]]></SEQNO>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <GRID_SEQNO><![CDATA[40]]></GRID_SEQNO>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--D82958A43B8D4FC18F9C24467ED00115-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--D82958A43B8D4FC18F9C24467ED00115--></AD_FIELD>
+
 <!--D8A3451B12AC4E0C964D9F53D9699449--><AD_FIELD>
 <!--D8A3451B12AC4E0C964D9F53D9699449-->  <AD_FIELD_ID><![CDATA[D8A3451B12AC4E0C964D9F53D9699449]]></AD_FIELD_ID>
 <!--D8A3451B12AC4E0C964D9F53D9699449-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -21808,6 +22068,35 @@
 <!--F9616FD8600E4650A96A241C1901ECFA-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--F9616FD8600E4650A96A241C1901ECFA--></AD_FIELD>
 
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5--><AD_FIELD>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_FIELD_ID><![CDATA[F98BFF6DF6EA41CB96E0B3042E5181A5]]></AD_FIELD_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <NAME><![CDATA[Business Partner]]></NAME>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <DESCRIPTION><![CDATA[Anyone who takes part in daily business operations by acting as a customer, employee, etc.]]></DESCRIPTION>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <HELP><![CDATA[A Business Partner is anyone with whom you transact.  This can include a customer, vendor, employee or any combination of these.]]></HELP>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_COLUMN_ID><![CDATA[7891269C83D9655DE040007F010155CE]]></AD_COLUMN_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <IGNOREINWAD><![CDATA[N]]></IGNOREINWAD>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISDISPLAYED><![CDATA[Y]]></ISDISPLAYED>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <DISPLAYLENGTH><![CDATA[0]]></DISPLAYLENGTH>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISREADONLY><![CDATA[Y]]></ISREADONLY>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <SEQNO><![CDATA[50]]></SEQNO>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISSAMELINE><![CDATA[N]]></ISSAMELINE>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISFIELDONLY><![CDATA[N]]></ISFIELDONLY>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISENCRYPTED><![CDATA[N]]></ISENCRYPTED>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <SHOWINRELATION><![CDATA[Y]]></SHOWINRELATION>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISFIRSTFOCUSEDFIELD><![CDATA[N]]></ISFIRSTFOCUSEDFIELD>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <GRID_SEQNO><![CDATA[50]]></GRID_SEQNO>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5-->  <EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
+<!--F98BFF6DF6EA41CB96E0B3042E5181A5--></AD_FIELD>
+
 <!--F9AE3E6335AF43F0B179C808694CFE90--><AD_FIELD>
 <!--F9AE3E6335AF43F0B179C808694CFE90-->  <AD_FIELD_ID><![CDATA[F9AE3E6335AF43F0B179C808694CFE90]]></AD_FIELD_ID>
 <!--F9AE3E6335AF43F0B179C808694CFE90-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MESSAGE.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -769,6 +769,18 @@
 <!--8444D07DF4214ED793366B83F5BDD042-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--8444D07DF4214ED793366B83F5BDD042--></AD_MESSAGE>
 
+<!--84E37050C028475886A8988DB250D0EB--><AD_MESSAGE>
+<!--84E37050C028475886A8988DB250D0EB-->  <AD_MESSAGE_ID><![CDATA[84E37050C028475886A8988DB250D0EB]]></AD_MESSAGE_ID>
+<!--84E37050C028475886A8988DB250D0EB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--84E37050C028475886A8988DB250D0EB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--84E37050C028475886A8988DB250D0EB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--84E37050C028475886A8988DB250D0EB-->  <VALUE><![CDATA[APRM_MULTIPLE_TRANSACTIONS_ADDED]]></VALUE>
+<!--84E37050C028475886A8988DB250D0EB-->  <MSGTEXT><![CDATA[%d transaction(s) added to the Financial Account.]]></MSGTEXT>
+<!--84E37050C028475886A8988DB250D0EB-->  <MSGTYPE><![CDATA[S]]></MSGTYPE>
+<!--84E37050C028475886A8988DB250D0EB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--84E37050C028475886A8988DB250D0EB-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--84E37050C028475886A8988DB250D0EB--></AD_MESSAGE>
+
 <!--89C77284A85346C6923D858E3AB3D363--><AD_MESSAGE>
 <!--89C77284A85346C6923D858E3AB3D363-->  <AD_MESSAGE_ID><![CDATA[89C77284A85346C6923D858E3AB3D363]]></AD_MESSAGE_ID>
 <!--89C77284A85346C6923D858E3AB3D363-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -835,7 +847,7 @@
 <!--8FC3C9524EE54E518B679D58F709119D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--8FC3C9524EE54E518B679D58F709119D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8FC3C9524EE54E518B679D58F709119D-->  <VALUE><![CDATA[APRM_AlgorithmConfirm]]></VALUE>
-<!--8FC3C9524EE54E518B679D58F709119D-->  <MSGTEXT><![CDATA[Do you want the algorithm to be run against unmatched bank statement lines?]]></MSGTEXT>
+<!--8FC3C9524EE54E518B679D58F709119D-->  <MSGTEXT><![CDATA[Do you want the algorithm to be run against unmatched bank statement lines? This process may create transactions which will be saved in the system.]]></MSGTEXT>
 <!--8FC3C9524EE54E518B679D58F709119D-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
 <!--8FC3C9524EE54E518B679D58F709119D-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--8FC3C9524EE54E518B679D58F709119D-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
@@ -1267,7 +1279,7 @@
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <VALUE><![CDATA[APRM_GRID_PERSIST_MESSAGE]]></VALUE>
-<!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <MSGTEXT><![CDATA[All the changes you make in this grid will be immediately saved]]></MSGTEXT>
+<!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <MSGTEXT><![CDATA[All the changes done in this grid will be immediately saved.]]></MSGTEXT>
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--CE54F0E4ABA846C9BA9E5A91CF38BE09-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
@@ -1453,6 +1465,18 @@
 <!--F0BBB5C1155F46378B6FF74A8F561046-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--F0BBB5C1155F46378B6FF74A8F561046--></AD_MESSAGE>
 
+<!--F1570980691E4FB1983519F8F6A9CD31--><AD_MESSAGE>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <AD_MESSAGE_ID><![CDATA[F1570980691E4FB1983519F8F6A9CD31]]></AD_MESSAGE_ID>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <VALUE><![CDATA[APRM_NO_PAYMENTS_SELECTED]]></VALUE>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <MSGTEXT><![CDATA[One or more payments must be selected]]></MSGTEXT>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--F1570980691E4FB1983519F8F6A9CD31-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--F1570980691E4FB1983519F8F6A9CD31--></AD_MESSAGE>
+
 <!--F302E4040E1B45318BA270BDFA37179C--><AD_MESSAGE>
 <!--F302E4040E1B45318BA270BDFA37179C-->  <AD_MESSAGE_ID><![CDATA[F302E4040E1B45318BA270BDFA37179C]]></AD_MESSAGE_ID>
 <!--F302E4040E1B45318BA270BDFA37179C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1489,6 +1513,18 @@
 <!--F4500597D99243129F93A0769047CFCB-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
 <!--F4500597D99243129F93A0769047CFCB--></AD_MESSAGE>
 
+<!--F482DF98F6FF45728419D116A7726765--><AD_MESSAGE>
+<!--F482DF98F6FF45728419D116A7726765-->  <AD_MESSAGE_ID><![CDATA[F482DF98F6FF45728419D116A7726765]]></AD_MESSAGE_ID>
+<!--F482DF98F6FF45728419D116A7726765-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--F482DF98F6FF45728419D116A7726765-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--F482DF98F6FF45728419D116A7726765-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--F482DF98F6FF45728419D116A7726765-->  <VALUE><![CDATA[APRM_MORECREDITAMOUNT]]></VALUE>
+<!--F482DF98F6FF45728419D116A7726765-->  <MSGTEXT><![CDATA[Credit amount should not be greater than total amount]]></MSGTEXT>
+<!--F482DF98F6FF45728419D116A7726765-->  <MSGTYPE><![CDATA[E]]></MSGTYPE>
+<!--F482DF98F6FF45728419D116A7726765-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--F482DF98F6FF45728419D116A7726765-->  <ISINCLUDEINI18N><![CDATA[N]]></ISINCLUDEINI18N>
+<!--F482DF98F6FF45728419D116A7726765--></AD_MESSAGE>
+
 <!--F579E42461DC472AA4F21B14DD3D680B--><AD_MESSAGE>
 <!--F579E42461DC472AA4F21B14DD3D680B-->  <AD_MESSAGE_ID><![CDATA[F579E42461DC472AA4F21B14DD3D680B]]></AD_MESSAGE_ID>
 <!--F579E42461DC472AA4F21B14DD3D680B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -6,7 +6,7 @@
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <NAME><![CDATA[Advanced Payables and Receivables Mngmt]]></NAME>
-<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.26187]]></VERSION>
+<!--A918E3331C404B889D69AA9BFAFB23AC-->  <VERSION><![CDATA[3.0.27055]]></VERSION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <DESCRIPTION><![CDATA[Managing your finances with an ERP does not have to be difficult. Enjoy a radically improved user experience that combines the power of an enterprise grade financial application with the simplicity and ease of a web 2.0 personal accounting service.]]></DESCRIPTION>
 <!--A918E3331C404B889D69AA9BFAFB23AC-->  <HELP><![CDATA[Advanced Payables and Receivables Management simplifies and automates the business processes around the management of financial accounts, from the receipt and issue of payment, to the reconciliation of those events with bank statements.
 If you would like to help shape this module you are welcome to take part in the forum discussions or register feature requests or issues in the corresponding (Forum and Bug Tracking) sections in the Advanced Payables and Receivable project in the OB Forge.]]></HELP>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -7,7 +7,7 @@
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <AD_DEPENDENT_MODULE_ID><![CDATA[5EB4F15C80684ACA904756BDC12ADBE5]]></AD_DEPENDENT_MODULE_ID>
-<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.26187]]></STARTVERSION>
+<!--89326AE95DAD449D85DFAB2C5B1C6683-->  <STARTVERSION><![CDATA[2.1.27055]]></STARTVERSION>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDANT_MODULE_NAME><![CDATA[User Interface Selector]]></DEPENDANT_MODULE_NAME>
 <!--89326AE95DAD449D85DFAB2C5B1C6683-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
@@ -21,7 +21,7 @@
 <!--B97FC854C6DD41E692161585645A900F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--B97FC854C6DD41E692161585645A900F-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.26187]]></STARTVERSION>
+<!--B97FC854C6DD41E692161585645A900F-->  <STARTVERSION><![CDATA[3.0.27055]]></STARTVERSION>
 <!--B97FC854C6DD41E692161585645A900F-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDANT_MODULE_NAME><![CDATA[core]]></DEPENDANT_MODULE_NAME>
 <!--B97FC854C6DD41E692161585645A900F-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_PROCESS.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -19,6 +19,7 @@
 <!--017312F51139438A9665775E3B5392A1-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--017312F51139438A9665775E3B5392A1-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--017312F51139438A9665775E3B5392A1-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--017312F51139438A9665775E3B5392A1-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--017312F51139438A9665775E3B5392A1--></AD_PROCESS>
 
 <!--0BDC2164ED3E48539FCEF4D306F29EFD--><AD_PROCESS>
@@ -40,6 +41,7 @@
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--0BDC2164ED3E48539FCEF4D306F29EFD-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--0BDC2164ED3E48539FCEF4D306F29EFD--></AD_PROCESS>
 
 <!--12016E2EDE0245B5A36B84CBA144DBDF--><AD_PROCESS>
@@ -62,6 +64,7 @@
 <!--12016E2EDE0245B5A36B84CBA144DBDF-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--12016E2EDE0245B5A36B84CBA144DBDF-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--12016E2EDE0245B5A36B84CBA144DBDF-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--12016E2EDE0245B5A36B84CBA144DBDF-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--12016E2EDE0245B5A36B84CBA144DBDF--></AD_PROCESS>
 
 <!--15C8708DFC464C2D91286E59624FDD18--><AD_PROCESS>
@@ -85,6 +88,7 @@
 <!--15C8708DFC464C2D91286E59624FDD18-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--15C8708DFC464C2D91286E59624FDD18-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--15C8708DFC464C2D91286E59624FDD18-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--15C8708DFC464C2D91286E59624FDD18-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--15C8708DFC464C2D91286E59624FDD18--></AD_PROCESS>
 
 <!--19EEA22FCA464979B3ADAD3A967ADA52--><AD_PROCESS>
@@ -106,6 +110,7 @@
 <!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--19EEA22FCA464979B3ADAD3A967ADA52-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--19EEA22FCA464979B3ADAD3A967ADA52-->  <IS_EXPLICIT_ACCESS><![CDATA[Y]]></IS_EXPLICIT_ACCESS>
+<!--19EEA22FCA464979B3ADAD3A967ADA52-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--19EEA22FCA464979B3ADAD3A967ADA52--></AD_PROCESS>
 
 <!--29D17F515727436DBCE32BC6CA28382B--><AD_PROCESS>
@@ -127,6 +132,7 @@
 <!--29D17F515727436DBCE32BC6CA28382B-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--29D17F515727436DBCE32BC6CA28382B-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--29D17F515727436DBCE32BC6CA28382B-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--29D17F515727436DBCE32BC6CA28382B-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--29D17F515727436DBCE32BC6CA28382B--></AD_PROCESS>
 
 <!--2DDE7D3618034C38A4462B7F3456C28D--><AD_PROCESS>
@@ -148,6 +154,7 @@
 <!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--2DDE7D3618034C38A4462B7F3456C28D-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--2DDE7D3618034C38A4462B7F3456C28D-->  <IS_EXPLICIT_ACCESS><![CDATA[Y]]></IS_EXPLICIT_ACCESS>
+<!--2DDE7D3618034C38A4462B7F3456C28D-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--2DDE7D3618034C38A4462B7F3456C28D--></AD_PROCESS>
 
 <!--2EED9BC16DB34D2B80BA40A21564BECF--><AD_PROCESS>
@@ -171,6 +178,7 @@
 <!--2EED9BC16DB34D2B80BA40A21564BECF-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--2EED9BC16DB34D2B80BA40A21564BECF-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--2EED9BC16DB34D2B80BA40A21564BECF-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--2EED9BC16DB34D2B80BA40A21564BECF-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--2EED9BC16DB34D2B80BA40A21564BECF--></AD_PROCESS>
 
 <!--3C4A5FB206B74C3CA9FE20116FCA0464--><AD_PROCESS>
@@ -192,6 +200,7 @@
 <!--3C4A5FB206B74C3CA9FE20116FCA0464-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--3C4A5FB206B74C3CA9FE20116FCA0464-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--3C4A5FB206B74C3CA9FE20116FCA0464-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--3C4A5FB206B74C3CA9FE20116FCA0464-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--3C4A5FB206B74C3CA9FE20116FCA0464--></AD_PROCESS>
 
 <!--4A059E4F79294640AD37B1B718C56E5D--><AD_PROCESS>
@@ -215,6 +224,7 @@
 <!--4A059E4F79294640AD37B1B718C56E5D-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--4A059E4F79294640AD37B1B718C56E5D-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--4A059E4F79294640AD37B1B718C56E5D-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--4A059E4F79294640AD37B1B718C56E5D-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--4A059E4F79294640AD37B1B718C56E5D--></AD_PROCESS>
 
 <!--58A9261BACEF45DDA526F29D8557272D--><AD_PROCESS>
@@ -236,6 +246,7 @@
 <!--58A9261BACEF45DDA526F29D8557272D-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--58A9261BACEF45DDA526F29D8557272D-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--58A9261BACEF45DDA526F29D8557272D-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--58A9261BACEF45DDA526F29D8557272D-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--58A9261BACEF45DDA526F29D8557272D--></AD_PROCESS>
 
 <!--5BE14AA10165490A9ADEFB7532F7FA94--><AD_PROCESS>
@@ -257,6 +268,7 @@
 <!--5BE14AA10165490A9ADEFB7532F7FA94-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--5BE14AA10165490A9ADEFB7532F7FA94-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--5BE14AA10165490A9ADEFB7532F7FA94-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--5BE14AA10165490A9ADEFB7532F7FA94-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--5BE14AA10165490A9ADEFB7532F7FA94--></AD_PROCESS>
 
 <!--6255BE488882480599C81284B70CD9B3--><AD_PROCESS>
@@ -278,6 +290,7 @@
 <!--6255BE488882480599C81284B70CD9B3-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--6255BE488882480599C81284B70CD9B3-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--6255BE488882480599C81284B70CD9B3-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--6255BE488882480599C81284B70CD9B3-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--6255BE488882480599C81284B70CD9B3--></AD_PROCESS>
 
 <!--62E6270312534380B9A8BDF603CA8FBB--><AD_PROCESS>
@@ -300,6 +313,7 @@
 <!--62E6270312534380B9A8BDF603CA8FBB-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--62E6270312534380B9A8BDF603CA8FBB-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--62E6270312534380B9A8BDF603CA8FBB-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--62E6270312534380B9A8BDF603CA8FBB-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--62E6270312534380B9A8BDF603CA8FBB--></AD_PROCESS>
 
 <!--6BF16EFC772843AC9A17552AE0B26AB7--><AD_PROCESS>
@@ -321,6 +335,7 @@
 <!--6BF16EFC772843AC9A17552AE0B26AB7-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--6BF16EFC772843AC9A17552AE0B26AB7-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--6BF16EFC772843AC9A17552AE0B26AB7-->  <IS_EXPLICIT_ACCESS><![CDATA[Y]]></IS_EXPLICIT_ACCESS>
+<!--6BF16EFC772843AC9A17552AE0B26AB7-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--6BF16EFC772843AC9A17552AE0B26AB7--></AD_PROCESS>
 
 <!--7AC7BE9024E448A0BB863C159DA762F9--><AD_PROCESS>
@@ -343,6 +358,7 @@
 <!--7AC7BE9024E448A0BB863C159DA762F9-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--7AC7BE9024E448A0BB863C159DA762F9-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--7AC7BE9024E448A0BB863C159DA762F9-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--7AC7BE9024E448A0BB863C159DA762F9-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--7AC7BE9024E448A0BB863C159DA762F9--></AD_PROCESS>
 
 <!--AA64E3BA23F24D4F8E6B06970500FC70--><AD_PROCESS>
@@ -367,6 +383,7 @@
 <!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--AA64E3BA23F24D4F8E6B06970500FC70-->  <PREVENTCONCURRENT><![CDATA[Y]]></PREVENTCONCURRENT>
 <!--AA64E3BA23F24D4F8E6B06970500FC70-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--AA64E3BA23F24D4F8E6B06970500FC70-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--AA64E3BA23F24D4F8E6B06970500FC70--></AD_PROCESS>
 
 <!--B54318B49E984B9CB855AEFB1F474CD6--><AD_PROCESS>
@@ -389,6 +406,7 @@
 <!--B54318B49E984B9CB855AEFB1F474CD6-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--B54318B49E984B9CB855AEFB1F474CD6-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--B54318B49E984B9CB855AEFB1F474CD6-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--B54318B49E984B9CB855AEFB1F474CD6-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--B54318B49E984B9CB855AEFB1F474CD6--></AD_PROCESS>
 
 <!--BBA11D1A061346459AF6148920FE6629--><AD_PROCESS>
@@ -410,6 +428,7 @@
 <!--BBA11D1A061346459AF6148920FE6629-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--BBA11D1A061346459AF6148920FE6629-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--BBA11D1A061346459AF6148920FE6629-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--BBA11D1A061346459AF6148920FE6629-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--BBA11D1A061346459AF6148920FE6629--></AD_PROCESS>
 
 <!--C125EA7C85234D8B89FEA511FCCD2E9E--><AD_PROCESS>
@@ -431,6 +450,7 @@
 <!--C125EA7C85234D8B89FEA511FCCD2E9E-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--C125EA7C85234D8B89FEA511FCCD2E9E-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--C125EA7C85234D8B89FEA511FCCD2E9E-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--C125EA7C85234D8B89FEA511FCCD2E9E-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--C125EA7C85234D8B89FEA511FCCD2E9E--></AD_PROCESS>
 
 <!--D16966FBF9604A3D91A50DC83C6EA8E3--><AD_PROCESS>
@@ -453,6 +473,7 @@
 <!--D16966FBF9604A3D91A50DC83C6EA8E3-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--D16966FBF9604A3D91A50DC83C6EA8E3-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--D16966FBF9604A3D91A50DC83C6EA8E3-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--D16966FBF9604A3D91A50DC83C6EA8E3-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--D16966FBF9604A3D91A50DC83C6EA8E3--></AD_PROCESS>
 
 <!--D5B90B539C254B959045EDCA1DC99BDF--><AD_PROCESS>
@@ -476,6 +497,7 @@
 <!--D5B90B539C254B959045EDCA1DC99BDF-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--D5B90B539C254B959045EDCA1DC99BDF-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--D5B90B539C254B959045EDCA1DC99BDF-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--D5B90B539C254B959045EDCA1DC99BDF-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--D5B90B539C254B959045EDCA1DC99BDF--></AD_PROCESS>
 
 <!--DC23BB9234174E52879E4B21C8CD1F4B--><AD_PROCESS>
@@ -498,6 +520,7 @@
 <!--DC23BB9234174E52879E4B21C8CD1F4B-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--DC23BB9234174E52879E4B21C8CD1F4B-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--DC23BB9234174E52879E4B21C8CD1F4B-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--DC23BB9234174E52879E4B21C8CD1F4B-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--DC23BB9234174E52879E4B21C8CD1F4B--></AD_PROCESS>
 
 <!--DE1B382FDD2540199D223586F6E216D0--><AD_PROCESS>
@@ -521,6 +544,7 @@
 <!--DE1B382FDD2540199D223586F6E216D0-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--DE1B382FDD2540199D223586F6E216D0-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--DE1B382FDD2540199D223586F6E216D0-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--DE1B382FDD2540199D223586F6E216D0-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--DE1B382FDD2540199D223586F6E216D0--></AD_PROCESS>
 
 <!--E011F492B0814A74B63CD1F3B9FF0526--><AD_PROCESS>
@@ -542,6 +566,7 @@
 <!--E011F492B0814A74B63CD1F3B9FF0526-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--E011F492B0814A74B63CD1F3B9FF0526-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--E011F492B0814A74B63CD1F3B9FF0526-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--E011F492B0814A74B63CD1F3B9FF0526-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--E011F492B0814A74B63CD1F3B9FF0526--></AD_PROCESS>
 
 <!--E3E92E9F08214507958E6875E66F2F99--><AD_PROCESS>
@@ -564,6 +589,7 @@
 <!--E3E92E9F08214507958E6875E66F2F99-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--E3E92E9F08214507958E6875E66F2F99-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--E3E92E9F08214507958E6875E66F2F99-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--E3E92E9F08214507958E6875E66F2F99-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--E3E92E9F08214507958E6875E66F2F99--></AD_PROCESS>
 
 <!--E54287EE357C493EB127DC3BA1758751--><AD_PROCESS>
@@ -586,6 +612,7 @@
 <!--E54287EE357C493EB127DC3BA1758751-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--E54287EE357C493EB127DC3BA1758751-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--E54287EE357C493EB127DC3BA1758751-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--E54287EE357C493EB127DC3BA1758751-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--E54287EE357C493EB127DC3BA1758751--></AD_PROCESS>
 
 <!--EB3D56BDD37E4229B67DBAB9F9A9B167--><AD_PROCESS>
@@ -608,6 +635,7 @@
 <!--EB3D56BDD37E4229B67DBAB9F9A9B167-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--EB3D56BDD37E4229B67DBAB9F9A9B167-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--EB3D56BDD37E4229B67DBAB9F9A9B167-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--EB3D56BDD37E4229B67DBAB9F9A9B167-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--EB3D56BDD37E4229B67DBAB9F9A9B167--></AD_PROCESS>
 
 <!--F68F2890E96D4D85A1DEF0274D105BCE--><AD_PROCESS>
@@ -629,6 +657,7 @@
 <!--F68F2890E96D4D85A1DEF0274D105BCE-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--F68F2890E96D4D85A1DEF0274D105BCE-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--F68F2890E96D4D85A1DEF0274D105BCE-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--F68F2890E96D4D85A1DEF0274D105BCE-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--F68F2890E96D4D85A1DEF0274D105BCE--></AD_PROCESS>
 
 <!--FF8080812E2F8EAE012E2F94CF470014--><AD_PROCESS>
@@ -651,6 +680,7 @@
 <!--FF8080812E2F8EAE012E2F94CF470014-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--FF8080812E2F8EAE012E2F94CF470014-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--FF8080812E2F8EAE012E2F94CF470014-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--FF8080812E2F8EAE012E2F94CF470014-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--FF8080812E2F8EAE012E2F94CF470014--></AD_PROCESS>
 
 <!--FF8080812F348A97012F349DC24F0007--><AD_PROCESS>
@@ -672,6 +702,7 @@
 <!--FF8080812F348A97012F349DC24F0007-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--FF8080812F348A97012F349DC24F0007-->  <PREVENTCONCURRENT><![CDATA[N]]></PREVENTCONCURRENT>
 <!--FF8080812F348A97012F349DC24F0007-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--FF8080812F348A97012F349DC24F0007-->  <ISKILLABLE><![CDATA[N]]></ISKILLABLE>
 <!--FF8080812F348A97012F349DC24F0007--></AD_PROCESS>
 
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REFERENCE.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -156,6 +156,18 @@
 <!--414E5DD3A1304C7781FB856A6872F428-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--414E5DD3A1304C7781FB856A6872F428--></AD_REFERENCE>
 
+<!--488E4BF765294DD8A7A943BDED4BA6E6--><AD_REFERENCE>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <AD_REFERENCE_ID><![CDATA[488E4BF765294DD8A7A943BDED4BA6E6]]></AD_REFERENCE_ID>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <NAME><![CDATA[Business Partner selector without default expressions]]></NAME>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <PARENTREFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></PARENTREFERENCE_ID>
+<!--488E4BF765294DD8A7A943BDED4BA6E6-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--488E4BF765294DD8A7A943BDED4BA6E6--></AD_REFERENCE>
+
 <!--4BD88BC3C76C44F09F01AD56D3604D02--><AD_REFERENCE>
 <!--4BD88BC3C76C44F09F01AD56D3604D02-->  <AD_REFERENCE_ID><![CDATA[4BD88BC3C76C44F09F01AD56D3604D02]]></AD_REFERENCE_ID>
 <!--4BD88BC3C76C44F09F01AD56D3604D02-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -313,6 +325,32 @@
 <!--C1B4345A1F8841C2B1ADD403CA733D75-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
 <!--C1B4345A1F8841C2B1ADD403CA733D75--></AD_REFERENCE>
 
+<!--C20E5E22588E40E5B8CC6D80ED3015C5--><AD_REFERENCE>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <AD_REFERENCE_ID><![CDATA[C20E5E22588E40E5B8CC6D80ED3015C5]]></AD_REFERENCE_ID>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <NAME><![CDATA[Match Statement Actions]]></NAME>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <PARENTREFERENCE_ID><![CDATA[FF80818132F94B500132F9575619000A]]></PARENTREFERENCE_ID>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--C20E5E22588E40E5B8CC6D80ED3015C5--></AD_REFERENCE>
+
+<!--D9B6068A6D3E4B7487470E7D2F033A54--><AD_REFERENCE>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_REFERENCE_ID><![CDATA[D9B6068A6D3E4B7487470E7D2F033A54]]></AD_REFERENCE_ID>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <NAME><![CDATA[Add Multiple Payments P&E]]></NAME>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <ISBASEREFERENCE><![CDATA[N]]></ISBASEREFERENCE>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <PARENTREFERENCE_ID><![CDATA[FF80818132D8F0F30132D9BC395D0038]]></PARENTREFERENCE_ID>
+<!--D9B6068A6D3E4B7487470E7D2F033A54-->  <ISVALUEDISPLAYED><![CDATA[N]]></ISVALUEDISPLAYED>
+<!--D9B6068A6D3E4B7487470E7D2F033A54--></AD_REFERENCE>
+
 <!--DA5377445D8D468DB17743F8082B3CFD--><AD_REFERENCE>
 <!--DA5377445D8D468DB17743F8082B3CFD-->  <AD_REFERENCE_ID><![CDATA[DA5377445D8D468DB17743F8082B3CFD]]></AD_REFERENCE_ID>
 <!--DA5377445D8D468DB17743F8082B3CFD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_REF_LIST.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -143,6 +143,18 @@
 <!--4A647396E4CE4E8B90D58E9FE4C12BBA-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
 <!--4A647396E4CE4E8B90D58E9FE4C12BBA--></AD_REF_LIST>
 
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC--><AD_REF_LIST>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <AD_REF_LIST_ID><![CDATA[4E4F2CBB72A3451B9F4BFB2540F517CC]]></AD_REF_LIST_ID>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <VALUE><![CDATA[OK]]></VALUE>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <NAME><![CDATA[OK]]></NAME>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <AD_REFERENCE_ID><![CDATA[C20E5E22588E40E5B8CC6D80ED3015C5]]></AD_REFERENCE_ID>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--4E4F2CBB72A3451B9F4BFB2540F517CC--></AD_REF_LIST>
+
 <!--52459CE549F14B35B4566E34426D79CD--><AD_REF_LIST>
 <!--52459CE549F14B35B4566E34426D79CD-->  <AD_REF_LIST_ID><![CDATA[52459CE549F14B35B4566E34426D79CD]]></AD_REF_LIST_ID>
 <!--52459CE549F14B35B4566E34426D79CD-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -436,6 +448,18 @@
 <!--C5D1596D065545B49156C1F9426C9E14-->  <SEQNO><![CDATA[30]]></SEQNO>
 <!--C5D1596D065545B49156C1F9426C9E14--></AD_REF_LIST>
 
+<!--C69982184F634AC79728338D1F327B76--><AD_REF_LIST>
+<!--C69982184F634AC79728338D1F327B76-->  <AD_REF_LIST_ID><![CDATA[C69982184F634AC79728338D1F327B76]]></AD_REF_LIST_ID>
+<!--C69982184F634AC79728338D1F327B76-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C69982184F634AC79728338D1F327B76-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C69982184F634AC79728338D1F327B76-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C69982184F634AC79728338D1F327B76-->  <VALUE><![CDATA[RE]]></VALUE>
+<!--C69982184F634AC79728338D1F327B76-->  <NAME><![CDATA[Reconcile]]></NAME>
+<!--C69982184F634AC79728338D1F327B76-->  <AD_REFERENCE_ID><![CDATA[C20E5E22588E40E5B8CC6D80ED3015C5]]></AD_REFERENCE_ID>
+<!--C69982184F634AC79728338D1F327B76-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C69982184F634AC79728338D1F327B76-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--C69982184F634AC79728338D1F327B76--></AD_REF_LIST>
+
 <!--D82326E588CB4BF685FAE03B5097B108--><AD_REF_LIST>
 <!--D82326E588CB4BF685FAE03B5097B108-->  <AD_REF_LIST_ID><![CDATA[D82326E588CB4BF685FAE03B5097B108]]></AD_REF_LIST_ID>
 <!--D82326E588CB4BF685FAE03B5097B108-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TAB.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TAB.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -68,6 +68,42 @@
 <!--1EA4A3F31A27483A8C6E93176AE912D3-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
 <!--1EA4A3F31A27483A8C6E93176AE912D3--></AD_TAB>
 
+<!--2700A962BC484D4C9B3E30B1C3C66BFB--><AD_TAB>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_TAB_ID><![CDATA[2700A962BC484D4C9B3E30B1C3C66BFB]]></AD_TAB_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <NAME><![CDATA[Add Multiple Payments P&E]]></NAME>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_TABLE_ID><![CDATA[D1A97202E832470285C9B1EB026D54E2]]></AD_TABLE_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_WINDOW_ID><![CDATA[A73B5E3D037A49CC8ACCE8B844FF7D14]]></AD_WINDOW_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <TABLEVEL><![CDATA[0]]></TABLEVEL>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISSINGLEROW><![CDATA[N]]></ISSINGLEROW>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISINFOTAB><![CDATA[N]]></ISINFOTAB>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISTRANSLATIONTAB><![CDATA[N]]></ISTRANSLATIONTAB>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISREADONLY><![CDATA[N]]></ISREADONLY>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <HASTREE><![CDATA[N]]></HASTREE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <HQLWHERECLAUSE><![CDATA[e.status in ('RPR', 'PPM') and e.amount <>0 and exists ( select 1 from FinancialMgmtFinAccPaymentMethod as  fapm join fapm.account as fa where fapm.paymentMethod = e.paymentMethod and fa.id = @FIN_Financial_Account.id@ and (case when e.receipt = true then fapm.payinAllow else fapm.payoutAllow end) = true and fa.currency = e.account.currency) and not exists (select 1 from FIN_Finacc_Transaction as ft where e = ft.finPayment) and AD_ISORGINCLUDED(e.organization.id, @FIN_Financial_Account.organization@, e.client.id)<>-1]]></HQLWHERECLAUSE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <HQLORDERBYCLAUSE><![CDATA[paymentDate, documentNo]]></HQLORDERBYCLAUSE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <HQLFILTERCLAUSE><![CDATA[e.account.id = @FIN_Financial_Account.id@]]></HQLFILTERCLAUSE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <FILTERNAME><![CDATA[Payments are filtered by the selected Financial Account]]></FILTERNAME>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISREADONLYTREE><![CDATA[N]]></ISREADONLYTREE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <ISSHOWTREENODEICONS><![CDATA[Y]]></ISSHOWTREENODEICONS>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <EM_OBUIAPP_CAN_ADD><![CDATA[N]]></EM_OBUIAPP_CAN_ADD>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <EM_OBUIAPP_CAN_DELETE><![CDATA[N]]></EM_OBUIAPP_CAN_DELETE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <EM_OBUIAPP_SHOW_SELECT><![CDATA[Y]]></EM_OBUIAPP_SHOW_SELECT>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB-->  <EM_OBUIAPP_SELECTION_TYPE><![CDATA[M]]></EM_OBUIAPP_SELECTION_TYPE>
+<!--2700A962BC484D4C9B3E30B1C3C66BFB--></AD_TAB>
+
 <!--2A9BA5FDA0F8470D881F8EA9DEDCC598--><AD_TAB>
 <!--2A9BA5FDA0F8470D881F8EA9DEDCC598-->  <AD_TAB_ID><![CDATA[2A9BA5FDA0F8470D881F8EA9DEDCC598]]></AD_TAB_ID>
 <!--2A9BA5FDA0F8470D881F8EA9DEDCC598-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -655,7 +691,7 @@
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--C095D2CC39704DBE8B906B7CD7710968-->  <UIPATTERN><![CDATA[SR]]></UIPATTERN>
+<!--C095D2CC39704DBE8B906B7CD7710968-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <HQLORDERBYCLAUSE><![CDATA[-transactionDate]]></HQLORDERBYCLAUSE>
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <SHOWPARENTBUTTONS><![CDATA[N]]></SHOWPARENTBUTTONS>
 <!--C095D2CC39704DBE8B906B7CD7710968-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
@@ -1059,7 +1095,7 @@
 <!--FF8080812F213146012F2135BC25000E-->  <IMPORTFIELDS><![CDATA[N]]></IMPORTFIELDS>
 <!--FF8080812F213146012F2135BC25000E-->  <ISSORTTAB><![CDATA[N]]></ISSORTTAB>
 <!--FF8080812F213146012F2135BC25000E-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
-<!--FF8080812F213146012F2135BC25000E-->  <UIPATTERN><![CDATA[SR]]></UIPATTERN>
+<!--FF8080812F213146012F2135BC25000E-->  <UIPATTERN><![CDATA[RO]]></UIPATTERN>
 <!--FF8080812F213146012F2135BC25000E-->  <HQLFILTERCLAUSE><![CDATA[e.reconciled = false]]></HQLFILTERCLAUSE>
 <!--FF8080812F213146012F2135BC25000E-->  <SHOWPARENTBUTTONS><![CDATA[Y]]></SHOWPARENTBUTTONS>
 <!--FF8080812F213146012F2135BC25000E-->  <DISABLE_PARENT_KEY_PROPERTY><![CDATA[N]]></DISABLE_PARENT_KEY_PROPERTY>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TABLE.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_TABLE.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -115,7 +115,8 @@
 from FIN_Payment f 
 @joinClause@ 
 where f.generatedCredit != '0' 
-and f.generatedCredit != f.usedCredit
+and f.generatedCredit != f.usedCredit 
+and aprm_seqnumberpaymentstatus(f.status) >= aprm_seqnoinvpaidstatus(f.paymentMethod, f.account, f.receipt) 
 @whereClause@ 
 and @additional_filters@ 
 and @insertion_point_0@ ]]></HQLQUERY>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_WINDOW.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/AD_WINDOW.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -115,6 +115,23 @@
 <!--81BAC97FE7754C669254C9CF4FA20292-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
 <!--81BAC97FE7754C669254C9CF4FA20292--></AD_WINDOW>
 
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14--><AD_WINDOW>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <AD_WINDOW_ID><![CDATA[A73B5E3D037A49CC8ACCE8B844FF7D14]]></AD_WINDOW_ID>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <NAME><![CDATA[Add Multiple Payments P&E]]></NAME>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <WINDOWTYPE><![CDATA[OBUIAPP_PickAndExecute]]></WINDOWTYPE>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <ISSOTRX><![CDATA[Y]]></ISSOTRX>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <PROCESSING><![CDATA[N]]></PROCESSING>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <ISDEFAULT><![CDATA[N]]></ISDEFAULT>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <ISTHREADSAFE><![CDATA[N]]></ISTHREADSAFE>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14-->  <ISADVANCEDFEATURE><![CDATA[N]]></ISADVANCEDFEATURE>
+<!--A73B5E3D037A49CC8ACCE8B844FF7D14--></AD_WINDOW>
+
 <!--C57DED2495184380AFBAAA3CA720C3DA--><AD_WINDOW>
 <!--C57DED2495184380AFBAAA3CA720C3DA-->  <AD_WINDOW_ID><![CDATA[C57DED2495184380AFBAAA3CA720C3DA]]></AD_WINDOW_ID>
 <!--C57DED2495184380AFBAAA3CA720C3DA-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PARAMETER.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -115,7 +115,7 @@
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <COLUMNNAME><![CDATA[converted_amount]]></COLUMNNAME>
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
-<!--0E081905DD9646A2AFB296F81C1AA62E-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--0E081905DD9646A2AFB296F81C1AA62E-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <DEFAULTVALUE><![CDATA[OB.getFilterExpression("org.openbravo.advpaymentmngt.filterexpression.AddPaymentDefaultValuesExpression")]]></DEFAULTVALUE>
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <AD_ELEMENT_ID><![CDATA[80FC8B411CC1476693BBC697E5AA0913]]></AD_ELEMENT_ID>
 <!--0E081905DD9646A2AFB296F81C1AA62E-->  <ISFIXED><![CDATA[N]]></ISFIXED>
@@ -151,6 +151,31 @@
 <!--0E18ACB41550424A83A62E33C2D83FB3-->  <DISPLAYTITLE><![CDATA[N]]></DISPLAYTITLE>
 <!--0E18ACB41550424A83A62E33C2D83FB3--></OBUIAPP_PARAMETER>
 
+<!--0F44A3B0971F47A1B509A50377BEB383--><OBUIAPP_PARAMETER>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <OBUIAPP_PARAMETER_ID><![CDATA[0F44A3B0971F47A1B509A50377BEB383]]></OBUIAPP_PARAMETER_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <NAME><![CDATA[Accounting Date]]></NAME>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <DESCRIPTION><![CDATA[The date this transaction is recorded for in the general ledger.]]></DESCRIPTION>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <HELP><![CDATA[The date this transaction is recorded on in the general ledger. This date also indicates which accounting period within the fiscal year this transaction will be part of.]]></HELP>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <COLUMNNAME><![CDATA[dateAcct]]></COLUMNNAME>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <DEFAULTVALUE><![CDATA[OB.getSession().getAttribute('#DATE')]]></DEFAULTVALUE>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <AD_ELEMENT_ID><![CDATA[263]]></AD_ELEMENT_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <OBUIAPP_PROCESS_ID><![CDATA[4CE463C04CA0412CAC57EF58FE0F8498]]></OBUIAPP_PROCESS_ID>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--0F44A3B0971F47A1B509A50377BEB383-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--0F44A3B0971F47A1B509A50377BEB383--></OBUIAPP_PARAMETER>
+
 <!--111000BF6C4445E785AA08331A268E1B--><OBUIAPP_PARAMETER>
 <!--111000BF6C4445E785AA08331A268E1B-->  <OBUIAPP_PARAMETER_ID><![CDATA[111000BF6C4445E785AA08331A268E1B]]></OBUIAPP_PARAMETER_ID>
 <!--111000BF6C4445E785AA08331A268E1B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -349,7 +374,7 @@
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <COLUMNNAME><![CDATA[conversion_rate]]></COLUMNNAME>
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
-<!--200C902859B746D5BDDC773D0C91C1BB-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--200C902859B746D5BDDC773D0C91C1BB-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <DEFAULTVALUE><![CDATA[OB.getFilterExpression("org.openbravo.advpaymentmngt.filterexpression.AddPaymentDefaultValuesExpression")]]></DEFAULTVALUE>
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <AD_ELEMENT_ID><![CDATA[DF96F3B1C94743F9BEFA1555FBD2BB23]]></AD_ELEMENT_ID>
 <!--200C902859B746D5BDDC773D0C91C1BB-->  <ISFIXED><![CDATA[N]]></ISFIXED>
@@ -673,6 +698,31 @@
 <!--61059745E59240A998ED90DC83E5DA4F-->  <DISPLAYTITLE><![CDATA[N]]></DISPLAYTITLE>
 <!--61059745E59240A998ED90DC83E5DA4F--></OBUIAPP_PARAMETER>
 
+<!--65AFBD9140014688A842ACF5ECF9E5A1--><OBUIAPP_PARAMETER>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <OBUIAPP_PARAMETER_ID><![CDATA[65AFBD9140014688A842ACF5ECF9E5A1]]></OBUIAPP_PARAMETER_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <NAME><![CDATA[Transaction Date]]></NAME>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <DESCRIPTION><![CDATA[The date the transaction is carried out and registered in the cash journal.]]></DESCRIPTION>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <HELP><![CDATA[The Statement Date field defines the date of the statement being processed.]]></HELP>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <SEQNO><![CDATA[10]]></SEQNO>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_REFERENCE_ID><![CDATA[15]]></AD_REFERENCE_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <COLUMNNAME><![CDATA[statementDate]]></COLUMNNAME>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <FIELDLENGTH><![CDATA[19]]></FIELDLENGTH>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <DEFAULTVALUE><![CDATA[OB.getSession().getAttribute('#DATE')]]></DEFAULTVALUE>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <AD_ELEMENT_ID><![CDATA[1434]]></AD_ELEMENT_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <OBUIAPP_PROCESS_ID><![CDATA[4CE463C04CA0412CAC57EF58FE0F8498]]></OBUIAPP_PROCESS_ID>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--65AFBD9140014688A842ACF5ECF9E5A1-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--65AFBD9140014688A842ACF5ECF9E5A1--></OBUIAPP_PARAMETER>
+
 <!--6AF091FD5F1440BB9F0E0C674A168144--><OBUIAPP_PARAMETER>
 <!--6AF091FD5F1440BB9F0E0C674A168144-->  <OBUIAPP_PARAMETER_ID><![CDATA[6AF091FD5F1440BB9F0E0C674A168144]]></OBUIAPP_PARAMETER_ID>
 <!--6AF091FD5F1440BB9F0E0C674A168144-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -779,6 +829,29 @@
 <!--6F1DACE3F9744318948C5A0154FAFEF2-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
 <!--6F1DACE3F9744318948C5A0154FAFEF2--></OBUIAPP_PARAMETER>
 
+<!--74479AE073FF4FA5A527DC79EC0A1C82--><OBUIAPP_PARAMETER>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <OBUIAPP_PARAMETER_ID><![CDATA[74479AE073FF4FA5A527DC79EC0A1C82]]></OBUIAPP_PARAMETER_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <NAME><![CDATA[Payment]]></NAME>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <SEQNO><![CDATA[30]]></SEQNO>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_REFERENCE_ID><![CDATA[FF80818132D8F0F30132D9BC395D0038]]></AD_REFERENCE_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_REFERENCE_VALUE_ID><![CDATA[D9B6068A6D3E4B7487470E7D2F033A54]]></AD_REFERENCE_VALUE_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <COLUMNNAME><![CDATA[payments]]></COLUMNNAME>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <ISCENTRALLYMAINTAINED><![CDATA[N]]></ISCENTRALLYMAINTAINED>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <ISMANDATORY><![CDATA[Y]]></ISMANDATORY>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <AD_ELEMENT_ID><![CDATA[7891269C83EA655DE040007F010155CE]]></AD_ELEMENT_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <OBUIAPP_PROCESS_ID><![CDATA[4CE463C04CA0412CAC57EF58FE0F8498]]></OBUIAPP_PROCESS_ID>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <DISPLAYEDROWS><![CDATA[18]]></DISPLAYEDROWS>
+<!--74479AE073FF4FA5A527DC79EC0A1C82-->  <DISPLAYTITLE><![CDATA[N]]></DISPLAYTITLE>
+<!--74479AE073FF4FA5A527DC79EC0A1C82--></OBUIAPP_PARAMETER>
+
 <!--76E43D5C34244BBDA6FE6678F94C3B7C--><OBUIAPP_PARAMETER>
 <!--76E43D5C34244BBDA6FE6678F94C3B7C-->  <OBUIAPP_PARAMETER_ID><![CDATA[76E43D5C34244BBDA6FE6678F94C3B7C]]></OBUIAPP_PARAMETER_ID>
 <!--76E43D5C34244BBDA6FE6678F94C3B7C-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1282,6 +1355,7 @@
 <!--9F106995848F42F385EBCB01526E439B-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
 <!--9F106995848F42F385EBCB01526E439B-->  <OBUIAPP_PROCESS_ID><![CDATA[E68790A7B65F4D45AB35E2BAE34C1F39]]></OBUIAPP_PROCESS_ID>
 <!--9F106995848F42F385EBCB01526E439B-->  <STARTINNEWLINE><![CDATA[Y]]></STARTINNEWLINE>
+<!--9F106995848F42F385EBCB01526E439B-->  <ONCHANGEFUNCTION><![CDATA[OB.APRM.AddTransaction.trxDateOnChangeFunction]]></ONCHANGEFUNCTION>
 <!--9F106995848F42F385EBCB01526E439B-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
 <!--9F106995848F42F385EBCB01526E439B-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
 <!--9F106995848F42F385EBCB01526E439B--></OBUIAPP_PARAMETER>
@@ -1655,6 +1729,29 @@
 <!--C511B1965C2A46C2BD8144DB918CD17B-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
 <!--C511B1965C2A46C2BD8144DB918CD17B--></OBUIAPP_PARAMETER>
 
+<!--C722D23258B64E50A9137C73598C418F--><OBUIAPP_PARAMETER>
+<!--C722D23258B64E50A9137C73598C418F-->  <OBUIAPP_PARAMETER_ID><![CDATA[C722D23258B64E50A9137C73598C418F]]></OBUIAPP_PARAMETER_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <NAME><![CDATA[Actions]]></NAME>
+<!--C722D23258B64E50A9137C73598C418F-->  <SEQNO><![CDATA[20]]></SEQNO>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_REFERENCE_ID><![CDATA[FF80818132F94B500132F9575619000A]]></AD_REFERENCE_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_REFERENCE_VALUE_ID><![CDATA[C20E5E22588E40E5B8CC6D80ED3015C5]]></AD_REFERENCE_VALUE_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <COLUMNNAME><![CDATA[actions]]></COLUMNNAME>
+<!--C722D23258B64E50A9137C73598C418F-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--C722D23258B64E50A9137C73598C418F-->  <FIELDLENGTH><![CDATA[30]]></FIELDLENGTH>
+<!--C722D23258B64E50A9137C73598C418F-->  <ISMANDATORY><![CDATA[N]]></ISMANDATORY>
+<!--C722D23258B64E50A9137C73598C418F-->  <AD_ELEMENT_ID><![CDATA[EF3508748A6A42C186F6709D68728306]]></AD_ELEMENT_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <ISFIXED><![CDATA[N]]></ISFIXED>
+<!--C722D23258B64E50A9137C73598C418F-->  <EVALUATEFIXEDVALUE><![CDATA[N]]></EVALUATEFIXEDVALUE>
+<!--C722D23258B64E50A9137C73598C418F-->  <OBUIAPP_PROCESS_ID><![CDATA[86F0B1EBE2BC48E3ACF458768D14CC99]]></OBUIAPP_PROCESS_ID>
+<!--C722D23258B64E50A9137C73598C418F-->  <STARTINNEWLINE><![CDATA[N]]></STARTINNEWLINE>
+<!--C722D23258B64E50A9137C73598C418F-->  <DISPLAYEDROWS><![CDATA[5]]></DISPLAYEDROWS>
+<!--C722D23258B64E50A9137C73598C418F-->  <DISPLAYTITLE><![CDATA[Y]]></DISPLAYTITLE>
+<!--C722D23258B64E50A9137C73598C418F--></OBUIAPP_PARAMETER>
+
 <!--D2F76322DF994A58B49D62E79944C219--><OBUIAPP_PARAMETER>
 <!--D2F76322DF994A58B49D62E79944C219-->  <OBUIAPP_PARAMETER_ID><![CDATA[D2F76322DF994A58B49D62E79944C219]]></OBUIAPP_PARAMETER_ID>
 <!--D2F76322DF994A58B49D62E79944C219-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
@@ -1691,7 +1788,7 @@
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <HELP><![CDATA[A Business Partner is anyone with whom you transact.  This can include a customer, vendor, employee or any combination of these.]]></HELP>
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <SEQNO><![CDATA[110]]></SEQNO>
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <AD_REFERENCE_ID><![CDATA[95E2A8B50A254B2AAE6774B8C2F28120]]></AD_REFERENCE_ID>
-<!--D58EE6F45C72436DB613C79F5FE8A37C-->  <AD_REFERENCE_VALUE_ID><![CDATA[56DEFF37A33F46D1AC918C97C4447EAF]]></AD_REFERENCE_VALUE_ID>
+<!--D58EE6F45C72436DB613C79F5FE8A37C-->  <AD_REFERENCE_VALUE_ID><![CDATA[488E4BF765294DD8A7A943BDED4BA6E6]]></AD_REFERENCE_VALUE_ID>
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <COLUMNNAME><![CDATA[c_bpartner_id]]></COLUMNNAME>
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
 <!--D58EE6F45C72436DB613C79F5FE8A37C-->  <FIELDLENGTH><![CDATA[0]]></FIELDLENGTH>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_PROCESS.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -19,6 +19,26 @@
 <!--154CB4F9274A479CB38A285E16984539-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
 <!--154CB4F9274A479CB38A285E16984539--></OBUIAPP_PROCESS>
 
+<!--4CE463C04CA0412CAC57EF58FE0F8498--><OBUIAPP_PROCESS>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <OBUIAPP_PROCESS_ID><![CDATA[4CE463C04CA0412CAC57EF58FE0F8498]]></OBUIAPP_PROCESS_ID>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <VALUE><![CDATA[Add Multiple Payments]]></VALUE>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <NAME><![CDATA[Add Multiple Payments]]></NAME>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <DESCRIPTION><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></DESCRIPTION>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <HELP><![CDATA[User can select multiple payments at the same time. The system will create a separate transaction per selected payment]]></HELP>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ACCESSLEVEL><![CDATA[1]]></ACCESSLEVEL>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <CLASSNAME><![CDATA[org.openbravo.advpaymentmngt.actionHandler.AddMultiplePaymentsHandler]]></CLASSNAME>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ISBACKGROUND><![CDATA[N]]></ISBACKGROUND>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <UIPATTERN><![CDATA[OBUIAPP_PickAndExecute]]></UIPATTERN>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ISMULTIRECORD><![CDATA[N]]></ISMULTIRECORD>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <IS_EXPLICIT_ACCESS><![CDATA[N]]></IS_EXPLICIT_ACCESS>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ISGRIDLEGACY><![CDATA[N]]></ISGRIDLEGACY>
+<!--4CE463C04CA0412CAC57EF58FE0F8498-->  <ISCANADDRECORDSTOSELECTOR><![CDATA[N]]></ISCANADDRECORDSTOSELECTOR>
+<!--4CE463C04CA0412CAC57EF58FE0F8498--></OBUIAPP_PROCESS>
+
 <!--4EEB3497082C4F2182E16A4371CD5D96--><OBUIAPP_PROCESS>
 <!--4EEB3497082C4F2182E16A4371CD5D96-->  <OBUIAPP_PROCESS_ID><![CDATA[4EEB3497082C4F2182E16A4371CD5D96]]></OBUIAPP_PROCESS_ID>
 <!--4EEB3497082C4F2182E16A4371CD5D96-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUIAPP_REF_WINDOW.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -72,4 +72,13 @@
 <!--98B655EC65BF4D669F3474F07CF22131-->  <AD_WINDOW_ID><![CDATA[C57DED2495184380AFBAAA3CA720C3DA]]></AD_WINDOW_ID>
 <!--98B655EC65BF4D669F3474F07CF22131--></OBUIAPP_REF_WINDOW>
 
+<!--B1A15F9CDFA34F459B7B9A7011625D29--><OBUIAPP_REF_WINDOW>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <OBUIAPP_REF_WINDOW_ID><![CDATA[B1A15F9CDFA34F459B7B9A7011625D29]]></OBUIAPP_REF_WINDOW_ID>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <AD_REFERENCE_ID><![CDATA[D9B6068A6D3E4B7487470E7D2F033A54]]></AD_REFERENCE_ID>
+<!--B1A15F9CDFA34F459B7B9A7011625D29-->  <AD_WINDOW_ID><![CDATA[A73B5E3D037A49CC8ACCE8B844FF7D14]]></AD_WINDOW_ID>
+<!--B1A15F9CDFA34F459B7B9A7011625D29--></OBUIAPP_REF_WINDOW>
+
 </data>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -186,7 +186,7 @@
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <NAME><![CDATA[Payment Method]]></NAME>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <AD_REFERENCE_ID><![CDATA[E664E415582A483DBBC91DEF256FB9E6]]></AD_REFERENCE_ID>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <AD_TABLE_ID><![CDATA[0B44DF7A2A854784BF34AD49C58647D7]]></AD_TABLE_ID>
-<!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <WHERECLAUSE><![CDATA[exists (select 1 from FinancialMgmtFinAccPaymentMethod fpm where fpm.paymentMethod = e  and  (case when @issotrx@ = 'true' then fpm.payinAllow else fpm.payoutAllow end) = true   and (fpm.account.id =  @fin_financial_account_id@ or @inpwindowId@ <> '94EAA455D2644E04AB25D93BE5157B6D'))]]></WHERECLAUSE>
+<!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <WHERECLAUSE><![CDATA[exists (select 1 from FinancialMgmtFinAccPaymentMethod fpm where fpm.paymentMethod = e  and  (case when @issotrx@ = 'true' then fpm.payinAllow else fpm.payoutAllow end) = true   and (fpm.account.id =  @fin_financial_account_id@ or @inpwindowId@ <> '94EAA455D2644E04AB25D93BE5157B6D') and fpm.active = true)]]></WHERECLAUSE>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
@@ -195,6 +195,22 @@
 <!--BA4FDCB15ACB47AD81BE3985E13032EE-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
 <!--BA4FDCB15ACB47AD81BE3985E13032EE--></OBUISEL_SELECTOR>
 
+<!--C994CAFA0DD14C83B0251EB1C6529575--><OBUISEL_SELECTOR>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <NAME><![CDATA[Business Partner]]></NAME>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <AD_REFERENCE_ID><![CDATA[488E4BF765294DD8A7A943BDED4BA6E6]]></AD_REFERENCE_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <AD_TABLE_ID><![CDATA[291]]></AD_TABLE_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <FILTER_EXPRESSION><![CDATA["e.active=true"]]></FILTER_EXPRESSION>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <OBCLKER_TEMPLATE_ID><![CDATA[9314DE8599AD44E7BFC4CC50699042AB]]></OBCLKER_TEMPLATE_ID>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <SUGGESTIONTEXTMATCHSTYLE><![CDATA[substring]]></SUGGESTIONTEXTMATCHSTYLE>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <POPUPTEXTMATCHSTYLE><![CDATA[substring]]></POPUPTEXTMATCHSTYLE>
+<!--C994CAFA0DD14C83B0251EB1C6529575-->  <CUSTOM_QUERY><![CDATA[N]]></CUSTOM_QUERY>
+<!--C994CAFA0DD14C83B0251EB1C6529575--></OBUISEL_SELECTOR>
+
 <!--EE54530EA4884AD5A10365E480015325--><OBUISEL_SELECTOR>
 <!--EE54530EA4884AD5A10365E480015325-->  <OBUISEL_SELECTOR_ID><![CDATA[EE54530EA4884AD5A10365E480015325]]></OBUISEL_SELECTOR_ID>
 <!--EE54530EA4884AD5A10365E480015325-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-db/database/sourcedata/OBUISEL_SELECTOR_FIELD.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -1,5 +1,27 @@
 <?xml version='1.0' encoding='UTF-8'?>
 <data>
+<!--020AFFE4543C44DB9423BD0E1069AC16--><OBUISEL_SELECTOR_FIELD>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[020AFFE4543C44DB9423BD0E1069AC16]]></OBUISEL_SELECTOR_FIELD_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <AD_COLUMN_ID><![CDATA[4940]]></AD_COLUMN_ID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <NAME><![CDATA[Business Partner Category]]></NAME>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <DESCRIPTION><![CDATA[A classification of business partners based on defined similarities.]]></DESCRIPTION>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <HELP><![CDATA[A way of grouping business partners together for classification and reporting purposes. Provides a method of defining certain defaults to be used when opening new business partners.]]></HELP>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <PROPERTY><![CDATA[businessPartnerCategory.name]]></PROPERTY>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <SORT><![CDATA[Y]]></SORT>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <FILTER><![CDATA[Y]]></FILTER>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <SHOWINGRID><![CDATA[Y]]></SHOWINGRID>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <SORTNO><![CDATA[3]]></SORTNO>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
+<!--020AFFE4543C44DB9423BD0E1069AC16-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
+<!--020AFFE4543C44DB9423BD0E1069AC16--></OBUISEL_SELECTOR_FIELD>
+
 <!--14ED4E3D75274AB3A59F3941D64027BE--><OBUISEL_SELECTOR_FIELD>
 <!--14ED4E3D75274AB3A59F3941D64027BE-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[14ED4E3D75274AB3A59F3941D64027BE]]></OBUISEL_SELECTOR_FIELD_ID>
 <!--14ED4E3D75274AB3A59F3941D64027BE-->  <OBUISEL_SELECTOR_ID><![CDATA[6643B422022B41698FEFD6C7FAD7AC4B]]></OBUISEL_SELECTOR_ID>
@@ -264,6 +286,30 @@
 <!--616F97738AFD4595B74A6A60C8D4B5C4-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
 <!--616F97738AFD4595B74A6A60C8D4B5C4--></OBUISEL_SELECTOR_FIELD>
 
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A--><OBUISEL_SELECTOR_FIELD>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[623132D3EA2C4FA5A8ABE6794BBCFE9A]]></OBUISEL_SELECTOR_FIELD_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <AD_COLUMN_ID><![CDATA[2901]]></AD_COLUMN_ID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <NAME><![CDATA[Search Key]]></NAME>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <DESCRIPTION><![CDATA[A fast method for finding a particular record.]]></DESCRIPTION>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <HELP><![CDATA[A search key allows for a fast method of finding a particular record. If you leave the search key empty, the system automatically creates a numeric number originating from a document sequence defined in the  "Document Sequence" window. The sequence naming convention follows a rule "DocumentNo_TableName", where TableName is the actual name of the database table (e.g. C_Order).
+
+Usually, company's internal identifiers for various records (products, customers, etc) are stored here.]]></HELP>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <PROPERTY><![CDATA[searchKey]]></PROPERTY>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <SORT><![CDATA[Y]]></SORT>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <FILTER><![CDATA[Y]]></FILTER>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <SHOWINGRID><![CDATA[Y]]></SHOWINGRID>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <SORTNO><![CDATA[2]]></SORTNO>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
+<!--623132D3EA2C4FA5A8ABE6794BBCFE9A--></OBUISEL_SELECTOR_FIELD>
+
 <!--62B1856699BD4CAE863FAF5621E5A00D--><OBUISEL_SELECTOR_FIELD>
 <!--62B1856699BD4CAE863FAF5621E5A00D-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[62B1856699BD4CAE863FAF5621E5A00D]]></OBUISEL_SELECTOR_FIELD_ID>
 <!--62B1856699BD4CAE863FAF5621E5A00D-->  <OBUISEL_SELECTOR_ID><![CDATA[EE54530EA4884AD5A10365E480015325]]></OBUISEL_SELECTOR_ID>
@@ -390,6 +436,72 @@
 <!--931DDACB7AE54909AD668A636EF460CE-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
 <!--931DDACB7AE54909AD668A636EF460CE--></OBUISEL_SELECTOR_FIELD>
 
+<!--A0BA9E0F3324435A960F5D024EDCE1F7--><OBUISEL_SELECTOR_FIELD>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[A0BA9E0F3324435A960F5D024EDCE1F7]]></OBUISEL_SELECTOR_FIELD_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <AD_COLUMN_ID><![CDATA[2902]]></AD_COLUMN_ID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <NAME><![CDATA[Commercial Name]]></NAME>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <DESCRIPTION><![CDATA[Commercial Name of the Business Partner]]></DESCRIPTION>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <HELP><![CDATA[Commercial Name of the Business Partner]]></HELP>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <PROPERTY><![CDATA[name]]></PROPERTY>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <SORT><![CDATA[Y]]></SORT>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <FILTER><![CDATA[Y]]></FILTER>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <SEARCHINSUGGESTIONBOX><![CDATA[Y]]></SEARCHINSUGGESTIONBOX>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <SHOWINGRID><![CDATA[Y]]></SHOWINGRID>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <SORTNO><![CDATA[1]]></SORTNO>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
+<!--A0BA9E0F3324435A960F5D024EDCE1F7--></OBUISEL_SELECTOR_FIELD>
+
+<!--A5FE0619C78F451BBCD6292D9DFA77BB--><OBUISEL_SELECTOR_FIELD>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[A5FE0619C78F451BBCD6292D9DFA77BB]]></OBUISEL_SELECTOR_FIELD_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <AD_COLUMN_ID><![CDATA[2916]]></AD_COLUMN_ID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <NAME><![CDATA[Customer]]></NAME>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <DESCRIPTION><![CDATA[Indicates a business partner that is your customer, ie. that will be making purchases from you.]]></DESCRIPTION>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <HELP><![CDATA[Indicates a business partner that is your customer, ie. that will be making purchases from you. If selected, additional fields will display further details that need to be entered for a customer.]]></HELP>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <PROPERTY><![CDATA[customer]]></PROPERTY>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <SORT><![CDATA[Y]]></SORT>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <FILTER><![CDATA[Y]]></FILTER>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <SHOWINGRID><![CDATA[Y]]></SHOWINGRID>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <SORTNO><![CDATA[4]]></SORTNO>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
+<!--A5FE0619C78F451BBCD6292D9DFA77BB--></OBUISEL_SELECTOR_FIELD>
+
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B--><OBUISEL_SELECTOR_FIELD>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[AA8BBA6DD4D949AAAD27F6C05D72B24B]]></OBUISEL_SELECTOR_FIELD_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <OBUISEL_SELECTOR_ID><![CDATA[C994CAFA0DD14C83B0251EB1C6529575]]></OBUISEL_SELECTOR_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <AD_MODULE_ID><![CDATA[A918E3331C404B889D69AA9BFAFB23AC]]></AD_MODULE_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <AD_COLUMN_ID><![CDATA[2915]]></AD_COLUMN_ID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <NAME><![CDATA[Vendor]]></NAME>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <DESCRIPTION><![CDATA[A business partner who sells products or services.]]></DESCRIPTION>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <HELP><![CDATA[The Vendor checkbox indicates if this Business Partner is a Vendor.  If it is selected, additional fields will display which further identify this vendor.]]></HELP>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <PROPERTY><![CDATA[vendor]]></PROPERTY>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <ISCENTRALLYMAINTAINED><![CDATA[Y]]></ISCENTRALLYMAINTAINED>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <SORT><![CDATA[Y]]></SORT>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <FILTER><![CDATA[Y]]></FILTER>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <SEARCHINSUGGESTIONBOX><![CDATA[N]]></SEARCHINSUGGESTIONBOX>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <SHOWINGRID><![CDATA[Y]]></SHOWINGRID>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <SORTNO><![CDATA[5]]></SORTNO>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <ISOUTFIELD><![CDATA[N]]></ISOUTFIELD>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B-->  <SHOWINPICKLIST><![CDATA[N]]></SHOWINPICKLIST>
+<!--AA8BBA6DD4D949AAAD27F6C05D72B24B--></OBUISEL_SELECTOR_FIELD>
+
 <!--B67B839A695A44499277CF0D09FAC54F--><OBUISEL_SELECTOR_FIELD>
 <!--B67B839A695A44499277CF0D09FAC54F-->  <OBUISEL_SELECTOR_FIELD_ID><![CDATA[B67B839A695A44499277CF0D09FAC54F]]></OBUISEL_SELECTOR_FIELD_ID>
 <!--B67B839A695A44499277CF0D09FAC54F-->  <OBUISEL_SELECTOR_ID><![CDATA[A98899B1C75A4F4EBD3414F1B654EFAB]]></OBUISEL_SELECTOR_ID>
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/AlertsForWrongOrders_data.xsql	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/AlertsForWrongOrders_data.xsql	Tue Aug 04 10:02:42 2015 +0200
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8" ?>
 <!--
  ************************************************************************************
- * Copyright (C) 2014 Openbravo S.L.U.
+ * Copyright (C) 2014-2015 Openbravo S.L.U.
  * Licensed under the Openbravo Commercial License version 1.0
  * You may obtain a copy of the License at http://www.openbravo.com/legal/obcl.html
  * or in the legal folder of this module distribution.
@@ -18,7 +18,7 @@
       from c_order, fin_payment_schedule, fin_payment_scheduledetail 
       where c_order.c_order_id = fin_payment_schedule.c_order_id
       and fin_payment_schedule.fin_payment_schedule_id = fin_payment_scheduledetail.fin_payment_schedule_order 
-      and fin_payment_scheduledetail.iscanceled = 'N' 
+      and fin_payment_scheduledetail.isinvoicepaid = 'Y'
       and fin_payment_scheduledetail.fin_payment_detail_id IS NOT NULL 
       group by fin_payment_schedule.ad_org_id, fin_payment_schedule.ad_client_id, c_order.issotrx, fin_payment_schedule.fin_payment_schedule_id, 
       fin_payment_schedule.c_order_id, fin_payment_schedule.paidamt 
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/AlertsForWrongOrdersData.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/AlertsForWrongOrdersData.java	Tue Aug 04 10:02:42 2015 +0200
@@ -63,7 +63,7 @@
       "      from c_order, fin_payment_schedule, fin_payment_scheduledetail " +
       "      where c_order.c_order_id = fin_payment_schedule.c_order_id" +
       "      and fin_payment_schedule.fin_payment_schedule_id = fin_payment_scheduledetail.fin_payment_schedule_order " +
-      "      and fin_payment_scheduledetail.iscanceled = 'N' " +
+      "      and fin_payment_scheduledetail.isinvoicepaid = 'Y'" +
       "      and fin_payment_scheduledetail.fin_payment_detail_id IS NOT NULL " +
       "      group by fin_payment_schedule.ad_org_id, fin_payment_schedule.ad_client_id, c_order.issotrx, fin_payment_schedule.fin_payment_schedule_id, " +
       "      fin_payment_schedule.c_order_id, fin_payment_schedule.paidamt " +
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddMultiplePaymentsHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,152 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import java.text.SimpleDateFormat;
+import java.util.Date;
+import java.util.Map;
+
+import org.apache.log4j.Logger;
+import org.codehaus.jettison.json.JSONArray;
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.advpaymentmngt.dao.TransactionsDao;
+import org.openbravo.advpaymentmngt.process.FIN_TransactionProcess;
+import org.openbravo.client.application.process.BaseProcessActionHandler;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
+import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
+import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+import org.openbravo.service.db.DbUtility;
+import org.openbravo.service.json.JsonUtils;
+
+public class AddMultiplePaymentsHandler extends BaseProcessActionHandler {
+  private static final Logger log = Logger.getLogger(AddMultiplePaymentsHandler.class);
+  private static final SimpleDateFormat jsDateFormat = JsonUtils.createDateFormat();
+  private static final String ACTION_PROCESS_TRANSACTION = "P";
+
+  @Override
+  protected JSONObject doExecute(Map<String, Object> parameters, String data) {
+    try {
+      final JSONObject jsonData = new JSONObject(data);
+      final JSONObject jsonparams = jsonData.getJSONObject("_params");
+
+      final JSONArray selectedPayments = jsonparams.getJSONObject("payments").getJSONArray(
+          "_selection");
+      final Date statementDate = jsDateFormat.parse(jsonparams.getString("statementDate"));
+      final Date dateAcct = jsDateFormat.parse(jsonparams.getString("dateAcct"));
+      final String strAccountId = jsonData.getString("Fin_Financial_Account_ID");
+
+      int selectedPaymentsLength = selectedPayments.length();
+      if (selectedPaymentsLength == 0) {
+        // Validation error: No lines selected
+        return getErrorMessage(OBMessageUtils.messageBD("APRM_NO_PAYMENTS_SELECTED"));
+      }
+
+      for (int i = 0; i < selectedPaymentsLength; i++) {
+        final JSONObject paymentJS = selectedPayments.getJSONObject(i);
+        createAndProcessTransactionFromPayment(paymentJS, statementDate, dateAcct, strAccountId);
+      }
+      // Success Message
+      return getSuccessMessage(String.format(
+          OBMessageUtils.messageBD("APRM_MULTIPLE_TRANSACTIONS_ADDED"), selectedPaymentsLength));
+
+    } catch (Exception e) {
+      OBDal.getInstance().rollbackAndClose();
+      log.error("Exception creating multiple transactions from payments", e);
+
+      try {
+        Throwable ex = DbUtility.getUnderlyingSQLException(e);
+        String message = OBMessageUtils.translateError(ex.getMessage()).getMessage();
+        return getErrorMessage(message);
+      } catch (Exception ignore) {
+      }
+    }
+
+    return new JSONObject();
+  }
+
+  /**
+   * Creates a new transaction from the payment and then it processes the transaction
+   */
+  private void createAndProcessTransactionFromPayment(final JSONObject paymentJS,
+      final Date transactionDate, final Date acctDate, String strAccountId) throws JSONException {
+
+    try {
+      OBContext.setAdminMode(true);
+      final String paymentId = paymentJS.getString("id");
+      log.debug("Creating transaction for FIN_Payment_ID: " + paymentId);
+      final FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
+      FIN_FinancialAccount account = OBDal.getInstance().get(FIN_FinancialAccount.class,
+          strAccountId);
+
+      if (payment != null) {
+        final FIN_FinaccTransaction transaction = TransactionsDao.createFinAccTransaction(payment);
+        transaction.setTransactionDate(transactionDate);
+        transaction.setDateAcct(acctDate);
+        transaction.setAccount(account);
+        FIN_TransactionProcess.doTransactionProcess(ACTION_PROCESS_TRANSACTION, transaction);
+      }
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+  }
+
+  /**
+   * Returns a JSONObject with the success message to be printed
+   */
+  private static JSONObject getSuccessMessage(final String msgText) {
+    final JSONObject result = new JSONObject();
+    try {
+      final JSONArray actions = new JSONArray();
+      final JSONObject msgInBPTab = new JSONObject();
+      msgInBPTab.put("msgType", "success");
+      msgInBPTab.put("msgTitle", OBMessageUtils.messageBD("success"));
+      msgInBPTab.put("msgText", msgText);
+      final JSONObject msgInBPTabAction = new JSONObject();
+      msgInBPTabAction.put("showMsgInProcessView", msgInBPTab);
+      actions.put(msgInBPTabAction);
+      result.put("responseActions", actions);
+    } catch (Exception e) {
+      log.error(e);
+    }
+
+    return result;
+  }
+
+  /**
+   * Returns a JSONObject with the error message to be printed and retry execution
+   */
+  private static JSONObject getErrorMessage(final String msgText) {
+    final JSONObject result = new JSONObject();
+    try {
+      final JSONObject msg = new JSONObject();
+      msg.put("severity", "error");
+      msg.put("text", msgText);
+      result.put("message", msg);
+      result.put("retryExecution", true);
+    } catch (Exception e) {
+      log.error(e);
+    }
+    return result;
+  }
+
+}
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddPaymentActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -19,6 +19,7 @@
 package org.openbravo.advpaymentmngt.actionHandler;
 
 import java.math.BigDecimal;
+import java.sql.SQLException;
 import java.util.ArrayList;
 import java.util.Date;
 import java.util.HashMap;
@@ -179,7 +180,7 @@
           convertedAmount);
       OBDal.getInstance().save(payment);
 
-      addCredit(payment, jsonparams);
+      addCredit(payment, jsonparams, differenceAmount, strDifferenceAction);
       addSelectedPSDs(payment, jsonparams, pdToRemove);
       addGLItems(payment, jsonparams);
 
@@ -239,7 +240,8 @@
 
   private FIN_Payment createNewPayment(JSONObject jsonparams, boolean isReceipt, Organization org,
       BusinessPartner bPartner, Date paymentDate, Currency currency, BigDecimal conversionRate,
-      BigDecimal convertedAmt, String strActualPayment) throws OBException, JSONException {
+      BigDecimal convertedAmt, String strActualPayment) throws OBException, JSONException,
+      SQLException {
 
     String strPaymentDocumentNo = jsonparams.getString("payment_documentno");
     String strReferenceNo = "";
@@ -290,6 +292,7 @@
     FIN_Payment payment = (new AdvPaymentMngtDao()).getNewPayment(isReceipt, org, documentType,
         strPaymentDocumentNo, bPartner, paymentMethod, finAccount, strPaymentAmount, paymentDate,
         strReferenceNo, currency, conversionRate, convertedAmt);
+    OBDal.getInstance().getConnection(true).commit();
     return payment;
   }
 
@@ -340,10 +343,12 @@
     }
   }
 
-  private void addCredit(FIN_Payment payment, JSONObject jsonparams) throws JSONException {
+  private void addCredit(FIN_Payment payment, JSONObject jsonparams, BigDecimal differenceAmount,
+      String strDifferenceAction) throws JSONException {
     // Credit to Use Grid
     JSONObject creditToUseGrid = jsonparams.getJSONObject("credit_to_use");
     JSONArray selectedCreditLines = creditToUseGrid.getJSONArray("_selection");
+    BigDecimal remainingRefundAmt = differenceAmount;
     String strSelectedCreditLinesIds = null;
     if (selectedCreditLines.length() > 0) {
       strSelectedCreditLinesIds = getSelectedCreditLinesIds(selectedCreditLines);
@@ -353,7 +358,16 @@
           selectedCreditLines, selectedCreditPayment);
 
       for (final FIN_Payment creditPayment : selectedCreditPayment) {
-        final BigDecimal usedCreditAmt = selectedCreditPaymentAmounts.get(creditPayment.getId());
+        BigDecimal usedCreditAmt = selectedCreditPaymentAmounts.get(creditPayment.getId());
+        if (strDifferenceAction.equals("refund")) {
+          if (remainingRefundAmt.compareTo(usedCreditAmt) > 0) {
+            remainingRefundAmt = remainingRefundAmt.subtract(usedCreditAmt);
+            usedCreditAmt = BigDecimal.ZERO;
+          } else {
+            usedCreditAmt = usedCreditAmt.subtract(remainingRefundAmt);
+            remainingRefundAmt = BigDecimal.ZERO;
+          }
+        }
         final StringBuffer description = new StringBuffer();
         if (creditPayment.getDescription() != null && !creditPayment.getDescription().equals("")) {
           description.append(creditPayment.getDescription()).append("\n");
@@ -365,8 +379,10 @@
         creditPayment.setDescription(truncateDescription);
         // Set Used Credit = Amount + Previous used credit introduced by the user
         creditPayment.setUsedCredit(usedCreditAmt.add(creditPayment.getUsedCredit()));
-        ;
-        FIN_PaymentProcess.linkCreditPayment(payment, usedCreditAmt, creditPayment);
+
+        if (usedCreditAmt.compareTo(BigDecimal.ZERO) > 0) {
+          FIN_PaymentProcess.linkCreditPayment(payment, usedCreditAmt, creditPayment);
+        }
         OBDal.getInstance().save(creditPayment);
       }
     }
@@ -535,17 +551,23 @@
       conn = new DalConnectionProvider(true);
       OBDal.getInstance().getSession().clear();
       payment = OBDal.getInstance().get(FIN_Payment.class, payment.getId());
-      addCredit(payment, jsonparams);
+      addCredit(payment, jsonparams, refundAmount, strDifferenceAction);
     }
     if (!strDifferenceAction.equals("refund")) {
       return message;
     }
     boolean newPayment = !payment.getFINPaymentDetailList().isEmpty();
+    JSONObject creditToUseGrid = jsonparams.getJSONObject("credit_to_use");
+    JSONArray selectedCreditLines = creditToUseGrid.getJSONArray("_selection");
+    String strSelectedCreditLinesIds = null;
+    if (selectedCreditLines.length() > 0) {
+      strSelectedCreditLinesIds = getSelectedCreditLinesIds(selectedCreditLines);
+    }
     FIN_Payment refundPayment = FIN_AddPayment.createRefundPayment(conn, vars, payment,
         refundAmount.negate(), exchangeRate);
-    OBError auxMessage = FIN_AddPayment
-        .processPayment(vars, conn, (strAction.equals("PRP") || strAction.equals("PPP")) ? "P"
-            : "D", refundPayment, comingFrom);
+    OBError auxMessage = FIN_AddPayment.processPayment(vars, conn,
+        (strAction.equals("PRP") || strAction.equals("PPP")) ? "P" : "D", refundPayment,
+        comingFrom, strSelectedCreditLinesIds);
     if (newPayment && !"Error".equalsIgnoreCase(auxMessage.getType())) {
       final String strNewRefundPaymentMessage = OBMessageUtils
           .parseTranslation("@APRM_RefundPayment@" + ": " + refundPayment.getDocumentNo()) + ".";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/AddTransactionActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -135,9 +135,37 @@
 
       final FIN_BankStatementLine bankStatementLine = OBDal.getInstance().get(
           FIN_BankStatementLine.class, strFinBankStatementLineId);
+      // Accounting Dimensions
+      final String strElement_OT = params.getString("ad_org_id");
+      organization = OBDal.getInstance().get(Organization.class, strElement_OT);
+      final String strElement_BP = params.getString("c_bpartner_id");
+      businessPartner = OBDal.getInstance().get(BusinessPartner.class, strElement_BP);
+      final String strElement_PR = params.getString("m_product_id");
+      product = OBDal.getInstance().get(Product.class, strElement_PR);
+      final String strElement_PJ = params.getString("c_project_id");
+      project = OBDal.getInstance().get(Project.class, strElement_PJ);
+      final String strElement_AY = params.getString("c_activity_id");
+      activity = OBDal.getInstance().get(ABCActivity.class, strElement_AY);
+      final String strElement_SR = params.getString("c_salesregion_id");
+      salesRegion = OBDal.getInstance().get(SalesRegion.class, strElement_SR);
+      final String strElement_MC = params.getString("c_campaign_id");
+      campaign = OBDal.getInstance().get(Campaign.class, strElement_MC);
+      final String strElement_U1 = params.getString("user1_id");
+      user1 = OBDal.getInstance().get(UserDimension1.class, strElement_U1);
+      final String strElement_U2 = params.getString("user2_id");
+      user2 = OBDal.getInstance().get(UserDimension2.class, strElement_U2);
+      final String strElement_CC = params.getString("c_costcenter_id");
+      costcenter = OBDal.getInstance().get(Costcenter.class, strElement_CC);
 
-      if (!selectedPaymentId.equals("null")) { // Payment
-        payment = OBDal.getInstance().get(FIN_Payment.class, selectedPaymentId);
+      String paymentId = selectedPaymentId;
+      String glitemId = strGLItemId;
+      if (strTransactionType.equals("BF")) {
+        paymentId = "null";
+        glitemId = "null";
+      }
+
+      if (!paymentId.equals("null")) { // Payment
+        payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
         depositAmt = FIN_Utility.getDepositAmount(payment.isReceipt(),
             payment.getFinancialTransactionAmount());
         paymentAmt = FIN_Utility.getPaymentAmount(payment.isReceipt(),
@@ -149,35 +177,13 @@
         paymentCurrency = payment.getCurrency();
         convertRate = payment.getFinancialTransactionConvertRate();
         sourceAmount = payment.getAmount();
-      } else if (!strGLItemId.equals("null")) {// GL item
-        // Accounting Dimensions
-        final String strElement_OT = params.getString("ad_org_id");
-        organization = OBDal.getInstance().get(Organization.class, strElement_OT);
-        final String strElement_BP = params.getString("c_bpartner_id");
-        businessPartner = OBDal.getInstance().get(BusinessPartner.class, strElement_BP);
-        final String strElement_PR = params.getString("m_product_id");
-        product = OBDal.getInstance().get(Product.class, strElement_PR);
-        final String strElement_PJ = params.getString("c_project_id");
-        project = OBDal.getInstance().get(Project.class, strElement_PJ);
-        final String strElement_AY = params.getString("c_activity_id");
-        activity = OBDal.getInstance().get(ABCActivity.class, strElement_AY);
-        final String strElement_SR = params.getString("c_salesregion_id");
-        salesRegion = OBDal.getInstance().get(SalesRegion.class, strElement_SR);
-        final String strElement_MC = params.getString("c_campaign_id");
-        campaign = OBDal.getInstance().get(Campaign.class, strElement_MC);
-        final String strElement_U1 = params.getString("user1_id");
-        user1 = OBDal.getInstance().get(UserDimension1.class, strElement_U1);
-        final String strElement_U2 = params.getString("user2_id");
-        user2 = OBDal.getInstance().get(UserDimension2.class, strElement_U2);
-        final String strElement_CC = params.getString("c_costcenter_id");
-        costcenter = OBDal.getInstance().get(Costcenter.class, strElement_CC);
-
-        glItem = OBDal.getInstance().get(GLItem.class, strGLItemId);
+      } else if (!glitemId.equals("null")) {// GL item
+        glItem = OBDal.getInstance().get(GLItem.class, glitemId);
 
         depositAmt = new BigDecimal(strDepositAmount);
         paymentAmt = new BigDecimal(strWithdrawalamt);
         isReceipt = (depositAmt.compareTo(paymentAmt) >= 0);
-        description = StringUtils.isBlank(strDescription) ? OBMessageUtils.messageBD("APRM_GLItem")
+        description = (StringUtils.isBlank(strDescription) || strDescription.equals("null")) ? OBMessageUtils.messageBD("APRM_GLItem")
             + ": " + glItem.getName() : strDescription;
       } else { // Bank Fee or transaction without payment and gl item
         depositAmt = new BigDecimal(strDepositAmount);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -39,20 +39,22 @@
 
 public class MatchStatementActionHandler extends BaseProcessActionHandler {
   private static final Logger log = LoggerFactory.getLogger(MatchStatementActionHandler.class);
+  private static final String OK_ACTION = "OK";
 
   @Override
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
     JSONObject jsonResponse = new JSONObject();
-    String strReconciliationId = null;
     OBContext.setAdminMode(true);
     try {
       JSONObject jsonRequest = new JSONObject(content);
       final String strFinancialAccount = jsonRequest.getString("Fin_Financial_Account_ID");
+      final String action = jsonRequest.getString("_buttonValue");
+      if (OK_ACTION.equals(action))
+        return jsonResponse;
       final FIN_FinancialAccount finAccount = OBDal.getInstance().get(FIN_FinancialAccount.class,
           strFinancialAccount);
       final FIN_Reconciliation lastReconciliation = TransactionsDao.getLastReconciliation(
           finAccount, "N");
-      strReconciliationId = lastReconciliation.getId();
       if (APRM_MatchingUtility.updateReconciliation(lastReconciliation, finAccount, true)) {
         final VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
         final JSONObject msg = new JSONObject();
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadGetPreferenceActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,60 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONException;
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.dal.service.OBQuery;
+import org.openbravo.model.ad.domain.Preference;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+public class MatchStatementOnLoadGetPreferenceActionHandler extends BaseActionHandler {
+  private static final Logger log = LoggerFactory
+      .getLogger(MatchStatementOnLoadGetPreferenceActionHandler.class);
+
+  @Override
+  protected JSONObject execute(Map<String, Object> parameters, String content) {
+    JSONObject jsonResponse = new JSONObject();
+    try {
+      OBContext.setAdminMode(true);
+      StringBuffer whereClause = new StringBuffer();
+      whereClause.append(" as p ");
+      whereClause.append(" where p.userContact.id = :userId");
+      whereClause.append("   and p.attribute = 'APRM_NoPersistInfoMessageInMatching' ");
+      OBQuery<Preference> query = OBDal.getInstance().createQuery(Preference.class,
+          whereClause.toString());
+      query.setNamedParameter("userId", OBContext.getOBContext().getUser().getId());
+      for (Preference preference : query.list()) {
+        jsonResponse.put("preference", preference.getSearchKey());
+        return jsonResponse;
+      }
+    } catch (JSONException e) {
+      log.error("Preference could not be loaded", e);
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return jsonResponse;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/MatchStatementOnLoadPreferenceActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,53 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+package org.openbravo.advpaymentmngt.actionHandler;
+
+import java.util.Map;
+
+import org.codehaus.jettison.json.JSONObject;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.client.kernel.BaseActionHandler;
+import org.openbravo.dal.core.OBContext;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.model.ad.domain.Preference;
+import org.openbravo.model.common.enterprise.Organization;
+
+public class MatchStatementOnLoadPreferenceActionHandler extends BaseActionHandler {
+
+  @Override
+  protected JSONObject execute(Map<String, Object> parameters, String content) {
+    JSONObject jsonResponse = new JSONObject();
+    try {
+      OBContext.setAdminMode(true);
+      Preference userPreference = OBProvider.getInstance().get(Preference.class);
+      userPreference.setNewOBObject(true);
+      userPreference.setOrganization(OBDal.getInstance().get(Organization.class, "0"));
+      userPreference.setClient(OBContext.getOBContext().getCurrentClient());
+      userPreference.setUserContact(OBContext.getOBContext().getUser());
+      userPreference.setSearchKey("Y");
+      userPreference.setPropertyList(false);
+      userPreference.setAttribute("APRM_NoPersistInfoMessageInMatching");
+      OBDal.getInstance().save(userPreference);
+      OBDal.getInstance().flush();
+    } finally {
+      OBContext.restorePreviousMode();
+    }
+    return jsonResponse;
+  }
+}
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ModifyPaymentPlanActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -494,6 +494,9 @@
   private List<JSONObject> getNewRows(JSONArray gridRows) throws JSONException {
     List<JSONObject> lResult = new ArrayList<JSONObject>();
     for (int ind = 0; ind < gridRows.length(); ind++) {
+      if (!gridRows.getJSONObject(ind).has("id")) {
+        gridRows.getJSONObject(ind).put("id", "");
+      }
       String id = gridRows.getJSONObject(ind).getString("id");
       if (StringUtils.isEmpty(id) || id.equals("NEW")) {
         lResult.add(gridRows.getJSONObject(ind));
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentMethodMulticurrencyActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentMethodMulticurrencyActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -86,7 +86,8 @@
           if (convRate != null) {
             result.put("conversionrate", convRate.getMultipleRateBy());
           } else {
-            result.put("conversionrate", 1);
+            result.put("conversionrate", "");
+            result.put("convertedamount", "");
           }
         }
         result.put("currencyToId", finAccPaymentMethod.getAccount().getCurrency().getId());
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/PaymentProposalPickEditLines.java	Tue Aug 04 10:02:42 2015 +0200
@@ -30,9 +30,7 @@
 import org.codehaus.jettison.json.JSONObject;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
-import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.client.application.process.BaseProcessActionHandler;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.dal.service.OBDao;
@@ -49,7 +47,6 @@
   protected JSONObject doExecute(Map<String, Object> parameters, String content) {
     JSONObject jsonRequest = null;
     OBContext.setAdminMode();
-    VariablesSecureApp vars = RequestContext.get().getVariablesSecureApp();
     try {
       jsonRequest = new JSONObject(content);
       log.debug(jsonRequest);
@@ -121,7 +118,7 @@
     int cont = 0;
     String differentPaymentMethod = "false";
     for (int i = 0; i < selectedLines.length(); i++) {
-      JSONObject selectedLine = selectedLines.getJSONObject((int) i);
+      JSONObject selectedLine = selectedLines.getJSONObject(i);
       log.debug(selectedLine);
       BigDecimal paidAmount = new BigDecimal(selectedLine.getString("payment"));
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ReceivedFromPaymentMethodActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/ReceivedFromPaymentMethodActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -48,7 +48,8 @@
           BusinessPartner businessPartner = OBDal.getInstance().get(BusinessPartner.class,
               receivedFrom);
           if (jsonData.getString("isSOTrx").toString().equals("true")) {
-            paymentMethod = businessPartner.getPaymentMethod().getId();
+            paymentMethod = businessPartner.getPaymentMethod() != null ? businessPartner
+                .getPaymentMethod().getId() : "";
           } else {
             paymentMethod = businessPartner.getPOPaymentMethod() != null ? businessPartner
                 .getPOPaymentMethod().getId() : "";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchTransactionActionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/actionHandler/UnMatchTransactionActionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -70,7 +70,6 @@
         throw new OBStaleObjectException("@APRM_StaleDate@");
       }
       final FIN_FinaccTransaction transaction = bsline.getFinancialAccountTransaction();
-
       if (transaction != null) {
         APRM_MatchingUtility.unmatch(bsline);
       }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/AddOrderOrInvoice.java	Tue Aug 04 10:02:42 2015 +0200
@@ -833,8 +833,8 @@
    * 
    * @param vars
    *          VariablseSecureApp with the session data.
-   * @param selectedPaymentScheduleDetails
-   *          List of FIN_PaymentScheduleDetails that need to be included in the HashMap.
+   * @param _strSelectedScheduledPaymentDetailIds
+   *          List of id's of FIN_PaymentScheduleDetails that need to be included in the HashMap.
    * @return A HashMap mapping the FIN_PaymentScheduleDetail's Id with the corresponding amount.
    */
   private HashMap<String, BigDecimal> getSelectedPaymentDetailsAndAmount(VariablesSecureApp vars,
@@ -876,7 +876,6 @@
    *          : amount to split among the set
    * @param psdSet
    *          : set of payment schedule details where to allocate the amount
-   * @return
    */
   private HashMap<String, BigDecimal> calculateAmounts(BigDecimal recordAmount, Set<String> psdSet) {
     BigDecimal remainingAmount = recordAmount;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ExecutePayments.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ExecutePayments.java	Tue Aug 04 10:02:42 2015 +0200
@@ -326,7 +326,7 @@
           "inpfinPaymentProposalId", IsIDFilter.instance);
       final FIN_PaymentProposal paymentProposal = dao.getObject(FIN_PaymentProposal.class,
           strPaymentProposalId);
-      payments = FIN_Utility.getInStrList(dao.getPaymentProposalPayments(paymentProposal));
+      payments = Utility.getInStrList(dao.getPaymentProposalPayments(paymentProposal));
 
     } else if (BatchPaymentExecutionForm.equals(strWindowId)) {
       payments = vars.getRequestGlobalVariable("inpSelectedRowList", "");
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/MatchTransaction.java	Tue Aug 04 10:02:42 2015 +0200
@@ -361,6 +361,7 @@
     return ((FIN_ReconciliationLine_v) obc.uniqueResult()).getTransactionDate();
   }
 
+  @SuppressWarnings("unused")
   private void printPage(HttpServletResponse response, VariablesSecureApp vars, String strOrgId,
       String strWindowId, String strTabId, String strPaymentTypeFilter,
       String strFinancialAccountId, String reconciliationId, String strShowCleared,
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/ProcessInvoice.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -36,6 +36,7 @@
 import javax.servlet.http.HttpServletRequest;
 import javax.servlet.http.HttpServletResponse;
 
+import org.apache.commons.lang.StringUtils;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.ProcessInvoiceHook;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
@@ -59,8 +60,10 @@
 import org.openbravo.erpCommon.utility.OBError;
 import org.openbravo.erpCommon.utility.OBMessageUtils;
 import org.openbravo.erpCommon.utility.Utility;
+import org.openbravo.financial.FinancialUtils;
 import org.openbravo.model.ad.process.ProcessInstance;
 import org.openbravo.model.ad.ui.Process;
+import org.openbravo.model.common.currency.ConversionRate;
 import org.openbravo.model.common.enterprise.DocumentType;
 import org.openbravo.model.common.invoice.Invoice;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
@@ -155,21 +158,22 @@
         }
         // check BP currency
         if ("CO".equals(strdocaction)) {
-            // check BP currency
-            if (invoice.getBusinessPartner().getCurrency() == null) {
-            	String errorMSG =  
-            			Utility.messageBD(this, "InitBPCurrencyLnk", vars.getLanguage(), false);
-               msg = new OBError();
-               msg.setType("Error");
-               msg.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
-               msg.setMessage(String.format(errorMSG, invoice.getBusinessPartner().getId(), invoice.getBusinessPartner().getName()));
+          // check BP currency
+          if (invoice.getBusinessPartner().getCurrency() == null) {
+            String errorMSG = Utility.messageBD(this, "InitBPCurrencyLnk", vars.getLanguage(),
+                false);
+            msg = new OBError();
+            msg.setType("Error");
+            msg.setTitle(Utility.messageBD(this, "Error", vars.getLanguage()));
+            msg.setMessage(String.format(errorMSG, invoice.getBusinessPartner().getId(), invoice
+                .getBusinessPartner().getName()));
 
-               vars.setMessage(strTabId, msg);
-               printPageClosePopUp(response, vars, Utility.getTabURL(strTabId, "R", true));
-               return;
-            }
+            vars.setMessage(strTabId, msg);
+            printPageClosePopUp(response, vars, Utility.getTabURL(strTabId, "R", true));
+            return;
+          }
         }
-        
+
         OBContext.setAdminMode(true);
         Process process = null;
         try {
@@ -292,14 +296,20 @@
             // If the invoice grand total is ZERO or already has payments (due to
             // payment method automation) or the business partner does not have a default financial
             // account defined or invoice's payment method is not inside BP's financial
-            // account do not cancel credit
+            // account or the business partner's currency is not equal to the invoice's currency do
+            // not cancel credit
             if (BigDecimal.ZERO.compareTo(invoice.getGrandTotalAmount()) != 0
                 && isPaymentMethodConfigured(invoice)
                 && !isInvoiceWithPayments(invoice)
                 && (AcctServer.DOCTYPE_ARInvoice.equals(invoiceDocCategory) || AcctServer.DOCTYPE_APInvoice
-                    .equals(invoiceDocCategory))) {
-              creditPayments = dao.getCustomerPaymentsWithCredit(invoice.getOrganization(),
-                  invoice.getBusinessPartner(), invoice.isSalesTransaction());
+                    .equals(invoiceDocCategory))
+                && (invoice.getBusinessPartner().getCurrency() != null && StringUtils.equals(
+                    invoice.getCurrency().getId(), invoice.getBusinessPartner().getCurrency()
+                        .getId()))) {
+              creditPayments = dao
+                  .getCustomerPaymentsWithCredit(invoice.getOrganization(),
+                      invoice.getBusinessPartner(), invoice.isSalesTransaction(),
+                      invoice.getCurrency());
               if (creditPayments != null && !creditPayments.isEmpty()) {
                 printPageCreditPaymentGrid(response, vars, strC_Invoice_ID, strdocaction, strTabId,
                     strC_Invoice_ID, strdocaction, strWindowId, strTabId, invoice.getInvoiceDate(),
@@ -413,11 +423,17 @@
           final FIN_FinancialAccount bpFinAccount = isSalesTransaction ? invoice
               .getBusinessPartner().getAccount() : invoice.getBusinessPartner()
               .getPOFinancialAccount();
+          // Calculate Conversion Rate
+          final ConversionRate conversionRate = StringUtils.equals(invoice.getCurrency().getId(),
+              bpFinAccount.getCurrency().getId()) ? null : FinancialUtils.getConversionRate(
+              FIN_Utility.getDate(strPaymentDate), invoice.getCurrency(),
+              bpFinAccount.getCurrency(), invoice.getOrganization(), invoice.getClient());
           final FIN_Payment newPayment = FIN_AddPayment.savePayment(null, isSalesTransaction,
               docType, strPaymentDocumentNo, invoice.getBusinessPartner(),
               invoice.getPaymentMethod(), bpFinAccount, "0", FIN_Utility.getDate(strPaymentDate),
               invoice.getOrganization(), invoice.getDocumentNo(), paymentScheduleDetails,
-              paymentScheduleDetailsAmounts, false, false, invoice.getCurrency(), null, null);
+              paymentScheduleDetailsAmounts, false, false, invoice.getCurrency(),
+              conversionRate != null ? conversionRate.getMultipleRateBy() : null, null);
           newPayment.setAmount(BigDecimal.ZERO);
           newPayment.setGeneratedCredit(BigDecimal.ZERO);
           newPayment.setUsedCredit(totalUsedCreditAmt);
@@ -475,7 +491,7 @@
       vars.setSessionValue("ExecutePayments|Window_ID", strWindowId);
       vars.setSessionValue("ExecutePayments|Tab_ID", strTabId);
       vars.setSessionValue("ExecutePayments|Org_ID", strOrg);
-      vars.setSessionValue("ExecutePayments|payments", FIN_Utility.getInStrList(payments));
+      vars.setSessionValue("ExecutePayments|payments", Utility.getInStrList(payments));
       if (myMessage != null)
         vars.setMessage("ExecutePayments|message", myMessage);
       response.sendRedirect(strDireccion
@@ -627,30 +643,35 @@
     SimpleDateFormat dateFormater = new SimpleDateFormat(dateFormat);
 
     BigDecimal pendingToPay = invoice.getGrandTotalAmount();
-    for (int i = 0; i < data.length; i++) {
-      FieldProviderFactory.setField(data[i], "finCreditPaymentId", creditPayments.get(i).getId());
-      FieldProviderFactory.setField(data[i], "documentNo", creditPayments.get(i).getDocumentNo());
-      FieldProviderFactory.setField(data[i], "paymentDescription", creditPayments.get(i)
-          .getDescription());
-      if (creditPayments.get(i).getPaymentDate() != null) {
-        FieldProviderFactory.setField(data[i], "documentDate",
-            dateFormater.format(creditPayments.get(i).getPaymentDate()).toString());
+    try {
+      OBContext.setAdminMode(true);
+      for (int i = 0; i < data.length; i++) {
+        FieldProviderFactory.setField(data[i], "finCreditPaymentId", creditPayments.get(i).getId());
+        FieldProviderFactory.setField(data[i], "documentNo", creditPayments.get(i).getDocumentNo());
+        FieldProviderFactory.setField(data[i], "paymentDescription", creditPayments.get(i)
+            .getDescription());
+        if (creditPayments.get(i).getPaymentDate() != null) {
+          FieldProviderFactory.setField(data[i], "documentDate",
+              dateFormater.format(creditPayments.get(i).getPaymentDate()).toString());
+        }
+
+        final BigDecimal outStandingAmt = creditPayments.get(i).getGeneratedCredit()
+            .subtract(creditPayments.get(i).getUsedCredit());
+        FieldProviderFactory.setField(data[i], "outstandingAmount", outStandingAmt.toString());
+
+        FieldProviderFactory.setField(
+            data[i],
+            "paymentAmount",
+            pendingToPay.compareTo(outStandingAmt) > 0 ? outStandingAmt.toString() : (pendingToPay
+                .compareTo(BigDecimal.ZERO) > 0 ? pendingToPay.toString() : ""));
+        pendingToPay = pendingToPay.subtract(outStandingAmt);
+
+        FieldProviderFactory.setField(data[i], "finSelectedCreditPaymentId",
+            "".equals(data[i].getField("paymentAmount")) ? "" : creditPayments.get(i).getId());
+        FieldProviderFactory.setField(data[i], "rownum", String.valueOf(i));
       }
-
-      final BigDecimal outStandingAmt = creditPayments.get(i).getGeneratedCredit()
-          .subtract(creditPayments.get(i).getUsedCredit());
-      FieldProviderFactory.setField(data[i], "outstandingAmount", outStandingAmt.toString());
-
-      FieldProviderFactory.setField(
-          data[i],
-          "paymentAmount",
-          pendingToPay.compareTo(outStandingAmt) > 0 ? outStandingAmt.toString() : (pendingToPay
-              .compareTo(BigDecimal.ZERO) > 0 ? pendingToPay.toString() : ""));
-      pendingToPay = pendingToPay.subtract(outStandingAmt);
-
-      FieldProviderFactory.setField(data[i], "finSelectedCreditPaymentId",
-          "".equals(data[i].getField("paymentAmount")) ? "" : creditPayments.get(i).getId());
-      FieldProviderFactory.setField(data[i], "rownum", String.valueOf(i));
+    } finally {
+      OBContext.restorePreviousMode();
     }
 
     return data;
@@ -697,4 +718,3 @@
     return "Servlet to Process Invoice";
   }
 }
-
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/Reconciliation.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_actionbutton/Reconciliation.java	Tue Aug 04 10:02:42 2015 +0200
@@ -141,8 +141,8 @@
             strSelectedTransId);
         String newStatus = "RPPC";
         if (!isChecked) {
-          newStatus = (trans.getPaymentAmount().compareTo(trans.getDepositAmount()) >= 0) ? "RDNC"
-              : "PWNC";
+          newStatus = (trans.getPaymentAmount().compareTo(trans.getDepositAmount()) >= 0) ? "PWNC"
+              : "RDNC";
           trans.setReconciliation(null);
           if (trans.getFinPayment() != null) {
             trans.getFinPayment().setStatus((trans.getFinPayment().isReceipt()) ? "RDNC" : "PWNC");
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/OutstandingDeposit.jrxml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/OutstandingDeposit.jrxml	Tue Aug 04 10:02:42 2015 +0200
@@ -1,31 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="OutstandingDeposit"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="495"
-		 pageHeight="802"
-		 columnWidth="495"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<parameter name="RECONCILIATION_ID" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<queryString><![CDATA[SELECT trans.statementdate as TRANS_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(gl.name), '') as DESCRIPTION,
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="OutstandingDeposit" pageWidth="495" pageHeight="802" columnWidth="495" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="1af2118e-1b84-4505-a21c-d6edce710df6">
+	<property name="ireport.scriptlethandling" value="0"/>
+	<property name="ireport.encoding" value="UTF-8"/>
+	<import value="net.sf.jasperreports.engine.*"/>
+	<import value="java.util.*"/>
+	<import value="net.sf.jasperreports.engine.data.*"/>
+	<parameter name="RECONCILIATION_ID" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false"/>
+	<queryString>
+		<![CDATA[SELECT trans.statementdate as TRANS_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(gl.name), '') as DESCRIPTION,
        coalesce(TO_CHAR(p.documentno), '') as REF, trans.depositamt as AMOUNT
 FROM fin_finacc_transaction trans
      left join fin_payment p on (trans.fin_payment_id = p.fin_payment_id)
@@ -45,128 +28,117 @@
       and trans.statementdate <= (SELECT rec.dateto
                                   FROM fin_reconciliation rec 
                                   WHERE fin_reconciliation_id=$P{RECONCILIATION_ID})
-ORDER BY TRANS_DATE, DESCRIPTION, AMOUNT]]></queryString>
-
+ORDER BY TRANS_DATE, DESCRIPTION, AMOUNT]]>
+	</queryString>
 	<field name="TRANS_DATE" class="java.util.Date"/>
 	<field name="DESCRIPTION" class="java.lang.String"/>
 	<field name="REF" class="java.lang.String"/>
 	<field name="AMOUNT" class="java.math.BigDecimal"/>
-
-	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
+	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" calculation="Sum">
 		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
 	</variable>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="15"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="0"
-						y="0"
-						width="70"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.util.Date"><![CDATA[$F{TRANS_DATE}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="70"
-						y="0"
-						width="188"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="258"
-						y="0"
-						width="122"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REF}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="25"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						key="textField-2"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-				<staticText>
-					<reportElement
-						x="211"
-						y="0"
-						width="169"
-						height="15"
-						key="staticText-1"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false"/>
-					</textElement>
+	<background>
+		<band splitType="Stretch"/>
+	</background>
+	<title>
+		<band splitType="Stretch"/>
+	</title>
+	<pageHeader>
+		<band splitType="Stretch"/>
+	</pageHeader>
+	<columnHeader>
+		<band splitType="Stretch"/>
+	</columnHeader>
+	<detail>
+		<band height="15" splitType="Stretch">
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="0" y="0" width="70" height="15" forecolor="#000000" uuid="5ac60df2-6c41-4681-bd2b-9474e879ab38"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{TRANS_DATE}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="70" y="0" width="188" height="15" forecolor="#000000" uuid="ddbee985-5f0d-4be7-9284-f1eb9dbe9080"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="258" y="0" width="122" height="15" forecolor="#000000" uuid="249df10b-bf4b-4a49-bc4d-4c5503e5cfa9"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{REF}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="380" y="0" width="115" height="15" forecolor="#000000" uuid="40755f84-a183-4d01-8c7c-eecb69087484"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+		</band>
+	</detail>
+	<columnFooter>
+		<band splitType="Stretch"/>
+	</columnFooter>
+	<pageFooter>
+		<band splitType="Stretch"/>
+	</pageFooter>
+	<summary>
+		<band height="25" splitType="Stretch">
+			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
+				<reportElement key="textField-2" x="380" y="0" width="115" height="15" uuid="e1b430bd-f552-4b70-bf5a-1f3323ec260a"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement key="staticText-1" x="211" y="0" width="169" height="15" uuid="fa3e7b86-f129-463f-92cb-10c0496e4085"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false"/>
+				</textElement>
 				<text><![CDATA[Total Outstanding Deposits]]></text>
-				</staticText>
-			</band>
-		</summary>
+			</staticText>
+		</band>
+	</summary>
 </jasperReport>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/OutstandingPayment.jrxml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/OutstandingPayment.jrxml	Tue Aug 04 10:02:42 2015 +0200
@@ -1,31 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="OutstandingPayment"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="495"
-		 pageHeight="802"
-		 columnWidth="495"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<parameter name="RECONCILIATION_ID" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<queryString><![CDATA[SELECT trans.statementdate as TRANS_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(gl.name), '') as DESCRIPTION,
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="OutstandingPayment" pageWidth="495" pageHeight="802" columnWidth="495" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="68f50d23-a828-4773-baa9-43d29eba6e70">
+	<property name="ireport.scriptlethandling" value="0"/>
+	<property name="ireport.encoding" value="UTF-8"/>
+	<import value="net.sf.jasperreports.engine.*"/>
+	<import value="java.util.*"/>
+	<import value="net.sf.jasperreports.engine.data.*"/>
+	<parameter name="RECONCILIATION_ID" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false"/>
+	<queryString>
+		<![CDATA[SELECT trans.statementdate as TRANS_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(gl.name), '') as DESCRIPTION,
        coalesce(TO_CHAR(p.documentno), '') as REF, trans.paymentamt as AMOUNT
 FROM fin_finacc_transaction trans
      left join fin_payment p on (trans.fin_payment_id = p.fin_payment_id)
@@ -45,128 +28,117 @@
       and trans.statementdate <= (SELECT rec.dateto
                                   FROM fin_reconciliation rec 
                                   WHERE fin_reconciliation_id=$P{RECONCILIATION_ID})
-ORDER BY TRANS_DATE, DESCRIPTION, AMOUNT]]></queryString>
-
+ORDER BY TRANS_DATE, DESCRIPTION, AMOUNT]]>
+	</queryString>
 	<field name="TRANS_DATE" class="java.util.Date"/>
 	<field name="DESCRIPTION" class="java.lang.String"/>
 	<field name="REF" class="java.lang.String"/>
 	<field name="AMOUNT" class="java.math.BigDecimal"/>
-
-	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
+	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" calculation="Sum">
 		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
 	</variable>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="15"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="0"
-						y="0"
-						width="70"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.util.Date"><![CDATA[$F{TRANS_DATE}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="70"
-						y="0"
-						width="188"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="258"
-						y="0"
-						width="122"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REF}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="25"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						key="textField-2"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-				<staticText>
-					<reportElement
-						x="211"
-						y="0"
-						width="169"
-						height="15"
-						key="staticText-1"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false"/>
-					</textElement>
+	<background>
+		<band splitType="Stretch"/>
+	</background>
+	<title>
+		<band splitType="Stretch"/>
+	</title>
+	<pageHeader>
+		<band splitType="Stretch"/>
+	</pageHeader>
+	<columnHeader>
+		<band splitType="Stretch"/>
+	</columnHeader>
+	<detail>
+		<band height="15" splitType="Stretch">
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="0" y="0" width="70" height="15" forecolor="#000000" uuid="a58d2606-6d3e-4595-a71b-47c49b5bb0f5"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{TRANS_DATE}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="70" y="0" width="188" height="15" forecolor="#000000" uuid="39ac3c1c-b0f1-4bad-937e-4e62b45dbe7a"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="258" y="0" width="122" height="15" forecolor="#000000" uuid="1fbd1971-7218-460e-ac70-34fa2b4eafa9"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{REF}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="380" y="0" width="115" height="15" forecolor="#000000" uuid="af740822-7e13-440c-8024-2e59eeb97147"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+		</band>
+	</detail>
+	<columnFooter>
+		<band splitType="Stretch"/>
+	</columnFooter>
+	<pageFooter>
+		<band splitType="Stretch"/>
+	</pageFooter>
+	<summary>
+		<band height="25" splitType="Stretch">
+			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
+				<reportElement key="textField-2" x="380" y="0" width="115" height="15" uuid="c6b5b448-e481-4f99-a0fe-2bab0061aa25"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement key="staticText-1" x="211" y="0" width="169" height="15" uuid="6ac100e3-91e4-4d9e-8a04-10fc24919482"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false"/>
+				</textElement>
 				<text><![CDATA[Total Outstanding Payments]]></text>
-				</staticText>
-			</band>
-		</summary>
+			</staticText>
+		</band>
+	</summary>
 </jasperReport>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2011 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -39,10 +39,10 @@
 import org.openbravo.base.secureApp.HttpSecureAppServlet;
 import org.openbravo.base.secureApp.VariablesSecureApp;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.client.application.report.ReportingUtils;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
-import org.openbravo.erpCommon.utility.Utility;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatement;
 import org.openbravo.model.financialmgmt.payment.FIN_BankStatementLine;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
@@ -107,15 +107,15 @@
     JasperReport subReportOutstandingDeposit;
     JasperReport subReportUnreconciledBankStatementLines;
     try {
-      subReportOutstandingPayment = Utility.getTranslatedJasperReport(this, strBaseDesign
+      subReportOutstandingPayment = ReportingUtils.getTranslatedJasperReport(this, strBaseDesign
           + "/org/openbravo/advpaymentmngt/ad_reports/OutstandingPayment.jrxml",
           vars.getLanguage(), strBaseDesign);
 
-      subReportOutstandingDeposit = Utility.getTranslatedJasperReport(this, strBaseDesign
+      subReportOutstandingDeposit = ReportingUtils.getTranslatedJasperReport(this, strBaseDesign
           + "/org/openbravo/advpaymentmngt/ad_reports/OutstandingDeposit.jrxml",
           vars.getLanguage(), strBaseDesign);
 
-      subReportUnreconciledBankStatementLines = Utility.getTranslatedJasperReport(this,
+      subReportUnreconciledBankStatementLines = ReportingUtils.getTranslatedJasperReport(this,
           strBaseDesign
               + "/org/openbravo/advpaymentmngt/ad_reports/UnreconciledBankStatement.jrxml",
           vars.getLanguage(), strBaseDesign);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.jrxml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/ReportReconciliation.jrxml	Tue Aug 04 10:02:42 2015 +0200
@@ -1,5 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
-<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReportReconciliation" pageWidth="595" pageHeight="842" columnWidth="495" leftMargin="50" rightMargin="50" topMargin="50" bottomMargin="50">
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="ReportReconciliation" pageWidth="595" pageHeight="842" columnWidth="495" leftMargin="50" rightMargin="50" topMargin="50" bottomMargin="50" uuid="e13c9c87-3b33-4f48-a07d-126ffc8c7729">
 	<property name="ireport.scriptlethandling" value="0"/>
 	<property name="ireport.encoding" value="UTF-8"/>
 	<property name="ireport.zoom" value="1.652892561983471"/>
@@ -44,10 +44,10 @@
 		<groupHeader>
 			<band height="30" splitType="Stretch">
 				<rectangle>
-					<reportElement key="rectangle-1" style="Gray" x="0" y="7" width="495" height="15"/>
+					<reportElement key="rectangle-1" style="Gray" x="0" y="7" width="495" height="15" uuid="c131ded8-d8f2-4052-addb-c98d78860259"/>
 				</rectangle>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-3" x="1" y="8" width="70" height="14"/>
+					<reportElement key="textField-3" x="1" y="8" width="70" height="14" uuid="f698ef9c-e197-4c6e-b8c2-937f07ae24ee"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -55,10 +55,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement verticalAlignment="Middle"/>
-					<textFieldExpression class="java.util.Date"><![CDATA[$P{DATE}]]></textFieldExpression>
+					<textFieldExpression><![CDATA[$P{DATE}]]></textFieldExpression>
 				</textField>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-6" x="380" y="8" width="115" height="14"/>
+					<reportElement key="textField-6" x="380" y="8" width="115" height="14" uuid="e20b0215-be5f-4bc9-8484-c1216fa7abff"/>
 					<box rightPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -66,10 +66,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{ACC_BAL_OB}!=null) ? $P{NUMBERFORMAT}.format($P{ACC_BAL_OB}).toString() : new String(" ")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{ACC_BAL_OB}!=null) ? $P{NUMBERFORMAT}.format($P{ACC_BAL_OB}).toString() : new String(" ")]]></textFieldExpression>
 				</textField>
 				<staticText>
-					<reportElement key="staticText-23" x="70" y="8" width="310" height="14"/>
+					<reportElement key="staticText-23" x="70" y="8" width="310" height="14" uuid="dedb8b72-67d5-42c2-a44c-3d47b6b1172a"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -84,10 +84,10 @@
 		<groupFooter>
 			<band height="40" splitType="Stretch">
 				<rectangle>
-					<reportElement key="rectangle-2" style="Gray" x="0" y="3" width="495" height="15"/>
+					<reportElement key="rectangle-2" style="Gray" x="0" y="3" width="495" height="15" uuid="77a6adec-f717-4469-8907-19ca51c860c1"/>
 				</rectangle>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-7" x="1" y="4" width="70" height="14"/>
+					<reportElement key="textField-7" x="1" y="4" width="70" height="14" uuid="ebd65b0c-a05a-46df-9310-62f0c0167fd8"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -95,10 +95,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement verticalAlignment="Middle"/>
-					<textFieldExpression class="java.util.Date"><![CDATA[$P{DATE}]]></textFieldExpression>
+					<textFieldExpression><![CDATA[$P{DATE}]]></textFieldExpression>
 				</textField>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-8" x="380" y="4" width="115" height="14"/>
+					<reportElement key="textField-8" x="380" y="4" width="115" height="14" uuid="11a2be14-6b04-4850-9721-79f5d8c65ab9"/>
 					<box rightPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -106,10 +106,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{ADJ_ACC_BAL_OB}!=null) ? "(" + $P{NUMBERFORMAT}.format($P{ADJ_ACC_BAL_OB}).toString() + ")" : new String(" ")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{ADJ_ACC_BAL_OB}!=null) ? "(" + $P{NUMBERFORMAT}.format($P{ADJ_ACC_BAL_OB}).toString() + ")" : new String(" ")]]></textFieldExpression>
 				</textField>
 				<staticText>
-					<reportElement key="staticText-24" x="70" y="4" width="310" height="14"/>
+					<reportElement key="staticText-24" x="70" y="4" width="310" height="14" uuid="ec4b912e-f847-461b-8cdf-52b0851fa4cc"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -120,10 +120,10 @@
 					<text><![CDATA[Adjusted Account Balance in Openbravo]]></text>
 				</staticText>
 				<rectangle>
-					<reportElement key="rectangle-3" style="Gray" x="0" y="18" width="495" height="15"/>
+					<reportElement key="rectangle-3" style="Gray" x="0" y="18" width="495" height="15" uuid="83c149f4-c94e-4277-a9e1-cd66915411b9"/>
 				</rectangle>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-9" x="1" y="19" width="70" height="14"/>
+					<reportElement key="textField-9" x="1" y="19" width="70" height="14" uuid="2ff6df70-fba7-437f-ab4d-79ed1d76b535"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -131,10 +131,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement verticalAlignment="Middle"/>
-					<textFieldExpression class="java.util.Date"><![CDATA[$P{DATE}]]></textFieldExpression>
+					<textFieldExpression><![CDATA[$P{DATE}]]></textFieldExpression>
 				</textField>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-10" x="380" y="19" width="115" height="14"/>
+					<reportElement key="textField-10" x="380" y="19" width="115" height="14" uuid="1e1fd754-07de-49f9-a954-ee948b9ae3a0"/>
 					<box rightPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -142,10 +142,10 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{END_BALANCE}!=null) ? "(" + $P{NUMBERFORMAT}.format($P{END_BALANCE}).toString() + ")" : new String("")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{END_BALANCE}!=null) ? "(" + $P{NUMBERFORMAT}.format($P{END_BALANCE}).toString() + ")" : new String("")]]></textFieldExpression>
 				</textField>
 				<staticText>
-					<reportElement key="staticText-25" x="70" y="19" width="310" height="14"/>
+					<reportElement key="staticText-25" x="70" y="19" width="310" height="14" uuid="c947f4cd-8ddc-4877-88d0-5df9f13690ab"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -164,7 +164,7 @@
 			<band height="20" splitType="Stretch">
 				<printWhenExpression><![CDATA[$P{SHOW_BAND_PAYMENT}]]></printWhenExpression>
 				<subreport isUsingCache="true">
-					<reportElement key="subreport-1" mode="Transparent" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true">
+					<reportElement key="subreport-1" mode="Transparent" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true" uuid="a36cebad-9476-4752-ad81-31a21d0b935b">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("DETAIL"))]]></printWhenExpression>
 					</reportElement>
 					<subreportParameter name="RECONCILIATION_ID">
@@ -174,10 +174,10 @@
 						<subreportParameterExpression><![CDATA[$P{NUMBERFORMAT}]]></subreportParameterExpression>
 					</subreportParameter>
 					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
-					<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SUBREP_OUTPAYMENT}]]></subreportExpression>
+					<subreportExpression><![CDATA[$P{SUBREP_OUTPAYMENT}]]></subreportExpression>
 				</subreport>
 				<staticText>
-					<reportElement key="staticText-11" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true"/>
+					<reportElement key="staticText-11" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true" uuid="0b5e5060-e767-45ee-9a73-62e1fe888c76"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -190,13 +190,13 @@
 					<text><![CDATA[Plus Outstanding Payments]]></text>
 				</staticText>
 				<line>
-					<reportElement key="line-1" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF"/>
+					<reportElement key="line-1" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF" uuid="9a6fc40b-e9c8-4122-8aff-909ea440abd9"/>
 					<graphicElement>
 						<pen lineWidth="0.5" lineStyle="Solid"/>
 					</graphicElement>
 				</line>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-12" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true">
+					<reportElement key="textField-12" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true" uuid="0e7a51ba-c00a-4baf-a6fa-e506064ab764">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("SUMMARY"))]]></printWhenExpression>
 					</reportElement>
 					<box rightPadding="5">
@@ -206,7 +206,7 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{AMT_OUT_PAYMENT}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_OUT_PAYMENT}).toString() : new String("")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{AMT_OUT_PAYMENT}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_OUT_PAYMENT}).toString() : new String("")]]></textFieldExpression>
 				</textField>
 			</band>
 		</groupHeader>
@@ -220,7 +220,7 @@
 			<band height="20" splitType="Stretch">
 				<printWhenExpression><![CDATA[$P{SHOW_BAND_DEPOSIT}]]></printWhenExpression>
 				<subreport isUsingCache="true">
-					<reportElement key="subreport-2" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true">
+					<reportElement key="subreport-2" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true" uuid="9dba37c9-3624-40e9-853b-a4a36f35f563">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("DETAIL"))]]></printWhenExpression>
 					</reportElement>
 					<subreportParameter name="RECONCILIATION_ID">
@@ -230,10 +230,10 @@
 						<subreportParameterExpression><![CDATA[$P{NUMBERFORMAT}]]></subreportParameterExpression>
 					</subreportParameter>
 					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
-					<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SUBREP_OUTDEPOSIT}]]></subreportExpression>
+					<subreportExpression><![CDATA[$P{SUBREP_OUTDEPOSIT}]]></subreportExpression>
 				</subreport>
 				<staticText>
-					<reportElement key="staticText-12" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true"/>
+					<reportElement key="staticText-12" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true" uuid="d3314afd-5f53-409e-bce5-13b6a2f86b68"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -246,13 +246,13 @@
 					<text><![CDATA[Less Outstanding Deposits]]></text>
 				</staticText>
 				<line>
-					<reportElement key="line-2" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF"/>
+					<reportElement key="line-2" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF" uuid="664c30d7-8479-4cbd-9697-ac3baa7fe10f"/>
 					<graphicElement>
 						<pen lineWidth="0.5" lineStyle="Solid"/>
 					</graphicElement>
 				</line>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-13" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true">
+					<reportElement key="textField-13" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true" uuid="e63299d1-73b3-493e-a4c7-bb6b9fac4db4">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("SUMMARY"))]]></printWhenExpression>
 					</reportElement>
 					<box rightPadding="5">
@@ -262,7 +262,7 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{AMT_OUT_DEPOSIT}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_OUT_DEPOSIT}).toString() : new String("")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{AMT_OUT_DEPOSIT}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_OUT_DEPOSIT}).toString() : new String("")]]></textFieldExpression>
 				</textField>
 			</band>
 		</groupHeader>
@@ -276,7 +276,7 @@
 			<band height="20" splitType="Stretch">
 				<printWhenExpression><![CDATA[$P{SHOW_BAND_BSLINE}]]></printWhenExpression>
 				<staticText>
-					<reportElement key="staticText-16" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true"/>
+					<reportElement key="staticText-16" x="0" y="0" width="244" height="14" isRemoveLineWhenBlank="true" uuid="0833c76d-7ec5-41e1-bba1-b8ce28dd3375"/>
 					<box leftPadding="5">
 						<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 						<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -289,7 +289,7 @@
 					<text><![CDATA[Plus Un-reconciled Bank Statement Lines]]></text>
 				</staticText>
 				<subreport isUsingCache="true">
-					<reportElement key="subreport-3" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true">
+					<reportElement key="subreport-3" x="1" y="15" width="494" height="5" isRemoveLineWhenBlank="true" uuid="7b4b599a-f070-49ea-8f56-53d99829d71f">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("DETAIL"))]]></printWhenExpression>
 					</reportElement>
 					<subreportParameter name="RECONCILIATION_ID">
@@ -299,22 +299,22 @@
 						<subreportParameterExpression><![CDATA[$P{NUMBERFORMAT}]]></subreportParameterExpression>
 					</subreportParameter>
 					<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
-					<subreportExpression class="net.sf.jasperreports.engine.JasperReport"><![CDATA[$P{SUBREP_UNRECBS}]]></subreportExpression>
+					<subreportExpression><![CDATA[$P{SUBREP_UNRECBS}]]></subreportExpression>
 				</subreport>
 				<line>
-					<reportElement key="line-3" x="0" y="13" width="495" height="1" forecolor="#E4DFDF"/>
+					<reportElement key="line-3" x="0" y="13" width="495" height="1" forecolor="#E4DFDF" uuid="d3d4172d-df6f-4db8-9c53-17ea62397922"/>
 					<graphicElement>
 						<pen lineWidth="0.5" lineStyle="Solid"/>
 					</graphicElement>
 				</line>
 				<line>
-					<reportElement key="line-4" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF"/>
+					<reportElement key="line-4" x="0" y="13" width="495" height="1" isRemoveLineWhenBlank="true" forecolor="#E4DFDF" uuid="3a93a5da-d574-44d2-b131-e6ab82ebc9fb"/>
 					<graphicElement>
 						<pen lineWidth="0.5" lineStyle="Solid"/>
 					</graphicElement>
 				</line>
 				<textField isBlankWhenNull="false">
-					<reportElement key="textField-14" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true">
+					<reportElement key="textField-14" x="380" y="0" width="115" height="15" isRemoveLineWhenBlank="true" uuid="8b13e43c-7a3c-44b7-866a-03eac41ecfa5">
 						<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("SUMMARY"))]]></printWhenExpression>
 					</reportElement>
 					<box rightPadding="5">
@@ -324,7 +324,7 @@
 						<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					</box>
 					<textElement textAlignment="Right" verticalAlignment="Middle"/>
-					<textFieldExpression class="java.lang.String"><![CDATA[($P{AMT_UNREC_BSLINE}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_UNREC_BSLINE}).toString() : new String("")]]></textFieldExpression>
+					<textFieldExpression><![CDATA[($P{AMT_UNREC_BSLINE}!=null) ? $P{NUMBERFORMAT}.format($P{AMT_UNREC_BSLINE}).toString() : new String("")]]></textFieldExpression>
 				</textField>
 			</band>
 		</groupHeader>
@@ -338,7 +338,7 @@
 	<title>
 		<band height="25" splitType="Stretch">
 			<staticText>
-				<reportElement key="staticText-26" x="0" y="0" width="495" height="25">
+				<reportElement key="staticText-26" x="0" y="0" width="495" height="25" uuid="6c3c0ed7-5ada-4eb2-9a35-f3c82eef720b">
 					<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("DETAIL"))]]></printWhenExpression>
 				</reportElement>
 				<box>
@@ -353,7 +353,7 @@
 				<text><![CDATA[Reconciliation Report]]></text>
 			</staticText>
 			<staticText>
-				<reportElement key="staticText-27" x="0" y="0" width="495" height="25">
+				<reportElement key="staticText-27" x="0" y="0" width="495" height="25" uuid="22fac109-dca3-4630-811f-d1f8199fd514">
 					<printWhenExpression><![CDATA[new Boolean($P{REPORT_TYPE}.equalsIgnoreCase("SUMMARY"))]]></printWhenExpression>
 				</reportElement>
 				<box>
@@ -372,7 +372,7 @@
 	<pageHeader>
 		<band height="36" splitType="Stretch">
 			<textField isBlankWhenNull="false">
-				<reportElement key="textField" x="50" y="0" width="445" height="18"/>
+				<reportElement key="textField" x="50" y="0" width="445" height="18" uuid="4adac3c2-d1f5-437c-8612-894c8e9ee6e5"/>
 				<box>
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -382,10 +382,10 @@
 				<textElement>
 					<font size="12"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$P{DATEFORMAT}.format($P{DATE})]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$P{DATEFORMAT}.format($P{DATE})]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="false">
-				<reportElement key="textField-11" x="50" y="18" width="445" height="18"/>
+				<reportElement key="textField-11" x="50" y="18" width="445" height="18" uuid="d7dd3a80-36b8-4eaa-b572-b40dc48b7e43"/>
 				<box>
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -395,17 +395,17 @@
 				<textElement>
 					<font size="12"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[$P{FINACCOUNT_INFO}]]></textFieldExpression>
+				<textFieldExpression><![CDATA[$P{FINACCOUNT_INFO}]]></textFieldExpression>
 			</textField>
 			<staticText>
-				<reportElement x="0" y="0" width="50" height="18"/>
+				<reportElement x="0" y="0" width="50" height="18" uuid="0c8c978a-ad85-444d-9fec-dd7909a55e5f"/>
 				<textElement>
 					<font size="12"/>
 				</textElement>
 				<text><![CDATA[per]]></text>
 			</staticText>
 			<staticText>
-				<reportElement x="0" y="18" width="50" height="18"/>
+				<reportElement x="0" y="18" width="50" height="18" uuid="137ddc7b-527b-4f23-8ee9-a6189e5185a2"/>
 				<textElement>
 					<font size="12"/>
 				</textElement>
@@ -416,7 +416,7 @@
 	<columnHeader>
 		<band height="18" splitType="Stretch">
 			<staticText>
-				<reportElement key="staticText-19" style="DarkGray" x="0" y="0" width="70" height="18"/>
+				<reportElement key="staticText-19" style="DarkGray" x="0" y="0" width="70" height="18" uuid="54c6e368-4ea7-4ce3-a1b2-757cb9c9ed90"/>
 				<box leftPadding="5">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -429,7 +429,7 @@
 				<text><![CDATA[Date]]></text>
 			</staticText>
 			<staticText>
-				<reportElement key="staticText-20" style="DarkGray" x="70" y="0" width="188" height="18"/>
+				<reportElement key="staticText-20" style="DarkGray" x="70" y="0" width="188" height="18" uuid="d2840ae6-4063-456d-b382-400e80153de8"/>
 				<box leftPadding="5">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -442,7 +442,7 @@
 				<text><![CDATA[Business Partner]]></text>
 			</staticText>
 			<staticText>
-				<reportElement key="staticText-21" style="DarkGray" x="258" y="0" width="122" height="18"/>
+				<reportElement key="staticText-21" style="DarkGray" x="258" y="0" width="122" height="18" uuid="f05dabc0-7803-4c62-aad5-f14806af8731"/>
 				<box leftPadding="5">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -455,7 +455,7 @@
 				<text><![CDATA[Reference]]></text>
 			</staticText>
 			<staticText>
-				<reportElement key="staticText-22" style="DarkGray" x="380" y="0" width="115" height="18"/>
+				<reportElement key="staticText-22" style="DarkGray" x="380" y="0" width="115" height="18" uuid="807da193-bf78-4771-8151-e3b4dfa2bb90"/>
 				<box leftPadding="5" rightPadding="5">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -478,7 +478,7 @@
 	<pageFooter>
 		<band height="20" splitType="Stretch">
 			<staticText>
-				<reportElement key="staticText-18" x="177" y="5" width="64" height="10"/>
+				<reportElement key="staticText-18" x="177" y="5" width="64" height="10" uuid="20547722-54b6-48b2-942c-b48f3ba3b0fa"/>
 				<box>
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -491,7 +491,7 @@
 				<text><![CDATA[Printed on ]]></text>
 			</staticText>
 			<textField isBlankWhenNull="false">
-				<reportElement key="textField-1" x="245" y="5" width="69" height="10"/>
+				<reportElement key="textField-1" x="245" y="5" width="69" height="10" uuid="1de32c9b-3444-4247-921a-4c1cb89b3dd1"/>
 				<box>
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -501,10 +501,10 @@
 				<textElement verticalAlignment="Middle">
 					<font size="8"/>
 				</textElement>
-				<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
+				<textFieldExpression><![CDATA[new Date()]]></textFieldExpression>
 			</textField>
 			<textField isBlankWhenNull="false">
-				<reportElement key="textField-2" x="325" y="5" width="141" height="10"/>
+				<reportElement key="textField-2" x="325" y="5" width="141" height="10" uuid="283754eb-9c0f-4ac1-9c93-86d8ca148e1a"/>
 				<box rightPadding="2">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -514,10 +514,10 @@
 				<textElement textAlignment="Right" verticalAlignment="Middle">
 					<font size="8"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA[" Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
+				<textFieldExpression><![CDATA[" Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
 			</textField>
 			<textField evaluationTime="Report" isBlankWhenNull="false">
-				<reportElement key="textField-15" x="467" y="5" width="28" height="10"/>
+				<reportElement key="textField-15" x="467" y="5" width="28" height="10" uuid="df6a7d65-428f-46a2-9fd4-09384a521eb0"/>
 				<box leftPadding="2">
 					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
 					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
@@ -527,7 +527,7 @@
 				<textElement textAlignment="Left" verticalAlignment="Middle">
 					<font size="8"/>
 				</textElement>
-				<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
+				<textFieldExpression><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
 			</textField>
 		</band>
 	</pageFooter>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/UnreconciledBankStatement.jrxml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/ad_reports/UnreconciledBankStatement.jrxml	Tue Aug 04 10:02:42 2015 +0200
@@ -1,31 +1,14 @@
-<?xml version="1.0" encoding="UTF-8"  ?>
-<!-- Created with iReport - A designer for JasperReports -->
-<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
-<jasperReport
-		 name="UnreconciledBankStatement"
-		 columnCount="1"
-		 printOrder="Vertical"
-		 orientation="Portrait"
-		 pageWidth="495"
-		 pageHeight="802"
-		 columnWidth="495"
-		 columnSpacing="0"
-		 leftMargin="0"
-		 rightMargin="0"
-		 topMargin="0"
-		 bottomMargin="0"
-		 whenNoDataType="NoPages"
-		 isTitleNewPage="false"
-		 isSummaryNewPage="false">
-	<property name="ireport.scriptlethandling" value="0" />
-	<property name="ireport.encoding" value="UTF-8" />
-	<import value="java.util.*" />
-	<import value="net.sf.jasperreports.engine.*" />
-	<import value="net.sf.jasperreports.engine.data.*" />
-
-	<parameter name="RECONCILIATION_ID" isForPrompting="false" class="java.lang.String"/>
-	<parameter name="NUMBERFORMAT" isForPrompting="false" class="java.text.DecimalFormat"/>
-	<queryString><![CDATA[SELECT bsl.datetrx as BSLINE_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(bsl.bpartnername), '') as DESCRIPTION,
+<?xml version="1.0" encoding="UTF-8"?>
+<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="UnreconciledBankStatement" pageWidth="495" pageHeight="802" columnWidth="495" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="9495e9b0-c162-42e2-8a73-7748c5fd766f">
+	<property name="ireport.scriptlethandling" value="0"/>
+	<property name="ireport.encoding" value="UTF-8"/>
+	<import value="net.sf.jasperreports.engine.*"/>
+	<import value="java.util.*"/>
+	<import value="net.sf.jasperreports.engine.data.*"/>
+	<parameter name="RECONCILIATION_ID" class="java.lang.String" isForPrompting="false"/>
+	<parameter name="NUMBERFORMAT" class="java.text.DecimalFormat" isForPrompting="false"/>
+	<queryString>
+		<![CDATA[SELECT bsl.datetrx as BSLINE_DATE, coalesce(TO_CHAR(bp.name), TO_CHAR(bsl.bpartnername), '') as DESCRIPTION,
        bsl.referenceno as REF, (bsl.cramount - bsl.dramount) as AMOUNT
 FROM fin_bankstatementline bsl join fin_bankstatement bs on (bsl.fin_bankstatement_id=bs.fin_bankstatement_id)
      left join c_bpartner bp on (bp.c_bpartner_id = bsl.c_bpartner_id)
@@ -43,128 +26,117 @@
 						and fin_reconciliation.created > (SELECT rec.created
 							     FROM fin_reconciliation rec
 							     WHERE fin_reconciliation_id=$P{RECONCILIATION_ID})))
-ORDER BY BSLINE_DATE, DESCRIPTION, AMOUNT]]></queryString>
-
+ORDER BY BSLINE_DATE, DESCRIPTION, AMOUNT]]>
+	</queryString>
 	<field name="BSLINE_DATE" class="java.util.Date"/>
 	<field name="DESCRIPTION" class="java.lang.String"/>
 	<field name="REF" class="java.lang.String"/>
 	<field name="AMOUNT" class="java.math.BigDecimal"/>
-
-	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" resetType="Report" calculation="Sum">
+	<variable name="SUM_LINEAMT" class="java.math.BigDecimal" calculation="Sum">
 		<variableExpression><![CDATA[$F{AMOUNT}]]></variableExpression>
 	</variable>
-		<background>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</background>
-		<title>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</title>
-		<pageHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageHeader>
-		<columnHeader>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnHeader>
-		<detail>
-			<band height="15"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="0"
-						y="0"
-						width="70"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.util.Date"><![CDATA[$F{BSLINE_DATE}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="70"
-						y="0"
-						width="188"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="258"
-						y="0"
-						width="122"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" leftPadding="5" rightBorder="None" rightBorderColor="#000000" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Left" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[$F{REF}]]></textFieldExpression>
-				</textField>
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						forecolor="#000000"
-						key="textField"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false" isItalic="false" isUnderline="false" isPdfEmbedded ="false" isStrikeThrough="false" />
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-			</band>
-		</detail>
-		<columnFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</columnFooter>
-		<pageFooter>
-			<band height="0"  isSplitAllowed="true" >
-			</band>
-		</pageFooter>
-		<summary>
-			<band height="25"  isSplitAllowed="true" >
-				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
-					<reportElement
-						x="380"
-						y="0"
-						width="115"
-						height="15"
-						key="textField-2"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8"/>
-					</textElement>
-				<textFieldExpression   class="java.lang.String"><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
-				</textField>
-				<staticText>
-					<reportElement
-						x="211"
-						y="0"
-						width="169"
-						height="15"
-						key="staticText-1"/>
-					<box topBorder="None" topBorderColor="#000000" leftBorder="None" leftBorderColor="#000000" rightBorder="None" rightBorderColor="#000000" rightPadding="5" bottomBorder="None" bottomBorderColor="#000000"/>
-					<textElement textAlignment="Right" verticalAlignment="Middle">
-						<font size="8" isBold="false"/>
-					</textElement>
+	<background>
+		<band splitType="Stretch"/>
+	</background>
+	<title>
+		<band splitType="Stretch"/>
+	</title>
+	<pageHeader>
+		<band splitType="Stretch"/>
+	</pageHeader>
+	<columnHeader>
+		<band splitType="Stretch"/>
+	</columnHeader>
+	<detail>
+		<band height="15" splitType="Stretch">
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="0" y="0" width="70" height="15" forecolor="#000000" uuid="b88289cf-2a24-4069-8424-8ff153478d1e"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{BSLINE_DATE}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="70" y="0" width="188" height="15" forecolor="#000000" uuid="a90cf7ad-08a1-44bc-9b14-02e75d629162"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{DESCRIPTION}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="true">
+				<reportElement key="textField" x="258" y="0" width="122" height="15" forecolor="#000000" uuid="538dcd06-f536-4782-b58b-9ed782de676d"/>
+				<box leftPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Left" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[$F{REF}]]></textFieldExpression>
+			</textField>
+			<textField pattern="" isBlankWhenNull="false">
+				<reportElement key="textField" x="380" y="0" width="115" height="15" forecolor="#000000" uuid="00a8a427-98a4-4f4d-a4fa-cf83845c204a"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" isPdfEmbedded="false"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($F{AMOUNT}!=null) ? $P{NUMBERFORMAT}.format($F{AMOUNT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+		</band>
+	</detail>
+	<columnFooter>
+		<band splitType="Stretch"/>
+	</columnFooter>
+	<pageFooter>
+		<band splitType="Stretch"/>
+	</pageFooter>
+	<summary>
+		<band height="25" splitType="Stretch">
+			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false">
+				<reportElement key="textField-2" x="380" y="0" width="115" height="15" uuid="46be7abd-7bf1-425d-b759-f9c8eb850e43"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8"/>
+				</textElement>
+				<textFieldExpression><![CDATA[($V{SUM_LINEAMT}!=null) ? $P{NUMBERFORMAT}.format($V{SUM_LINEAMT}).toString() : new String(" ")]]></textFieldExpression>
+			</textField>
+			<staticText>
+				<reportElement key="staticText-1" x="211" y="0" width="169" height="15" uuid="d3692343-d2f3-478e-9991-7668a97e3157"/>
+				<box rightPadding="5">
+					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
+				</box>
+				<textElement textAlignment="Right" verticalAlignment="Middle">
+					<font size="8" isBold="false"/>
+				</textElement>
 				<text><![CDATA[Total Un-reconciled Bank Statement Lines]]></text>
-				</staticText>
-			</band>
-		</summary>
+			</staticText>
+		</band>
+	</summary>
 </jasperReport>
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/AdvPaymentMngtDao.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  Enterprise Intelligence Systems (http://www.eintel.com.au).
  *************************************************************************
@@ -256,8 +256,7 @@
 
       // remove selected payments
       if (selectedScheduledPaymentDetails != null && selectedScheduledPaymentDetails.size() > 0) {
-        String strSelectedPaymentDetails = FIN_Utility
-            .getInStrList(selectedScheduledPaymentDetails);
+        String strSelectedPaymentDetails = Utility.getInStrList(selectedScheduledPaymentDetails);
         whereClause.append(" and psd not in (");
         whereClause.append(strSelectedPaymentDetails);
         whereClause.append(")");
@@ -272,7 +271,7 @@
         for (FIN_PaymentPropDetail ppd : obc.list()) {
           aux.add(ppd.getFINPaymentScheduledetail());
         }
-        whereClause.append(" and psd.id not in (" + FIN_Utility.getInStrList(aux) + ")");
+        whereClause.append(" and psd.id not in (" + Utility.getInStrList(aux) + ")");
       }
       if (!StringUtils.isEmpty(strAmountFrom)) {
         whereClause.append(" and psd.");
@@ -554,11 +553,21 @@
       paymentScheduleDetails.add(paymentScheduleDetail);
       newPaymentDetail.setFINPaymentScheduleDetailList(paymentScheduleDetails);
 
+      if (payment.getDocumentType().getDocumentSequence() != null) {
+        OBContext.getOBContext().addWritableOrganization(
+            payment.getDocumentType().getDocumentSequence().getOrganization().getId());
+      }
+
       OBDal.getInstance().save(payment);
       OBDal.getInstance().save(newPaymentDetail);
       OBDal.getInstance().save(paymentScheduleDetail);
       OBDal.getInstance().flush();
 
+      if (payment.getDocumentType().getDocumentSequence() != null) {
+        OBContext.getOBContext().removeWritableOrganization(
+            payment.getDocumentType().getDocumentSequence().getOrganization().getId());
+      }
+
       return newPaymentDetail;
     } finally {
       OBContext.restorePreviousMode();
@@ -1886,8 +1895,14 @@
   }
 
   public BigDecimal getCustomerCredit(BusinessPartner bp, boolean isReceipt, Organization Org) {
+    return getCustomerCredit(bp, isReceipt, Org, null);
+  }
+
+  public BigDecimal getCustomerCredit(BusinessPartner bp, boolean isReceipt, Organization Org,
+      Currency currency) {
     BigDecimal creditAmount = BigDecimal.ZERO;
-    for (FIN_Payment payment : getCustomerPaymentsWithCredit(Org, bp, isReceipt))
+    List<FIN_Payment> paymentList = getCustomerPaymentsWithCredit(Org, bp, isReceipt, currency);
+    for (FIN_Payment payment : paymentList)
       creditAmount = creditAmount.add(payment.getGeneratedCredit()).subtract(
           payment.getUsedCredit());
     return creditAmount;
@@ -1914,6 +1929,15 @@
    */
   public List<FIN_Payment> getCustomerPaymentsWithCredit(Organization org, BusinessPartner bp,
       boolean isReceipt) {
+    return getCustomerPaymentsWithCredit(org, bp, isReceipt, null);
+  }
+
+  /**
+   * Returns the list of credit payments for the selected business partner that belongs to the legal
+   * entity's natural tree of the given organization
+   */
+  public List<FIN_Payment> getCustomerPaymentsWithCredit(Organization org, BusinessPartner bp,
+      boolean isReceipt, Currency currency) {
 
     try {
       OBContext.setAdminMode(true);
@@ -1927,6 +1951,9 @@
       Set<String> orgIds = OBContext.getOBContext().getOrganizationStructureProvider()
           .getChildTree(legalEntity.getId(), true);
       obcPayment.add(Restrictions.in("organization.id", orgIds));
+      if (currency != null) {
+        obcPayment.add(Restrictions.eq(FIN_Payment.PROPERTY_CURRENCY, currency));
+      }
       obcPayment.addOrderBy(FIN_Payment.PROPERTY_PAYMENTDATE, true);
       obcPayment.addOrderBy(FIN_Payment.PROPERTY_DOCUMENTNO, true);
 
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/dao/TransactionsDao.java	Tue Aug 04 10:02:42 2015 +0200
@@ -131,6 +131,7 @@
         newTransaction.setForeignConversionRate(payment.getFinancialTransactionConvertRate());
         newTransaction.setForeignAmount(payment.getAmount());
       }
+      payment.getFINFinaccTransactionList().add(newTransaction);
       OBDal.getInstance().save(newTransaction);
       OBDal.getInstance().flush();
     } finally {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/event/FIN_FinaccTransactionEventListener.java	Tue Aug 04 10:02:42 2015 +0200
@@ -33,12 +33,8 @@
 import org.openbravo.model.financialmgmt.gl.GLItem;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
 
 public class FIN_FinaccTransactionEventListener extends EntityPersistenceEventObserver {
-  private static final Logger logger = LoggerFactory
-      .getLogger(FIN_FinaccTransactionEventListener.class);
 
   private static Entity[] entities = { ModelProvider.getInstance().getEntity(
       FIN_FinaccTransaction.ENTITY_NAME) };
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddOrderOrInvoiceFilterExpressionHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -83,7 +83,7 @@
     AddPaymentDefaultValuesHandler handler = getDefaultsHandler(strWindowId);
     String paymentMethodId = handler.getDefaultPaymentMethod(requestMap);
     if (context.has("inpfinPaymentId") && context.get("inpfinPaymentId") != JSONObject.NULL
-        && StringUtils.isNotBlank((String) context.getString("inpfinPaymentId"))) {
+        && StringUtils.isNotBlank(context.getString("inpfinPaymentId"))) {
       if (hasDetailsWithDifferentPaymentMethods((String) context.get("inpfinPaymentId"))) {
         return "";
       } else {
@@ -111,7 +111,7 @@
     query.setParameter("paymentId", paymentId);
     FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, paymentId);
     for (Object pmId : query.list()) {
-      if (!payment.getPaymentMethod().getId().equals((String) pmId)) {
+      if (!payment.getPaymentMethod().getId().equals(pmId)) {
         return true;
       }
     }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddPaymentDefaultValuesHandler.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -27,17 +27,21 @@
 import org.apache.commons.lang.StringUtils;
 import org.codehaus.jettison.json.JSONException;
 import org.codehaus.jettison.json.JSONObject;
+import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.security.OrganizationStructureProvider;
+import org.openbravo.dal.service.OBCriteria;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
+import org.openbravo.model.financialmgmt.payment.FIN_PaymentMethod;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentSchedule;
 import org.openbravo.model.financialmgmt.payment.FIN_PaymentScheduleDetail;
+import org.openbravo.model.financialmgmt.payment.FinAccPaymentMethod;
 
 @RequestScoped
 // Public class to allow extend the functionality, for example Add Payment popup opening from menu
@@ -316,6 +320,8 @@
    */
   public String getDefaultPaymentMethod(Map<String, String> requestMap) throws JSONException {
     String strContext = requestMap.get("context");
+    String strFinPaymentMethodId = null;
+    String strFinancialAccountId = null;
     if (strContext == null) {
       return "";
     }
@@ -323,16 +329,28 @@
     if (context.has("inpfinPaymentmethodId")
         && context.get("inpfinPaymentmethodId") != JSONObject.NULL
         && StringUtils.isNotEmpty(context.getString("inpfinPaymentmethodId"))) {
-      return context.getString("inpfinPaymentmethodId");
+      strFinPaymentMethodId = context.getString("inpfinPaymentmethodId");
+    }
+    strFinancialAccountId = getDefaultFinancialAccount(requestMap);
+    if (strFinPaymentMethodId != null && strFinancialAccountId != null) {
+      if (getFinancialAccountPaymentMethod(strFinPaymentMethodId, strFinancialAccountId) != null) {
+        return strFinPaymentMethodId;
+      }
     }
     String strBPartnerId = getDefaultReceivedFrom(requestMap);
     if (StringUtils.isNotEmpty(strBPartnerId)) {
       BusinessPartner businessPartner = OBDal.getInstance().get(BusinessPartner.class,
           strBPartnerId);
       boolean isSOTrx = "Y".equals(getDefaultIsSOTrx(requestMap));
-      if (isSOTrx && businessPartner.getPaymentMethod() != null) {
+      if (isSOTrx
+          && businessPartner.getPaymentMethod() != null
+          && getFinancialAccountPaymentMethod(businessPartner.getPaymentMethod().getId(),
+              strFinancialAccountId) != null) {
         return businessPartner.getPaymentMethod().getId();
-      } else if (!isSOTrx && businessPartner.getPOPaymentMethod() != null) {
+      } else if (!isSOTrx
+          && businessPartner.getPOPaymentMethod() != null
+          && getFinancialAccountPaymentMethod(businessPartner.getPOPaymentMethod().getId(),
+              strFinancialAccountId) != null) {
         return businessPartner.getPOPaymentMethod().getId();
       }
     }
@@ -404,4 +422,17 @@
     }
   }
 
+  private FinAccPaymentMethod getFinancialAccountPaymentMethod(String paymentMethodId,
+      String financialAccountId) {
+    OBCriteria<FinAccPaymentMethod> obc = OBDal.getInstance().createCriteria(
+        FinAccPaymentMethod.class);
+    obc.setFilterOnReadableOrganization(false);
+    obc.setMaxResults(1);
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_ACCOUNT,
+        OBDal.getInstance().get(FIN_FinancialAccount.class, financialAccountId)));
+    obc.add(Restrictions.eq(FinAccPaymentMethod.PROPERTY_PAYMENTMETHOD,
+        OBDal.getInstance().get(FIN_PaymentMethod.class, paymentMethodId)));
+    return (FinAccPaymentMethod) obc.uniqueResult();
+  }
+
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/AddTransactionFilterExpression.java	Tue Aug 04 10:02:42 2015 +0200
@@ -1,3 +1,22 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU 
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU 
+ * All Rights Reserved. 
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
 package org.openbravo.advpaymentmngt.filterexpression;
 
 import java.math.BigDecimal;
@@ -91,7 +110,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return "BPW";
     } else {
       return "BPD";
@@ -137,7 +156,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return "0.00";
     } else {
       return bankstatementline.getCramount().toString();
@@ -149,7 +168,7 @@
     String bankStatementLineId = context.getString("bankStatementLineId");
     FIN_BankStatementLine bankstatementline = OBDal.getInstance().get(FIN_BankStatementLine.class,
         bankStatementLineId);
-    if (!(bankstatementline.getDramount().equals(BigDecimal.ZERO))) {
+    if (bankstatementline.getDramount().compareTo(BigDecimal.ZERO) != 0) {
       return bankstatementline.getDramount().toString();
     } else {
       return "0.00";
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentInAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentInAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
 
@@ -59,7 +60,9 @@
     BusinessPartner bpartner = paymentIn.getBusinessPartner();
     if (bpartner != null) {
       Organization org = paymentIn.getOrganization();
-      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org);
+      Currency currency = paymentIn.getCurrency();
+      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org,
+          currency);
       return customerCredit.signum() > 0;
     } else {
       return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentOutAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentOutAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.payment.FIN_Payment;
 
@@ -59,7 +60,9 @@
       BusinessPartner bpartner = paymentOut.getBusinessPartner();
       if (bpartner != null) {
         Organization org = paymentOut.getOrganization();
-        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org);
+        Currency currency = paymentOut.getCurrency();
+        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org,
+            currency);
         return customerCredit.signum() > 0;
       } else {
         return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentSelectorFilterExpression.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PaymentSelectorFilterExpression.java	Tue Aug 04 10:02:42 2015 +0200
@@ -21,26 +21,16 @@
 
 import java.util.Map;
 
-import javax.servlet.http.HttpSession;
-
-import org.apache.log4j.Logger;
 import org.openbravo.client.application.FilterExpression;
-import org.openbravo.client.application.OBBindingsConstants;
-import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.financialmgmt.payment.FIN_FinancialAccount;
 
 public class PaymentSelectorFilterExpression implements FilterExpression {
-  private Logger log = Logger.getLogger(PaymentSelectorFilterExpression.class);
   private Map<String, String> requestMap;
-  private HttpSession httpSession;
-  private String windowId;
 
   @Override
   public String getExpression(Map<String, String> _requestMap) {
     requestMap = _requestMap;
-    httpSession = RequestContext.get().getSession();
-    windowId = requestMap.get(OBBindingsConstants.WINDOW_ID_PARAM);
 
     if (requestMap.containsKey("inpfinFinancialAccountId")) {
       FIN_FinancialAccount financialaccount = OBDal.getInstance().get(FIN_FinancialAccount.class,
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseInvoiceAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseInvoiceAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.invoice.Invoice;
 
@@ -60,7 +61,9 @@
       BusinessPartner bpartner = invoice.getBusinessPartner();
       if (bpartner != null) {
         Organization org = invoice.getOrganization();
-        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org);
+        Currency currency = invoice.getCurrency();
+        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org,
+            currency);
         return customerCredit.signum() > 0;
       } else {
         return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseOrderAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/PurchaseOrderAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.order.Order;
 
@@ -60,7 +61,9 @@
       BusinessPartner bpartner = order.getBusinessPartner();
       if (bpartner != null) {
         Organization org = order.getOrganization();
-        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org);
+        Currency currency = order.getCurrency();
+        BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, false, org,
+            currency);
         return (customerCredit.signum() > 0);
       } else {
         return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesInvoiceAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesInvoiceAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.invoice.Invoice;
 
@@ -59,7 +60,9 @@
     BusinessPartner bpartner = invoice.getBusinessPartner();
     if (bpartner != null) {
       Organization org = invoice.getOrganization();
-      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org);
+      Currency currency = invoice.getCurrency();
+      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org,
+          currency);
       return customerCredit.signum() > 0;
     } else {
       return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesOrderAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/SalesOrderAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.common.order.Order;
 
@@ -60,7 +61,9 @@
     BusinessPartner bpartner = order.getBusinessPartner();
     if (bpartner != null) {
       Organization org = order.getOrganization();
-      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org);
+      Currency currency = order.getCurrency();
+      BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner, true, org,
+          currency);
       return customerCredit.signum() > 0;
     } else {
       return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDefaultValues.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -170,16 +170,18 @@
     FinAccPaymentMethod anyFinAccPaymentMethod = null;
     for (FinAccPaymentMethod finAccPaymentMethod : getFinancialAccount(requestMap)
         .getFinancialMgmtFinAccPaymentMethodList()) {
-      if (finAccPaymentMethod.isDefault()) {
+      if (finAccPaymentMethod.isActive()) {
+        if (finAccPaymentMethod.isDefault()) {
+          if ((isReceipt && finAccPaymentMethod.isPayinAllow())
+              || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
+            return finAccPaymentMethod.getPaymentMethod().getId();
+          }
+        }
         if ((isReceipt && finAccPaymentMethod.isPayinAllow())
             || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
-          return finAccPaymentMethod.getPaymentMethod().getId();
+          anyFinAccPaymentMethod = finAccPaymentMethod;
         }
       }
-      if ((isReceipt && finAccPaymentMethod.isPayinAllow())
-          || (!isReceipt && finAccPaymentMethod.isPayoutAllow())) {
-        anyFinAccPaymentMethod = finAccPaymentMethod;
-      }
     }
     return anyFinAccPaymentMethod != null ? anyFinAccPaymentMethod.getPaymentMethod().getId() : "";
   }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDisplayLogics.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/filterexpression/TransactionAddPaymentDisplayLogics.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -28,6 +28,7 @@
 import org.openbravo.client.kernel.ComponentProvider;
 import org.openbravo.dal.service.OBDal;
 import org.openbravo.model.common.businesspartner.BusinessPartner;
+import org.openbravo.model.common.currency.Currency;
 import org.openbravo.model.common.enterprise.Organization;
 import org.openbravo.model.financialmgmt.payment.FIN_FinaccTransaction;
 
@@ -55,16 +56,21 @@
   @Override
   public boolean getCreditToUseDisplayLogic(Map<String, String> requestMap) throws JSONException {
     JSONObject context = new JSONObject(requestMap.get("context"));
-    if (context.has("received_from") && !context.isNull("received_from")
-        && !"".equals(context.getString("received_from"))) {
-      String document = context.getString("trxtype");
-      String strBusinessPartner = context.getString("received_from");
+    if ((context.has("received_from") && !context.isNull("received_from") && !"".equals(context
+        .getString("received_from")))
+        || (context.has("inpreceivedFrom") && !context.isNull("inpreceivedFrom") && !""
+            .equals(context.getString("inpreceivedFrom")))) {
+      String document = !context.isNull("received_from") ? context.getString("trxtype") : context
+          .getString("inptrxtype");
+      String strBusinessPartner = !context.isNull("received_from") ? context
+          .getString("received_from") : context.getString("inpreceivedFrom");
       if (getDefaultGeneratedCredit(requestMap).signum() == 0 || "RCIN".equals(document)) {
         BusinessPartner bpartner = OBDal.getInstance().get(BusinessPartner.class,
             strBusinessPartner);
         Organization org = OBDal.getInstance().get(Organization.class, context.get("ad_org_id"));
+        Currency currency = OBDal.getInstance().get(Currency.class, context.get("c_currency_id"));
         BigDecimal customerCredit = new AdvPaymentMngtDao().getCustomerCredit(bpartner,
-            "RCIN".equals(document), org);
+            "RCIN".equals(document), org, currency);
         return customerCredit.signum() > 0;
       } else {
         return false;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/AddPaymentOrderInvoicesTransformer.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/AddPaymentOrderInvoicesTransformer.java	Tue Aug 04 10:02:42 2015 +0200
@@ -287,7 +287,9 @@
     StringBuffer groupByClause = new StringBuffer();
     // Create GroupBy Clause
     if ("I".equals(transactionType)) {
+      groupByClause.append(" inv.id, ");
       groupByClause.append(" inv.documentNo, ");
+      groupByClause.append(" inv.documentType, ");
       groupByClause.append(" COALESCE(ips.finPaymentmethod.id, ops.finPaymentmethod.id), ");
       groupByClause.append(" COALESCE(ipsfp.name, opsfp.name), ");
       groupByClause.append(" COALESCE(ips.expectedDate, ops.expectedDate), ");
@@ -297,14 +299,20 @@
       groupByClause.append(" oinfo.aPRMPaymentDescription, ");
       groupByClause.append(" inv.orderReference, ");
     } else if ("O".equals(transactionType)) {
+      groupByClause.append(" ord.id, ");
       groupByClause.append(" ord.documentNo, ");
+      groupByClause.append(" ord.documentType, ");
       groupByClause.append(" COALESCE(ops.finPaymentmethod.id, ips.finPaymentmethod.id), ");
       groupByClause.append(" COALESCE(opsfp.name, ipsfp.name), ");
       groupByClause.append(" COALESCE(ops.expectedDate, ips.expectedDate), ");
       groupByClause.append(" COALESCE(opriority.priority, ipriority.priority), ");
     } else {
+      groupByClause.append(" inv.id, ");
       groupByClause.append(" inv.documentNo, ");
+      groupByClause.append(" inv.documentType, ");
+      groupByClause.append(" ord.id, ");
       groupByClause.append(" ord.documentNo, ");
+      groupByClause.append(" ord.documentType, ");
       groupByClause.append(" COALESCE(ips.finPaymentmethod.id, ops.finPaymentmethod.id), ");
       groupByClause.append(" COALESCE(ipsfp.name, opsfp.name), ");
       groupByClause.append(" COALESCE(ips.expectedDate, ops.expectedDate), ");
@@ -321,10 +329,6 @@
 
   /**
    * Order by selectedPSDs, scheduled date and document number
-   * 
-   * @param selectedPSDs
-   * @param transactionType
-   * @return
    */
   protected StringBuffer getOrderByClause(String transactionType, List<String> selectedPSDs,
       Map<String, String> requestParameters) {
@@ -383,13 +387,6 @@
     return hqlQuery;
   }
 
-  /**
-   * @param _hqlQuery
-   * @param transactionType
-   * @param criteria
-   * @param queryNamedParameters
-   * @return
-   */
   protected String calculateHavingClause(String _hqlQuery, String transactionType,
       JSONObject criteria, Map<String, Object> queryNamedParameters) {
     String hqlQuery = _hqlQuery;
@@ -419,7 +416,10 @@
             getAggregatorFunction("ord.documentNo"));
       }
       if (havingGridFilters.contains("@invoiceNo@")) {
-        havingGridFilters = havingGridFilters.replaceAll("@invoiceNo@", "inv.documentNo");
+        havingGridFilters = havingGridFilters.replaceAll("@invoiceNo@",
+            " case when (inv.salesTransaction = false and oinfo is not null"
+                + " and oinfo.aPRMPaymentDescription like 'Supplier Reference')"
+                + " then inv.orderReference else inv.documentNo end");
       }
       if (havingGridFilters.contains("@paymentMethod@")) {
         havingGridFilters = havingGridFilters.replaceAll("@paymentMethod@",
@@ -446,8 +446,11 @@
         havingGridFilters = havingGridFilters.replaceAll("@salesOrderNo@", "ord.documentNo");
       }
       if (havingGridFilters.contains("@invoiceNo@")) {
+        getAggregatorFunction("inv.documentNo");
         havingGridFilters = havingGridFilters.replaceAll("@invoiceNo@",
-            getAggregatorFunction("inv.documentNo"));
+            " hqlagg(case when (inv.salesTransaction = false and oinfo is not null"
+                + " and oinfo.aPRMPaymentDescription like 'Supplier Reference')"
+                + " then inv.orderReference else inv.documentNo end)");
       }
       if (havingGridFilters.contains("@paymentMethod@")) {
         havingGridFilters = havingGridFilters.replaceAll("@paymentMethod@",
@@ -474,7 +477,10 @@
         havingGridFilters = havingGridFilters.replaceAll("@salesOrderNo@", "ord.documentNo");
       }
       if (havingGridFilters.contains("@invoiceNo@")) {
-        havingGridFilters = havingGridFilters.replaceAll("@invoiceNo@", "inv.documentNo");
+        havingGridFilters = havingGridFilters.replaceAll("@invoiceNo@",
+            " case when (inv.salesTransaction = false and oinfo is not null"
+                + " and oinfo.aPRMPaymentDescription like 'Supplier Reference')"
+                + " then inv.orderReference else inv.documentNo end");
       }
       if (havingGridFilters.contains("@paymentMethod@")) {
         havingGridFilters = havingGridFilters.replaceAll("@paymentMethod@",
@@ -510,13 +516,6 @@
     return hqlQuery;
   }
 
-  /**
-   * @param _hqlQuery
-   * @param transactionType
-   * @param selectedPSDs
-   * @param orderByClause
-   * @return
-   */
   protected String appendOrderByClause(String _hqlQuery, StringBuffer orderByClause,
       boolean justCount) {
     String hqlQuery = _hqlQuery;
@@ -553,10 +552,6 @@
     buildCriteria.put("criteria", newCriteriaArray);
   }
 
-  /**
-   * @param expression
-   * @return
-   */
   protected String getAggregatorFunction(String expression) {
     return " hqlagg(" + expression + ")";
   }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/CreditToUseTransformer.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/hqlinjections/CreditToUseTransformer.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -36,12 +36,16 @@
     transformedHQL = transformedHQL.replace("@whereClause@",
         getWhereClause(requestParameters, queryNamedParameters));
 
+    // Sets parameters
+    queryNamedParameters.put("currencyId", requestParameters.get("c_currency_id"));
+
     return transformedHQL;
   }
 
   private CharSequence getWhereClause(Map<String, String> requestParameters,
       Map<String, Object> queryNamedParameters) {
-    return " ";
+    StringBuffer whereClause = new StringBuffer();
+    whereClause.append(" and f.currency.id = :currencyId ");
+    return whereClause;
   }
-
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPayment.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -1276,9 +1276,6 @@
 
   /**
    * Returns the date in which last payment for this invoice took place
-   * 
-   * @param invoice
-   * @return
    */
   private static Date getFinalSettlementDate(Invoice invoice) {
     final OBCriteria<FIN_PaymentSchedInvV> obc = OBDal.getInstance().createCriteria(
@@ -1364,7 +1361,7 @@
    */
   public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn,
       String strAction, FIN_Payment payment) throws Exception {
-    OBError myMessage = processPayment(vars, conn, strAction, payment, null);
+    OBError myMessage = processPayment(vars, conn, strAction, payment, null, null);
     return myMessage;
   }
 
@@ -1386,11 +1383,37 @@
    */
   public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn,
       String strAction, FIN_Payment payment, String comingFrom) throws Exception {
+    OBError myMessage = processPayment(vars, conn, strAction, payment, comingFrom, null);
+    return myMessage;
+  }
+
+  /**
+   * It calls the PAyment Process for the given payment, action and origin.
+   * 
+   * @param vars
+   *          VariablesSecureApp with the session data.
+   * @param conn
+   *          ConnectionProvider with the connection being used.
+   * @param strAction
+   *          String with the action of the process. {P, D, R}
+   * @param payment
+   *          FIN_Payment that needs to be processed.
+   * @param comingFrom
+   *          Origin where the process is invoked
+   * @param selectedCreditLineIds
+   *          Id's of selected lines in Credit to Use grid
+   * @return a OBError with the result message of the process.
+   * @throws Exception
+   */
+  public static OBError processPayment(VariablesSecureApp vars, ConnectionProvider conn,
+      String strAction, FIN_Payment payment, String comingFrom, String selectedCreditLineIds)
+      throws Exception {
     ProcessBundle pb = new ProcessBundle("6255BE488882480599C81284B70CD9B3", vars).init(conn);
     HashMap<String, Object> parameters = new HashMap<String, Object>();
     parameters.put("action", strAction);
     parameters.put("Fin_Payment_ID", payment.getId());
     parameters.put("comingFrom", comingFrom);
+    parameters.put("selectedCreditLineIds", selectedCreditLineIds);
     pb.setParams(parameters);
     OBError myMessage = null;
     new FIN_PaymentProcess().execute(pb);
@@ -1500,7 +1523,7 @@
    *          Payment Schedule Detail amount.
    * @param paymentAmount
    *          Amount selected to be collected. Always less or equal than scheduleDetailAmount.
-   * @param doubtfulDebtAmount
+   * @param doubtfulDebtTotalAmount
    *          Payment Schedule Detail doubtFulDebt amount.
    * @return resultant doubtful debt amount. Zero if no doubtful debt amount was present.
    */
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPaymentFromJournal.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_AddPaymentFromJournal.java	Tue Aug 04 10:02:42 2015 +0200
@@ -19,9 +19,7 @@
 
 package org.openbravo.advpaymentmngt.process;
 
-import java.text.SimpleDateFormat;
 import java.util.ArrayList;
-import java.util.Date;
 import java.util.HashMap;
 import java.util.List;
 
@@ -29,7 +27,6 @@
 
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.secureApp.VariablesSecureApp;
-import org.openbravo.base.session.OBPropertiesProvider;
 import org.openbravo.client.kernel.RequestContext;
 import org.openbravo.dal.core.OBContext;
 import org.openbravo.dal.service.OBDal;
@@ -48,10 +45,6 @@
   protected void doExecute(ProcessBundle bundle) throws Exception {
     int cont = 0;
 
-    String dateFormatString = OBPropertiesProvider.getInstance().getOpenbravoProperties()
-        .getProperty("dateFormat.java");
-    SimpleDateFormat dateFormat = new SimpleDateFormat(dateFormatString);
-
     // Recover context and variables
     ConnectionProvider conn = bundle.getConnection();
     VariablesSecureApp varsAux = bundle.getContext().toVars();
@@ -86,11 +79,6 @@
           }
         }
       }
-      if (!"".equals(relatedPayments)) {
-        relatedPayments = relatedPayments.substring(0, relatedPayments.length() - 2);
-        throw new OBException("@FIN_JournalLineRelatedPayments@: " + relatedPayments);
-      }
-
       try {
         // Call GL_Journal_Post method from the database.
         final List<Object> parameters = new ArrayList<Object>();
@@ -107,7 +95,6 @@
       }
 
       OBDal.getInstance().refresh(journal);
-      Date date = journal.getDocumentDate();
 
       // Complete the Journal
       if ("CO".equals(docAction)) {
@@ -146,6 +133,13 @@
       if (cont > 0) {
         msg.setMessage(" @FIN_NumberOfPayments@: " + cont);
       }
+      if (!"".equals(relatedPayments) && "RE".equals(docAction)) {
+        relatedPayments = relatedPayments.substring(0, relatedPayments.length() - 2);
+        msg.setType("Warning");
+        msg.setTitle("@Success@");
+        msg.setMessage("@Warning@: @FIN_JournalLineRelatedPayments@: " + relatedPayments
+            + ". @ModifyGLJournalLine@");
+      }
       bundle.setResult(msg);
       OBDal.getInstance().commitAndClose();
     } catch (final OBException e) {
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_BankStatementProcess.java	Tue Aug 04 10:02:42 2015 +0200
@@ -42,7 +42,7 @@
       final VariablesSecureApp vars = bundle.getContext().toVars();
       final ConnectionProvider conProvider = bundle.getConnection();
       final String language = bundle.getContext().getLanguage();
-      final boolean isForceProcess = (Boolean) "2DDE7D3618034C38A4462B7F3456C28D".equals(bundle
+      final boolean isForceProcess = "2DDE7D3618034C38A4462B7F3456C28D".equals(bundle
           .getProcessId());
 
       bankStatement.setProcessNow(true);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ExecutePayment.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -24,6 +24,7 @@
 import java.util.List;
 import java.util.Set;
 
+import org.apache.commons.lang.StringUtils;
 import org.openbravo.advpaymentmngt.dao.AdvPaymentMngtDao;
 import org.openbravo.advpaymentmngt.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.exception.NoExecutionProcessFoundException;
@@ -56,8 +57,9 @@
   private AdvPaymentMngtDao dao;
   private FIN_PaymentExecutionProcess paymentExecutionProcess = null;
   private PaymentExecutionProcess executionProcess;
-  private HashMap<String, String> constantParameters;
-  private HashMap<String, String> parameters;
+  private HashMap<String, String> constantParameters = new HashMap<String, String>();
+  private HashMap<String, String> parameters = new HashMap<String, String>();
+  private HashMap<String, String> internalParameters = new HashMap<String, String>();
   private PaymentRun paymentRun;
 
   public void init(String sourceType, PaymentExecutionProcess _executionProcess,
@@ -188,8 +190,10 @@
               for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
                 for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
                   if (pd.getGLItem() != null || psd.isInvoicePaid()) {
+
                     if (FIN_Utility.isAutomaticDepositWithdrawn(paymentRunPayment.getPayment())
-                        && paymentRunPayment.getPayment().getAmount().compareTo(BigDecimal.ZERO) != 0) {
+                        && paymentRunPayment.getPayment().getAmount().compareTo(BigDecimal.ZERO) != 0
+                        && !StringUtils.equals(internalParameters.get("comingFrom"), "TRANSACTION")) {
                       FIN_FinaccTransaction transaction = TransactionsDao
                           .createFinAccTransaction(paymentRunPayment.getPayment());
                       VariablesSecureApp vars = new VariablesSecureApp(RequestContext.get()
@@ -241,10 +245,10 @@
     final List<PaymentExecutionProcessParameter> allParameters = executionProcess
         .getFinancialMgmtPaymentExecutionProcessParameterList();
     for (PaymentExecutionProcessParameter parameter : allParameters)
-      if ("IN".equals(parameter.getInputType()))
-        if ("CHECK".equals(parameter.getParameterType()))
+      if ("IN".equals(parameter.getParameterType()))
+        if ("CHECK".equals(parameter.getInputType()))
           constantParameters.put(parameter.getSearchKey(), parameter.getDefaultValueForFlag());
-        else if ("TEXT".equals(parameter.getParameterType()))
+        else if ("TEXT".equals(parameter.getInputType()))
           constantParameters.put(parameter.getSearchKey(), parameter.getDefaultTextValue());
   }
 
@@ -252,7 +256,7 @@
     final List<PaymentExecutionProcessParameter> allParameters = executionProcess
         .getFinancialMgmtPaymentExecutionProcessParameterList();
     for (PaymentExecutionProcessParameter parameter : allParameters)
-      if ("CONSTANT".equals(parameter.getInputType()))
+      if ("CONSTANT".equals(parameter.getParameterType()))
         constantParameters.put(parameter.getSearchKey(), parameter.getDefaultTextValue());
   }
 
@@ -329,4 +333,8 @@
     return myMessage;
   }
 
+  public void addInternalParameter(final String key, final String value) {
+    this.internalParameters.put(key, value);
+  }
+
 }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentMonitorProcess.java	Tue Aug 04 10:02:42 2015 +0200
@@ -191,9 +191,6 @@
 
   /**
    * Returns the date in which last payment for this invoice took place
-   * 
-   * @param invoice
-   * @return
    */
   private static Date getFinalSettlementDate(Invoice invoice) {
     final OBCriteria<FIN_PaymentSchedInvV> obc = OBDal.getInstance().createCriteria(
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Tue Aug 04 10:02:42 2015 +0200
@@ -21,6 +21,8 @@
 import java.math.BigDecimal;
 import java.math.RoundingMode;
 import java.util.ArrayList;
+import java.util.Collections;
+import java.util.Comparator;
 import java.util.Date;
 import java.util.HashSet;
 import java.util.List;
@@ -80,6 +82,7 @@
       // retrieve custom params
       final String strAction = (String) bundle.getParams().get("action");
       final String comingFrom = (String) bundle.getParams().get("comingFrom");
+      final String selectedCreditLineIds = (String) bundle.getParams().get("selectedCreditLineIds");
       // retrieve standard params
       final String recordID = (String) bundle.getParams().get("Fin_Payment_ID");
       final FIN_Payment payment = OBDal.getInstance().get(FIN_Payment.class, recordID);
@@ -90,7 +93,7 @@
         isPosOrder = bundle.getParams().get("isPOSOrder").equals("Y");
       }
       final String paymentDate = (String) bundle.getParams().get("paymentdate");
-      processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom);
+      processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom, selectedCreditLineIds);
       bundle.setResult(msg);
     } catch (Exception e) {
       log4j.error(e.getMessage());
@@ -106,11 +109,11 @@
   public static void doProcessPayment(FIN_Payment payment, String strAction, Boolean isPosOrder,
       String paymentDate, String comingFrom) throws OBException {
     FIN_PaymentProcess fpp = WeldUtils.getInstanceFromStaticBeanManager(FIN_PaymentProcess.class);
-    fpp.processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom);
+    fpp.processPayment(payment, strAction, isPosOrder, paymentDate, comingFrom, null);
   }
 
   private void processPayment(FIN_Payment payment, String strAction, Boolean isPosOrder,
-      String paymentDate, String comingFrom) throws OBException {
+      String paymentDate, String comingFrom, String selectedCreditLineIds) throws OBException {
     dao = new AdvPaymentMngtDao();
     String msg = "";
     try {
@@ -154,14 +157,14 @@
         }
       }
 
-      OBDal.getInstance().flush();
       if (strAction.equals("P") || strAction.equals("D")) {
         // Guess if this is a refund payment
         boolean isRefund = false;
         OBContext.setAdminMode(false);
         try {
-          if (payment.getFINPaymentDetailList().size() > 0) {
-            for (FIN_PaymentDetail det : payment.getFINPaymentDetailList()) {
+          List<FIN_PaymentDetail> paymentDetailList = payment.getFINPaymentDetailList();
+          if (paymentDetailList.size() > 0) {
+            for (FIN_PaymentDetail det : paymentDetailList) {
               if (det.isRefund()) {
                 isRefund = true;
                 break;
@@ -177,13 +180,14 @@
           OBDal.getInstance().save(payment);
         }
 
-        boolean orgLegalWithAccounting = FIN_Utility.periodControlOpened(FIN_Payment.TABLE_NAME,
-            payment.getId(), FIN_Payment.TABLE_NAME + "_ID", "LE");
         boolean documentEnabled = getDocumentConfirmation(null, payment.getId());
-        if (documentEnabled
+        boolean periodNotAvailable = documentEnabled
             && !FIN_Utility.isPeriodOpen(payment.getClient().getId(), payment.getDocumentType()
                 .getDocumentCategory(), payment.getOrganization().getId(), OBDateUtils
-                .formatDate(payment.getPaymentDate())) && orgLegalWithAccounting) {
+                .formatDate(payment.getPaymentDate()))
+            && FIN_Utility.periodControlOpened(FIN_Payment.TABLE_NAME, payment.getId(),
+                FIN_Payment.TABLE_NAME + "_ID", "LE");
+        if (periodNotAvailable) {
           msg = OBMessageUtils.messageBD("PeriodNotAvailable");
           throw new OBException(msg);
         }
@@ -203,6 +207,7 @@
         // FIXME: added to access the FIN_PaymentSchedule and FIN_PaymentScheduleDetail tables to be
         // removed when new security implementation is done
         OBContext.setAdminMode();
+        boolean flushDone = false;
         try {
           String strRefundCredit = "";
           // update payment schedule amount
@@ -282,7 +287,7 @@
             payment.setUsedCredit(paymentAmount.subtract(payment.getAmount()));
           }
           if (payment.getUsedCredit().compareTo(BigDecimal.ZERO) != 0) {
-            updateUsedCredit(payment);
+            updateUsedCredit(payment, selectedCreditLineIds);
           }
 
           payment.setWriteoffAmount(paymentWriteOfAmount);
@@ -312,8 +317,9 @@
             }
           }
           // Execution Process
-          if (dao.isAutomatedExecutionPayment(payment.getAccount(), payment.getPaymentMethod(),
-              payment.isReceipt())) {
+          if (!isPosOrder
+              && dao.isAutomatedExecutionPayment(payment.getAccount(), payment.getPaymentMethod(),
+                  payment.isReceipt())) {
             try {
               payment.setStatus("RPAE");
 
@@ -326,6 +332,7 @@
                   FIN_ExecutePayment executePayment = new FIN_ExecutePayment();
                   executePayment.init("APP", executionProcess, payments, null,
                       payment.getOrganization());
+                  executePayment.addInternalParameter("comingFrom", comingFrom);
                   OBError result = executePayment.execute();
                   if ("Error".equals(result.getType())) {
                     msg = OBMessageUtils.messageBD(result.getMessage());
@@ -357,16 +364,26 @@
                 decreaseCustomerCredit(businessPartner, payment.getUsedCredit());
               }
             }
+
             for (FIN_PaymentDetail paymentDetail : payment.getFINPaymentDetailList()) {
+
+              List<FIN_PaymentScheduleDetail> orderPaymentScheduleDetails = new ArrayList<FIN_PaymentScheduleDetail>(
+                  paymentDetail.getFINPaymentScheduleDetailList());
+
               // Get payment schedule detail list ordered by amount asc.
               // First negative if they exist and then positives
-              OBCriteria<FIN_PaymentScheduleDetail> obcPSD = OBDal.getInstance().createCriteria(
-                  FIN_PaymentScheduleDetail.class);
-              obcPSD.add(Restrictions.eq(FIN_PaymentScheduleDetail.PROPERTY_PAYMENTDETAILS,
-                  paymentDetail));
-              obcPSD.addOrderBy(FIN_PaymentScheduleDetail.PROPERTY_AMOUNT, true);
+              if (orderPaymentScheduleDetails.size() > 1) {
+                Collections.sort(orderPaymentScheduleDetails,
+                    new Comparator<FIN_PaymentScheduleDetail>() {
+                      @Override
+                      public int compare(FIN_PaymentScheduleDetail o1, FIN_PaymentScheduleDetail o2) {
+                        // TODO Auto-generated method stub
+                        return o1.getAmount().compareTo(o2.getAmount());
+                      }
+                    });
+              }
 
-              for (FIN_PaymentScheduleDetail paymentScheduleDetail : obcPSD.list()) {
+              for (FIN_PaymentScheduleDetail paymentScheduleDetail : orderPaymentScheduleDetails) {
                 BigDecimal amount = paymentScheduleDetail.getAmount().add(
                     paymentScheduleDetail.getWriteoffAmount());
                 // Do not restore paid amounts if the payment is awaiting execution.
@@ -376,7 +393,7 @@
                 paymentScheduleDetail.setInvoicePaid(false);
                 // Payment = 0 when the payment is generated by a invoice that consume credit
                 if (invoicePaidAmounts
-                    | (payment.getAmount().compareTo(new BigDecimal("0.00")) == 0)) {
+                    || (payment.getAmount().compareTo(new BigDecimal("0.00")) == 0)) {
                   if (paymentScheduleDetail.getInvoicePaymentSchedule() != null) {
                     // BP SO_CreditUsed
                     businessPartner = paymentScheduleDetail.getInvoicePaymentSchedule()
@@ -390,7 +407,7 @@
                     paidAmount = BigDecimal.ZERO;
                     String fromCurrency = payment.getCurrency().getId();
                     if (businessPartner.getCurrency() == null) {
-                      String errorMSG = OBMessageUtils.messageBD("InitBPCurrencyLnk");
+                      String errorMSG = OBMessageUtils.messageBD("InitBPCurrencyLnk", false);
                       msg = String.format(errorMSG, businessPartner.getId(),
                           businessPartner.getName());
                       throw new OBException(msg);
@@ -399,8 +416,7 @@
                     if (!fromCurrency.equals(toCurrency)) {
                       BigDecimal exchangeRate = BigDecimal.ZERO;
                       // check at invoice document level
-                      List<ConversionRateDoc> conversionRateDocumentForInvoice = getConversionRateDocumentForInvoice(
-                          invoiceForConversion, isReceipt);
+                      List<ConversionRateDoc> conversionRateDocumentForInvoice = getConversionRateDocumentForInvoice(invoiceForConversion);
                       if (conversionRateDocumentForInvoice.size() > 0) {
                         exchangeRate = conversionRateDocumentForInvoice.get(0).getRate();
                       } else {
@@ -435,6 +451,7 @@
                         paymentScheduleDetail.getOrderPaymentSchedule(),
                         paymentScheduleDetail.getAmount(),
                         paymentScheduleDetail.getWriteoffAmount());
+                    paymentScheduleDetail.setInvoicePaid(true);
                   }
                   // when generating credit for a BP SO_CreditUsed is also updated
                   if (paymentScheduleDetail.getInvoicePaymentSchedule() == null
@@ -457,14 +474,18 @@
                 && payment.getAmount().compareTo(BigDecimal.ZERO) != 0
                 && !"TRANSACTION".equals(comingFrom)) {
               triggerAutomaticFinancialAccountTransaction(payment);
+              flushDone = true;
             }
           }
           if (!payment.getAccount().getCurrency().equals(payment.getCurrency())
               && getConversionRateDocument(payment).size() == 0) {
             insertConversionRateDocument(payment);
+            flushDone = true;
           }
         } finally {
-          OBDal.getInstance().flush();
+          if (!flushDone) {
+            OBDal.getInstance().flush();
+          }
           OBContext.restorePreviousMode();
         }
 
@@ -632,7 +653,8 @@
         String newStrAction = "P";
         FIN_PaymentProcess fpp = WeldUtils
             .getInstanceFromStaticBeanManager(FIN_PaymentProcess.class);
-        fpp.processPayment(reversedPayment, newStrAction, isPosOrder, paymentDate, comingFrom);
+        fpp.processPayment(reversedPayment, newStrAction, isPosOrder, paymentDate, comingFrom,
+            selectedCreditLineIds);
 
         return;
 
@@ -782,15 +804,18 @@
                     paidAmount = BigDecimal.ZERO;
                     if (!(businessPartner == null)) {
                       final Currency fromCurrency = payment.getCurrency();
-                      // At this point the BP must have a currency, because it is set when
-                      // processing the payment associated to the invoice
+                      if (businessPartner.getCurrency() == null) {
+                        String errorMSG = OBMessageUtils.messageBD("InitBPCurrencyLnk", false);
+                        msg = String.format(errorMSG, businessPartner.getId(),
+                            businessPartner.getName());
+                        throw new OBException(msg);
+                      }
                       final Currency toCurrency = businessPartner.getCurrency();
                       if (fromCurrency != null && toCurrency != null
                           && !fromCurrency.getId().equals(toCurrency.getId())) {
                         BigDecimal exchangeRate = BigDecimal.ZERO;
                         // check at invoice document level
-                        List<ConversionRateDoc> conversionRateDocumentForInvoice = getConversionRateDocumentForInvoice(
-                            invoiceForConversion, isReceipt);
+                        List<ConversionRateDoc> conversionRateDocumentForInvoice = getConversionRateDocumentForInvoice(invoiceForConversion);
                         if (conversionRateDocumentForInvoice.size() > 0) {
                           exchangeRate = conversionRateDocumentForInvoice.get(0).getRate();
                         } else {
@@ -1146,23 +1171,29 @@
     return true;
   }
 
-  private void updateUsedCredit(FIN_Payment newPayment) {
+  private void updateUsedCredit(FIN_Payment newPayment, String selectedCreditLineIds) {
     if (newPayment.getFINPaymentCreditList().isEmpty()) {
       // We process the payment from the Payment In/Out window (not from the Process Invoice flow)
       final BigDecimal usedAmount = newPayment.getUsedCredit();
       final BusinessPartner bp = newPayment.getBusinessPartner();
       final boolean isReceipt = newPayment.isReceipt();
       final Organization Org = newPayment.getOrganization();
-
+      List<FIN_Payment> selectedCreditPayments = null;
+      if (selectedCreditLineIds != null) {
+        selectedCreditPayments = FIN_Utility.getOBObjectList(FIN_Payment.class,
+            selectedCreditLineIds);
+      }
       final OBCriteria<FIN_Payment> reversepayment = OBDal.getInstance().createCriteria(
           FIN_Payment.class);
       reversepayment.add(Restrictions.eq(FIN_Payment.PROPERTY_REVERSEDPAYMENT, newPayment));
       final FIN_Payment reversepaymnt = (FIN_Payment) reversepayment.uniqueResult();
 
       List<FIN_Payment> creditPayments;
-      if (reversepaymnt == null) {
+      if (reversepaymnt == null && selectedCreditLineIds == null) {
         // Normal scenario
         creditPayments = dao.getCustomerPaymentsWithCredit(Org, bp, isReceipt);
+      } else if (selectedCreditLineIds != null) {
+        creditPayments = selectedCreditPayments;
       } else {
         // If it is a reverse payment use its original payment
         creditPayments = new ArrayList<FIN_Payment>(1);
@@ -1254,15 +1285,13 @@
     }
   }
 
-  private List<ConversionRateDoc> getConversionRateDocumentForInvoice(Invoice invoice,
-      boolean isReceipt) {
+  private List<ConversionRateDoc> getConversionRateDocumentForInvoice(Invoice invoice) {
     OBContext.setAdminMode(true);
     try {
       OBCriteria<ConversionRateDoc> obc = OBDal.getInstance().createCriteria(
           ConversionRateDoc.class);
       obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_CURRENCY, invoice.getCurrency()));
-      obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_TOCURRENCY, isReceipt ? invoice
-          .getBusinessPartner().getCurrency() : invoice.getBusinessPartner().getPurchasePricelist()
+      obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_TOCURRENCY, invoice.getBusinessPartner()
           .getCurrency()));
       obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_INVOICE, invoice));
       return obc.list();
@@ -1351,6 +1380,7 @@
         }
       }
     } catch (Exception e) {
+      // TODO no logging... ??
       return confirmation;
     } finally {
       OBContext.restorePreviousMode();
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_ReconciliationProcess.java	Tue Aug 04 10:02:42 2015 +0200
@@ -111,7 +111,7 @@
           bundle.setResult(msg);
           return;
         }
-        final boolean isForceProcess = (Boolean) "6BF16EFC772843AC9A17552AE0B26AB7".equals(bundle
+        final boolean isForceProcess = "6BF16EFC772843AC9A17552AE0B26AB7".equals(bundle
             .getProcessId());
         // Transaction exists
         if (!isForceProcess && !MatchTransactionDao.islastreconciliation(reconciliation)) {
@@ -158,7 +158,6 @@
         reconciliation.setAPRMProcessReconciliationForce("P");
         OBDal.getInstance().save(reconciliation);
         OBDal.getInstance().flush();
-        Boolean invoicePaidold = false;
       }
       reconciliation.setProcessNow(false);
       OBDal.getInstance().save(reconciliation);
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Tue Aug 04 10:02:42 2015 +0200
@@ -18,8 +18,10 @@
  */
 package org.openbravo.advpaymentmngt.process;
 
+import java.math.BigDecimal;
 import java.util.List;
 
+import org.apache.commons.lang.StringUtils;
 import org.hibernate.criterion.Restrictions;
 import org.openbravo.advpaymentmngt.APRM_FinaccTransactionV;
 import org.openbravo.advpaymentmngt.utility.FIN_Utility;
@@ -97,6 +99,7 @@
         // ***********************
         // Process Transaction
         // ***********************
+
         boolean orgLegalWithAccounting = FIN_Utility.periodControlOpened(
             FIN_FinaccTransaction.TABLE_NAME, transaction.getId(), FIN_FinaccTransaction.TABLE_NAME
                 + "_ID", "LE");
@@ -108,6 +111,7 @@
           msg = OBMessageUtils.messageBD("PeriodNotAvailable");
           throw new OBException(msg);
         }
+
         final FIN_FinancialAccount financialAccount = transaction.getAccount();
         financialAccount.setCurrentBalance(financialAccount.getCurrentBalance().add(
             transaction.getDepositAmount().subtract(transaction.getPaymentAmount())));
@@ -119,7 +123,11 @@
           }
           payment.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
           transaction.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
-          transaction.setTransactionType(payment.isReceipt() ? "BPD" : "BPW");
+          if (transaction.getPaymentAmount().compareTo(BigDecimal.ZERO) > 0) {
+            transaction.setTransactionType(TRXTYPE_BPWithdrawal);
+          } else {
+            transaction.setTransactionType(TRXTYPE_BPDeposit);
+          }
           OBDal.getInstance().save(payment);
           if (transaction.getDescription() == null || "".equals(transaction.getDescription())) {
             transaction.setDescription(payment.getDescription());
@@ -141,6 +149,12 @@
             }
           }
 
+          if (!StringUtils.equals(transaction.getCurrency().getId(), payment.getCurrency().getId())) {
+            transaction.setForeignCurrency(payment.getCurrency());
+            transaction.setForeignConversionRate(payment.getFinancialTransactionConvertRate());
+            transaction.setForeignAmount(payment.getAmount());
+          }
+
         } else {
           transaction.setStatus(transaction.getDepositAmount().compareTo(
               transaction.getPaymentAmount()) > 0 ? "RDNC" : "PWNC");
@@ -153,7 +167,6 @@
         transaction.setAprmProcessed("R");
         OBDal.getInstance().save(financialAccount);
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
 
       } else if (strAction.equals("R")) {
         // ***********************
@@ -184,10 +197,14 @@
               ConversionRateDoc.class);
           obc.add(Restrictions.eq(ConversionRateDoc.PROPERTY_FINANCIALACCOUNTTRANSACTION,
               transaction));
+          boolean dataRemoved = false;
           for (ConversionRateDoc conversionRateDoc : obc.list()) {
+            dataRemoved = true;
             OBDal.getInstance().remove(conversionRateDoc);
           }
-          OBDal.getInstance().flush();
+          if (dataRemoved) {
+            OBDal.getInstance().flush();
+          }
         } finally {
           OBContext.restorePreviousMode();
         }
@@ -197,7 +214,6 @@
             .subtract(transaction.getDepositAmount()).add(transaction.getPaymentAmount()));
         OBDal.getInstance().save(financialAccount);
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
         if (payment != null) {
           Boolean invoicePaidold = false;
           for (FIN_PaymentDetail pd : payment.getFINPaymentDetailList()) {
@@ -221,9 +237,9 @@
         }
         transaction.setAprmProcessed("P");
         OBDal.getInstance().save(transaction);
-        OBDal.getInstance().flush();
       }
     } finally {
+      OBDal.getInstance().flush();
       OBContext.restorePreviousMode();
     }
   }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/APRM_MatchingUtility.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/APRM_MatchingUtility.java	Tue Aug 04 10:02:42 2015 +0200
@@ -40,6 +40,7 @@
 import org.openbravo.advpaymentmngt.dao.TransactionsDao;
 import org.openbravo.advpaymentmngt.process.FIN_AddPayment;
 import org.openbravo.advpaymentmngt.process.FIN_ReconciliationProcess;
+import org.openbravo.advpaymentmngt.process.FIN_TransactionProcess;
 import org.openbravo.base.exception.OBException;
 import org.openbravo.base.provider.OBProvider;
 import org.openbravo.base.secureApp.VariablesSecureApp;
@@ -76,7 +77,6 @@
 import org.openbravo.model.materialmgmt.cost.ABCActivity;
 import org.openbravo.model.project.Project;
 import org.openbravo.model.sales.SalesRegion;
-import org.openbravo.scheduling.OBScheduler;
 import org.openbravo.scheduling.ProcessBundle;
 import org.openbravo.service.db.CallStoredProcedure;
 import org.openbravo.service.db.DalConnectionProvider;
@@ -525,7 +525,7 @@
     parameters.put("Fin_FinAcc_Transaction_ID", transaction.getId());
     pb.setParams(parameters);
     OBError myMessage = null;
-    OBScheduler.getInstance().schedule(pb);
+    new FIN_TransactionProcess().execute(pb);
     myMessage = (OBError) pb.getResult();
     return myMessage;
   }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_BankStatementImport.java	Tue Aug 04 10:02:42 2015 +0200
@@ -425,7 +425,7 @@
         if (!businessPartnersScroll.next()) {
           String strParnterId = "";
           if (resultObject.getClass().isArray()) {
-            final Object[] values = (Object[]) resultObject;
+            final Object[] values = resultObject;
             strParnterId = (String) values[0];
           }
           BusinessPartner bp = OBDal.getInstance().get(BusinessPartner.class, strParnterId);
@@ -454,7 +454,7 @@
 
       String targetBusinessPartnerName = "";
       if (resultObject.getClass().isArray()) {
-        final Object[] values = (Object[]) resultObject;
+        final Object[] values = resultObject;
         targetBusinessPartnerId = (String) values[0];
         targetBusinessPartnerName = (String) values[1];
       }
@@ -481,7 +481,7 @@
         String bpName = "";
         resultObject = (Object[]) businessPartners.get(0);
         if (resultObject.getClass().isArray()) {
-          final Object[] values = (Object[]) resultObject;
+          final Object[] values = resultObject;
           bpId = (String) values[0];
           bpName = (String) values[1];
         }
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/utility/FIN_Utility.java	Tue Aug 04 10:02:42 2015 +0200
@@ -229,15 +229,9 @@
    *          List of OBObjects
    * @return Comma separated string of Id's
    */
+  @Deprecated
   public static <T extends BaseOBObject> String getInStrList(List<T> obObjectList) {
-    StringBuilder strInList = new StringBuilder();
-    for (T obObject : obObjectList) {
-      if (strInList.length() == 0)
-        strInList.append("'" + obObject.getId() + "'");
-      else
-        strInList.append(", '" + obObject.getId() + "'");
-    }
-    return strInList.toString();
+    return Utility.getInStrList(obObjectList);
   }
 
   /**
@@ -289,10 +283,6 @@
     DocumentType outDocType = null;
     Client client = null;
 
-    OBCriteria<DocumentType> obcDoc = OBDal.getInstance().createCriteria(DocumentType.class);
-    obcDoc.setFilterOnReadableClients(false);
-    obcDoc.setFilterOnReadableOrganization(false);
-
     if ("0".equals(org.getId())) {
       client = OBContext.getOBContext().getCurrentClient();
       if ("0".equals(client.getId())) {
@@ -301,18 +291,29 @@
     } else {
       client = org.getClient();
     }
-    obcDoc.add(Restrictions.eq(DocumentType.PROPERTY_CLIENT, client));
 
-    obcDoc
-        .add(Restrictions.in("organization.id",
-            OBContext.getOBContext().getOrganizationStructureProvider(org.getClient().getId())
-                .getParentTree(org.getId(), true)));
-    obcDoc.add(Restrictions.eq(DocumentType.PROPERTY_DOCUMENTCATEGORY, docCategory));
-    obcDoc.addOrderBy(DocumentType.PROPERTY_DEFAULT, false);
-    obcDoc.addOrderBy(DocumentType.PROPERTY_ID, false);
-    List<DocumentType> docTypeList = obcDoc.list();
-    if (docTypeList != null && docTypeList.size() > 0) {
-      outDocType = docTypeList.get(0);
+    OBContext.setAdminMode(false);
+    try {
+      StringBuilder whereOrderByClause = new StringBuilder();
+      whereOrderByClause.append(" as dt where dt.organization.id in (");
+      whereOrderByClause.append(Utility.getInStrSet(new OrganizationStructureProvider()
+          .getParentTree(org.getId(), true)));
+      whereOrderByClause.append(") and dt.client.id = '" + client.getId()
+          + "' and dt.documentCategory = '" + docCategory + "' order by ad_isorgincluded('"
+          + org.getId() + "', dt.organization.id, '" + client.getId()
+          + "') , dt.default desc, dt.id desc");
+      OBQuery<DocumentType> dt = OBDal.getInstance().createQuery(DocumentType.class,
+          whereOrderByClause.toString());
+      dt.setFilterOnReadableClients(false);
+      dt.setFilterOnReadableOrganization(false);
+      dt.setMaxResult(1);
+
+      List<DocumentType> dtList = dt.list();
+      if (dtList != null && !dtList.isEmpty()) {
+        outDocType = dtList.get(0);
+      }
+    } finally {
+      OBContext.restorePreviousMode();
     }
     return outDocType;
   }
@@ -1065,7 +1066,7 @@
       invoiceDocNo = invoice.getDocumentNo();
 
       final String paymentDescription = OBDal.getInstance()
-          .get(OrganizationInformation.class, ((String) DalUtil.getId(organization)))
+          .get(OrganizationInformation.class, (DalUtil.getId(organization)))
           .getAPRMPaymentDescription();
       // In case of a purchase invoice and the Supplier Reference is selected use Reference
       if (paymentDescription.equals("Supplier Reference") && !invoice.isSalesTransaction()) {
@@ -1251,7 +1252,6 @@
 
   public static boolean periodControlOpened(String tableName, String recordId, String idColumnName,
       String orgType) {
-    final Session session = OBDal.getInstance().getSession();
 
     List<Object> parameters = new ArrayList<Object>();
     parameters.add(tableName);
@@ -1261,7 +1261,7 @@
     Object result = CallStoredProcedure.getInstance().call("ad_get_doc_le_bu", parameters, null,
         false, true);
 
-    Organization org = OBDal.getInstance().get(Organization.class, (String) result);
+    Organization org = OBDal.getInstance().get(Organization.class, result);
 
     return org.getOrganizationType().isLegalEntityWithAccounting();
   }
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addPayment.js	Tue Aug 04 10:02:42 2015 +0200
@@ -161,7 +161,8 @@
       isSOTrx = form.getItem('issotrx').getValue(),
       currencyId = form.getItem('c_currency_id').getValue(),
       paymentDate = form.getItem('payment_date').getValue(),
-      orgId = form.getItem('ad_org_id').getValue();
+      orgId = form.getItem('ad_org_id').getValue(),
+      trxtype = (form.getItem('trxtype')) ? form.getItem('trxtype').getValue() : "";
 
   callback = function (response, data, request) {
     var isShown = false;
@@ -173,16 +174,17 @@
       form.getItem('c_currency_id').valueMap[data.currencyId] = data.currencyIdIdentifier;
     }
     isShown = data.isPayIsMulticurrency && currencyId !== data.currencyToId && currencyId !== undefined;
-    if (data.isWrongFinancialAccount) {
+    if (data.isWrongFinancialAccount && trxtype === "") {
       form.getItem('fin_financial_account_id').setValue('');
-    } else {
+    } else if (!data.isWrongFinancialAccount) {
       if (!form.getItem('c_currency_to_id').valueMap) {
         form.getItem('c_currency_to_id').valueMap = {};
       }
       form.getItem('c_currency_to_id').setValue(data.currencyToId);
       form.getItem('c_currency_to_id').valueMap[data.currencyToId] = data.currencyToIdentifier;
-      if (recalcConvRate && isc.isA.Number(data.conversionrate)) {
-        form.getItem('conversion_rate').setValue(Number(data.conversionrate));
+      if (recalcConvRate) {
+        form.getItem('conversion_rate').setValue(data.conversionrate);
+        form.getItem('converted_amount').setValue(data.convertedamount);
         OB.APRM.AddPayment.updateConvertedAmount(view, form, false);
       }
     }
@@ -301,6 +303,9 @@
   var issotrx = this.view.theForm.getItem('issotrx').getValue(),
       payment = this.view.theForm.getItem('fin_payment_id').getValue();
   grid.isReady = true;
+  if (grid.obaprmAllRecordsSelectedByUser) {
+    delete grid.obaprmAllRecordsSelectedByUser;
+  }
   if ((issotrx || !payment) && (grid.selectedIds.length === 0)) {
     OB.APRM.AddPayment.distributeAmount(this.view, this.view.theForm, false);
   } else {
@@ -501,7 +506,7 @@
     OB.APRM.AddPayment.updateDifferenceActions(form);
   }
   affectedParams.push(form.getField('overpayment_action_display_logic').paramId);
-  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, null, affectedParams);
+  OB.APRM.AddPayment.recalcDisplayLogicOrReadOnlyLogic(form, form.paramWindow, affectedParams);
 };
 
 OB.APRM.AddPayment.updateDifferenceActions = function (form) {
@@ -563,6 +568,7 @@
       selectedIds = orderInvoice.selectedIds,
       glitem = new BigDecimal(String(view.theForm.getItem('amount_gl_items').getValue() || 0)),
       credit = new BigDecimal(String(view.theForm.getItem('used_credit').getValue() || 0)),
+      bslamount = new BigDecimal(String(view.theForm.getItem('bslamount').getValue() || 0)),
       i;
 
   amount = amount.subtract(distributedAmount);
@@ -592,7 +598,16 @@
   } else {
     for (i = 0; i < selectedIds.length; i++) {
       if (selectedIds[i] === record.id) {
-        orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+        if (bslamount.compareTo(BigDecimal.prototype.ZERO) !== 0) {
+          if (outstandingAmount.compareTo(amount) > 0) {
+            orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(amount.toString()));
+          } else {
+            orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+          }
+        } else {
+          orderInvoice.setEditValue(orderInvoice.getRecordIndex(record), 'amount', Number(outstandingAmount.toString()));
+        }
+
       }
     }
   }
@@ -813,8 +828,21 @@
 };
 
 OB.APRM.AddPayment.doSelectionChangedCredit = function (record, state, view) {
+  var issotrx = view.theForm.getItem('issotrx'),
+      grid = view.theForm.getItem('credit_to_use').canvas.viewGrid,
+      amountField = grid.getFieldByColumnName('paymentAmount'),
+      outstanding = new BigDecimal(String(record.outstandingAmount));
+
+  if (state) {
+    grid.setEditValue(grid.getRecordIndex(record), amountField, Number(outstanding));
+  } else {
+    grid.setEditValue(grid.getRecordIndex(record), amountField, '0');
+  }
   OB.APRM.AddPayment.updateCreditTotal(view.theForm);
   OB.APRM.AddPayment.updateActualExpected(view.theForm);
+  if (issotrx) {
+    OB.APRM.AddPayment.distributeAmount(view, view.theForm, true);
+  }
 };
 
 OB.APRM.AddPayment.conversionRateOnChange = function (item, view, form, grid) {
@@ -826,8 +854,8 @@
 };
 
 OB.APRM.AddPayment.updateConvertedAmount = function (view, form, recalcExchangeRate) {
-  var exchangeRate = new BigDecimal(String(form.getItem('conversion_rate').getValue() || 1)),
-      actualConverted = new BigDecimal(String(form.getItem('converted_amount').getValue() || 0)),
+  var exchangeRate = form.getItem('conversion_rate').getValue(),
+      actualConverted = form.getItem('converted_amount').getValue(),
       actualPayment = new BigDecimal(String(form.getItem('actual_payment').getValue() || 0)),
       actualConvertedItem = form.getItem('converted_amount'),
       exchangeRateItem = form.getItem('conversion_rate'),
@@ -835,6 +863,12 @@
       newExchangeRate = BigDecimal.prototype.ONE,
       currencyPrecision = form.getItem('StdPrecision').getValue();
 
+  if (!actualConverted && !exchangeRate) {
+    return;
+  }
+
+  exchangeRate = new BigDecimal(String(exchangeRate || 1));
+  actualConverted = new BigDecimal(String(actualConverted || 0));
   if (!actualConverted || !exchangeRate) {
     return;
   }
@@ -845,7 +879,7 @@
         exchangeRateItem.setValue(Number(newExchangeRate.toString()));
       }
     } else {
-      exchangeRateItem.setValue(Number(newExchangeRate.toString));
+      exchangeRateItem.setValue(Number(newExchangeRate.toString()));
     }
   } else if (exchangeRate) {
     newConvertedAmount = actualPayment.multiply(exchangeRate).setScale(currencyPrecision, BigDecimal.prototype.ROUND_HALF_UP);
@@ -1045,7 +1079,7 @@
   OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentReloadLabelsActionHandler', {}, params, callbackReloadLabelsActionHandler);
 };
 
-OB.APRM.AddPayment.onProcess = function (view, actionHandlerCall) {
+OB.APRM.AddPayment.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
   var orderInvoiceGrid = view.theForm.getItem('order_invoice').canvas.viewGrid,
       receivedFrom = view.theForm.getItem('received_from').getValue(),
       issotrx = view.theForm.getItem('issotrx').getValue(),
@@ -1053,7 +1087,8 @@
       amountInvOrds = new BigDecimal(String(view.theForm.getItem('amount_inv_ords').getValue() || 0)),
       total = new BigDecimal(String(view.theForm.getItem('total').getValue() || 0)),
       actualPayment = new BigDecimal(String(view.theForm.getItem('actual_payment').getValue() || 0)),
-      overpaymentAction = view.theForm.getItem('overpayment_action').getValue(),
+      overpaymentField = view.theForm.getItem('overpayment_action'),
+      overpaymentAction = overpaymentField.getValue(),
       creditTotalItem = new BigDecimal(String(view.theForm.getItem('used_credit').getValue() || 0)),
       document = (view.theForm.getItem('trxtype')) ? view.theForm.getItem('trxtype').getValue() : "",
       amountField = orderInvoiceGrid.getFieldByColumnName('amount'),
@@ -1085,27 +1120,31 @@
   // If there is Overpayment check it exists a business partner
   if (overpaymentAction && receivedFrom === null) {
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_CreditWithoutBPartner'));
-    return false;
+    return clientSideValidationFail();
   }
   //If Actual Payment amount is negative, it is not necessary to use credit.
   if ((total.compareTo(BigDecimal.prototype.ZERO) < 0) && (creditTotalItem.signum() !== 0)) {
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_CreditWithNegativeAmt'));
-    return false;
+    return clientSideValidationFail();
   }
-
-  if (actualPayment.compareTo(total) > 0 && totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0) {
+  if (actualPayment.compareTo(total.subtract(creditTotalItem)) > 0 && totalOustandingAmount.compareTo(amountInvOrds.add(totalWriteOffAmount)) > 0) {
     // Not all the payment amount has been allocated
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSNOTALLAMOUTALLOCATED'));
-    return false;
+    return clientSideValidationFail();
   } else if (total.compareTo(actualPayment.add(creditTotalItem)) > 0) {
     // More than available amount has been distributed
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_JSMOREAMOUTALLOCATED'));
-    return false;
+    return clientSideValidationFail();
   }
 
-  if (document !== null && document !== '' && actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0 && view.parentWindow && view.parentWindow.windowId) {
+  if (creditTotalItem.compareTo(BigDecimal.prototype.ZERO) !== 0 && (total.compareTo(creditTotalItem) < 0) && (overpaymentField.isVisible() && overpaymentAction === 'CR')) {
+    view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_MORECREDITAMOUNT'));
+    return clientSideValidationFail();
+  }
+
+  if (document !== null && document !== '' && actualPayment.compareTo(BigDecimal.prototype.ZERO) === 0 && view.parentWindow && view.parentWindow.windowId && !overpaymentAction) {
     view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_ZEROAMOUNTPAYMENTTRANSACTION'));
-    return false;
+    return clientSideValidationFail();
   }
 
   //It is not possible to add a glitem with both amounts equal to 0
@@ -1117,7 +1156,7 @@
     paidOutAmt = new BigDecimal(String(glitemGrid.getEditedCell(i, paidOutField) || 0));
     if (receivedInAmt.signum() === 0 && paidOutAmt.signum() === 0) {
       view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_GLITEMSDIFFERENTZERO'));
-      return false;
+      return clientSideValidationFail();
     }
 
   }
@@ -1125,16 +1164,16 @@
     //Check if there are blocked Business Partners
     if (data.message.severity === 'error') {
       view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, data.message.title, data.message.text);
-      return false;
+      return clientSideValidationFail();
     }
     // Check if the write off limit has been exceeded
     if (writeOffLimitPreference === 'Y') {
       if (totalWriteOffAmount > data.writeofflimit) {
         view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_NotAllowWriteOff'));
-        return false;
+        return clientSideValidationFail();
       }
     }
-    actionHandlerCall(view);
+    actionHandlerCall();
   };
 
   OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.AddPaymentOnProcessActionHandler', {
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addTransaction.js	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-addTransaction.js	Tue Aug 04 10:02:42 2015 +0200
@@ -30,12 +30,14 @@
 };
 
 
-OB.APRM.AddTransaction.onProcess = function (view, actionHandlerCall) {
+OB.APRM.AddTransaction.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
   var execute;
 
   execute = function (ok) {
     if (ok) {
-      actionHandlerCall(view);
+      actionHandlerCall();
+    } else {
+      clientSideValidationFail();
     }
   };
 
@@ -52,20 +54,21 @@
 
     if (("BPD" === trxType || "BPW" === trxType) && !glitemId && !paymentId) {
       view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_INVALID_TRANSACTION'));
+      clientSideValidationFail();
     } else if (trxAmt !== blineAmt) {
       // Split required
       if (hideSplitConfirmation === 'Y') {
         // Continue with the match
-        actionHandlerCall(view);
+        actionHandlerCall();
       } else {
         isc.confirm(OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm'), execute);
       }
     } else {
       // Continue with the match
-      actionHandlerCall(view);
+      actionHandlerCall();
     }
   } else {
-    actionHandlerCall(view);
+    actionHandlerCall();
   }
 };
 
@@ -80,8 +83,6 @@
     form.getItem('depositamt').setDisabled(false);
     form.getItem('withdrawalamt').setDisabled(false);
     form.getItem('description').setValue('');
-    form.getItem('c_glitem_id').setValue(null);
-    form.getItem('fin_payment_id').setValue(null);
   }
 };
 
@@ -110,4 +111,8 @@
   OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.GLItemTransactionActionHandler', {
     strGLItemId: strGLItemId
   }, {}, callback);
+};
+
+OB.APRM.AddTransaction.trxDateOnChangeFunction = function (item, view, form, grid) {
+  form.getItem('dateacct').setDateParameterValue(new Date(item.getValue()));
 };
\ No newline at end of file
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-findTransaction.js	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-findTransaction.js	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2014 Openbravo SLU
+ * All portions are Copyright (C) 2014-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -19,12 +19,14 @@
 
 OB.APRM.FindTransactions = {};
 
-OB.APRM.FindTransactions.onProcess = function (view, actionHandlerCall) {
+OB.APRM.FindTransactions.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
   var execute;
 
   execute = function (ok) {
     if (ok) {
-      actionHandlerCall(view);
+      actionHandlerCall();
+    } else {
+      clientSideValidationFail();
     }
   };
 
@@ -42,7 +44,7 @@
         // Split required
         if (hideSplitConfirmation === 'Y') {
           // Continue with the match
-          actionHandlerCall(view);
+          actionHandlerCall();
         } else {
           if (isc.isA.emptyObject(OB.TestRegistry.registry)) {
             isc.confirm(OB.I18N.getLabel('APRM_SplitBankStatementLineConfirm'), execute);
@@ -52,11 +54,12 @@
         }
       } else {
         // Continue with the match
-        actionHandlerCall(view);
+        actionHandlerCall();
       }
     } else {
       // No Transaction selected
       view.messageBar.setMessage(isc.OBMessageBar.TYPE_ERROR, null, OB.I18N.getLabel('APRM_SELECT_RECORD_ERROR'));
+      clientSideValidationFail();
     }
   }
 };
\ No newline at end of file
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-matchStatement.js	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-matchStatement.js	Tue Aug 04 10:02:42 2015 +0200
@@ -19,9 +19,16 @@
 
 OB.APRM.MatchStatement = {};
 
+OB.APRM.MatchStatement.addPreference = function (view) {
+  var onLoadCallback;
+  onLoadCallback = function (response, data, request) {};
+  OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadPreferenceActionHandler', {}, {}, onLoadCallback);
+};
 
 OB.APRM.MatchStatement.onLoad = function (view) {
   var execute, grid = view.theForm.getItem('match_statement').canvas.viewGrid;
+  view.cancelButton.hide();
+  view.parentElement.parentElement.closeButton.hide();
 
   grid.dataSourceOrig = grid.dataSource;
   grid.dataSource = null;
@@ -40,10 +47,16 @@
       grid.filterByEditor();
     };
     OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadActionHandler', {}, params, onLoadCallback);
-    if (grid && grid.parentElement && grid.parentElement.messageBar && grid.parentElement.messageBar.text && grid.parentElement.messageBar.text.contents) {
-      grid.parentElement.messageBar.text.setContents(grid.parentElement.messageBar.text.contents.replace(OB.I18N.getLabel('OBUIAPP_ClearFilters'), OB.I18N.getLabel('OBUIAPP_ClearFilters') + '<br/>' + OB.I18N.getLabel('APRM_GRID_PERSIST_MESSAGE')));
-    }
   };
+  if (grid && grid.parentElement && grid.parentElement.messageBar) {
+    var onLoadCallback;
+    onLoadCallback = function (response, data, request) {
+      if (!data.preference) {
+        grid.parentElement.messageBar.setMessage(isc.OBMessageBar.TYPE_INFO, '<div><div class="' + OB.Styles.MessageBar.leftMsgContainerStyle + '">' + OB.I18N.getLabel('APRM_GRID_PERSIST_MESSAGE') + '</div><div class="' + OB.Styles.MessageBar.rightMsgContainerStyle + '"><a href="#" class="' + OB.Styles.MessageBar.rightMsgTextStyle + '" onclick="' + 'window[\'' + grid.parentElement.messageBar.ID + '\'].hide(); OB.APRM.MatchStatement.addPreference();">' + OB.I18N.getLabel('OBUIAPP_NeverShowMessageAgain') + '</a></div></div>', ' ');
+      }
+    };
+    OB.RemoteCallManager.call('org.openbravo.advpaymentmngt.actionHandler.MatchStatementOnLoadGetPreferenceActionHandler', {}, {}, onLoadCallback);
+  }
   isc.confirm(OB.I18N.getLabel('APRM_AlgorithmConfirm'), execute);
 };
 
@@ -51,22 +64,13 @@
   var grid = view.theForm.getItem('match_statement').canvas.viewGrid,
       newCriteria = {};
   newCriteria.criteria = [];
-  // add dummy criterion to force fetch
   newCriteria.criteria.push(isc.OBRestDataSource.getDummyCriterion());
-  grid.fetchData(newCriteria);
+  grid.invalidateCache();
+  view.theForm.redraw();
 };
 
-OB.APRM.MatchStatement.onProcess = function (view, actionHandlerCall) {
-  var execute;
-  execute = function (ok) {
-    if (ok) {
-      actionHandlerCall(view);
-    } else {
-      view.parentElement.parentElement.closeClick();
-    }
-  };
-  isc.confirm(OB.I18N.getLabel('APRM_ProcessReconciliation'), execute);
-
+OB.APRM.MatchStatement.onProcess = function (view, actionHandlerCall, clientSideValidationFail) {
+  actionHandlerCall();
 };
 
 
--- a/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/web/org.openbravo.advpaymentmngt/js/ob-aprm-utilities.js	Tue Aug 04 10:02:42 2015 +0200
@@ -164,7 +164,7 @@
   returnObject.received = 0;
   returnObject.expected = 0;
   returnObject.awaitingExecutionAmount = 0;
-  returnObject.id = '';
+  delete returnObject.id;
   returnObject.paymentMethod = selectedRecord.paymentMethod;
   returnObject['paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER] = selectedRecord['paymentMethod' + OB.Constants.FIELDSEPARATOR + OB.Constants.IDENTIFIER];
   returnObject.currency = selectedRecord.currency;
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-api-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-config-api-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-config-impl-base-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-container-impl-base-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-container-spi-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-container-test-api-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-container-test-impl-base-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-container-test-spi-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-core-api-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-core-impl-base-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-core-spi-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-impl-base-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-junit-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-junit-container-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-junit-core-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-protocol-local-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-spi-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-test-api-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-test-impl-base-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-test-spi-1.1.8.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-testenricher-cdi-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-testenricher-cdi-1.0.2.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-weld-ee-embedded-1.1-1.0.0.Alpha4.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/arquillian-weld-ee-embedded-1.1-1.0.0.CR8.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/jboss-el-api_2.2_spec-1.0.0.Final.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-api-1.0.0-alpha-11.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-api-1.2.2.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-descriptors-api-base-2.0.0-alpha-7.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-descriptors-spi-2.0.0-alpha-7.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-extension-classloader-1.0.0-alpha-11.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-impl-base-1.0.0-alpha-11.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-impl-base-1.2.2.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-spi-1.0.0-alpha-11.jar has changed
Binary file modules/org.openbravo.base.weld/lib/test/shrinkwrap-spi-1.2.2.jar has changed
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -6,7 +6,7 @@
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <NAME><![CDATA[JBoss Weld]]></NAME>
-<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.26187]]></VERSION>
+<!--C70732EA90A14EC0916078B85CC33D2D-->  <VERSION><![CDATA[1.1.27055]]></VERSION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <DESCRIPTION><![CDATA[JBoss Weld]]></DESCRIPTION>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <HELP><![CDATA[Provides the JBoss Weld framework: Java Contexts and Dependency Injection for the Java EE platform (CDI). For more information see http://seamframework.org/Weld]]></HELP>
 <!--C70732EA90A14EC0916078B85CC33D2D-->  <URL><![CDATA[http://forge.openbravo.com/projects/weld]]></URL>
--- a/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.base.weld/src-db/database/sourcedata/AD_MODULE_DEPENDENCY.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -7,7 +7,7 @@
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_MODULE_ID><![CDATA[C70732EA90A14EC0916078B85CC33D2D]]></AD_MODULE_ID>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <AD_DEPENDENT_MODULE_ID><![CDATA[0]]></AD_DEPENDENT_MODULE_ID>
-<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.26187]]></STARTVERSION>
+<!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <STARTVERSION><![CDATA[3.0.27055]]></STARTVERSION>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <ISINCLUDED><![CDATA[N]]></ISINCLUDED>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDANT_MODULE_NAME><![CDATA[Core]]></DEPENDANT_MODULE_NAME>
 <!--8BDE81545C1A43EAAC4BA3C5ED754DC8-->  <DEPENDENCY_ENFORCEMENT><![CDATA[MAJOR]]></DEPENDENCY_ENFORCEMENT>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/ParameterCdiTest.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,39 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test;
+
+import java.lang.annotation.ElementType;
+import java.lang.annotation.Retention;
+import java.lang.annotation.RetentionPolicy;
+import java.lang.annotation.Target;
+
+/**
+ * Defines which field in a cdi test class will take the parameter values set by
+ * {@link ParameterCdiTestRule}. There should be a single field with this annotation per class.
+ * 
+ * @see ParameterCdiTestRule
+ * 
+ * @author alostale
+ *
+ */
+@Retention(RetentionPolicy.RUNTIME)
+@Target({ ElementType.FIELD })
+public @interface ParameterCdiTest {
+}
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/ParameterCdiTestRule.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,103 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test;
+
+import java.lang.reflect.Field;
+import java.util.List;
+
+import org.junit.rules.MethodRule;
+import org.junit.runners.model.FrameworkMethod;
+import org.junit.runners.model.Statement;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+/**
+ * Rule to make possible to run parameterized test cases with Arquillian runner. The Rule field
+ * defines the parameter values which will be taken by the field annotated with @ParameterCdiTest.
+ * 
+ * Based on https://gist.github.com/poolik/8764414
+ * 
+ * @see ParameterCdiTest
+ * 
+ * @author alostale
+ */
+public class ParameterCdiTestRule<T> implements MethodRule {
+  private final List<T> params;
+  private static final Logger log = LoggerFactory.getLogger(ParameterCdiTestRule.class);
+
+  public ParameterCdiTestRule(List<T> params) {
+    if (params == null || params.size() == 0) {
+      throw new IllegalArgumentException(
+          "'params' must be specified and have more than zero length!");
+    }
+    this.params = params;
+  }
+
+  @Override
+  public Statement apply(final Statement base, final FrameworkMethod method, final Object target) {
+    return new Statement() {
+      @Override
+      public void evaluate() throws Throwable {
+        evaluateParamsToTarget(base, target, method);
+      }
+    };
+  }
+
+  private void evaluateParamsToTarget(Statement base, Object target, FrameworkMethod method)
+      throws Throwable {
+    Field targetField = getTargetField(target);
+    if (!targetField.isAccessible()) {
+      targetField.setAccessible(true);
+    }
+
+    for (Object param : params) {
+      targetField.set(target, param);
+
+      log.info(
+          "============================================================================================================");
+      log.info("   Paremeterized test {}.{} ", target.getClass().getName(), method.getName());
+      log.info("       {}: {}", targetField.getName(), param);
+      log.info(
+          "============================================================================================================");
+
+      base.evaluate();
+    }
+  }
+
+  private Field getTargetField(Object target) throws NoSuchFieldException {
+    Field[] allFields = target.getClass().getDeclaredFields();
+    Field paramField = null;
+    for (Field field : allFields) {
+      if (field.getAnnotation(ParameterCdiTest.class) != null) {
+        if (paramField != null) {
+          throw new IllegalStateException(
+              "More than one field with @ParameterCdiTest. There should be a single @ParameterCdiTest field.");
+        }
+
+        paramField = field;
+      }
+    }
+    if (paramField == null) {
+      throw new IllegalStateException(
+          "No field with @ParameterCdiTest annotation found. There should be a single @ParameterCdiTest field.");
+    }
+    return paramField;
+  }
+}
\ No newline at end of file
--- a/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/WeldBaseTest.java	Tue Aug 04 10:02:42 2015 +0200
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2010-2014 Openbravo SLU
+ * All portions are Copyright (C) 2010-2015 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -24,16 +24,23 @@
 import javax.enterprise.util.AnnotationLiteral;
 import javax.inject.Inject;
 
-import org.jboss.arquillian.api.Deployment;
+import org.jboss.arquillian.container.test.api.Deployment;
 import org.jboss.arquillian.junit.Arquillian;
 import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
 import org.jboss.shrinkwrap.api.importer.ExplodedImporter;
 import org.jboss.shrinkwrap.api.spec.JavaArchive;
-import org.junit.After;
+import org.junit.AfterClass;
 import org.junit.Before;
 import org.junit.runner.RunWith;
 import org.openbravo.base.session.OBPropertiesProvider;
+import org.openbravo.base.session.SessionFactoryController;
+import org.openbravo.base.weld.WeldUtils;
+import org.openbravo.client.kernel.KernelInitializer;
+import org.openbravo.dal.core.OBInterceptor;
 import org.openbravo.test.base.OBBaseTest;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * Base test for weld, provides access to the weld container.
@@ -42,14 +49,34 @@
  */
 @RunWith(Arquillian.class)
 public class WeldBaseTest extends OBBaseTest {
+  private static final Logger log = LoggerFactory.getLogger(WeldBaseTest.class);
+
+  private static boolean initialized = false;
+  private static JavaArchive archive = null;
 
   @Deployment
   public static JavaArchive createTestArchive() {
-    final String sourcePath = OBPropertiesProvider.getInstance().getOpenbravoProperties()
-        .getProperty("source.path");
-    final JavaArchive archive = ShrinkWrap.create(JavaArchive.class, "test.jar");
-    archive.as(ExplodedImporter.class).importDirectory(sourcePath + "/build/classes");
-    archive.addDirectory(sourcePath + "/WebContent/WEB-INF/lib");
+    if (archive == null) {
+      log.info("Creating cdi archive...");
+      final String sourcePath = OBPropertiesProvider.getInstance().getOpenbravoProperties()
+          .getProperty("source.path");
+      archive = ShrinkWrap.create(JavaArchive.class);
+
+      // add all beans without exclusions so cdi can also be used for *test* packages
+      archive.addAsManifestResource(EmptyAsset.INSTANCE, "beans.xml");
+
+      // include all classes deployed in webapp container
+      archive.as(ExplodedImporter.class).importDirectory(sourcePath + "/build/classes/");
+
+      // ...and all the jUnit ones
+      archive.as(ExplodedImporter.class).importDirectory(sourcePath + "/src-test/build/classes/");
+
+      // include all libraries deployed in webapp container
+      archive.addAsDirectory(sourcePath + "/WebContent/WEB-INF/lib");
+
+      log.debug(archive.toString(true));
+      log.info("... cdi archive created");
+    }
     return archive;
   }
 
@@ -60,6 +87,39 @@
   @Inject
   private BeanManager beanManager;
 
+  @Inject
+  private KernelInitializer kernelInitializer;
+
+  /**
+   * Sets static instance bean manager in WeldUtils so it is globally accessible and initializes
+   * kernel.
+   * 
+   * Arquillian creates a new cdi container for each test class but keeps existent one for all tests
+   * within same class, let's initialize it once per class but we cannot use @BeforeClass at this
+   * point because we require of beanManager to be injected.
+   */
+  @Before
+  public void setManager() {
+    if (!initialized) {
+      WeldUtils.setStaticInstanceBeanManager(beanManager);
+      kernelInitializer.setInterceptor();
+      initialized = true;
+    }
+  }
+
+  /**
+   * Once we are done with the class execution, OBInterceptor needs to be reset other case when
+   * executing a suite it will reuse the container created for the previous classes instead of the
+   * new one.
+   */
+  @AfterClass
+  public static void resetOBInterceptors() {
+    final OBInterceptor interceptor = (OBInterceptor) SessionFactoryController.getInstance()
+        .getConfiguration().getInterceptor();
+    interceptor.setInterceptorListener(null);
+    initialized = false;
+  }
+
   @SuppressWarnings("unchecked")
   protected <U extends Object> U getWeldComponent(Class<U> clz) {
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/ApplicationScopedBean.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,36 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import javax.enterprise.context.ApplicationScoped;
+
+/** Simple application scoped bean */
+@ApplicationScoped
+public class ApplicationScopedBean {
+  private String value;
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public String getValue() {
+    return value;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/CdiInfrastructure.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,80 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.notNullValue;
+import static org.hamcrest.CoreMatchers.nullValue;
+import static org.junit.Assert.assertThat;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.junit.InSequence;
+import org.junit.Test;
+import org.openbravo.base.weld.test.WeldBaseTest;
+
+/**
+ * Test cases for cdi infrastructure. Checking Arquillian works fine and it is possible to inject
+ * beans.
+ * 
+ * @author alostale
+ *
+ */
+public class CdiInfrastructure extends WeldBaseTest {
+
+  @Inject
+  private ApplicationScopedBean applicationBean;
+
+  @Inject
+  private SessionScopedBean sessionBean;
+
+  @Inject
+  private RequestScopedBean requestBean;
+
+  /** beans are correctly injected */
+  @Test
+  public void beansAreInjected() {
+    assertThat("application bean is injected", applicationBean, notNullValue());
+    assertThat("session bean is injected", sessionBean, notNullValue());
+    assertThat("request bean is injected", requestBean, notNullValue());
+  }
+
+  /** starts application and session scopes */
+  @Test
+  @InSequence(1)
+  public void start() {
+    applicationBean.setValue("application");
+    sessionBean.setValue("session");
+    requestBean.setValue("request");
+
+    assertThat(applicationBean.getValue(), equalTo("application"));
+    assertThat(sessionBean.getValue(), equalTo("session"));
+    assertThat(requestBean.getValue(), equalTo("request"));
+  }
+
+  /** application and session scopes are preserved but not request scope */
+  @Test
+  @InSequence(2)
+  public void applicationAndSessionShouldBeKept() {
+    assertThat(applicationBean.getValue(), equalTo("application"));
+    assertThat(sessionBean.getValue(), equalTo("session"));
+    assertThat(requestBean.getValue(), nullValue());
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/DalPersistanceEventTest.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,65 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import org.junit.Rule;
+import org.junit.Test;
+import org.junit.rules.ExpectedException;
+import org.openbravo.base.exception.OBException;
+import org.openbravo.base.provider.OBProvider;
+import org.openbravo.base.weld.test.WeldBaseTest;
+import org.openbravo.dal.service.OBDal;
+import org.openbravo.erpCommon.utility.OBMessageUtils;
+import org.openbravo.model.common.geography.Country;
+
+/**
+ * Persistance observers require of cdi. Test cases covering observers are executed when using
+ * WeldBaseTest.
+ * 
+ * @author alostale
+ *
+ */
+public class DalPersistanceEventTest extends WeldBaseTest {
+  @Rule
+  public ExpectedException exception = ExpectedException.none();
+
+  @Test
+  public void persisntaceObserversShouldBeExecuted() {
+    try {
+      setSystemAdministratorContext();
+      Country newCountry = OBProvider.getInstance().get(Country.class);
+      newCountry.setName("Wonderland");
+      newCountry.setISOCountryCode("WL");
+      newCountry.setAddressPrintFormat("-");
+
+      newCountry.setDateformat("invalid date format");
+
+      // expecting exception thrown by by persistance observer, it will be thrown only if it is
+      // executed
+      exception.expect(OBException.class);
+      exception.expectMessage(OBMessageUtils.messageBD("InvalidDateFormat"));
+
+      OBDal.getInstance().save(newCountry);
+      OBDal.getInstance().flush();
+    } finally {
+      OBDal.getInstance().rollbackAndClose();
+    }
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/ParameterizedCdi.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,88 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import static org.hamcrest.CoreMatchers.equalTo;
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertThat;
+
+import java.util.Arrays;
+import java.util.List;
+
+import org.junit.AfterClass;
+import org.junit.Rule;
+import org.junit.Test;
+import org.openbravo.base.weld.test.ParameterCdiTest;
+import org.openbravo.base.weld.test.ParameterCdiTestRule;
+import org.openbravo.base.weld.test.WeldBaseTest;
+
+/**
+ * Test cases checking test case parameterization with cdi.
+ * 
+ * @author alostale
+ *
+ */
+public class ParameterizedCdi extends WeldBaseTest {
+  public static final List<String> PARAMS = Arrays.asList("param1", "param2", "param3");
+
+  /** defines the values the parameter will take. */
+  @Rule
+  public ParameterCdiTestRule<String> parameterValuesRule = new ParameterCdiTestRule<String>(
+      PARAMS);
+
+  /** this field will take the values defined by parameterValuesRule field. */
+  private @ParameterCdiTest String parameter;
+
+  private static int counterTest1 = 0;
+  private static int counterTest2 = 0;
+  private static String test1Execution = "";
+  private static String test2Execution = "";
+
+  /** Test case to be executed once per parameter value */
+  @Test
+  public void test1() {
+    assertThat("parameter value", parameter, equalTo(PARAMS.get(counterTest1)));
+    counterTest1++;
+    test1Execution += parameter;
+  }
+
+  /** Test case to be executed once per parameter value */
+  @Test
+  public void test2() {
+    assertThat("parameter value", parameter, equalTo(PARAMS.get(counterTest2)));
+
+    counterTest2++;
+    test2Execution += parameter;
+  }
+
+  /** Checks the previous test cases were executed as many times as parameter values in the list. */
+  @AfterClass
+  public static void testsShouldBeExecutedOncePerParameter() {
+    String expectedValue = "";
+    for (String paramValue : PARAMS) {
+      expectedValue += paramValue;
+    }
+    assertThat("# of executions for test 1", PARAMS.size(), is(counterTest1));
+    assertThat("# of executions for test 2", PARAMS.size(), is(counterTest2));
+
+    assertThat("test 1 result", test1Execution, equalTo(expectedValue));
+    assertThat("test 2 result", test2Execution, equalTo(expectedValue));
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/RequestScopedBean.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,36 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import javax.enterprise.context.RequestScoped;
+
+/** Simple request scoped bean */
+@RequestScoped
+public class RequestScopedBean {
+  private String value;
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public String getValue() {
+    return value;
+  }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/modules/org.openbravo.base.weld/src-test/org/openbravo/base/weld/test/testinfrastructure/SessionScopedBean.java	Tue Aug 04 10:02:42 2015 +0200
@@ -0,0 +1,40 @@
+/*
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.1  (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 
+ * 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 SLU
+ * All portions are Copyright (C) 2015 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.base.weld.test.testinfrastructure;
+
+import java.io.Serializable;
+
+import javax.enterprise.context.SessionScoped;
+
+/** Simple session scoped bean */
+@SuppressWarnings("serial")
+@SessionScoped
+public class SessionScopedBean implements Serializable {
+  private String value;
+
+  public void setValue(String value) {
+    this.value = value;
+  }
+
+  public String getValue() {
+    return value;
+  }
+
+}
Binary file modules/org.openbravo.client.application/lib/runtime/guice-2.0.jar has changed
Binary file modules/org.openbravo.client.application/lib/runtime/httpclient-4.0.jar has changed
Binary file modules/org.openbravo.client.application/lib/runtime/httpcore-4.0.1.jar has changed
Binary file modules/org.openbravo.client.application/lib/runtime/httpmime-4.1.jar has changed
--- a/modules/org.openbravo.client.application/src-db/database/model/tables/OBUIAPP_GC_FIELD.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/model/tables/OBUIAPP_GC_FIELD.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -65,6 +65,14 @@
         <default><![CDATA[D]]></default>
         <onCreateDefault><![CDATA['D']]></onCreateDefault>
       </column>
+      <column name="ISFKDROPDOWNUNFILTERED" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[D]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="DISABLEFKCOMBO" primaryKey="false" required="true" type="VARCHAR" size="60" autoIncrement="false">
+        <default><![CDATA[D]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="OBUIAPP_GC_FIELD_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
--- a/modules/org.openbravo.client.application/src-db/database/model/tables/OBUIAPP_GC_SYSTEM.xml	Mon May 04 09:06:54 2015 +0200
+++ b/modules/org.openbravo.client.application/src-db/database/model/tables/OBUIAPP_GC_SYSTEM.xml	Tue Aug 04 10:02:42 2015 +0200
@@ -61,6 +61,14 @@
         <default><![CDATA[Y]]></default>
         <onCreateDefault><![CDATA['Y']]></onCreateDefault>
       </column>
+      <column name="ISFKDROPDOWNUNFILTERED" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
+      <column name="DISABLEFKCOMBO" primaryKey="false" required="true" type="CHAR" size="1" autoIncrement="false">
+        <default><![CDATA[N]]></default>
+        <onCreateDefault/>
+      </column>
       <foreign-key foreignTable="AD_CLIENT" name="OBUIAPP_GC_SYSTEM_CLIENT">
         <reference local="AD_CLIENT_ID" foreign="AD_CLIENT_ID"/>
       </foreign-key>
@@ -70,9 +78,11 @@
       <unique name="OBUIAPP_GC_SYS_UNIQUE_CLIENT">
         <unique-column name="AD_CLIENT_ID"/>
       </unique>
+      <check name="OBUIAPP_GC_SYS_DISCOMBO_CHK"><![CDATA[DISABLEFKCOMBO IN ('Y', 'N')]]></check>
       <check name="OBUIAPP_GC_SYS_ISFILT_CHK"><![CDATA[ISFILTERABLE IN ('Y', 'N')]]></check>
       <check name="OBUIAPP_GC_SYS_ISLAZY_CHK"><![CDATA[ISLAZYFILTERING IN ('Y', 'N')]]></check>
       <check name="OBUIAPP_GC_SYS_ISSORT_CHK"><![CDATA[ISSORTABLE IN ('Y', 'N')]]></check>
       <check name="OBUIAPP_GC_SYS_ONCHNG_CHK"><![CDATA[FILTERONCHANGE IN ('Y', 'N')]]></check>
+      <check name="OBUIAPP_GC_SYS_UNFILTDD_CHK"><![CDATA[ISFKDROPDOWNUNFILTERED IN ('Y', 'N')