From 6f4f7c8243fb5faf6efd94883f3624314e5b60d3 Mon Sep 17 00:00:00 2001 From: sriramv Date: Wed, 15 Sep 2021 15:35:30 +0530 Subject: [PATCH] FIN_Summary_issue:GWM --- app/controllers/financial.controller.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/controllers/financial.controller.js b/app/controllers/financial.controller.js index 795a7a2..2e5ab1a 100644 --- a/app/controllers/financial.controller.js +++ b/app/controllers/financial.controller.js @@ -91,8 +91,8 @@ exports.MenuList = (req, res) => { exports.FinantialsSummary = async (req, res) => { const id = req.query.entityid - sequelize.query("select a.losid,a.entityid,a.Y1,a.Y2,a.Y3,a.Y1_st_type as Y1_st_type_id, b.statement_name as Y1_st_type_name,a.Y2_st_type as Y2_st_type_id, c.statement_name as Y2_st_type_name,a.Y3_st_type as Y3_st_type_id, d.statement_name as Y3_st_type_name FROM entity_fin_years a JOIN (SELECT id,statement_name FROM statement_type) b ON a.Y1_st_type = b.id JOIN (SELECT id,statement_name FROM statement_type) c ON a.Y2_st_type = c.id JOIN (SELECT id,statement_name FROM statement_type) d ON a.Y3_st_type = d.id WHERE entityid ="+id) - .then(data => { + sequelize.query("select a.losid,a.entityid,a.Y1,a.Y2,a.Y3,a.Y1_st_type as Y1_st_type_id, b.statement_name as Y1_st_type_name,a.Y2_st_type as Y2_st_type_id, c.statement_name as Y2_st_type_name,a.Y3_st_type as Y3_st_type_id, d.statement_name as Y3_st_type_name FROM entity_fin_years a LEFT JOIN (SELECT id,statement_name FROM statement_type) b ON a.Y1_st_type = b.id JOIN (SELECT id,statement_name FROM statement_type) c ON a.Y2_st_type = c.id LEFT JOIN (SELECT id,statement_name FROM statement_type) d ON a.Y3_st_type = d.id WHERE entityid ="+id) + .then(data => { const Year_1 = data[0][0].Y1; const Year_2 = data[0][0].Y2; @@ -101,7 +101,7 @@ exports.FinantialsSummary = async (req, res) => { const current_year = new Date().getFullYear(); const current_month = new Date().getMonth() + 1; let add_new_FY_flag; - if(Year_1 == current_year && 3 < current_month) + if(Year_1 >= current_year && 3 < current_month) { add_new_FY_flag = {show_add_finyear_button:0}; }