Fixes issue 20326: Null Pointer Exception error.
authorIoritz Cia <ioritz.cia@openbravo.com>
Mon, 23 Apr 2012 17:44:56 +0200
changeset 16514 f4c64b25b00b
parent 16513 071251abc7ed
child 16515 d7a6f96f5831
Fixes issue 20326: Null Pointer Exception error.
Null Pointer Exception when executing report 'Include Empty Business Partner' and there is a transaction without payment.
modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java
--- a/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Thu Apr 26 18:37:11 2012 +0200
+++ b/modules/org.openbravo.financial.paymentreport/src/org/openbravo/financial/paymentreport/erpCommon/ad_reports/PaymentReportDao.java	Mon Apr 23 17:44:56 2012 +0200
@@ -1407,13 +1407,6 @@
             || (transaction.getCurrency().getISOCode().toString()
                 .compareTo(data.getField("TRANS_CURRENCY")) < 0);
       }
-      if (strOrdCritList[i].contains("Date")) {
-        Date transactionDate = transaction.getDateAcct();
-        Date dataDate = FIN_Utility.getDate(data.getField("DUE_DATE"));
-        if (transactionDate.before(dataDate)) {
-          isBefore = true;
-        }
-      }
       return isBefore;
     } else {
       if (strOrdCritList[i].contains("Project")) {
@@ -1465,17 +1458,13 @@
               strProject);
         }
       } else if (strOrdCritList[i].contains("Date")) {
-        Date transactionDate = transaction.getDateAcct();
-        Date dataDate = FIN_Utility.getDate(data.getField("DUE_DATE"));
-        if (transactionDate.before(dataDate)) {
-          isBefore = true;
-        } else if (transactionDate.equals(dataDate)) {
+        Date dataDate = FIN_Utility.getDate(data.getField("INVOICE_DATE"));
+        if (dataDate != null) {
+          isBefore = false;
+        } else {
           isBefore = isBeforeOrder(transaction, data, strOrdCritList, i + 1, BPName, BPCategory,
               strProject);
         }
-      } else {
-        isBefore = isBeforeOrder(transaction, data, strOrdCritList, i + 1, BPName, BPCategory,
-            strProject);
       }
       return isBefore;
     }