From 7e46320941139c3bcb3f6121fa6c44d83f72c570 Mon Sep 17 00:00:00 2001 From: sriramv Date: Tue, 22 Mar 2022 12:00:33 +0530 Subject: [PATCH] new_itemMaster:GWM --- app/controllers/financial.controller.js | 2 +- app/models/Itemsmaster.js | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/controllers/financial.controller.js b/app/controllers/financial.controller.js index f92834c..b339884 100644 --- a/app/controllers/financial.controller.js +++ b/app/controllers/financial.controller.js @@ -311,7 +311,7 @@ sequelize.query("select a.losid,a.entityid,a.FY,a.st_type as st_type_id, b.state } }); // end of foreach - var query = "Select a.entity_id,x.id as statement_id,x.statement as statement,y.id as section_id,y.section as section,w.subsection as subsection_id,z.subsection as subsection , z.itemtext as subsection_itemtext ,a.itemid,w.itemtext as items,w.formula,w.is_calculated,w.is_summary,w.pvtltd,w.pvtltd_is_calculated,w.pvtltd_formula,w.llp,w.others,a.st_type as Y1_st_type,a.fy as Y1,a.id as Y1_id ,a.is_editable as Y1_is_editable,a.value as Y1_value "+ select_items +",v.remarks , v.id as remarks_id FROM financials a LEFT JOIN ( SELECT id,entity_id,itemid,remarks FROM fin_remarks WHERE is_active = 1) v ON a.entity_id = v.entity_id and a.itemid = v.itemid JOIN ( SELECT id,itemtext,statement,section,subsection,formula,is_calculated,is_summary,pvtltd,llp,others,pvtltd_is_calculated,pvtltd_formula FROM itemsmaster ) w ON a.itemid = w.id JOIN ( SELECT id, statement FROM statementsmaster ) x ON w.statement = x.id JOIN ( SELECT id, section FROM sectionsmaster ) y ON w.section = y.id LEFT JOIN ( SELECT id, subsection , itemtext FROM subsectionsmaster ) z ON w.subsection = z.id "+ sub_query +"WHERE a.fy = '"+year_1+"' and a.entity_id = "+id+" and a.is_active = 1 order by w.statement asc , w.section asc , w.subsection asc"; + var query = "Select a.entity_id,x.id as statement_id,x.statement as statement,y.id as section_id,y.section as section,w.subsection as subsection_id,z.subsection as subsection , z.itemtext as subsection_itemtext ,a.itemid,w.itemtext as items,w.formula,w.is_calculated,w.is_summary,w.pvtltd,w.llp,w.others,a.st_type as Y1_st_type,a.fy as Y1,a.id as Y1_id ,a.is_editable as Y1_is_editable,a.value as Y1_value "+ select_items +",v.remarks , v.id as remarks_id FROM financials a LEFT JOIN ( SELECT id,entity_id,itemid,remarks FROM fin_remarks WHERE is_active = 1) v ON a.entity_id = v.entity_id and a.itemid = v.itemid JOIN ( SELECT id,itemtext,statement,section,subsection,formula,is_calculated,is_summary,pvtltd,llp,others FROM new_itemsmaster ) w ON a.itemid = w.id JOIN ( SELECT id, statement FROM statementsmaster ) x ON w.statement = x.id JOIN ( SELECT id, section FROM sectionsmaster ) y ON w.section = y.id LEFT JOIN ( SELECT id, subsection , itemtext FROM subsectionsmaster ) z ON w.subsection = z.id "+ sub_query +"WHERE a.fy = '"+year_1+"' and a.entity_id = "+id+" and a.is_active = 1 order by w.statement asc , w.section asc , w.subsection asc"; setTimeout(function(){ sequelize.query(query).then(summary => { // is_summary filter from fin_summary data diff --git a/app/models/Itemsmaster.js b/app/models/Itemsmaster.js index a6dfdac..fb5d690 100644 --- a/app/models/Itemsmaster.js +++ b/app/models/Itemsmaster.js @@ -30,8 +30,8 @@ module.exports = (sequelize, DataTypes) => { subsection: { type: DataTypes.INTEGER }, itemtext: { type: DataTypes.STRING }, pvtltditemkey: { type: DataTypes.STRING }, - pvtltd_is_calculated: { type: DataTypes.INTEGER }, - pvtltd_formula: { type: DataTypes.INTEGER }, + // pvtltd_is_calculated: { type: DataTypes.INTEGER }, + // pvtltd_formula: { type: DataTypes.INTEGER }, is_active: { type: DataTypes.INTEGER }, pvtltd: { type: DataTypes.INTEGER }, llp: { type: DataTypes.INTEGER }, @@ -45,7 +45,7 @@ module.exports = (sequelize, DataTypes) => { }, { sequelize, - tableName: 'itemsmaster', + tableName: 'new_itemsmaster', modelName: 'Itemsmaster', createdAt: 'createdon', updatedAt: 'updatedon',