Fixes issue 20326: Null Pointer Exception error.
authorIoritz Cia <ioritz.cia@openbravo.com>
Mon, 23 Apr 2012 17:44:56 +0200
changeset 16474 936e350ed6ca
parent 16473 01ec47428462
child 16475 6881ef99f43e
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	Wed Apr 25 16:55:56 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 = FIN_Utility.getDate(strOrdCritList[i]);
-        Date dataDate = FIN_Utility.getDate(data.getField("DUE_DATE"));
-        if (transactionDate.before(dataDate)) {
-          isBefore = true;
-        }
-      }
       return isBefore;
     } else {
       if (strOrdCritList[i].contains("Project")) {
@@ -1465,11 +1458,10 @@
               strProject);
         }
       } else if (strOrdCritList[i].contains("Date")) {
-        Date transactionDate = FIN_Utility.getDate(strOrdCritList[i]);
-        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);
         }