Fixed issue with previous week quarterly targets in daily report

This commit is contained in:
Daniel Wathen
2023-07-05 15:31:28 -07:00
parent 32182e8f7c
commit 1633c82323
5 changed files with 9 additions and 11 deletions

View File

@ -200,7 +200,7 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
return weeklyPartChanges;
}
public QuarterlyTargets GetQuarterlyTargets()
public QuarterlyTargets GetQuarterlyTargets(string startDate)
{
Dictionary<string, float> targets = new();
@ -212,18 +212,16 @@ public class ScrapeDatabaseRepository : IScrapeDatabaseRepository
" WHERE THRU_GROUP = 'TOT' " +
" AND FISCAL_YR = " +
" (SELECT FISCAL_YR FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()) " +
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT) " +
" AND FISCAL_QTR = " +
" (SELECT FISCAL_QTR FROM FISCAL_QTR " +
" WHERE START_DT < SYSDATETIME() " +
" AND END_DT > SYSDATETIME()) " +
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT) " +
"UNION " +
"SELECT 'PlanWorkingDays' As THRU_TARGET," +
" PLAN_WORKING_DAYS AS THRU_QTY," +
" NULL AS THRU_PCNT" +
" FROM FISCAL_QTR " +
" WHERE SYSDATETIME() BETWEEN START_DT AND END_DT";
" WHERE '" + startDate + "' BETWEEN START_DT AND END_DT";
cmd.CommandText = query;