From 85f8742c1bd5d04f8dc02d28c3b6768ffc953634 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Fri, 12 Feb 2021 12:32:55 +0530 Subject: [PATCH] SMC Feedbacks: Template validation removal, Borrower with multi mobile number, CPA self allocation, Highlighted the mandatory section and some issue fixes --- .../list-pd/all-pd/all-pd.component.ts | 23 +- .../completed-pd/completed-pd.component.html | 4 +- .../completed-pd/completed-pd.component.ts | 57 +- .../inprogress-pd.component.html | 4 +- .../inprogress-pd/inprogress-pd.component.ts | 56 +- .../pd-status-change-dialogue.component.ts | 4 +- .../dynamic-form/dynamic-form.component.html | 73 + .../dynamic-form/dynamic-form.component.ts | 78 +- .../dynamic-question-template.component.html | 1 + .../dynamic-question-template.component.ts | 16 +- .../ques-form/ques-form.service.ts | 112 +- .../list-pd/start-pd/start-pd.component.html | 2 +- .../list-pd/start-pd/start-pd.component.scss | 5 + .../list-pd/view-pd/view-pd.component.html | 5 +- .../list-pd/view-pd/view-pd.component.ts | 76 +- .../data/SMC_CREDIT_TEMPLATES/LFMP/1.json | 21 + .../data/SMC_CREDIT_TEMPLATES/LFMP/10.json | 1289 +++++++++-------- .../data/SMC_CREDIT_TEMPLATES/LFMP/11.json | 114 +- .../data/SMC_CREDIT_TEMPLATES/LFMP/12.json | 72 +- .../data/SMC_CREDIT_TEMPLATES/LFMP/13.json | 56 +- .../data/SMC_CREDIT_TEMPLATES/LFMP/3.json | 184 +-- .../data/SMC_CREDIT_TEMPLATES/LFMP/4.json | 49 +- .../data/SMC_CREDIT_TEMPLATES/LFMP/8.json | 208 +-- .../data/SMC_CREDIT_TEMPLATES/WCTL/3.json | 48 +- 24 files changed, 1232 insertions(+), 1325 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts index 3f60b31..30870cc 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts @@ -55,6 +55,8 @@ export class AllPdComponent implements OnInit, OnChanges { common: any; pagedList: ReplaySubject = new ReplaySubject(1); user_id: any; + startIndex: number; + endIndex: any; constructor(private _pd: PdTrigerService,private _fb:FormBuilder,notifier: NotifierService,private userService:UserService, private _aws:AwsService,private loaderService:LoaderService) { this.LenderRoleID = localStorage.getItem('LenderRoleID'); @@ -126,7 +128,9 @@ console.log(this.displayedColumns) filterData(text) { if(!text) { + setTimeout(()=>{ this.pagedList .next(this.PdListData.slice(0, 10)); + },0) this.length = this.PdListData.length; return } @@ -138,7 +142,9 @@ console.log(this.displayedColumns) } return false }) - this.pagedList.next(temp) + setTimeout(()=>{ + this.pagedList.next(temp) + },0) // this.pa // this.length = this.pagedList.length // console.log(this.PdListData,this.pagedList,text) @@ -160,7 +166,12 @@ console.log(this.displayedColumns) if (data.status == 200) { this.PdListData = data.records; // this.PdListData = ; + if(this.startIndex && this.endIndex) { + this.pagedList.next(this.PdListData.slice(this.startIndex, this.endIndex)); + } + else { this.pagedList.next(this.PdListData.slice(0, 10)); + } this.length = this.PdListData.length; this.PdListData.forEach(value=>{ let original=value.pd_sno @@ -193,12 +204,12 @@ console.log(this.displayedColumns) } OnPageChange(event: PageEvent){ - let startIndex = event.pageIndex * event.pageSize; - let endIndex = startIndex + event.pageSize; - if(endIndex > this.length){ - endIndex = this.length; + this.startIndex = event.pageIndex * event.pageSize; + this.endIndex = this.startIndex + event.pageSize; + if(this.endIndex > this.length){ + this.endIndex = this.length; } - this.pagedList.next(this.PdListData.slice(startIndex, endIndex)); + this.pagedList.next(this.PdListData.slice(this.startIndex, this.endIndex)); } pageChange(e) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html index 8130a86..4546e15 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html @@ -74,7 +74,7 @@
-
+

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

