This commit is contained in:
sriramv 2022-08-06 10:45:05 +05:30
parent 07fb6e29ad
commit 4f163e40d4
2 changed files with 8 additions and 7 deletions

View File

@ -626,15 +626,17 @@ exports.LoansDetailsMergeUnmergeApi =async (req, res) =>
//unmerge loans
request_object.unmergeData.forEach(async(unmergeValue,unmergeIndex,unmergeArray) => {
let Unique_Group_string = Math.random().toString(36).slice(2, 10).toUpperCase();
await InCreditFacility.update({grp_str:Unique_Group_string},{where:{losid:request_object.losid,ReferenceNumber:unmergeValue.refno,grp_str:unmergeValue.grp_str}}).catch(err=>{});
await OutputActiveAndClosedLoans.update({grp_str:Unique_Group_string},{where:{losid:request_object.losid,ref_no:unmergeValue.refno,grp_str:unmergeValue.grp_str}}).catch(err=>{});
await InCreditFacility.update({grp_str:Unique_Group_string},{where:{losid:request_object.losid,ReferenceNumber:unmergeValue.refno,grp_str:unmergeValue.grp_str},limit : 1})
.catch(err=>{logMsg.info("");});
await OutputActiveAndClosedLoans.update({grp_str:Unique_Group_string},{where:{losid:request_object.losid,ref_no:unmergeValue.refno,grp_str:unmergeValue.grp_str},limit : 1})
.catch(err=>{logMsg.info("");});
console.log(unmergeValue.refno);
});
}else { logMsg.info("There is no any unmerge data selected for losid= "+request_object.losid); }
if(request_object.mergeData.length != 0)
{
//merge loans
//merge loans (3 types of merge 1.SINGLE_TO_GROUP 2.GROUP_TO_GROUP 3.SINGLE_TO_SINGLE)
request_object.mergeData.forEach(async(mergeValue,mergeIndex,mergeArray) => {
if(mergeValue.type == 'SINGLE_TO_GROUP')
{

View File

@ -1243,7 +1243,7 @@ async function commercialIntermediateDataInsert(losid,refNo)
{
BorrowerProfileData = await BorrowerProfile.findAll({attributes: ['losid','ApplicationRefno','EnqInfoBorrowerName','EnqInfoPan'],raw:true ,where:{losid:losid,ApplicationRefno:refNo}});
BorrowerProfileData = await BorrowerProfile.findAll({attributes: ['ReportHeaderReportOrderDate','losid','ApplicationRefno','EnqInfoBorrowerName','EnqInfoPan'],raw:true ,where:{losid:losid,ApplicationRefno:refNo}});
BorrowerProfileData.forEach(async(value,index,array) => {
BorrowerProfileDataObj = {
@ -1262,9 +1262,8 @@ async function commercialIntermediateDataInsert(losid,refNo)
//month bucket count skeleton creation
//DateTimeProcessed = BorrowerProfileData[0].CPSInsLtstCFOpndDate;
end_date = '2022-05-05'
sk = await Helper.createSkeleton(end_date);
DateTimeProcessed = BorrowerProfileData[0].ReportHeaderReportOrderDate;
sk = await Helper.createSkeleton(DateTimeProcessed);