Fixed bug 29197 Payment Out is registered as "BP Deposit" transaction
authorSandra Huguet <sandra.huguet@openbravo.com>
Thu, 12 Mar 2015 16:00:40 +0100
changeset 26174 5c3aeebd4d49
parent 26172 ba035397bf8a
child 26175 e2cc40f75e69
Fixed bug 29197 Payment Out is registered as "BP Deposit" transaction

In FIN_TransactionProcess.java set the correct value depending on
the type of transaction
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab.class
modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.class
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab.java
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab_data.xsql
modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab.class has changed
Binary file modules/org.openbravo.advpaymentmngt/build/classes/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.class has changed
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab.java	Mon Mar 09 18:58:14 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab.java	Thu Mar 12 16:00:40 2015 +0100
@@ -1,3 +1,21 @@
+/* 
+ *************************************************************************
+ * The contents of this file are subject to the Openbravo  Public  License
+ * Version  1.0  (the  "License"),  being   the  Mozilla   Public  License
+ * Version 1.1  with a permitted attribution clause; you may not  use this
+ * file except in compliance with the License. You  may  obtain  a copy of
+ * the License at http://www.openbravo.com/legal/license.html
+ * 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.modulescript;
 
 import org.openbravo.database.ConnectionProvider;
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab_data.xsql	Mon Mar 09 18:58:14 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTab_data.xsql	Thu Mar 12 16:00:40 2015 +0100
@@ -12,7 +12,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):  ______________________________________.
  *************************************************************************
@@ -58,7 +58,7 @@
         SELECT count(*) as exist
         FROM DUAL
         WHERE EXISTS (SELECT 1 FROM ad_preference
-                      WHERE attribute = 'UpdatedTransactionType')
+                      WHERE attribute = 'UpdatedTransactionTypeV2')
       ]]>
     </Sql>
   </SqlMethod>
@@ -70,7 +70,7 @@
            ad_preference_id, ad_client_id, ad_org_id, isactive,
            createdby, created, updatedby, updated,attribute
            ) VALUES (
-           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'UpdatedTransactionType')
+           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'UpdatedTransactionTypeV2')
          ]]>
         </Sql>
    </SqlMethod>
--- a/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.java	Mon Mar 09 18:58:14 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src-util/modulescript/src/src/org/openbravo/advpaymentmngt/modulescript/UpdateTransactionTypeTransactionTabData.java	Thu Mar 12 16:00:40 2015 +0100
@@ -173,7 +173,7 @@
       "        SELECT count(*) as exist" +
       "        FROM DUAL" +
       "        WHERE EXISTS (SELECT 1 FROM ad_preference" +
-      "                      WHERE attribute = 'UpdatedTransactionType')";
+      "                      WHERE attribute = 'UpdatedTransactionTypeV2')";
 
     ResultSet result;
     boolean boolReturn = false;
@@ -210,7 +210,7 @@
       "           ad_preference_id, ad_client_id, ad_org_id, isactive," +
       "           createdby, created, updatedby, updated,attribute" +
       "           ) VALUES (" +
-      "           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'UpdatedTransactionType')";
+      "           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'UpdatedTransactionTypeV2')";
 
     int updateCount = 0;
     PreparedStatement st = null;
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Mon Mar 09 18:58:14 2015 +0100
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Thu Mar 12 16:00:40 2015 +0100
@@ -119,6 +119,7 @@
           }
           payment.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
           transaction.setStatus(payment.isReceipt() ? "RDNC" : "PWNC");
+          transaction.setTransactionType(payment.isReceipt() ? "BPD" : "BPW");
           OBDal.getInstance().save(payment);
           if (transaction.getDescription() == null || "".equals(transaction.getDescription())) {
             transaction.setDescription(payment.getDescription());