Fixed issue 34345:Sales Dimensional Report is not showing SO with 0 net amount
authorRafael Queralta Pozo <rqueralta@nauta.cu>
Mon, 02 Jan 2017 17:15:14 -0500
changeset 31486 d8929499d9ff
parent 31485 9a02f5f50ace
child 31487 a75ea21e11ec
Fixed issue 34345:Sales Dimensional Report is not showing SO with 0 net amount

Having clause was changed to show Sales Order lines with 0 line net amount
src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java
--- a/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java	Mon Jan 16 09:46:35 2017 +0100
+++ b/src/org/openbravo/erpCommon/ad_reports/ReportSalesDimensionalAnalyzeJR.java	Mon Jan 02 17:15:14 2017 -0500
@@ -598,14 +598,14 @@
     }
     String strHaving = "";
     if (!strMayor.equals("") && !strMenor.equals("")) {
-      strHaving = " HAVING (SUM(CONVAMOUNT) > " + strMayor + " AND SUM(CONVAMOUNT) < " + strMenor
+      strHaving = " HAVING (SUM(CONVAMOUNT) >= " + strMayor + " AND SUM(CONVAMOUNT) < " + strMenor
           + ")";
     } else if (!strMayor.equals("") && strMenor.equals("")) {
-      strHaving = " HAVING (SUM(CONVAMOUNT) > " + strMayor + ")";
+      strHaving = " HAVING (SUM(CONVAMOUNT) >= " + strMayor + ")";
     } else if (strMayor.equals("") && !strMenor.equals("")) {
-      strHaving = " HAVING (SUM(CONVAMOUNT) < " + strMenor + ")";
+      strHaving = " HAVING (SUM(CONVAMOUNT) <= " + strMenor + ")";
     } else {
-      strHaving = " HAVING (SUM(CONVAMOUNT) <> 0 OR SUM(CONVAMOUNTREF) <> 0)";
+      strHaving = " HAVING ((SUM(CONVAMOUNT) >= 0 OR SUM(CONVAMOUNTREF) >= 0) OR (SUM(CONVAMOUNT) <= 0 OR SUM(CONVAMOUNTREF) <= 0))";
     }
     strOrderby = strHaving + strOrderby;