@@ -116,7 +116,7 @@ -
+
{{details.pd_sno}}
{{details.pd_type_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts index 9356311..2032b07 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.ts @@ -7,6 +7,7 @@ import { NotifierService } from 'angular-notifier'; import { UserService } from 'app/settings/service/user.service'; import { AwsService } from 'app/AwsService/aws.service'; import { LoaderService } from 'app/shared/loaderService/loader.service'; +import { ReplaySubject } from 'rxjs'; @Component({ selector: 'app-completed-pd', @@ -52,8 +53,10 @@ export class CompletedPdComponent implements OnInit, OnChanges { user_role_name: string; limitMsg: boolean = false; common: any; - pagedList: any=[]; + pagedList: ReplaySubject = new ReplaySubject(1); user_id: any; + startIndex: any; + endIndex: any; constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService, private _aws:AwsService, private loaderService:LoaderService) { this.notifier = notifier; @@ -112,7 +115,8 @@ export class CompletedPdComponent implements OnInit, OnChanges { let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue; // filteredText = filteredText ? filteredText.trim() : filteredText; filteredText = filteredText ? filteredText.toLowerCase() : filteredText; - this.dataSourceTab4.filter = filteredText; + // this.dataSourceTab4.filter = filteredText; + this.filterData(filteredText) } @@ -130,7 +134,12 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID'); this.completedPdListData = data.records; // this.dataLengthTab4 = data.records.length; // this.dataSourceTab4.data = this.completedPdListData; - this.pagedList = this.completedPdListData.slice(0, 10); + if(this.startIndex && this.endIndex) { + this.pagedList.next(this.completedPdListData.slice(this.startIndex, this.endIndex)); + } + else { + this.pagedList.next(this.completedPdListData.slice(0, 10)); + } this.length = this.completedPdListData.length; this.completedPdListData.forEach(value=>{ let original=value.pd_sno @@ -157,13 +166,13 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID'); } OnPageChange(event: PageEvent){ - let startIndex = event.pageIndex * event.pageSize; - let endIndex = startIndex + event.pageSize; - if(endIndex > this.length){ - endIndex = this.length; - } - this.pagedList = this.completedPdListData.slice(startIndex, endIndex); - } + this.startIndex = event.pageIndex * event.pageSize; + this.endIndex = this.startIndex + event.pageSize; + if(this.endIndex > this.length){ + this.endIndex = this.length; + } + this.pagedList.next(this.completedPdListData.slice(this.startIndex, this.endIndex)); + } pageChange(e) { console.log(e); @@ -271,7 +280,7 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID'); this.completedPdListData=res['records']; // this.dataSourceTab4.data = res['records']; // this.dataSourceTab4.paginator = this.paginator; - this.pagedList = this.completedPdListData.slice(0, 10); + this.pagedList .next(this.completedPdListData.slice(0, 10)); this.length = this.completedPdListData.length; this.completedPdListData.forEach(value=>{ let original=value.pd_sno @@ -285,7 +294,7 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID'); // this.dataSourceTab4.paginator['pageIndex'] = 0; // this.dataSourceTab4.data = []; // this.completedPdListData = []; - this.pagedList = []; + this.pagedList.next([]); this.recordStatus=true this.limitMsg = false } @@ -294,6 +303,30 @@ public LenderRoleID : any = localStorage.getItem('LenderRoleID'); this.notifier.notify('warning', 'Something Went Wrong Try Again.!' + '-' + error.error_text + ' occur'); alert(error.html_format); }); + } + filterData(text) { + if(!text) { + setTimeout(()=>{ + this.pagedList .next(this.completedPdListData.slice(0, 10)); + },0) + this.length = this.completedPdListData.length; + return + } + let temp = this.completedPdListData.filter(v=>{ + if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1 + || v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1 + ||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) { + return true; + } + return false + }) + setTimeout(()=>{ + this.pagedList.next(temp) + },0) + // this.pa + // this.length = this.pagedList.length + // console.log(this.PdListData,this.pagedList,text) + } onReset(){ this.searchForm.reset(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html index cc41f5c..0bda936 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.html @@ -73,7 +73,7 @@
-
+

{{details.pd_sno_split.lender_name}}
{{details.pd_sno_split.serial_no}}

@@ -115,7 +115,7 @@ -
+
{{details.pd_sno}}
{{details.pd_type_name}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts index 7f01193..a6b6580 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/inprogress-pd/inprogress-pd.component.ts @@ -7,6 +7,7 @@ import { NotifierService } from 'angular-notifier'; import { UserService } from 'app/settings/service/user.service'; import { AwsService } from 'app/AwsService/aws.service'; import { LoaderService } from 'app/shared/loaderService/loader.service'; +import { ReplaySubject } from 'rxjs'; @Component({ selector: 'app-inprogress-pd', @@ -50,8 +51,10 @@ export class InprogressPdComponent implements OnInit, OnChanges { user_role_name: string; limitMsg: boolean = false; common: any; - pagedList: any=[]; + pagedList: ReplaySubject = new ReplaySubject(1); user_id: any; + startIndex: any; + endIndex: any; constructor(private _pd: PdTrigerService,public _fb:FormBuilder,notifier: NotifierService,private userService:UserService, private _aws:AwsService, private loaderService:LoaderService) { this.notifier = notifier; @@ -109,7 +112,7 @@ export class InprogressPdComponent implements OnInit, OnChanges { // filteredText = filteredText ? filteredText.trim() : filteredText; let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue; filteredText = filteredText ? filteredText.toLowerCase() : filteredText; - this.dataSourceTab2.filter = filteredText; + this.filterData(filteredText) } // load inprogress pd list @@ -126,7 +129,12 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID'); this.progressPdListData = data.records; // this.dataLengthTab2 = data.records.length; // this.dataSourceTab2.data = this.progressPdListData; - this.pagedList = this.progressPdListData.slice(0, 10); + if(this.startIndex && this.endIndex) { + this.pagedList.next(this.progressPdListData.slice(this.startIndex, this.endIndex)); + } + else { + this.pagedList.next(this.progressPdListData.slice(0, 10)); + } this.length = this.progressPdListData.length; this.progressPdListData.forEach(value=>{ let original=value.pd_sno @@ -150,13 +158,13 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID'); } OnPageChange(event: PageEvent){ - let startIndex = event.pageIndex * event.pageSize; - let endIndex = startIndex + event.pageSize; - if(endIndex > this.length){ - endIndex = this.length; - } - this.pagedList = this.progressPdListData.slice(startIndex, endIndex); - } + this.startIndex = event.pageIndex * event.pageSize; + this.endIndex = this.startIndex + event.pageSize; + if(this.endIndex > this.length){ + this.endIndex = this.length; + } + this.pagedList.next(this.progressPdListData.slice(this.startIndex, this.endIndex)); + } pageChange(e) { console.log(e); @@ -261,7 +269,7 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID'); this.progressPdListData = res['records']; // this.dataSourceTab2.data = res['records']; // this.dataSourceTab2.paginator = this.paginator; - this.pagedList = this.progressPdListData.slice(0, 10); + this.pagedList.next(this.progressPdListData.slice(0, 10)); this.length = this.progressPdListData.length; this.progressPdListData.forEach(value=>{ let original=value.pd_sno @@ -275,7 +283,7 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID'); // this.dataSourceTab2.paginator['pageIndex'] = 0; // this.dataSourceTab2.data = []; this.progressPdListData = []; - this.pagedList = []; + this.pagedList.next([]); this.recordStatus=true this.limitMsg = false } @@ -285,6 +293,30 @@ public LenderRoleID : string = localStorage.getItem('LenderRoleID'); alert(error.html_format); }); } + filterData(text) { + if(!text) { + setTimeout(()=>{ + this.pagedList .next(this.progressPdListData.slice(0, 10)); + },0) + this.length = this.progressPdListData.length; + return + } + let temp = this.progressPdListData.filter(v=>{ + if ((v.pd_sno && v.pd_sno.toLowerCase().indexOf(text.toLowerCase())>-1 )|| v.applicat_details[0].applicant_name.toLowerCase().indexOf(text.toLowerCase()) > -1 + || v.pd_status.toLowerCase().indexOf(text.toLowerCase())>-1|| v.city_name && v.city_name.toLowerCase().indexOf(text.toLowerCase())>-1 || v.lender_applicant_id.toLowerCase().indexOf(text.toLowerCase())>-1 + ||( v.pd_sno_split && v.pd_sno_split.serial_no && v.pd_sno_split.serial_no.toLowerCase().indexOf(text.toLowerCase())>-1)) { + return true; + } + return false + }) + setTimeout(()=>{ + this.pagedList.next(temp) + },0) + // this.pa + // this.length = this.pagedList.length + // console.log(this.PdListData,this.pagedList,text) + + } onReset(){ this.searchForm.reset(); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index e2f5919..4d985d0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -25,8 +25,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { this.notifier = notifier; - this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : 'Change Discussion'; - this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : 'Change Discussion'; + this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussion' : this.data.pd_status=='COMPLETED' ? 'Complete Discussion' : this.data.pd_status=='ALLOCATED' ? 'Send Back to CPA' : this.data.pd_status=='BOUNCED' ? 'PD Reject' : this.data.pd_status == 'CM_ALLOCATED' ? 'Self Allocate' : 'Change Discussion'; + this.dialoge_content = this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussion ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussion' : this.data.pd_status=='ALLOCATED' ? 'Do you want to Send back the PD to CPA ?' : this.data.pd_status=='BOUNCED' ? 'Do you want to reject this PD' : this.data.pd_status == 'CM_ALLOCATED' ? 'Do you want to Allocate the PD to yourself' : 'Change Discussion'; this.enableAddonPD = false; this.CompletenessCheck = this.data.pd_status=='INPROGRESS' ? true : this.data.pd_status=='COMPLETED' ? false : true; this.Loading = this.data.pd_status=='INPROGRESS' ? false : this.data.pd_status=='COMPLETED' ? true : false; diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html index d6fb50f..edff34d 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.html @@ -42,8 +42,81 @@ [ngStyle.xs]="{'margin-bottom' : (singleQues.field_type == 'numtoword' || singleQues.field_type == 'str&numtoword') ? '5%' : '0' }"> +
+
+ + +
+ + +
+ + + + +
+ + + + + {{singleQues.group_title}} {{g_c_i+1}} + + + + +
+ + + + +
+
+
+
+ + +
+
+ + +
+
+
+
+
+ +
+ +
+ + + + + + + +

diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts index a9ed905..38b8c74 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-form/dynamic-form.component.ts @@ -16,6 +16,7 @@ export class DynamicFormComponent implements OnInit { @Input() questions_JSON:any; @Input() json_answers:any; step: number=0; + step_child:number = 0 @ViewChild('mapanel') matExpansionPanel:MatExpansionPanel @ViewChild('accordion') Accordion: MatAccordion constructor(private _fb:FormBuilder,private questionService:QuesFormService) { } @@ -38,9 +39,11 @@ export class DynamicFormComponent implements OnInit { if(parent_ques.is_repeatable == '1'){ if(this.json_answers[parent_ques.group_key] && this.json_answers[parent_ques.group_key].length > this.form_group_name.value[parent_ques.group_key].length) { console.log(this.json_answers[parent_ques.group_key]); - + // this.json_answers[parent_ques.group_key].mobile_numbers= [{mobile_no:93299},{mobile_no:948392}] this.json_answers[parent_ques.group_key].forEach((group_ques,g_i)=>{ - console.log(parent_ques,g_i) + + console.log(parent_ques,g_i,group_ques) + // debugger; if(g_i != 0){ // let parent_control=this.form_group_name @@ -49,6 +52,28 @@ export class DynamicFormComponent implements OnInit { this.addData(g_i,parent_ques) // } } + // FOR CHILD REPEATABLE + let keys= Object.keys(group_ques) + keys.forEach((vv,key_index)=>{ + if(typeof(group_ques[vv]) != 'string') { + console.log("Entered",group_ques[vv]); + if(group_ques[vv] && group_ques[vv].length > 0) { + // + group_ques[vv].forEach((child_val,child_index)=>{ + if(child_index != 0) { + console.log(parent_ques,this.form_group_name.get(parent_ques.group_key)['controls'][g_i],parent_ques,vv,g_i) + let find_json = parent_ques.group_questions[g_i].filter(val=>val.hasOwnProperty('group_key') && val.group_key == vv) + if(find_json.length > 0) { + find_json = find_json[0] + console.log(find_json,child_index,g_i) + this.addSecondLevelChild(g_i,find_json,this.form_group_name.get(parent_ques.group_key)['controls'][g_i]) + } + + } + }) + } + } + }) }) } } @@ -93,9 +118,19 @@ export class DynamicFormComponent implements OnInit { let control_names:any= {} let control = this.form_group_name.get(json_obj.group_key) as FormArray json_obj.question.map(val=>{ + // FOR CHILD REPEATABLE + if(val.is_repeatable == '2') { + val.question.map(rr=>{ + control_names[val.group_key]=this._fb.array([this._fb.group({[rr.question_key]:''})]) + // control_names[val.group_key].push({[rr.question_key]:''}) + }) + } + else { control_names[val.question_key] = '' + } }) - console.log(control,json_obj.group_key,control_names); + console.log(control,json_obj.group_key,control_names,json_obj.question); + // debugger; json_obj.group_questions.push(json_obj.question); control.push(this._fb.group(control_names)) @@ -110,6 +145,43 @@ export class DynamicFormComponent implements OnInit { this.form_group_name.updateValueAndValidity(); this.step = control.length-1 console.log(this.form_group_name.value); + // debugger; + } + // ADDING A CHILD REPEATABLE OBJ IN A EXISTING FORM ARRYA + addSecondLevelChild(index,json_obj,parent_group) { + console.log(json_obj,parent_group) + let control_names:any= {} + let control = parent_group.get(json_obj.group_key) as FormArray + json_obj.question.map(val=>{ + control_names[val.question_key] = '' + }) + console.log(control,json_obj.group_key,control_names,json_obj.question); + // debugger; + + json_obj.questions_level_two.push(json_obj.question); + control.push(this._fb.group(control_names)) + + json_obj.question.forEach((group_indi,arr_index)=>{ + // console.log("sd",childControl) + this.questionService.addAdditionalControl(group_indi, control.controls[control.length-1], arr_index) + }) + json_obj.question = JSON.parse(JSON.stringify(json_obj.question)) + control.updateValueAndValidity(); + control.controls[control.length-1].updateValueAndValidity(); + parent_group.updateValueAndValidity(); + this.step_child = control.length-1 + console.log(this.form_group_name.value,this.questions_JSON); + // debugger; + } + // REMOVE OF CHILD REPEATABLE OBJ + removeSecondLevelChild(index,json_obj,parent_group) { + console.log(json_obj) + // debugger; + let control = parent_group.get(json_obj.group_key) + control.removeAt(index) + json_obj.questions_level_two.splice(index,1) + this.step_child = control.length-1 + console.log(json_obj) } removeData(index,json_obj) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html index 86ac14b..427fafc 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.html @@ -20,6 +20,7 @@ align="end" style="font-size: 12px;">{{"₹"}} {{formGroupN.value[parent_ques.question_key] | numberToWords}} + {{validation.message}} diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts index d2ee7a2..c0c4fb8 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts @@ -60,19 +60,28 @@ export class DynamicQuestionTemplateComponent implements OnInit { this.generateGroupControls.emit() } this.json_answers.forEach((value,index)=>{ + + let keys= Object.keys(value) keys.forEach(vv=>{ + console.log("ype of ",value[vv],typeof(value[vv]),this.whole_json) + // debugger; + if(typeof(value[vv])== 'string') { + // console.log("ype of ",typeof(value[vv])) + // console.log("ansssssssssssssssssssssssssssss",this.json_answers[vv],vv,this.whole_json.filter(vl=>vl.question_key == vv)) - if(this.whole_form.get(this.group_key)) { + if(this.whole_form.get(this.group_key) && this.whole_json.length > 0) { let curr_obj=this.whole_json.filter(vl=>vl.question_key == vv)[0] this.onChangeProperty({value:value[vv]},curr_obj,'') } console.log("Repeatable ques",value,this.parent_ques.question_key) + } }) + }) // debugger; - + } // this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || '')) // setTimeout(()=>{ @@ -678,6 +687,9 @@ export class DynamicQuestionTemplateComponent implements OnInit { ques_control=this.whole_json[this.json_index] console.log(ques_control,this.whole_json,this.json_index) let other_control = ques_control + if(ques_control.hasOwnProperty('is_repeatable') && ques_control.is_repeatable == '2') { + return; + } // =ques_control.filter(val=>{ // if(val.question_key == validation_obj.validation_to){ // return val diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 71cda50..67088ae 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -42,32 +42,15 @@ export class QuesFormService { ques_data[index].group_questions = [] ques_data[index].group_questions.push(val.question) val.group_questions[0].forEach((group_indi, arr_index) => { - // if(group_indi.api_properties != null && typeof(group_indi.api_properties) == 'object'){ - console.log("api pro", val.api_properties) - // let param - // val.api_properties.forEach(val=>param=val) - // console.log(param) + // CREATING A FORMARRAY AND CONTROL FOR CHILD REPEATABLE + if(group_indi.is_repeatable == '2') { + this.addLevelTwoControls(group_indi,childControl,val.group_questions[0],val.question,arr_index) + } + else { group_indi.raw_validations = group_indi.validations - // sub_childControl.push(this.createValue(group_indi)) - // childControl.addControl(group_indi.question_key,new FormControl('')) + control_names[group_indi.question_key] = '' - // childControl.push(this._fb.group({ - // [group_indi.question_key] :[''] - // })) - // setTimeout(()=>{ - // this.addAdditionalControl(group_indi, childControl.at(arr_index), arr_index) - // },2000) - // if(group_indi.type == '5'){ - // sub_childControl.controls[arr_index].removeControl('answer_value'); - // console.log("loop",arr_index,sub_childControl); - // sub_childControl.controls[arr_index].addControl('answer_value',this._fb.array([])) - // } - // if(group_indi.type == '1'){ - // sub_childControl.controls[arr_index].addControl('field_type',new FormControl(group_indi.field_type)) - // } - // if(val.type == '8'){ - // sub_childControl.controls[index].addControl('select_search',new FormControl(val.field_type)) - // } + if (group_indi.api_properties != null) { if(group_indi.api_properties.hasOwnProperty('purpose') && group_indi.api_properties.purpose == 'answer_options_local') { @@ -91,6 +74,7 @@ export class QuesFormService { const question_temp:any = JSON.parse(JSON.stringify(val.question)); ques_data[index].question = question_temp + } // else{ // setTimeout(()=>{ // sub_childControl.push(this.createValue(group_indi)) @@ -98,15 +82,34 @@ export class QuesFormService { // } // sub_childControl.push(this.createValue(group_indi)) }) - console.log(control_names); + console.log(control_names, childControl.at(0)); + // debugger // val.questions[0]=val.question; - + if(childControl.value.length == 0) { + childControl.push(this._fb.group(control_names)) + } + else{ + // MERGINE THE 0 INDEX ARRAY WITH CHILD REPEATABLE + // control_names[childControl.at(0)] ='' + let previous_added_controls = childControl.at(0).controls + control_names = Object.assign(previous_added_controls,control_names) + console.log(control_names); + // debugger; + childControl.setControl(0,this._fb.group(control_names)) + } console.log(formgroup.value); // debugger; val.group_questions[0].forEach((group_indi,arr_index)=>{ console.log("sd",childControl,group_indi) + if(group_indi.is_repeatable == '2' && group_indi.hasOwnProperty('questions_level_two') && group_indi.questions_level_two.length > 0) { + group_indi.questions_level_two.forEach((child_val,child_index)=> { + this.addAdditionalControl(child_val, childControl.at(0).get(group_indi.group_key).controls[0], child_index) + }) + } + else{ this.addAdditionalControl(group_indi, childControl.controls[0], arr_index) + } }) // } @@ -175,7 +178,8 @@ export class QuesFormService { // else{ // control.push(this.createValue(val)) // } - console.log(formgroup) + console.log(formgroup,ques_data) + // debugger; } }, err => console.log(err)) @@ -183,6 +187,60 @@ export class QuesFormService { } // END OF FORM CREATION + // FUNCTIONAL TO HANDLE THE CREATION OF CHILD REPEABLE 2 + addLevelTwoControls(curr_obj:any,child_control,group_ques,valQues,group_index) { + console.log(child_control) + // CURR VALUE(MULTI ARRAY) + const question_temp:any = JSON.parse(JSON.stringify(curr_obj.questions_level_two)); + group_ques[group_index].questions_level_two = [] + group_ques[group_index].questions_level_two.push(question_temp) + group_ques[group_index].question = question_temp + + // RAW VALUES(SINGLE ARRAY) + valQues[group_index].question = question_temp + valQues[group_index].questions_level_two = [] + valQues[group_index].questions_level_two.push(question_temp) + console.log(group_ques[group_index],question_temp); + // debugger; + let group_key:any = {} + group_key[curr_obj.group_key] = this._fb.array([]) + child_control.push(this._fb.group(group_key)) + console.log(child_control) + console.log(child_control.at(0),child_control.controls[0].controls[curr_obj.group_key]) + // debugger; + let levelTwoChildCtrl: any = child_control.at(0).get(curr_obj.group_key) as FormArray + let control_names:any={} + curr_obj.questions_level_two[0].forEach((val,arr_index)=>{ + console.log("Level 2",val) + val.raw_validations = val.validations + control_names[val.question_key] = '' + + if (val.api_properties != null) { + if(val.api_properties.hasOwnProperty('purpose') && val.api_properties.purpose == 'answer_options_local') { + if(val.api_properties.master_name == 'pd_applicants') { + val.answers = (this.convertArrayNames( val.api_properties.fields,this.pd_all_details.pdapplicants_detials)) + // val.question[arr_index].answers = val.answers + } + } + else{ + this.apiPropertiesCall(val).then(res => { + if (res != false) { + val.answers = [] + // group_indi.answers=this.convertArrayNames(val.api_properties.fields,res) + val.answers = (this.convertArrayNames(val.api_properties.fields, res)) + // val.question[arr_index].answers = val.answers + + } + }) + } + } + + }) + console.log(group_ques[group_index]) + + levelTwoChildCtrl.push(this._fb.group(control_names)) + // console.log(formgroup.value); + } // FOR CREATING THE FORM CONTROL FOR SPECIFIC FORM ARRAY createValue(data){ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html index 594b2d4..9a96289 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html @@ -22,7 +22,7 @@ {{quesIndex+1}}
- {{ formButton.form_name }} + {{ formButton.form_name }} *
- - + + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts index 8b72962..ded49e3 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.ts @@ -507,6 +507,7 @@ else { /** To update pd officer*/ selfAllocation(city_id) { + if(this.LenderRoleID == '27') { const dialogRef1 = this.dialog.open(PdAllocationComponent, { data: { pd_id:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly',city_id:city_id, lender_role_id:this.LenderRoleID }, disableClose: true, @@ -518,43 +519,46 @@ else { } // this.notifier.notify("success","Allocated Successfully") }) + } + else{ // return; - // const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { - // data: { pdid:this.viewID, pd_status: this.pdStatusCheck.ALLOCATED,random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' }, - // disableClose: true, - // minWidth: '30%', - // // maxWidth: '40%', - // }); - // dialogRef.afterClosed() - // .subscribe(dataresult => { - // if (dataresult.update_status == true) { - // // return; - // let user_id = this._aws.getlocale(); - // if(!user_id) { - // this.notifier.notify('error',"Something went wrong. Try again!!"); - // return; - // } - // let updateData = { - // "pd_id":this.viewID, - // "fk_pd_allocated_to":user_id, - // } - // this._pd.updatePdOfficer(updateData).subscribe( - // result => { - // if (result.status == 200) { - // this.notifier.notify('success', 'PD Allocated Successfully.!'); - // this.viewPdDetails(this.viewID) - // } - // else { - // this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); - // this.errorMessage = "Something Went Wrong Try Again.!"; - // } - // }, error => { - // this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); - // this.errorMessage = "Some Thing Wents Wrong Try Again.!"; - // // this.dialogRef.close(); - // }); - // } - // }); + const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + data: { pdid:this.viewID, pd_status: "CM_ALLOCATED",random_string:this.pdMasterData[0].random_string,dialogType:'actionOnly' }, + disableClose: true, + minWidth: '30%', + // maxWidth: '40%', + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if (dataresult.update_status == true) { + // return; + let user_id = this._aws.getlocale(); + if(!user_id) { + this.notifier.notify('error',"Something went wrong. Try again!!"); + return; + } + let updateData = { + "pd_id":this.viewID, + "fk_pd_allocated_to":user_id, + } + this._pd.updatePdOfficer(updateData).subscribe( + result => { + if (result.status == 200) { + this.notifier.notify('success', 'PD Allocated Successfully.!'); + this.viewPdDetails(this.viewID) + } + else { + this.notifier.notify('warning', 'Something Went Wrong Try Again.!'); + this.errorMessage = "Something Went Wrong Try Again.!"; + } + }, error => { + this.notifier.notify('error', 'Something Went Wrong Try Again.! \t\"' + (error.error_type == 2 ? error.error_status + ' ( ' + error.error_text + ' ) ' : ' ( ' + error.error_text + ' ) ') +'\" Error Occur.!'); + this.errorMessage = "Some Thing Wents Wrong Try Again.!"; + // this.dialogRef.close(); + }); + } + }); + } } diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json index d721d63..0362048 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json @@ -90,6 +90,27 @@ } ] }, + { + "questions_level_two":[ + { + "question":"Mobile Number", + "question_key":"mobile_no", + "type":"1", + "field_type":"num", + "field_width":"100", + "onchange_properties":null, + "api_properties":null, + "answers":null, + "is_repeatable":null, + "validations":[ + + ] + } + ], + "is_repeatable":"2", + "group_key":"mobile_numbers", + "group_title":"Mobile Number" + }, { "question":"Entity Type", "question_key":"entity_type", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json index 0c4d37c..f4ccf1a 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json @@ -10,633 +10,672 @@ } ], "questions": [ - { - "question": "Number of financial years for which we have financials", - "question_key": "no_of_financial_years", - "place_holder": "Enter the number", - "type": "1", - "field_width": "45", - "api_properties": null, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - { - "name": "pattern", - "isactive": "1", - "validator": "[0-9]*", - "message": "Numeric only ", - "value": null - } - ] - }, - { - "question": [ - { - "question": "Enter FY", - "question_key": "fy", - "type": "3", - "field_width": "45", - "answers": [], - "answer_value": "GET_FY_YEARS", - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - ] - }, - { - "question": "Sales / Revenue (Rs)", - "question_key": "sales_revenue", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", - "value_keys": [ - "sales_revenue", - "net_profit" - ], - "insert_control": "net_profit_sales_percent" - }, - { - "purpose": "answer_value_arr", - "arr_include": [ - "py", - "now" - ], - "expression": "((Number(sales_revenue[now])-Number(sales_revenue[py]))/Number(sales_revenue[py]))*100", - "value_keys": [ - "sales_revenue" - ], - "insert_control": "sales_py" - }, - { - "purpose": "answer_value_arr", - "arr_include": [ - "py", - "now" - ], - "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys": [ - "net_profit_sales_percent" - ], - "insert_control": "netprofit_py_percent" - } - ], - "is_repeatable": null, - "field_type": "numtoword", - "validations": [ - - ] - }, - { - "question": "Net Profit / (Net Loss) (Rs) ", - "question_key": "net_profit", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", - "value_keys": [ - "sales_revenue", - "net_profit" - ], - "insert_control": "net_profit_sales_percent" - }, - { - "purpose": "answer_value_arr", - "arr_include": [ - "py", - "now" - ], - "expression": "((Number(net_profit[now])-Number(net_profit[py]))/Number(net_profit[py]))*100", - "value_keys": [ - "net_profit" - ], - "insert_control": "netprofit_py" - }, - { - "purpose": "answer_value_arr", - "arr_include": [ - "py", - "now" - ], - "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys": [ - "net_profit_sales_percent" - ], - "insert_control": "netprofit_py_percent" - } - ], - "is_repeatable": null, - "field_type": "numtoword", - "validations": [ - - ] - }, - { - "question": "Net Profit or (Net Loss) to Sales % ", - "question_key": "net_profit_sales_percent", - "type": "1", - "is_disabled": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value_arr", - "arr_include": [ - "py", - "now" - ], - "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", - "value_keys": [ - "net_profit_sales_percent" - ], - "insert_control": "netprofit_py_percent" - } - ], - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "% (? /?) in Sales over PY", - "question_key": "sales_py", - "type": "1", - "is_disabled": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ + { + "question":"Is the Financial information available?", + "question_key":"financial_info_available", + "type":"2", + "field_width":"45", + "api_properties":null, + "onchange_properties":[ + { + "purpose":"FORM_CTRL", + "form_controls":[ + { + "insert_index":"financial_info_available", + "expression":"(String('financial_info_available') == String('Yes'))", + "value_keys":[ + "financial_info_available" + ], + "questions":[ + { + "question": "Net Profit / (Net Loss) (Rs)", + "question_key": "net_profit_rs", + "place_holder": "Enter the text", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ], + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit_rs)/Number(sales_amount))*100).toFixed(2)", + "value_keys": [ + "sales_amount", + "net_profit_rs" + ], + "insert_control": "net_profit_to_sales_percent" + } + ] + }, + { + "question": "Net Profit or (Net Loss) to Sales % ", + "question_key": "net_profit_to_sales_percent", + "place_holder": "Enter number", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(Number(sales_amount)*Number(net_profit_to_sales_percent))/100", + "value_keys": [ + "sales_amount", + "net_profit_to_sales_percent" + ], + "insert_control": "net_profit_rs" + } + ], + "is_repeatable": null, + "field_type": "num", + "validations": [ + + { + "name": "max", + "validator": "100", + "isactive": "1", + "message": "Number must be less than 100", + "value": null + } + ] + }, + { + "question": "Sales / Revenue (Rs)", + "sub_title": "Particulars of Financials for Latest Year as per person met during PD visit", + "question_key": "sales_amount", + "place_holder": "Enter text", + "type": "1", + "field_width": "100", + "field_type": "numtoword", + "api_properties": null, + "answers": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value; Number(net_profit_to_sales_percent) ? final_value = (Number(sales_amount)*Number(net_profit_to_sales_percent))/100 : '';return final_value}())", + "value_keys": [ + "sales_amount", + "net_profit_to_sales_percent" + ], + "insert_control": "net_profit_rs" + }, + { + "purpose": "answer_value", + "expression": "(function (){let final_value; Number(net_profit_rs) ? final_value = (Number(net_profit_rs)/Number(sales_amount))*100 : '';return final_value.toFixed(2)}())", + "value_keys": [ + "sales_amount", + "net_profit_rs" + ], + "insert_control": "net_profit_to_sales_percent" + } + ], + "is_repeatable": null, + "validations": [ + + ] + }, + { + "question": "Does the business have any working capital facility from any lender other than Moneywise?", + "question_key": "is_any_other_working_captial_facility", + "type": "2", + "field_width": "45", + "answers": [ + { + "answer": "Yes", + "answer_id": "Yes" + }, + { + "answer": "No", + "answer_id": "No" + } + ], + "api_properties": null, + "onchange_properties": [ + { + "purpose": "FORM_CTRL", + "form_controls": [ + { + "insert_index": "is_any_other_working_captial_facility", + "expression": "(String('is_any_other_working_captial_facility') === String('Yes'))", + "value_keys": [ + "is_any_other_working_captial_facility" + ], + "questions": [ + { + "question": "Details of above facilities need to be entered", + "question_key": "facility_details_specify", + "type": "7", + "placeholder": "Enter the text", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "is_any_other_working_captial_facility", + "validations": [ + + ] + }, + { + "question": "Facility details i.e. Letter of Credit/ Bank guarantee, CC limit etc.", + "question_key": "facility_details_other_lender", + "type": "3", + "field_width": "45", + "answers": [ + { + "answer": "Letter of Credit", + "answer_id": "Letter of Credit" + }, + { + "answer": "Bank guarantee", + "answer_id": "Bank guarantee" + }, + { + "answer": "CC limit", + "answer_id": "CC limit" + }, + { + "answer": "Others", + "answer_id": "Others" + } + ], + "api_properties": null, + "onchange_properties": [ + { + "purpose": "FORM_CTRL", + "form_controls": [ + { + "insert_index": "facility_details_other_lender", + "expression": "(String('facility_details_other_lender').toLowerCase() == String('others'))", + "value_keys": [ + "facility_details_other_lender" + ], + "questions": [ + { + "question": "Specify Facility details", + "question_key": "facility_details_other", + "type": "1", + "field_width": "45", + "field_type": "string", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "facility_details_other_lender", + "validations": [] + } + ] + } + ] + } + ], + "is_repeatable": null, + "is_subfield": "1", + "parent_question_key": "is_any_other_working_captial_facility", + "validations": [ + + ] + } + ] + } + ] + } + ], + "is_repeatable": null, + "validations": [ + + ] + }, + { + "question": "Increase / Decrease in Turnover for Broken Period %", + "question_key": "broken_period_turnover_percent", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Turnover for Broken Period in PY (Rs)", + "question_key": "broken_period_turnover_py", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", + "value_keys": [ + "broken_period_turnover_py", + "broken_period_turnover_cy" + ], + "insert_control": "broken_period_turnover_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Turnover for Broken Period in CY (Rs)", + "question_key": "broken_period_turnover_cy", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", + "value_keys": [ + "broken_period_turnover_py", + "broken_period_turnover_cy" + ], + "insert_control": "broken_period_turnover_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "No of Months", + "question_key": "broken_period_no_of_months", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Broken Period starting to (Date)", + "question_key": "broken_period_to_month", + "type": "1", + "place_holder": "DD-MM-YYYY (Eg 03-12-2020)", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", + "value_keys": [ + "broken_period_to_month", + "broken_period_from_month" + ], + "insert_control": "broken_period_no_of_months" + } + ], + "is_repeatable": null, + "field_type": "string", + "validations": [ + + ] + }, + { + "question": "Broken Period starting from (Date)", + "question_key": "broken_period_from_month", + "type": "1", + "field_width": "45", + "place_holder": "DD-MM-YYYY (Eg 05-02-2020)", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", + "value_keys": [ + "broken_period_to_month", + "broken_period_from_month" + ], + "insert_control": "broken_period_no_of_months" + } + ], + "is_repeatable": null, + "field_type": "string", + "validations": [ + + ] + }, + { + "question": "Inventory Days as per CM Discussion", + "question_key": "inventory_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Creditor Days as per CM Discussion", + "question_key": "creditor_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Debtor Days as per CM Discussion", + "question_key": "debtor_days_cm", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": [ + { + "question": "Enter FY", + "question_key": "fy", + "type": "3", + "field_width": "45", + "answers": [], + "answer_value": "GET_FY_YEARS", + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + ] + }, + { + "question": "Sales / Revenue (Rs)", + "question_key": "sales_revenue", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", + "value_keys": [ + "sales_revenue", + "net_profit" + ], + "insert_control": "net_profit_sales_percent" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "((Number(sales_revenue[now])-Number(sales_revenue[py]))/Number(sales_revenue[py]))*100", + "value_keys": [ + "sales_revenue" + ], + "insert_control": "sales_py" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Net Profit / (Net Loss) (Rs) ", + "question_key": "net_profit", + "type": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value", + "expression": "((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", + "value_keys": [ + "sales_revenue", + "net_profit" + ], + "insert_control": "net_profit_sales_percent" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "((Number(net_profit[now])-Number(net_profit[py]))/Number(net_profit[py]))*100", + "value_keys": [ + "net_profit" + ], + "insert_control": "netprofit_py" + }, + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "numtoword", + "validations": [ + + ] + }, + { + "question": "Net Profit or (Net Loss) to Sales % ", + "question_key": "net_profit_sales_percent", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": [ + { + "purpose": "answer_value_arr", + "arr_include": [ + "py", + "now" + ], + "expression": "(((Number(net_profit_sales_percent[now])-Number(net_profit_sales_percent[py]))/Number(net_profit_sales_percent[py]))*100).toFixed(2)", + "value_keys": [ + "net_profit_sales_percent" + ], + "insert_control": "netprofit_py_percent" + } + ], + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "% (? /?) in Sales over PY", + "question_key": "sales_py", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "% (? /?) in Net Profit over PY", + "question_key": "netprofit_py", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "% (? /?) in Net Profit % over PY", + "question_key": "netprofit_py_percent", + "type": "1", + "is_disabled": "1", + "field_width": "45", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Debtor Days as per CET", + "sub_title": "In Case of credit sales, what is the average no. of days taken to receive the money?", + "question_key": "debtor_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Creditor Days as per CET", + "sub_title": "In Case of credit purchases, what is the average no. of days taken to pay the money?", + "question_key": "creditor_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + }, + { + "question": "Inventory Days as per CET", + "sub_title": "What is the average no. of days for which stock lies unsold during the year?", + "question_key": "inventory_days_cet", + "type": "1", + "field_width": "100", + "answers": null, + "api_properties": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + + ] + } + ], + "is_repeatable": "1", + "group_key": "financial_info", + "group_title": "Financial Information" + }, + { + "question": "Number of financial years for which we have financials", + "question_key": "no_of_financial_years", + "place_holder": "Enter the number", + "type": "1", + "field_width": "45", + "api_properties": null, + "answers": null, + "onchange_properties": null, + "is_repeatable": null, + "field_type": "num", + "validations": [ + { + "name": "pattern", + "isactive": "1", + "validator": "[0-9]*", + "message": "Numeric only ", + "value": null + } + ] + } + ] + }] + }], + "is_repeatable":null, + "answers":[{ + "answer":"Yes", + "answer_id":"Yes" + }, + { + "answer":"No", + "answer_id":"No" + }], + "validations":[ - ] - }, - { - "question": "% (? /?) in Net Profit over PY", - "question_key": "netprofit_py", - "type": "1", - "is_disabled": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "% (? /?) in Net Profit % over PY", - "question_key": "netprofit_py_percent", - "type": "1", - "is_disabled": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Debtor Days as per CET", - "sub_title": "In Case of credit sales, what is the average no. of days taken to receive the money?", - "question_key": "debtor_days_cet", - "type": "1", - "field_width": "100", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Creditor Days as per CET", - "sub_title": "In Case of credit purchases, what is the average no. of days taken to pay the money?", - "question_key": "creditor_days_cet", - "type": "1", - "field_width": "100", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Inventory Days as per CET", - "sub_title": "What is the average no. of days for which stock lies unsold during the year?", - "question_key": "inventory_days_cet", - "type": "1", - "field_width": "100", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - } - ], - "is_repeatable": "1", - "group_key": "financial_info", - "group_title": "Financial Information" - }, - { - "question": "Debtor Days as per CM Discussion", - "question_key": "debtor_days_cm", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Creditor Days as per CM Discussion", - "question_key": "creditor_days_cm", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Inventory Days as per CM Discussion", - "question_key": "inventory_days_cm", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Broken Period starting from (Date)", - "question_key": "broken_period_from_month", - "type": "1", - "field_width": "45", - "place_holder": "DD-MM-YYYY (Eg 05-02-2020)", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", - "value_keys": [ - "broken_period_to_month", - "broken_period_from_month" - ], - "insert_control": "broken_period_no_of_months" - } - ], - "is_repeatable": null, - "field_type": "string", - "validations": [ - - ] - }, - { - "question": "Broken Period starting to (Date)", - "question_key": "broken_period_to_month", - "type": "1", - "place_holder": "DD-MM-YYYY (Eg 03-12-2020)", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(function (){let final_value = ''; if(String('broken_period_to_month') && String('broken_period_from_month')) {let from_date = new Date((String('broken_period_from_month')).split('-').reverse().join('-'));let to_date = new Date((String('broken_period_to_month')).split('-').reverse().join('-'));console.log(to_date);if(!from_date || !to_date || !from_date instanceof Date || !to_date instanceof Date || isNaN(from_date) || isNaN(to_date)) {final_value = '';return;}final_value = to_date.getMonth() - from_date.getMonth() + (12 * (to_date.getFullYear() - from_date.getFullYear()))};return final_value}())", - "value_keys": [ - "broken_period_to_month", - "broken_period_from_month" - ], - "insert_control": "broken_period_no_of_months" - } - ], - "is_repeatable": null, - "field_type": "string", - "validations": [ - - ] - }, - { - "question": "No of Months", - "question_key": "broken_period_no_of_months", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Turnover for Broken Period in CY (Rs)", - "question_key": "broken_period_turnover_cy", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", - "value_keys": [ - "broken_period_turnover_py", - "broken_period_turnover_cy" - ], - "insert_control": "broken_period_turnover_percent" - } - ], - "is_repeatable": null, - "field_type": "numtoword", - "validations": [ - - ] - }, - { - "question": "Turnover for Broken Period in PY (Rs)", - "question_key": "broken_period_turnover_py", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(((Number(broken_period_turnover_cy)-Number(broken_period_turnover_py))/Number(broken_period_turnover_cy))*100).toFixed(2)", - "value_keys": [ - "broken_period_turnover_py", - "broken_period_turnover_cy" - ], - "insert_control": "broken_period_turnover_percent" - } - ], - "is_repeatable": null, - "field_type": "numtoword", - "validations": [ - - ] - }, - { - "question": "Increase / Decrease in Turnover for Broken Period %", - "question_key": "broken_period_turnover_percent", - "type": "1", - "field_width": "45", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "field_type": "num", - "validations": [ - - ] - }, - { - "question": "Does the business have any working capital facility from any lender other than Moneywise?", - "question_key": "is_any_other_working_captial_facility", - "type": "2", - "field_width": "45", - "answers": [ - { - "answer": "Yes", - "answer_id": "Yes" - }, - { - "answer": "No", - "answer_id": "No" - } - ], - "api_properties": null, - "onchange_properties": [ - { - "purpose": "FORM_CTRL", - "form_controls": [ - { - "insert_index": "is_any_other_working_captial_facility", - "expression": "(String('is_any_other_working_captial_facility') === String('Yes'))", - "value_keys": [ - "is_any_other_working_captial_facility" - ], - "questions": [ - { - "question": "Details of above facilities need to be entered", - "question_key": "facility_details_specify", - "type": "7", - "placeholder": "Enter the text", - "answers": null, - "api_properties": null, - "onchange_properties": null, - "is_repeatable": null, - "is_subfield": "1", - "parent_question_key": "is_any_other_working_captial_facility", - "validations": [ - - ] + ] }, - { - "question": "Facility details i.e. Letter of Credit/ Bank guarantee, CC limit etc.", - "question_key": "facility_details_other_lender", - "type": "3", - "field_width": "45", - "answers": [ - { - "answer": "Letter of Credit", - "answer_id": "Letter of Credit" - }, - { - "answer": "Bank guarantee", - "answer_id": "Bank guarantee" - }, - { - "answer": "CC limit", - "answer_id": "CC limit" - }, - { - "answer": "Others", - "answer_id": "Others" - } - ], - "api_properties": null, - "onchange_properties": [ - { - "purpose": "FORM_CTRL", - "form_controls": [ - { - "insert_index": "facility_details_other_lender", - "expression": "(String('facility_details_other_lender').toLowerCase() == String('others'))", - "value_keys": [ - "facility_details_other_lender" - ], - "questions": [ - { - "question": "Specify Facility details", - "question_key": "facility_details_other", - "type": "1", - "field_width": "45", - "field_type": "string", - "api_properties": null, - "answers": null, - "onchange_properties": null, - "is_repeatable": null, - "validations": [] - } - ] - } - ] - } - ], - "is_repeatable": null, - "is_subfield": "1", - "parent_question_key": "is_any_other_working_captial_facility", - "validations": [ - - ] - } - ] - } - ] - } - ], - "is_repeatable": null, - "validations": [ - - ] - }, - { - "question": "Sales / Revenue (Rs)", - "sub_title": "Particulars of Financials for Latest Year as per person met during PD visit", - "question_key": "sales_amount", - "place_holder": "Enter text", - "type": "1", - "field_width": "100", - "field_type": "numtoword", - "api_properties": null, - "answers": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(function (){let final_value; Number(net_profit_to_sales_percent) ? final_value = (Number(sales_amount)*Number(net_profit_to_sales_percent))/100 : '';return final_value}())", - "value_keys": [ - "sales_amount", - "net_profit_to_sales_percent" - ], - "insert_control": "net_profit_rs" - }, - { - "purpose": "answer_value", - "expression": "(function (){let final_value; Number(net_profit_rs) ? final_value = (Number(net_profit_rs)/Number(sales_amount))*100 : '';return final_value.toFixed(2)}())", - "value_keys": [ - "sales_amount", - "net_profit_rs" - ], - "insert_control": "net_profit_to_sales_percent" - } - ], - "is_repeatable": null, - "validations": [ - - ] - }, - { - "question": "Net Profit or (Net Loss) to Sales % ", - "question_key": "net_profit_to_sales_percent", - "place_holder": "Enter number", - "type": "1", - "field_width": "45", - "api_properties": null, - "answers": null, - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "(Number(sales_amount)*Number(net_profit_to_sales_percent))/100", - "value_keys": [ - "sales_amount", - "net_profit_to_sales_percent" - ], - "insert_control": "net_profit_rs" - } - ], - "is_repeatable": null, - "field_type": "num", - "validations": [ - - { - "name": "max", - "validator": "100", - "isactive": "1", - "message": "Number must be less than 100", - "value": null - } - ] - }, - { - "question": "Net Profit / (Net Loss) (Rs)", - "question_key": "net_profit_rs", - "place_holder": "Enter the text", - "type": "1", - "field_width": "45", - "api_properties": null, - "answers": null, - "is_repeatable": null, - "field_type": "numtoword", - "validations": [ - - ], - "onchange_properties": [ - { - "purpose": "answer_value", - "expression": "((Number(net_profit_rs)/Number(sales_amount))*100).toFixed(2)", - "value_keys": [ - "sales_amount", - "net_profit_rs" - ], - "insert_control": "net_profit_to_sales_percent" - } - ] - }, + + + + { "question_key": "common_remarks", "question": "Remarks", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json index 90266e9..e23f725 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json @@ -31,13 +31,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] } ] }, { @@ -63,13 +57,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -84,13 +72,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -105,13 +87,7 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -151,13 +127,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{10,12}", - "message":"Mobile number should be 10-12 digit", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{10,12}", + "message":"Mobile number should be 10-12 digit", + "value":null + } ] }, { @@ -174,13 +150,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{3,5}", - "message":"Maximum 5 digit allowed", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{3,5}", + "message":"Maximum 5 digit allowed", + "value":null + } ] }, { @@ -196,13 +172,13 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"pattern", - "isactive":"1", - "validator":"[0-9]{6,8}", - "message":"Maximum 8 digit allowed", - "value":null - } + { + "name":"pattern", + "isactive":"1", + "validator":"[0-9]{6,8}", + "message":"Maximum 8 digit allowed", + "value":null + } ] }, { @@ -244,13 +220,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -266,13 +236,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - }, + { "name":"max", "isactive":"1", @@ -289,13 +253,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -323,13 +281,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ], @@ -352,13 +304,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json index cffc0d9..8522211 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json @@ -31,13 +31,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] } ] }, { @@ -63,13 +57,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -84,13 +72,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -105,13 +87,7 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -244,13 +220,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -266,13 +236,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - }, + { "name":"max", "isactive":"1", @@ -289,13 +253,7 @@ "parent_question_key":"payment_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -323,13 +281,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ], @@ -352,13 +304,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json index 46ceb5b..3b10ab1 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json @@ -32,13 +32,7 @@ "parent_question_key": "stock_info_available", "answers": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] } ] @@ -80,13 +74,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] } ] @@ -125,13 +113,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] }, { @@ -145,13 +127,7 @@ "is_repeatable": null, "field_type": "string", "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Required", - "value": null - } + ] }, { @@ -171,13 +147,7 @@ ], "is_repeatable": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Required", - "value": null - } + ], "onchange_properties": [ { @@ -222,13 +192,7 @@ "parent_question_key": "provider_observed", "answers": null, "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Either Estimated Stock value or Estimated Quantity is required", - "value": null - } + ] }, { @@ -314,13 +278,7 @@ } ], "validations": [ - { - "name": "required", - "isactive": "1", - "validator": "Validators.required", - "message": "Field required", - "value": null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json index 57cd83a..1d817f0 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json @@ -36,13 +36,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -51,13 +45,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -71,13 +59,7 @@ "answers":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -100,13 +82,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -119,13 +95,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -161,13 +131,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -175,13 +139,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -224,13 +182,7 @@ "parent_question_key":"is_transfer", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -253,13 +205,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -273,13 +219,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] } ] @@ -288,13 +228,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -307,13 +241,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -331,13 +259,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -371,13 +293,7 @@ "parent_question_key":"construction_status", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -386,13 +302,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -407,13 +317,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -428,13 +332,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -448,13 +346,7 @@ "is_repeatable":null, "field_type":"string", "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Address Required", - "value":null - } + ] }, { @@ -489,13 +381,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"State Required", - "value":null - } + ] }, { @@ -508,13 +394,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"CIty Required", - "value":null - } + ] }, { @@ -527,13 +407,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Pincode Required", - "value":null - } + ] }, { @@ -548,13 +422,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -569,13 +437,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json index 83dc374..e9a8470 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/4.json @@ -96,6 +96,29 @@ "seasonality" ], "questions":[ + { + "question_key":"low_sale_month_reason", + "question":"Reason for Months in which sales/services is low?", + "place_holder":"Enter the text", + "type":"1", + "api_properties":null, + "answers":null, + "onchange_properties":null, + "is_repeatable":null, + "field_type":"string", + "is_subfield":"1", + "field_width":"45", + "parent_question_key":"seasonality", + "validations":[ + { + "name":"required", + "isactive":"1", + "validator":"Validators.required", + "message":"Required", + "value":null + } + ] + }, { "question_key":"low_sale_month", "question":"Months in which sales/services is low?", @@ -167,30 +190,8 @@ "value":null } ] - }, - { - "question_key":"low_sale_month_reason", - "question":"Reason for Months in which sales/services is low?", - "place_holder":"Enter the text", - "type":"1", - "api_properties":null, - "answers":null, - "onchange_properties":null, - "is_repeatable":null, - "field_type":"string", - "is_subfield":"1", - "field_width":"45", - "parent_question_key":"seasonality", - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } - ] - } + } + ] } ] diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json index 66ce862..fcdb97b 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json @@ -13,13 +13,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -47,6 +41,22 @@ "is_business_address" ], "questions":[ + { + "question":"No of Months", + "question_key":"business_months", + "place_holder":"", + "field_type":"num", + "type":"1", + "field_width":"45", + "api_properties":null, + "onchange_properties":null, + "is_repeatable":null, + "is_subfield":"1", + "parent_question_key":"is_business_address", + "answers":null, + "validations":[ + ] + }, { "question":"No of Years", "sub_title":"How Long has business been operated from visited premises? (Eg. If operating for 5 years and 4 months enter 5 in Years field and 4 in months field)", @@ -62,31 +72,9 @@ "parent_question_key":"is_business_address", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, - { - "question":"No of Months", - "question_key":"business_months", - "place_holder":"", - "field_type":"num", - "type":"1", - "field_width":"45", - "api_properties":null, - "onchange_properties":null, - "is_repeatable":null, - "is_subfield":"1", - "parent_question_key":"is_business_address", - "answers":null, - "validations":[ - ] - }, { "question":"Was any business activities seen during visit?", "question_key":"business_is_pd_visited", @@ -120,13 +108,7 @@ "parent_question_key":"business_is_pd_visited", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -144,13 +126,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -186,13 +162,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -212,13 +182,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -293,13 +257,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -331,13 +289,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -359,13 +311,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -375,13 +321,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -475,13 +415,7 @@ "parent_question_key":"property_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -508,13 +442,7 @@ "parent_question_key":"property_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -526,13 +454,7 @@ "parent_question_key":"business_assets_mode", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -588,13 +510,7 @@ "parent_question_key":"vehicle_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -606,13 +522,7 @@ "parent_question_key":"business_assets_mode", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -623,13 +533,7 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -676,13 +580,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -702,13 +600,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { @@ -785,13 +677,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -822,13 +708,7 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -850,13 +730,7 @@ } ], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }], "is_repeatable":"1", @@ -878,13 +752,7 @@ "answer_id":"No" }], "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] }, { diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json index a8828b9..02954cb 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json @@ -36,13 +36,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -51,13 +45,7 @@ ], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -71,13 +59,7 @@ "answers":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -90,13 +72,7 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, { @@ -132,13 +108,7 @@ "parent_question_key":"total_fund_requirement", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } + ] } ] @@ -146,13 +116,7 @@ }], "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } + ] }, {