Related to issue 30019: Backout changeset c7f004f2815d
authorAlvaro Ferraz <alvaro.ferraz@openbravo.com>
Wed, 17 Jun 2015 14:27:39 +0200
changeset 27117 38993c090dd0
parent 27116 9f250bdc7db7
child 27118 a28a880b5aeb
Related to issue 30019: Backout changeset c7f004f2815d
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java
modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java
src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class
src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql
src/org/openbravo/event/PaidStatusEventHandler.java
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Wed Jun 17 14:25:28 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_PaymentProcess.java	Wed Jun 17 14:27:39 2015 +0200
@@ -377,9 +377,8 @@
                     .invoicePaymentStatus(payment)));
                 paymentScheduleDetail.setInvoicePaid(false);
                 // Payment = 0 when the payment is generated by a invoice that consume credit
-                if ((invoicePaidAmounts && paymentScheduleDetail.getInvoicePaymentSchedule() != null)
-                    || (paymentScheduleDetail.getOrderPaymentSchedule() != null)
-                    || (payment.getAmount().compareTo(new BigDecimal("0.00")) == 0)) {
+                if (invoicePaidAmounts
+                    | (payment.getAmount().compareTo(new BigDecimal("0.00")) == 0)) {
                   if (paymentScheduleDetail.getInvoicePaymentSchedule() != null) {
                     // BP SO_CreditUsed
                     businessPartner = paymentScheduleDetail.getInvoicePaymentSchedule()
--- a/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Wed Jun 17 14:25:28 2015 +0200
+++ b/modules/org.openbravo.advpaymentmngt/src/org/openbravo/advpaymentmngt/process/FIN_TransactionProcess.java	Wed Jun 17 14:27:39 2015 +0200
@@ -135,8 +135,7 @@
             for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
               invoicePaidold = psd.isInvoicePaid();
               if (!invoicePaidold) {
-                if (FIN_Utility.invoicePaymentStatus(payment).equals(payment.getStatus())
-                    && psd.getInvoicePaymentSchedule() != null) {
+                if ((FIN_Utility.invoicePaymentStatus(payment).equals(payment.getStatus()))) {
                   psd.setInvoicePaid(true);
                 }
                 if (psd.isInvoicePaid()) {
Binary file src-util/modulescript/build/classes/org/openbravo/modulescript/UpdatePaymentPlanData.class has changed
--- a/src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql	Wed Jun 17 14:25:28 2015 +0200
+++ b/src-util/modulescript/src/org/openbravo/modulescript/UpdatePaymentPlan_data.xsql	Wed Jun 17 14:27:39 2015 +0200
@@ -54,7 +54,7 @@
         SELECT count(*) as exist
         FROM DUAL
         WHERE EXISTS (SELECT 1 FROM ad_preference
-                      WHERE attribute = 'PaymentPlanUpdatedV3')
+                      WHERE attribute = 'PaymentPlanUpdatedV2')
       ]]>
     </Sql>
   </SqlMethod>
@@ -66,7 +66,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(),'PaymentPlanUpdatedV3')
+           get_uuid(), '0', '0', 'Y', '0', NOW(), '0', NOW(),'PaymentPlanUpdatedV2')
          ]]>
         </Sql>
    </SqlMethod>
--- a/src/org/openbravo/event/PaidStatusEventHandler.java	Wed Jun 17 14:25:28 2015 +0200
+++ b/src/org/openbravo/event/PaidStatusEventHandler.java	Wed Jun 17 14:27:39 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-2015 Openbravo SLU
+ * All portions are Copyright (C) 2014 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  *************************************************************************
@@ -72,8 +72,7 @@
             for (FIN_PaymentScheduleDetail psd : pd.getFINPaymentScheduleDetailList()) {
               invoicePaidold = psd.isInvoicePaid();
               if (!invoicePaidold) {
-                if (newStatus.equals(transaction.getFinPayment().getStatus())
-                    && psd.getInvoicePaymentSchedule() != null) {
+                if (newStatus.equals(transaction.getFinPayment().getStatus())) {
                   psd.setInvoicePaid(true);
                 }
                 if (psd.isInvoicePaid()) {