diff --git a/src/controllers/ReportController.ts b/src/controllers/ReportController.ts index 9dbf86e..1d1ead2 100644 --- a/src/controllers/ReportController.ts +++ b/src/controllers/ReportController.ts @@ -61,11 +61,12 @@ export class ReoportController { async sumaryEvaluationReport(@Query("year") year?: string, @Query("rootid") rootId?: string) { const yearInAD = year?year:null; + const yearInBE = yearInAD ? (parseInt(yearInAD) - 543).toString() : null; const evaluation = await AppDataSource.getRepository(Evaluation) .createQueryBuilder("evaluation") .where('evaluation.evaluationResult NOT IN (:...evaluationResults)', { evaluationResults: ['PENDING'] }) - .andWhere( yearInAD && yearInAD != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInAD }) + .andWhere( yearInBE && yearInBE != null? 'YEAR(createdAt) = :year': "1=1", { year: yearInBE }) .andWhere(rootId?'orgRootId = :rootId': "1=1", { rootId: rootId }) .andWhere('evaluation.step = :step', { step: 'DONE' }) .getMany();