Commit afa43bde authored by pborate's avatar pborate

Updated to add SITE_CODE_FR & SITE_CODE_TO filters in SalesTrends Dashboard

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@194800 ce508802-f39f-4f6c-b175-0d175dae99d5
parent 99d3ef14
......@@ -74,6 +74,20 @@ public class SalesTrends extends ValidatorEJB implements SalesTrendsLocal, Sales
growthValueArray=calculateGross(netSummary, netSummaryPrv);
}
//Added By Saitej to Add Filters of fromDate, toDate, SITE_CODE_FR, SITE_CODE_TO [START]
//String fromDate = Detail1.optString("fromDate");
//String toDate = Detail1.optString("toDate");
//E12GenericUtility e12Utility = new E12GenericUtility();
//String applDateFormat = e12Utility.getApplDateFormat();
//String dbDateFormat = e12Utility.getDBDateFormat();
//String fromDateStr = e12Utility.getValidDateString(fromDate, applDateFormat, dbDateFormat);
//String toDateStr = e12Utility.getValidDateString(toDate, applDateFormat, dbDateFormat);
String SITE_CODE_FR = Detail1.optString("SITE_CODE_FR");
String SITE_CODE_TO = Detail1.optString("SITE_CODE_TO");
//Added By Saitej to Add Filters of fromDate, toDate, SITE_CODE_FR, SITE_CODE_TO [END]
JSONArray salesSummaryArr = null;
String salesTrendsData = "";
String sqlCurrYear = "" , sqlPrevYear = "";
......@@ -147,7 +161,9 @@ public class SalesTrends extends ValidatorEJB implements SalesTrendsLocal, Sales
" AND DWH_HIERARCHY.TABLE_NO = ORG_STRUCT.TABLE_NO" +
" AND DWH_HIERARCHY.VERSION_ID = ORG_STRUCT.VERSION_ID" +
" AND ISER.item_ser >= '"+itemser_fm+"' " +
" AND ISER.item_ser <= '"+itemser_to+"' "
" AND ISER.item_ser <= '"+itemser_to+"' " +
" AND DSS.SITE_CODE >= '"+SITE_CODE_FR+"' " +
" AND DSS.SITE_CODE <= '"+SITE_CODE_TO+"' "
+ period1;
System.out.println("SQL QUERY EXECUTED ::::::::::::::::: " + sqlCurrYear );
......@@ -542,8 +558,11 @@ public class SalesTrends extends ValidatorEJB implements SalesTrendsLocal, Sales
Double netAmountPvs=netSummaryObjPvs.optDouble("NET_AVG");
System.out.println("calculateGross1 monthPvs ["+monthPvs+"] yearPvs ["+yearPvs+"] netAmountPvs ["+netAmountPvs+"]" +"] netAmount ["+netAmount+"]");
Double minusNet=netAmount-netAmountPvs;
if(netAmount != 0.0) {
growthValue=(minusNet/netAmount)*100;
// if(netAmount != 0.0) {
// growthValue=(minusNet/netAmount)*100;
// }
if(netAmountPvs != 0.0) {
growthValue=(minusNet/netAmountPvs)*100;
}
else {
growthValue=0.0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment