Commit 21d3a1cc authored by msinkar's avatar msinkar

CHanges for MTD dashbaord

git-svn-id: http://15.206.35.175/svn/proteus/business-java/trunk@195799 ce508802-f39f-4f6c-b175-0d175dae99d5
parent df207fbe
......@@ -223,7 +223,8 @@ public class CurrentDayWrkSummary extends ValidatorEJB implements CurrentDayWrkS
//"To_CHAR(TRUNC(?),'DD-MM-YYYY') as show_Date , " +
"SalesPerson_Code , To_Calls," +
" SalesPerson_Name , nvl(SUM(Tot_Calls),0) as Tot_Calls , nvl(SUM(Tot_PC),0) as Tot_PC , " +
" nvl(SUM((To_Calls - Tot_Dist_Calls)),0) as Call_Bal , nvl(SUM(TLSD),0) as TLSD , " +
//" nvl(SUM((To_Calls - Tot_Dist_Calls)),0) as Call_Bal , nvl(SUM(TLSD),0) as TLSD , " + //modified by mrunalini sinkar to remove sum function in call_bal on 16-01-2019
" nvl((To_Calls - Tot_Dist_Calls),0) as Call_Bal , nvl(SUM(TLSD),0) as TLSD , " +
" nvl(SUM(Ord_Val),0) as Ord_Val , nvl(SUM(Display),0) as Display " +
" From ( Select SM.Sales_Pers as SalesPerson_Code , " +
" SP.SP_Name as SalesPerson_Name ,nvl(count(strg_code),0) as Tot_Calls , nvl(count(Distinct strg_code),0) as Tot_Dist_Calls ," +
......@@ -509,7 +510,7 @@ public class CurrentDayWrkSummary extends ValidatorEJB implements CurrentDayWrkS
" And SM.Strg_Code = SMO.Strg_Code " +
" And SM.Dcr_Id = SMO.DCR_Id " +
" And I.Item_Code = SMO.Item_Code " +
" And SM.Strg_Type = 'C' " +
//" And SM.Strg_Type = 'C' " + //commented by mrunalini sinkar to show outlet same as main dashbaord on 16-01-2019
" And SM.Event_Date = TO_DATE(To_CHAR(TRUNC(?),'DD-MM-YYYY'),'DD-MM-YYYY')" +
" " + appendSqlStr + " " +
" And (SMO.Quantity) > 0 " +
......@@ -1114,12 +1115,12 @@ public class CurrentDayWrkSummary extends ValidatorEJB implements CurrentDayWrkS
year = ""+(cal.get(Calendar.YEAR));
System.out.println("In getMTDWorkDetail current ==>>month = ["+month+"] year = ["+year+"] salePers = ["+salePerson+"]" );
appendSqlStr = " And sales_pers.Sales_Pers In ( Select Emp_Code " +
appendSqlStr = " sales_pers.Sales_Pers In ( Select Emp_Code " +
" From Employee Start With Emp_code = (Select Emp_Code From Users Where Code = "+salePerson+") " +
" Connect By Prior Emp_Code =Report_To )";
}else
{
appendSqlStr = " And sales_pers.Sales_Pers In ("+salePerson+") ";
appendSqlStr = " sales_pers.Sales_Pers In ("+salePerson+") ";
}
month = dashboardUtility.getCommaSeparated(checkNull(month));
......@@ -1154,8 +1155,9 @@ public class CurrentDayWrkSummary extends ValidatorEJB implements CurrentDayWrkS
"LEFT JOIN " +
"sales_pers SALES_PERS1 " +
"ON SALES_PERS1.sales_pers = SPT.sprs_code__ww " +
"WHERE strg_meet.strg_type = 'C' " +
" "+appendSqlStr+ " " +
"WHERE "
//+ "strg_meet.strg_type = 'C' " //commented by mrunalini sinkar to show proper data
+" "+appendSqlStr+ " " +
"and strg_meet.EVENT_DATE BETWEEN trunc(to_date("+month+"||"+year+",'MONYYYY'),'MON') " +
"AND last_day(to_date("+month+"||"+year+",'MONYYYY')) Group By strg_meet.sales_pers, " +
"sales_pers.sp_name, strg_meet.Event_Date, " +
......
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