details:   https://code.openbravo.com/erp/devel/pi/rev/3510a7bf3601
changeset: 32201:3510a7bf3601
user:      Asier Martirena <asier.martirena <at> openbravo.com>
date:      Thu May 25 10:31:59 2017 +0200
summary:   Fixed issue 35511: When doing a C&R process, the finacc_txn_amount 
field of the netting payment is not set to 0

diffstat:

 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmount.class
     |    0 
 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmountData.class
 |    0 
 
src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount.java
                |   49 ++++++++++
 
src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount_data.xsql
           |   37 +++++++
 src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java         
                     |    1 +
 5 files changed, 87 insertions(+), 0 deletions(-)

diffs (111 lines):

diff -r 472e625ebe84 -r 3510a7bf3601 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmount.class
Binary file 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmount.class
 has changed
diff -r 472e625ebe84 -r 3510a7bf3601 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmountData.class
Binary file 
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdateFinTransactionAmountData.class
 has changed
diff -r 472e625ebe84 -r 3510a7bf3601 
src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount.java
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount.java
      Thu May 25 10:31:59 2017 +0200
@@ -0,0 +1,49 @@
+/*
+ *************************************************************************
+ * 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) 2017 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+ */
+
+package org.openbravo.modulescript;
+
+import java.sql.Connection;
+import java.sql.SQLException;
+import java.util.UUID;
+import org.apache.log4j.Logger;
+
+import javax.servlet.ServletException;
+
+import org.openbravo.database.ConnectionProvider;
+
+public class UpdateFinTransactionAmount extends ModuleScript {
+
+  @Override
+  public void execute() {
+    try {
+      ConnectionProvider cp = getConnectionProvider();
+      UpdateFinTransactionAmountData.update(cp);
+    } catch (Exception e) {
+      handleError(e);
+    }
+  }
+
+  @Override
+  protected ModuleScriptExecutionLimits getModuleScriptExecutionLimits() {
+    return new ModuleScriptExecutionLimits("0", new OpenbravoVersion(3, 0, 
30440),
+        new OpenbravoVersion(3, 0, 32201));
+  }
+
+}
\ No newline at end of file
diff -r 472e625ebe84 -r 3510a7bf3601 
src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount_data.xsql
--- /dev/null   Thu Jan 01 00:00:00 1970 +0000
+++ 
b/src-util/modulescript/src/org/openbravo/modulescript/UpdateFinTransactionAmount_data.xsql
 Thu May 25 10:31:59 2017 +0200
@@ -0,0 +1,37 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+<!--
+ *************************************************************************
+ * 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) 2017 Openbravo SLU
+ * All Rights Reserved.
+ * Contributor(s):  ______________________________________.
+ ************************************************************************
+-->
+<SqlClass name="UpdateFinTransactionAmountData" 
package="org.openbravo.modulescript">
+  <SqlClassComment></SqlClassComment>
+  <SqlMethod name="select" type="preparedStatement" return="multiple">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql><![CDATA[
+      SELECT '' as exist FROM DUAL
+      ]]>
+    </Sql>
+  </SqlMethod>
+  <SqlMethod name="update" type="preparedStatement" return="rowcount">
+    <SqlMethodComment></SqlMethodComment>
+    <Sql>
+      <![CDATA[
+        UPDATE FIN_Payment SET finacc_txn_amount = 0 WHERE amount = 0
+      ]]>
+    </Sql>
+  </SqlMethod>
+</SqlClass>
\ No newline at end of file
diff -r 472e625ebe84 -r 3510a7bf3601 
src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java
--- a/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java    
Thu May 25 09:50:37 2017 +0200
+++ b/src/org/openbravo/erpCommon/businessUtility/CancelAndReplaceUtils.java    
Thu May 25 10:31:59 2017 +0200
@@ -1063,6 +1063,7 @@
 
     // Set amount and used credit to zero
     nettingPayment.setAmount(BigDecimal.ZERO);
+    nettingPayment.setFinancialTransactionAmount(BigDecimal.ZERO);
     nettingPayment.setUsedCredit(BigDecimal.ZERO);
     String truncatedDescription = (description.length() > 255) ? 
description.substring(0, 252)
         .concat("...").toString() : description.toString();

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Openbravo-commits mailing list
Openbravo-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to