probedataupdate:GWM

This commit is contained in:
sriramv 2021-12-29 10:50:45 +05:30
parent 258fc67b93
commit fbf388cb48

View File

@ -117,14 +117,14 @@ var EntityInsert = new Promise((resolve, reject) => {
SkeletonInsert.then((Query_data)=>{ SkeletonInsert.then((Query_data)=>{
Financials.bulkCreate(Query_data).then(data=>{ Financials.bulkCreate(Query_data).then(data=>{
//line item data update //line item data update
lineItem_result.forEach((value,index,array) => { // lineItem_result.forEach((value,index,array) => {
// mapping of probe42 api lineItem with itemMaster primary key // mapping of probe42 api lineItem with itemMaster primary key
final_array = Probe42DataMappingHelper.lineItemMapping(value,entityid); final_array = Probe42DataMappingHelper.lineItemMapping(value,entityid);
final_array.then(function(update_array_data){ final_array.then(function(update_array_data){
// update mapped lineitem value here // update mapped lineitem value here
Probe42DataMappingHelper.lineItemUpdate(update_array_data); Probe42DataMappingHelper.lineItemUpdate(update_array_data);
});//end of lineItemUpdate helper call });//end of lineItemUpdate helper call
});//end of lineItem mapping with itemMaster primary key helper call // });//end of lineItem mapping with itemMaster primary key helper call
}).catch(err=>(console.log(err))); //skeleton bulk create query }).catch(err=>(console.log(err))); //skeleton bulk create query
}); });
@ -191,7 +191,6 @@ var EntityInsert = new Promise((resolve, reject) => {
}); });
// obj_data = { ...value.dataValues , statementsmasterrData:MasterData } // obj_data = { ...value.dataValues , statementsmasterrData:MasterData }
// data.push(obj_data); // data.push(obj_data);
}); // end of EntitiesData foreach }); // end of EntitiesData foreach
setTimeout(()=>{ setTimeout(()=>{
@ -415,8 +414,7 @@ sequelize.query("select a.losid,a.entityid,a.FY,a.st_type as st_type_id, b.state
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,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 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,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 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(){ setTimeout(function(){
sequelize.query(query) sequelize.query(query).then(summary => {
.then(summary => {
// is_summary filter from fin_summary data // is_summary filter from fin_summary data
let is_summary_item_array = []; let is_summary_item_array = [];
const fin_summary = summary[0]; const fin_summary = summary[0];