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)=>{
Financials.bulkCreate(Query_data).then(data=>{
//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
final_array = Probe42DataMappingHelper.lineItemMapping(value,entityid);
final_array.then(function(update_array_data){
// update mapped lineitem value here
Probe42DataMappingHelper.lineItemUpdate(update_array_data);
});//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
});
@ -168,7 +168,7 @@ var EntityInsert = new Promise((resolve, reject) => {
EntityInsert.then(() => {
setTimeout(()=>{
Statementsmaster.findAll({ where :{is_active : 1} , include: { all: true, nested: true , where :{is_active : 1} , required:false}})
Statementsmaster.findAll({ where :{is_active : 1} , include: { all: true, nested: true , where :{is_active : 1} , required:false}})
.then(MasterData => {
Entities.findAll({where : { losid } , attributes: [ 'id', 'losid' , 'pan' , 'cin' , 'bizname' , 'entity_type' , 'activity_group' , 'biz_act_desc' , 'process_instance_id' ] })
.then(EntitiesData => {
@ -191,7 +191,6 @@ var EntityInsert = new Promise((resolve, reject) => {
});
// obj_data = { ...value.dataValues , statementsmasterrData:MasterData }
// data.push(obj_data);
}); // end of EntitiesData foreach
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";
setTimeout(function(){
sequelize.query(query)
.then(summary => {
sequelize.query(query).then(summary => {
// is_summary filter from fin_summary data
let is_summary_item_array = [];
const fin_summary = summary[0];