Fairoj : All templates are created and related save and fetching done. smc credit pd old removed

This commit is contained in:
venbatechnologies@gmail.com 2020-11-06 11:09:40 +05:30
parent dc89e331d5
commit 84ef33d8a4
30 changed files with 4775 additions and 64 deletions

View File

@ -34,10 +34,10 @@ export const AppRoutes: Routes = [{
path:'sales-pd-list', path:'sales-pd-list',
component:SalesPdComponent component:SalesPdComponent
}, },
{ // {
path:'credit_pd', // path:'credit_pd',
loadChildren:'./lender-credit-pd/lender-credit-pd.module#LenderCreditPdModule' // loadChildren:'./lender-credit-pd/lender-credit-pd.module#LenderCreditPdModule'
}, // },
// { // {
// path:'reports', // path:'reports',
// loadChildren:'./reports/reports.module#ReportsModule' // loadChildren:'./reports/reports.module#ReportsModule'

View File

@ -1,25 +1,32 @@
<div *ngIf="questions_JSON.questions.length > 0" #whole_form> <div *ngIf="questions_JSON.questions.length > 0" #whole_form>
<form [formGroup]="form_group_name" fxLayout="row wrap" fxFlex="100" fxLayoutAlign="space-between" fxLayout.xs="column" fxLayoutGap="33px"> <form [formGroup]="form_group_name" fxLayout="row wrap" fxLayoutWrap fxFlex="100" fxLayoutAlign="space-between" fxLayout.xs="column" fxLayoutGap="33px">
<!-- {{form_group_name.value | json}} --> <!-- {{form_group_name.value | json}} -->
<!-- <div *ngIf="form_group_name.controls['questions']"> --> <!-- <div *ngIf="form_group_name.controls['questions']"> -->
<!-- <section formArrayName="questions">fxFlex.md="33" fxFlex.lg="33" fxFlex.xl="33" --> <!-- <section formArrayName="questions">fxFlex.md="33" fxFlex.lg="33" fxFlex.xl="33" -->
<!-- {{form_group_name.value | json}} --> <!-- {{form_group_name.value | json}} -->
<span *ngFor="let parent_ques of questions_JSON.questions;let p_i =index; let p_last=last" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'" > <div *ngFor="let parent_ques of questions_JSON.questions;let p_i =index; let p_last=last" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'" >
<!-- {{parent_ques.hasOwnProperty('field_width') && parent_ques.field_width ? parent_ques.field_width : '100'}} -->
<!-- <div *ngFor="let parent_ques of form_group_name.controls['questions']['controls'];let p_i=index; let p_l=last" [formGroupName]="p_i"> --> <!-- <div *ngFor="let parent_ques of form_group_name.controls['questions']['controls'];let p_i=index; let p_l=last" [formGroupName]="p_i"> -->
<!-- {{parent_ques | json}} --> <!-- {{parent_ques | json}} -->
<!-- <div *ngIf="parent_ques.sub_title" fxLayout="row" >
<mat-card-subtitle *ngIf="parent_ques.sub_title" fxFlex="100%">
{{parent_ques.sub_title}}
</mat-card-subtitle>
<br style="clear: both;"/>
</div> -->
<div *ngIf="parent_ques.is_repeatable != '1'" > <div *ngIf="parent_ques.is_repeatable != '1'" >
<app-dynamic-question-template [currFormArrayObj]="parent_ques" [json_answers] = "json_answers" [formGroupN]="form_group_name" <app-dynamic-question-template [currFormArrayObj]="parent_ques" [json_answers] = "json_answers" [formGroupN]="form_group_name"
[whole_json]="questions_JSON.questions" [json_index]="p_i"></app-dynamic-question-template> [whole_json]="questions_JSON.questions" [json_index]="p_i"></app-dynamic-question-template>
</div> </div>
<div *ngIf="parent_ques.is_repeatable == '1'"> <div *ngIf="parent_ques.is_repeatable == '1'">
<!-- {{form_group_name.value[parent_ques.group_key] | json}} --> <!-- {{form_group_name.value[parent_ques.group_key] | json}} -->
<div [formArrayName]="parent_ques.group_key" *ngIf="parent_ques.group_type != '6'"> <div [formArrayName]="parent_ques.group_key" *ngIf="parent_ques.group_type != '6'" >
<span *ngFor="let group_ques of form_group_name.get(parent_ques.group_key)['controls'];let g_i=index;let g_l=last" <div *ngFor="let group_ques of form_group_name.get(parent_ques.group_key)['controls'];let g_i=index;let g_l=last"
[formGroupName]="g_i"> [formGroupName]="g_i">
<!-- {{g_i}} {{g_l}} --> <!-- {{g_i}} {{g_l}} -->
<mat-accordion *ngIf="parent_ques.group_type != '6' && parent_ques.group_questions[g_i]" #accordion="matAccordion"> <mat-accordion *ngIf="parent_ques.group_type != '6' && parent_ques.group_questions[g_i]" #accordion="matAccordion" >
<mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel"> <mat-expansion-panel [expanded]="step === g_i" #mapanel="matExpansionPanel" >
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
{{parent_ques.group_title}} {{g_i+1}} {{parent_ques.group_title}} {{g_i+1}}
@ -28,11 +35,15 @@
Type your name and age Type your name and age
</mat-panel-description> --> </mat-panel-description> -->
</mat-expansion-panel-header> </mat-expansion-panel-header>
<div *ngFor="let singleQues of parent_ques.group_questions[g_i];let s_i=index"> <!-- {{json_answers[parent_ques.group_key][0] | json}} -->
<app-dynamic-question-template [currFormArrayObj]="singleQues" [formGroupN]="group_ques" [whole_form]="form_group_name" <div *ngFor="let singleQues of parent_ques.group_questions[g_i];let s_i=index" fxFlex.xs="100" fxFlex.sm="100" [fxFlex]="singleQues.hasOwnProperty('field_width') && singleQues.field_width ? singleQues.field_width : '100'" >
[whole_json]="parent_ques.group_questions[g_i]" [json_index]="s_i"></app-dynamic-question-template> <!-- {{s_i}} -->
<!-- {{json_answers[parent_ques.group_key][s_i] | json}} -->
<app-dynamic-question-template [group_key] = parent_ques.group_key [currFormArrayObj]="singleQues" [json_answers] = "json_answers != null && json_answers ? json_answers[parent_ques.group_key] : null" [formGroupN]="group_ques" [whole_form]="form_group_name"
[whole_json]="parent_ques.group_questions[g_i]" [json_index]="g_i" (generateGroupControls) = generateGroupControls($event)></app-dynamic-question-template>
</div> </div>
<div fxLayout="row" fxLayoutAlign="flex-end"> <br/>
<div fxLayout="row" fxLayoutAlign="flex-end" fxFlex="100" style="margin-top: 1%;">
<div > <div >
<!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)"> <!-- <ion-button class="ion-float-right" fill="clear" color="optblue" *ngIf="g_i != 0" (click)="removeData(g_i,parent_ques)">
<ion-icon style="font-size: 22px" name="md-trash"></ion-icon> <ion-icon style="font-size: 22px" name="md-trash"></ion-icon>
@ -49,7 +60,7 @@
<ion-icon style="font-size: 24px" name="add-circle"></ion-icon> <ion-icon style="font-size: 24px" name="add-circle"></ion-icon>
</ion-button> --> </ion-button> -->
<button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button <button type="button" class="ml-1 mr-1 hover-icon" mat-raised-button
mat-icon-button matTooltip="Delete" mat-icon-button matTooltip="Add More"
matTooltipPosition="above" *ngIf="g_l" matTooltipPosition="above" *ngIf="g_l"
(click)="addData(g_i,parent_ques)"> (click)="addData(g_i,parent_ques)">
<mat-icon>add</mat-icon> <mat-icon>add</mat-icon>
@ -58,12 +69,12 @@
</div> </div>
</mat-expansion-panel> </mat-expansion-panel>
</mat-accordion> </mat-accordion>
</span> </div>
</div> </div>
<!-- IS REPEATABLE --> <!-- IS REPEATABLE -->
</div> </div>
<!-- </div> --> <!-- </div> -->
<!-- </section> --> <!-- </section> -->
</span> </div>
</form> </form>
</div> </div>

View File

@ -0,0 +1,6 @@
::ng-deep {
.mat-expansion-panel-body{
flex-flow: wrap;
place-content: space-between;
}
}

View File

@ -1,8 +1,10 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, ViewChild } from '@angular/core';
import { FormGroup, FormBuilder, FormArray } from '@angular/forms'; import { FormGroup, FormBuilder, FormArray } from '@angular/forms';
import { MatExpansionPanel } from '@angular/material';
import { QuesFormService } from '../ques-form/ques-form.service'; import { QuesFormService } from '../ques-form/ques-form.service';
@Component({ @Component({
selector: 'app-dynamic-form', selector: 'app-dynamic-form',
templateUrl: './dynamic-form.component.html', templateUrl: './dynamic-form.component.html',
@ -14,16 +16,68 @@ export class DynamicFormComponent implements OnInit {
@Input() questions_JSON:any; @Input() questions_JSON:any;
@Input() json_answers:any; @Input() json_answers:any;
step: number=0; step: number=0;
@ViewChild('mapanel') matExpansionPanel:MatExpansionPanel
constructor(private _fb:FormBuilder,private questionService:QuesFormService) { } constructor(private _fb:FormBuilder,private questionService:QuesFormService) { }
ngOnInit() { ngOnInit() {
// this.form_group_name=new FormGroup({questions:this._fb.array([])}) // this.form_group_name=new FormGroup({questions:this._fb.array([])})
console.log(this.questions_JSON,this.json_answers,this.questionService); console.log(this.questions_JSON,this.json_answers,this.questionService);
this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions) this.form_group_name=this.questionService.assignFormControl_array(this.form_group_name,this.questions_JSON.questions)
// debugger // debugger
this.generateGroupControls();
}
generateGroupControls() {
if(this.json_answers && this.json_answers != null ){
this.questions_JSON.questions.forEach(parent_ques=>{
console.log(parent_ques);
// debugger;
// FOR ADDING THE GROUP QUES TO DISPLAY WITHOUT CONSIDERING INDEX 0
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].forEach((group_ques,g_i)=>{
console.log(parent_ques,g_i)
if(g_i != 0){
// let parent_control=this.form_group_name
// if(parent_control.value.hasOwnProperty('questions_group')){
this.addData(g_i,parent_ques)
// }
}
})
}
}
})
}
} }
ngOnChanges() { ngOnChanges() {
console.log(this.questions_JSON,this.json_answers,this.questionService); console.log(this.questions_JSON,this.json_answers,this.questionService);
// debugger
// if(this.json_answers && this.json_answers != null ){
// this.questions_JSON.questions.forEach(parent_ques=>{
// console.log(parent_ques);
// // debugger;
// // FOR ADDING THE GROUP QUES TO DISPLAY WITHOUT CONSIDERING INDEX 0
// if(parent_ques.is_repeatable == '1'){
// console.log(this.json_answers[parent_ques.group_key]);
// debugger;
// this.json_answers[parent_ques.group_key].forEach((group_ques,g_i)=>{
// console.log(parent_ques,g_i)
// debugger;
// if(g_i != 0){
// // let parent_control=this.form_group_name
// // if(parent_control.value.hasOwnProperty('questions_group')){
// this.addData(g_i,parent_ques)
// // }
// }
// })
// }
// })
// }
// this.form_group_name=new FormGroup({questions:this._fb.array([])}) // this.form_group_name=new FormGroup({questions:this._fb.array([])})
console.log(this.form_group_name); console.log(this.form_group_name);
@ -40,6 +94,7 @@ export class DynamicFormComponent implements OnInit {
control_names[val.question_key] = '' 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.group_questions.push(json_obj.question); json_obj.group_questions.push(json_obj.question);
control.push(this._fb.group(control_names)) control.push(this._fb.group(control_names))
@ -64,5 +119,11 @@ export class DynamicFormComponent implements OnInit {
this.step = control.length-1 this.step = control.length-1
console.log(json_obj) console.log(json_obj)
} }
openMatExpansionPanel() {
console.log("opening expansion panek",this.matExpansionPanel)
if(this.matExpansionPanel!= undefined){
this.matExpansionPanel.open()
}
}
} }

View File

@ -1,4 +1,10 @@
<section [formGroup]="formGroupN"> <section [formGroup]="formGroupN">
<div *ngIf="parent_ques.sub_title" fxLayout="row" >
<mat-card-subtitle *ngIf="parent_ques.sub_title" fxFlex="100%">
{{parent_ques.sub_title}}
</mat-card-subtitle>
<br style="clear: both;"/>
</div>
<!-- {{formGroupN.value | json}} --> <!-- {{formGroupN.value | json}} -->
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '1'" <mat-form-field style="width: 100%" *ngIf="parent_ques.type == '1'"
[ngStyle]="{'margin-bottom':parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword' ? '5%' : '0' }"> [ngStyle]="{'margin-bottom':parent_ques.field_type == 'numtoword' || parent_ques.field_type == 'str&numtoword' ? '5%' : '0' }">
@ -70,16 +76,17 @@
</ng-container> </ng-container>
</mat-form-field> </mat-form-field>
<!-- <div class="radio-gap" [formArrayName]="parent_ques.question_key" *ngIf="parent_ques.type == '5'"> <div class="radio-gap" [formArrayName]="parent_ques.question_key" *ngIf="parent_ques.type == '5'">
<mat-label>{{parent_ques.question}}</mat-label> <mat-label>{{parent_ques.question}}</mat-label>
<mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.answers" <mat-checkbox class="radio-btn-gap" *ngFor="let val of parent_ques.answers;let i=index"
[value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer" [value]="val.hasOwnProperty('answer_id') ? val.answer_id : val.answer"
(change)="onChange_checkbox($event,parent_ques)">{{val.answer}}</mat-checkbox><br /> (change)="onChange_checkbox($event,parent_ques);onChangeProperty($event,parent_ques,'','','')">{{val.answer}}</mat-checkbox><br />
<ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error"> <ng-container *ngFor="let validation of parent_ques.validations" ngProjectAs="mat-error">
<mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())"> <mat-error align="end" *ngIf="formGroupN.get(parent_ques.question_key).hasError(validation.name.toLowerCase())">
{{validation.message}}</mat-error> {{validation.message}}</mat-error>
</ng-container> </ng-container>
</div> --> {{formGroupN.value[parent_ques.question_key] | json}}
</div>
<mat-form-field style="width: 100%" *ngIf="parent_ques.type == '4'"> <mat-form-field style="width: 100%" *ngIf="parent_ques.type == '4'">
<mat-label>{{parent_ques.question}}</mat-label> <mat-label>{{parent_ques.question}}</mat-label>

View File

@ -32,3 +32,43 @@ mat-form-field {
height: 28px; height: 28px;
} }
@-webkit-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@-moz-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@-ms-keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
@keyframes highlight-fade {
0% {
background: orange;
}
100% {
background: white;
}
}
.field_highlight {
-webkit-animation: highlight-fade 4s ease-out;
-moz-animation: highlight-fade 4s ease-out;
-o-animation: highlight-fade 4s ease-out;
animation: highlight-fade 4s ease-out;
// background: blue;
}

View File

@ -1,5 +1,5 @@
import { Component, OnInit, Input } from '@angular/core'; import { Component, OnInit, Input, Output, EventEmitter } from '@angular/core';
import { FormGroup, FormArray, FormControl } from '@angular/forms'; import { FormGroup, FormArray, FormControl, FormBuilder } from '@angular/forms';
import { QuesFormService } from '../ques-form/ques-form.service'; import { QuesFormService } from '../ques-form/ques-form.service';
import { startWith, map } from 'rxjs/operators'; import { startWith, map } from 'rxjs/operators';
import { Observable, ReplaySubject } from 'rxjs'; import { Observable, ReplaySubject } from 'rxjs';
@ -18,12 +18,14 @@ export class DynamicQuestionTemplateComponent implements OnInit {
@Input() json_index:any; @Input() json_index:any;
@Input() whole_form:FormGroup; @Input() whole_form:FormGroup;
@Input() json_answers:any; @Input() json_answers:any;
@Input()group_key:any;
@Output() generateGroupControls= new EventEmitter()
local_city: any; local_city: any;
local_pincode: any; local_pincode: any;
autoCompleteAns:Observable<string[]> autoCompleteAns:Observable<string[]>
public commonFilterCtrl:FormControl = new FormControl(); public commonFilterCtrl:FormControl = new FormControl();
public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(1); public ngxFilteredValue:ReplaySubject<any> = new ReplaySubject<any>(1);
constructor(private quesService:QuesFormService) { } constructor(private quesService:QuesFormService,private _fb:FormBuilder) { }
ngOnInit() { ngOnInit() {
if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) { if(this.parent_ques.type == '9' && this.parent_ques.answers && this.parent_ques.answers.length > 0) {
@ -33,23 +35,62 @@ export class DynamicQuestionTemplateComponent implements OnInit {
) )
} }
} }
ngOnChanges() { ngOnChanges() {
this.parent_ques = this.currFormArrayObj this.parent_ques = this.currFormArrayObj
console.log(this.parent_ques,this.formGroupN);
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) { if(this.json_answers!=null && this.json_answers != undefined && this.json_answers) {
console.log("ddddddddddddddd",this.json_answers[this.parent_ques.question_key],this.parent_ques) // console.log("ddddddddddddddd",this.json_answers[this.parent_ques.question_key],this.parent_ques)
setTimeout(()=>{ setTimeout(()=>{
console.clear()
console.log(this.json_answers,this.parent_ques.question_key)
if(this.json_answers!=null && this.json_answers != undefined && this.json_answers && !this.group_key) {
this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || '')) this.formGroupN.get(this.parent_ques.question_key).patchValue((this.json_answers[this.parent_ques.question_key] || ''))
this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'') this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'')
console
}
else if(this.json_answers!=null && this.json_answers != undefined && this.json_answers){
// this.formGroupN.patchValue((this.json_answers[this.group_key] || ''))
console.log(this.json_answers,this.whole_form.get(this.group_key))
// debugger;
this.whole_form.get(this.group_key).patchValue(this.json_answers)
if(this.json_answers.length > 1) {
this.generateGroupControls.emit()
}
this.json_answers.forEach((value,index)=>{
let keys= Object.keys(value)
keys.forEach(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)) {
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(()=>{
// console.log("last on change fun",this.json_answers[this.parent_ques.question_key],this.parent_ques.question_key)
// debugger;
// this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'')
// },1000)
// this.formGroupN.patchValue(this.json_answers)
})
// this.formGroupN.get(this.parent_ques.question_key).patchValue(this.json_answers[this.parent_ques.question_key]) // this.formGroupN.get(this.parent_ques.question_key).patchValue(this.json_answers[this.parent_ques.question_key])
// this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'') // this.onChangeProperty({value:this.json_answers[this.parent_ques.question_key]},this.parent_ques,'')
setTimeout(()=>{ setTimeout(()=>{
this.json_answers = null this.json_answers = null
},700) },700)
} }
// console.log(this.parent_ques,this.formGroupN,this.whole_json ,this.json_answers);
// debugger;
if(this.parent_ques.type == '8') { if(this.parent_ques.type == '8') {
console.log("Initial",this.parent_ques.answers) console.log("Initial",this.parent_ques.answers)
if(this.parent_ques.answers && this.parent_ques.answers.length > 0){ if(this.parent_ques.answers && this.parent_ques.answers.length > 0){
@ -261,9 +302,97 @@ export class DynamicQuestionTemplateComponent implements OnInit {
// this.creteNewField(onChangeProperty,this.quesAnsForm,sec_control,sec_index) // this.creteNewField(onChangeProperty,this.quesAnsForm,sec_control,sec_index)
// } // }
} }
if(onChangeProperty.purpose == 'answer_value') {
this.setModifiedValuetoControl(onChangeProperty,this.formGroupN,sec_index)
}
// for calculation field from multiple arr values
if(onChangeProperty.purpose == 'answer_value_arr') {
let index = JSON.parse(JSON.stringify(this.json_index))
this.setModifiedValuetoControl_frommultiple(onChangeProperty,this.whole_form.get(this.group_key),index)
}
}) })
} }
} }
setModifiedValuetoControl_frommultiple(curr_obj,formArray,curr_index ?) {
console.log(curr_obj,formArray,this.json_index);
if(curr_obj && curr_obj.value_keys.length > 0 && curr_obj.arr_include.length > 0 ) {
let expression_value=curr_obj.expression
for(let index_str of curr_obj.arr_include) {
let value_index;
if(index_str == 'py') {
if(curr_index == 0) {
formArray.controls[curr_index].controls[curr_obj.insert_control].setValue(0)
}
if(formArray.value.length < 2) {
return;
}
value_index = curr_index-1
}
if(index_str == 'now'){
value_index = curr_index
}
for(let value of curr_obj.value_keys) {
console.log("dsf",value_index,value,value+'['+index_str+']',index_str)
let control_value = formArray.value[value_index] ? formArray.value[value_index][value] : ''
if(control_value) {
expression_value = expression_value.split(value+'['+index_str+']').join(control_value)
}
else{
return
}
}
}
if(expression_value) {
let calc_exp=eval(expression_value)
console.log(calc_exp)
if(calc_exp){
if(typeof(calc_exp) == 'number'){
calc_exp = calc_exp.toFixed(2)
}
if(curr_obj.insert_control) {
formArray.controls[curr_index].controls[curr_obj.insert_control].setValue(calc_exp)
if(formArray.value.length > curr_index+1) {
console.log("Current index",curr_index,this.json_index)
this.setModifiedValuetoControl_frommultiple(curr_obj,formArray,curr_index+1)
}
}
}
}
}
}
// for setting the modified value to another or same control while field change
setModifiedValuetoControl(curr_obj,form_control_obj,curr_index) {
console.log(curr_obj,form_control_obj,curr_index)
if(curr_obj && curr_obj.value_keys.length > 0){
let expression_value=curr_obj.expression
// curr_obj.value_keys.forEach(val=>{
for(let val of curr_obj.value_keys) {
let control_value
control_value =form_control_obj.value[val]
if(control_value) {
expression_value = expression_value.replace(val,control_value)
}
else{
return;
}
}
// })
console.log(expression_value)
let calc_exp=eval(expression_value)
console.log(calc_exp)
if(calc_exp){
if(typeof(calc_exp) == 'number'){
calc_exp = calc_exp.toFixed(2)
}
if(curr_obj.insert_control) {
form_control_obj.controls[curr_obj.insert_control].setValue(calc_exp)
}
}
}
}
creteNewField(form_control_obj_raw,group_ques,sec_control,sec_index,purpose?){ creteNewField(form_control_obj_raw,group_ques,sec_control,sec_index,purpose?){
console.log(group_ques,form_control_obj_raw,sec_index); console.log(group_ques,form_control_obj_raw,sec_index);
if(form_control_obj_raw.form_controls.length > 0){ if(form_control_obj_raw.form_controls.length > 0){
@ -312,10 +441,52 @@ export class DynamicQuestionTemplateComponent implements OnInit {
console.log(form_control_obj,group_ques,question_index_after) console.log(form_control_obj,group_ques,question_index_after)
let ques_control=this.whole_json let ques_control=this.whole_json
let inserted_control_obj=form_control_obj let inserted_control_obj=form_control_obj
inserted_control_obj.questions.sort() // inserted_control_obj.questions.sort()
inserted_control_obj.questions.reverse() // inserted_control_obj.questions.reverse()
inserted_control_obj.questions.forEach(val=>{ console.log("check ddddddddddd",inserted_control_obj.questions.reverse(),inserted_control_obj.questions)
if(options == 1){ inserted_control_obj.questions.forEach((val,index)=>{
if(val.hasOwnProperty('is_repeatable') && val.is_repeatable == '1') {
if(options == 1) {
let check_dup=ques_control.filter(control_key=>control_key.group_key == val.group_key)
console.log(check_dup,this.formGroupN);
if(check_dup.length == 0){
this.formGroupN.addControl(val.group_key,this._fb.array([]))
// val.question.reverse()
let childControl: any = this.formGroupN.get(val.group_key) as FormArray
let control_names:any={}
inserted_control_obj.questions[index].group_questions = []
inserted_control_obj.questions[index].group_questions.push(val.question)
this.whole_json.splice(question_index_after+1,0,val);
val.question.forEach(group_val=>{
control_names[group_val.question_key] = ''
console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val)
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
})
const question_temp:any = JSON.parse(JSON.stringify(val.question));
inserted_control_obj.questions[index].question = question_temp
childControl.push(this._fb.group(control_names))
val.group_questions[0].forEach((group_indi,arr_index)=>{
console.log("sd",childControl)
this.quesService.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
})
}
}
else{
// let childControl: any = this.formGroupN.get(val.group_key) as FormArray
val.question.forEach(group_val=>{
// control_names[group_val.question_key] = ''
console.log("check ffffff",inserted_control_obj.questions.reverse(),inserted_control_obj.questions,group_val)
this.addOrRemoveControl(group_val,ques_control,question_index_after,options,val)
})
}
}
else{
this.addOrRemoveControl(val,ques_control,question_index_after,options,val)
}
})
}
addOrRemoveControl(val,ques_control,question_index_after,options,paren_ques) {
if(options == 1){
let check_dup=ques_control.filter(control_key=>control_key.question_key == val.question_key) let check_dup=ques_control.filter(control_key=>control_key.question_key == val.question_key)
console.log(check_dup,this.formGroupN); console.log(check_dup,this.formGroupN);
@ -323,22 +494,39 @@ export class DynamicQuestionTemplateComponent implements OnInit {
if(check_dup.length == 0){ if(check_dup.length == 0){
val.raw_validations=val.validations val.raw_validations=val.validations
// ques_control.insert(question_index_after+1,this.questionService.createValue(val)) // ques_control.insert(question_index_after+1,this.questionService.createValue(val))
this.whole_json.splice(question_index_after+1,0,val); if(paren_ques.hasOwnProperty('is_repeatable') && paren_ques.is_repeatable == '1') {
// this.formGroupN.addControl(val.question_key,new FormControl(''))
}
else{
this.whole_json.splice(question_index_after+1,0,val);
this.formGroupN.addControl(val.question_key,new FormControl('')) this.formGroupN.addControl(val.question_key,new FormControl(''))
console.log("After adding control",this.whole_json,this.formGroupN,this.whole_form);
this.quesService.addAdditionalControl(val, this.formGroupN, question_index_after+1,"") this.quesService.addAdditionalControl(val, this.formGroupN, question_index_after+1,"")
}
console.log("After adding control",this.whole_json,this.formGroupN,this.whole_form);
} }
} }
else{ else{
console.log("Delete",ques_control)
ques_control.forEach((control_key,index)=>{ ques_control.forEach((control_key,index)=>{
if(paren_ques.hasOwnProperty('is_repeatable') && paren_ques.is_repeatable == '1') {
if(control_key.group_key == paren_ques.group_key){
this.whole_json.splice(index,1)
// this.formGroupN.controls[val.question_key].reset()
this.formGroupN.removeControl(paren_ques.group_key);
}
console.log(this.formGroupN,this.whole_json)
}
else{
if(control_key.question_key == val.question_key){ if(control_key.question_key == val.question_key){
this.whole_json.splice(index,1) this.whole_json.splice(index,1)
this.formGroupN.controls[val.question_key].reset() this.formGroupN.controls[val.question_key].reset()
this.formGroupN.removeControl(val.question_key); this.formGroupN.removeControl(val.question_key);
} }
}
}) })
} }
})
} }
setValidations_onChange(validation_obj_raw,group_ques,sec_control,sec_index){ setValidations_onChange(validation_obj_raw,group_ques,sec_control,sec_index){

View File

@ -2,6 +2,7 @@ import { Injectable } from '@angular/core';
import { FormGroup, FormArray, FormBuilder, FormControl, Validators } from '@angular/forms'; import { FormGroup, FormArray, FormBuilder, FormControl, Validators } from '@angular/forms';
import { HttpClient } from '@angular/common/http'; import { HttpClient } from '@angular/common/http';
import { environment } from 'environments/environment'; import { environment } from 'environments/environment';
import { DatePipe } from '@angular/common';
const apiUrl = environment.apiEndpoint const apiUrl = environment.apiEndpoint
@ -11,7 +12,9 @@ const apiUrl = environment.apiEndpoint
export class QuesFormService { export class QuesFormService {
pd_all_details:any= {} pd_all_details:any= {}
datepipe: DatePipe;
constructor(private _fb:FormBuilder,private http:HttpClient) { constructor(private _fb:FormBuilder,private http:HttpClient) {
this.datepipe=new DatePipe('en-US')
// this.apiUrl = constantProvider.environment().url // this.apiUrl = constantProvider.environment().url
} }
// FOR CREATING A FORM CONTROL DYNAMICALLY // FOR CREATING A FORM CONTROL DYNAMICALLY
@ -102,7 +105,7 @@ export class QuesFormService {
console.log(formgroup.value); console.log(formgroup.value);
// debugger; // debugger;
val.group_questions[0].forEach((group_indi,arr_index)=>{ val.group_questions[0].forEach((group_indi,arr_index)=>{
console.log("sd",childControl) console.log("sd",childControl,group_indi)
this.addAdditionalControl(group_indi, childControl.controls[0], arr_index) this.addAdditionalControl(group_indi, childControl.controls[0], arr_index)
}) })
@ -265,6 +268,58 @@ export class QuesFormService {
} }
// END OF CONVERTARRAYNAMES FUN-- // END OF CONVERTARRAYNAMES FUN--
setAnswerOptionsorValue(data_json,control) {
let answer_value_loc='';
let answers_from_client=[]
if(data_json.hasOwnProperty('answer_value') && data_json.answer_value != '' || null){
console.log(data_json,control)
let values_for_cli:any = this.getAnswerValue(data_json)
if(values_for_cli.flag == 1){
answer_value_loc=values_for_cli.values
}
else{
answers_from_client=values_for_cli.values
}
data_json.answers = answers_from_client;
if(answer_value_loc){
control.setValue(answer_value_loc)
}
}
}
// --- FOR SETTING THE VALUE DEFAULT WITH DISABLED AND GENERATE THE ANSWERS FOR FIELDS(EX. refer 'GET_FY_YEARS' switch)
getAnswerValue(value_obj) {
if (value_obj != null && value_obj.hasOwnProperty('answer_value')) {
let return_value = { flag: 1, values: '' };
let user_det: any = localStorage.getItem("user_details")
user_det = JSON.parse(user_det);
switch (value_obj.answer_value) {
case 'CURRENT_USER':
console.log("current user", user_det)
return_value.values = user_det.user_first_name + ' ' + user_det.user_last_name
break;
case "CURRENT_DESIGNATION":
return_value.values = user_det.designation_name != null ? user_det.designation_name : ''
break;
case "CURRENT_DATE":
let date = new Date()
return_value.values = this.datepipe.transform(date, 'dd-MM-yyyy, h:mm:ss a')
break;
case "GET_FY_YEARS":
return_value.values = this.getCurrentFyYears()
return_value.flag = 2
break;
default:
return_value.values = ''
break
}
return return_value
}
return ''
}
// --END OF GETANSWERVALUE FUN
addAdditionalControl(data,curr_control,curr_index,purpose?){ addAdditionalControl(data,curr_control,curr_index,purpose?){
console.log(curr_control); console.log(curr_control);
//FOR CHECKBOX CHANGE THE VALUE STORAGE AS ARRAY //FOR CHECKBOX CHANGE THE VALUE STORAGE AS ARRAY
@ -295,10 +350,30 @@ export class QuesFormService {
curr_control.controls[curr_index].addControl('is_loader',new FormControl('')) curr_control.controls[curr_index].addControl('is_loader',new FormControl(''))
curr_control.controls[curr_index].addControl('is_saved',new FormControl('')) curr_control.controls[curr_index].addControl('is_saved',new FormControl(''))
curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false)) curr_control.controls[curr_index].addControl('is_image_status',new FormControl(false))
}
if (data.api_properties != null) {
if(data.api_properties.hasOwnProperty('purpose') && data.api_properties.purpose == 'answer_options_local') {
if(data.api_properties.master_name == 'pd_applicants') {
data.answers = (this.convertArrayNames( data.api_properties.fields,this.pd_all_details.pdapplicants_detials))
// val.question[arr_index].answers = group_indi.answers
}
}
else{
this.apiPropertiesCall(data).then(res => {
if (res != false) {
data.answers = []
// group_indi.answers=this.convertArrayNames(val.api_properties.fields,res)
data.answers = (this.convertArrayNames(data.api_properties.fields, res))
// val.question[arr_index].answers = group_indi.answers
}
})
}
} }
//FOR SETTING THE VALIDATORS //FOR SETTING THE VALIDATORS
this.settingArrayofValidators(data,curr_control,curr_index) this.settingArrayofValidators(data,curr_control,curr_index)
this.setAnswerOptionsorValue(data,curr_control)
} }
// FOR SETTING THE ARRAY OF VALIDATORS COMING FROM JSON Temp, // FOR SETTING THE ARRAY OF VALIDATORS COMING FROM JSON Temp,
@ -356,6 +431,26 @@ export class QuesFormService {
} }
// END OF GETVALIDATORVALUE FUN // END OF GETVALIDATORVALUE FUN
// FOR GENERATING THE FY YEAR FIELD ANSWERS
getCurrentFyYears(){
let month=new Date().getMonth()
let year=new Date().getFullYear()
let fy:any=[];
if(month >=3){
fy.push({fy_year:year-1+'-'+(year),curr:year})
}
else{
fy.push({fy_year:year-2+'-'+(year-1),curr:year-1})
}
console.log(fy)
for(let i=0;i<=2;i++){
fy.push({fy_year:(fy[i].curr-2)+'-'+(fy[i].curr-1),curr:fy[i].curr-1})
}
return fy.map(val=>({answer:val.fy_year,answer_id:val.fy_year}))
}
// END OF GETCURRFYYEARS FUN
// FOR CREATING THE CORRECT VALIDATION // FOR CREATING THE CORRECT VALIDATION
setValueForValidator(value_obj){ setValueForValidator(value_obj){
console.log("setvlaue of validator",value_obj.validator,typeof(value_obj.validator)) console.log("setvlaue of validator",value_obj.validator,typeof(value_obj.validator))

View File

@ -1,9 +1,9 @@
<h2 mat-dialog-title class="paragraph_change"> <h2 mat-dialog-title class="paragraph_change">
<div fxFlex="70" align="left" style="padding: 10px !important;"> <div fxFlex="75" align="left" style="padding: 1% !important" [ngStyle.xs]="{'font-size':'16px','font-weight':'bold'}">
<span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br> <span>{{main_applicant}} {{lender_applicant_id ? '('+lender_applicant_id+')' : ''}}, {{customer_segment_abbr}} - {{subproduct_abbr}} </span><br>
{{questions_JSON.section_name}} {{questions_JSON.section_name}}
</div> </div>
<div fxFlex="30" align="end" style="padding: 10px !important;"> <div fxFlex="25" align="end" style="padding: 10px !important;">
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close" <button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Close"
matTooltipPosition="right" mat-dialog-close> matTooltipPosition="right" mat-dialog-close>
<mat-icon>close</mat-icon> <mat-icon>close</mat-icon>
@ -14,11 +14,11 @@
<mat-dialog-content style="border-bottom: 2px solid #e2412f8f;"> <mat-dialog-content style="border-bottom: 2px solid #e2412f8f;">
<h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0">No Templates Found</h5> <h5 style="text-align: center;" *ngIf="questions_JSON.questions.length == 0">No Templates Found</h5>
<mat-card *ngIf="questions_JSON.questions.length > 0"> <mat-card *ngIf="questions_JSON.questions.length > 0">
<mat-card-header> <!-- <mat-card-header>
<mat-card-title> <mat-card-title>
<!-- <h5>{{questions_JSON.section_name}}</h5> --> <h5>{{questions_JSON.section_name}}</h5>
</mat-card-title> </mat-card-title>
</mat-card-header> </mat-card-header> -->
<mat-card-content> <mat-card-content>
<app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="form_answers"></app-dynamic-form> <app-dynamic-form [questions_JSON]="questions_JSON" [form_group_name] = "commonFormGroup" [json_answers]="form_answers"></app-dynamic-form>
</mat-card-content> </mat-card-content>

View File

@ -1,10 +1,13 @@
import { Component, Inject, OnInit } from '@angular/core'; import { Component, Inject, OnInit, ViewChild } from '@angular/core';
import { FormBuilder, FormGroup } from '@angular/forms'; import { FormBuilder, FormGroup } from '@angular/forms';
import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material'; import { MatDialogRef, MatDialog, MAT_DIALOG_DATA } from '@angular/material';
import { ActivatedRoute, Router } from '@angular/router'; import { ActivatedRoute, Router } from '@angular/router';
import { NotifierService } from 'angular-notifier'; import { NotifierService } from 'angular-notifier';
import { AwsService } from 'app/AwsService/aws.service'; import { AwsService } from 'app/AwsService/aws.service';
import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service'; import { PdTrigerService } from 'app/personal-discussion/pd-service/pd-triger.service';
import { LoaderService } from 'app/shared/loaderService/loader.service';
import { environment } from 'environments/environment';
import { DynamicFormComponent } from '../dynamic-form/dynamic-form/dynamic-form.component';
import { QuesFormService } from '../dynamic-form/ques-form/ques-form.service'; import { QuesFormService } from '../dynamic-form/ques-form/ques-form.service';
@Component({ @Component({
@ -27,6 +30,7 @@ export class FormComponent implements OnInit {
questions_JSON: any = {questions:[],section_name:''}; questions_JSON: any = {questions:[],section_name:''};
commonFormGroup:FormGroup; commonFormGroup:FormGroup;
form_answers: any; form_answers: any;
@ViewChild(DynamicFormComponent) formComponent:DynamicFormComponent
constructor(notifier: NotifierService, constructor(notifier: NotifierService,
private fb: FormBuilder, private fb: FormBuilder,
private route: ActivatedRoute, private route: ActivatedRoute,
@ -36,7 +40,7 @@ export class FormComponent implements OnInit {
private dialog: MatDialog, private quesService:QuesFormService, private dialog: MatDialog, private quesService:QuesFormService,
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, @Inject(MAT_DIALOG_DATA) public pd_all_details: any,
private pdTriggerService:PdTrigerService, private pdTriggerService:PdTrigerService,
private awsService:AwsService) { private awsService:AwsService,private loaderService:LoaderService) {
// console.log(this.pd_all_details) // console.log(this.pd_all_details)
this.form_id = 24; this.form_id = 24;
this.pd_all_details.pdmaster_details=this.pd_all_details.pdmaster_details[0] this.pd_all_details.pdmaster_details=this.pd_all_details.pdmaster_details[0]
@ -70,6 +74,7 @@ export class FormComponent implements OnInit {
// this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{ // this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{
let params = {"fk_entity_id":"35","fk_product_id":"","pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id} let params = {"fk_entity_id":"35","fk_product_id":"","pd_form_id":this.pd_all_details.form_id,"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id}
this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{ this.pdTriggerService.loadCreditPDTemplate(params).subscribe(result=>{
// result.dataStatus = false
if(result.dataStatus) { if(result.dataStatus) {
let question_template: any = result.records let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined if (question_template && question_template != null && question_template != undefined
@ -87,6 +92,28 @@ export class FormComponent implements OnInit {
} }
} }
} }
// FOR LOCAL TEMPLATES ENV PURPOSE
else if(!environment.production){
this.pdTriggerService.loadTemplate(Number(this.pd_all_details.form_id)).subscribe(result=>{
if(result.dataStatus) {
let question_template: any = result.records
if (question_template && question_template != null && question_template != undefined
) {
// question_template = JSON.parse(question_template)
if (question_template.hasOwnProperty('template') && question_template.template) {
question_template =JSON.parse(question_template.template);
this.commonFormGroup = new FormGroup({})
this.questions_JSON = question_template;
console.log(this.questions_JSON);
// setTimeout(() => {
// this.covidAnswers = null
// console.log("cleared")
// }, 2000)
}
}
}
})
}
}) })
} }
getSectionData() { getSectionData() {
@ -124,7 +151,7 @@ export class FormComponent implements OnInit {
this.form_answers= formValues this.form_answers= formValues
setTimeout(()=>{ setTimeout(()=>{
this.form_answers = null this.form_answers = null
},2000) },2500)
// this.commonFormGroup.patchValue(formValues) // this.commonFormGroup.patchValue(formValues)
} }
} }
@ -145,14 +172,101 @@ export class FormComponent implements OnInit {
} }
} }
private markFormGroupTouched(formGroup: FormGroup) {
(<any>Object).values(formGroup.controls).forEach(control => {
control.markAsTouched();
if (control.controls) {
this.markFormGroupTouched(control);
}
});
}
public findInvalidControls() {
const invalid = [];
let msg=''
// let formArray:any = this.commonFormGroup ;
// console.log(formArray);
// for( const group in <any>(this.commonFormGroup.controls)) {
// if(group.invalid) {
// console.log(group,group.value.form_name,this.commonFormGroup.controls);
// debugger;
// msg= group.value.form_name+" are not complete"
// let index = this.stepperInfo.findIndex(vv=>vv.form_id == group.value.form_id);
// console.log("Index",index);
// if(index != -1) {
// msg = this.stepperInfo[index].form_name+" are not complete"
// this.myStepper.selectedIndex = this.stepperInfo[index].stepper_index
// }
for (const name in <any>(this.commonFormGroup.controls)) {
console.log(this.commonFormGroup.controls[name],name)
if (this.commonFormGroup.controls[name].invalid) {
invalid.push(name);
let invalidFields = [].slice.call(document.getElementsByClassName('ng-invalid'));
let firstInvalidField;
for(let val in invalidFields){
if( invalidFields[val].nodeName == 'MAT-FORM-FIELD' || invalidFields[val].nodeName == 'MAT-SELECT' || invalidFields[val].nodeName == 'TEXTAREA' || invalidFields[val].nodeName == 'MAT-RADIO-GROUP' ){ //INPUT FOR INPUT FIELD
firstInvalidField=invalidFields[val]
break;
}
}
if(firstInvalidField != undefined){
// firstInvalidField.scrollIntoView({behavior: "smooth", block: "end", inline: "nearest"})
this.formComponent.openMatExpansionPanel()
setTimeout(()=>{
firstInvalidField.scrollIntoView({block: "start", inline: "nearest"})
setTimeout(()=>{
firstInvalidField.focus()
},0)
// firstInvalidField.style.background = 'red'
firstInvalidField.classList.remove('field_highlight')
setTimeout(()=>{
firstInvalidField.classList.add('field_highlight')
},300)
},300)
// this.myStepper.selectedIndex = 0;
}
else {
// msg = this.stepperInfo[index].form_name+" images are not taken"
}
// console.log("kkdd",group['controls'][name],firstInvalidField)
// if(typeof(group['controls'][name].value) == 'string') {
// return name+' field is not '
// }
break
}
}
// }
// }
// let business_group_ctrl = formArray.at(2).get('business_group') as FormArray
// const controls = this.getQuestionControl().at(1)['controls']
// for (const name in controls) {
// if (controls[name].invalid) {
// invalid.push(name);
// }
// }
return invalid;
}
saveForm() { saveForm() {
console.log("values",this.commonFormGroup.getRawValue(),this.questions_JSON) console.log("values",this.commonFormGroup.getRawValue(),this.questions_JSON)
if(this.commonFormGroup.invalid) { if(this.commonFormGroup.invalid) {
this.commonFormGroup.markAsDirty(); this.commonFormGroup.markAsDirty();
this.commonFormGroup.markAsTouched() this.commonFormGroup.markAsTouched()
this.markFormGroupTouched(this.commonFormGroup)
let invalidfield = this.findInvalidControls()
console.log("Invalid field",invalidfield)
this.notifier.notify("info","Please fill all the required fields"); this.notifier.notify("info","Please fill all the required fields");
return return
} }
let checkProperty=this.onSubmitProperty()
console.log("check rp",checkProperty)
if(checkProperty == false){
return;
}
this.loaderService.showMatSpinnerDialog('')
let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''} let params = {"fk_pd_id":this.pd_all_details.pdmaster_details.pd_id,"fk_form_id":this.pd_all_details.form_id,"json":this.commonFormGroup.getRawValue(),createdby:''}
this.pdTriggerService.saveSMCCreditPDsection(params).subscribe(result=>{ this.pdTriggerService.saveSMCCreditPDsection(params).subscribe(result=>{
if(result['dataStatus']) { if(result['dataStatus']) {
@ -164,9 +278,130 @@ export class FormComponent implements OnInit {
else { else {
this.notifier.notify("warning","Something went wrong"); this.notifier.notify("warning","Something went wrong");
} }
this.loaderService.closeMatSpinnerDialog()
},err=>{ },err=>{
this.loaderService.closeMatSpinnerDialog()
this.notifier.notify("warning","Network Error"); this.notifier.notify("warning","Network Error");
}) })
} }
onSubmitProperty(){
let return_val=[]
let send_val:boolean=true
// this.local_ques_JSON.onsubmit=[
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];control.questions_group.forEach(ques_obj=>{ques_obj.questions.map(ques=>{if(ques.question_key == submitProperty.key_name){ques_key.push(ques)}})});if(ques_key.length >=3){return true}else{return false}return sum_val}())",
// "key_name": "approach_to_pd_location",
// "msg": "Minimum 3 image required in approach"
// },
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];if(control.question_key == submitProperty.key_name && control.answer_value == ''){return false}else{return true}return sum_val}())",
// "key_name": "selfie_with_person_met",
// "msg": "Selfie Person met pic is required"
// }
// {
// "expression": "(function () {let sum_val=null;let ques_key=[];if(control.question_key == submitProperty.key_name){return control.answer_value.length >= 100}}())",
// "key_name": "brief_business_service",
// "msg": "Please enter more details"
// }
// ]
// console.log(this.local_ques_JSON);
if(this.questions_JSON.hasOwnProperty('onsubmit') && this.questions_JSON.onsubmit != null){
for(let i=0; i<this.questions_JSON.onsubmit.length ; i++){
// this.quesAnsForm.value.questions.forEach(parent_ques=>{
// let parent_ques
// for( parent_ques of this.commonFormGroup.getRawValue()){
// this.local_ques_JSON.onsubmit.forEach(submitProperty=>{
let submitProperty=this.questions_JSON.onsubmit[i]
if((submitProperty.hasOwnProperty('group_key') && submitProperty.group_key)){
return_val.length = 0
let val=this.calculation(this.commonFormGroup.getRawValue()[submitProperty.group_key],submitProperty)
if(val != true && val != 100){
this.notifier.notify("info",submitProperty.msg)
return_val.push(false) ;
break;
}
else {
return_val.push(true) ;
}
}
else{
send_val =true
}
// })
// })
// }
// console.log(return_val.filter(val=>val == false).length > 0)
if(return_val.filter(val=>val == false).length > 0){
break;
}
}
console.log(return_val)
if(return_val.length > 0){
if(return_val.filter(res=>res == false).length > 0){
send_val = false
}
else{
send_val =true
}
}
}
return send_val
}
calculation(control,submitProperty){
console.log("control",control)
let exp=`
(function () {let sum_val=null
let ques_key=[]
control.questions_group.forEach(ques_obj=>{
ques_obj.questions.map(ques=>{
// console.log(ques)
if(ques.question_key == 'share_holding'){
ques_key.push(ques)
}
})
})
if(ques_key.length > 0){
console.log(ques_key)
sum_val= ques_key.map(val=>val.answer_value).reduce((tot,val)=>{
console.log(">>>>",tot,val)
return parseInt(tot)+parseInt(val)
})
}
return sum_val == 100}());`
let exp1 = `(function (){let sum_val=null;let ques_key=[];
control.forEach(ques_obj=>{ques_key.push(ques_obj[submitProperty.key_name])});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())`
//for image total check
// let exp=`
// (function () {let sum_val=null
// let ques_key=[]
// control.questions_group.forEach(ques_obj=>{
// ques_obj.questions.map(ques=>{
// // console.log(ques)
// if(ques.question_key == 'name_board_seen'){
// ques_key.push(ques)
// }
// })
// })
// if(ques_key.length >= 3){
// sum_val=true
// }
// else{
// sum_val=false
// }
// return sum_val }());`
// let val= eval(submitProperty.expression);
let val= eval(exp1);
console.log(val)
return val
}
} }

View File

@ -74,12 +74,12 @@ const salesmenu = [
type:'link', type:'link',
icon:'work', icon:'work',
}, },
{ // {
state:'credit_pd', // state:'credit_pd',
name:'Credit PD - Internal', // name:'Credit PD - Internal',
type:'link', // type:'link',
icon:'list' // icon:'list'
} // }
// { // {
// state:'quality_check_discussion', // state:'quality_check_discussion',
// name:'Quality Check', // name:'Quality Check',
@ -102,9 +102,9 @@ export class HorizontalMenuItems {
salesgetAll(): Menu[] { salesgetAll(): Menu[] {
let filtered_sales_menu = salesmenu let filtered_sales_menu = salesmenu
let user_type= localStorage.getItem('len_user_role') let user_type= localStorage.getItem('len_user_role')
if(user_type != 'credit'){ // if(user_type != 'credit'){
filtered_sales_menu = salesmenu.filter(vv=>vv.state != 'credit_pd') // filtered_sales_menu = salesmenu.filter(vv=>vv.state != 'credit_pd')
} // }
return filtered_sales_menu; return filtered_sales_menu;
} }
add(menu: Menu) { add(menu: Menu) {

View File

@ -156,12 +156,12 @@ const salesMenus: Menu[]= [
type:'link', type:'link',
icon:'work', icon:'work',
}, },
{ // {
state:'credit_pd', // state:'credit_pd',
name:'Credit PD - Internal', // name:'Credit PD - Internal',
type:'link', // type:'link',
icon:'list' // icon:'list'
} // }
// { // {
// state:'quality_check_discussion', // state:'quality_check_discussion',
// name:'Quality Check', // name:'Quality Check',
@ -184,9 +184,9 @@ export class MenuItems {
salesgetAll(): Menu[] { salesgetAll(): Menu[] {
let filtered_sales_menu = salesMenus let filtered_sales_menu = salesMenus
let user_type= localStorage.getItem('len_user_role') let user_type= localStorage.getItem('len_user_role')
if(user_type != 'credit'){ // if(user_type != 'credit'){
filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd') // filtered_sales_menu = salesMenus.filter(vv=>vv.state != 'credit_pd')
} // }
return filtered_sales_menu; return filtered_sales_menu;
} }

View File

@ -4,6 +4,7 @@
"onsubmit":null, "onsubmit":null,
"questions":[ "questions":[
{ {
"question":[{
"question":"Borrower Type", "question":"Borrower Type",
"question_key":"borrower_type", "question_key":"borrower_type",
"type":"1", "type":"1",
@ -202,5 +203,9 @@
} }
] ]
} }
],
"is_repeatable":"1",
"group_key":"borrower_details",
"group_title":"Borrower Details"}
] ]
} }

View File

@ -0,0 +1,679 @@
{
"section_id":"10",
"section_name":"Financial Information",
"onsubmit":[
{
"expression":"(function (){let sum_val=null;let ques_key=[];control.questions_group.forEach(ques_obj=>{ques_obj.questions.map(ques=>{if(ques.question_key == submitProperty.key_name){ques_key.push(ques.answer_value)}})});console.log('none',ques_key);return new Set(ques_key).size === ques_key.length}())",
"group_key":"financial_info",
"key_name":"fy",
"msg":"Financial Year already entered earlier"
}
],
"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":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]*",
"message":"alphabets 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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Fin Yr Required",
"value":null
}
]
},
{
"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",
"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"
}
],
"is_repeatable":null,
"field_type":"numtoword",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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",
"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",
"value_keys":[
"net_profit_sales_percent"
],
"insert_control":"netprofit_py_percent"
}
],
"is_repeatable":null,
"field_type":"numtoword",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"question":"Net Profit or (Net Loss) to Sales % ",
"question_key":"net_profit_sales_percent",
"type":"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",
"value_keys":[
"net_profit_sales_percent"
],
"insert_control":"netprofit_py_percent"
}
],
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"% (↑ /↓) in Sales over PY",
"question_key":"sales_py",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"% (↑ /↓) in Net Profit over PY",
"question_key":"netprofit_py",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"% (↑ /↓) in Net Profit % over PY",
"question_key":"netprofit_py_percent",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Broken Period starting from (Month)",
"question_key":"broken_period_from_month",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"question":"Broken Period starting to (Month)",
"question_key":"broken_period_to_month",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"question":"Sales / Revenue (Rs) for the broken period of the Current FY as per applicant",
"question_key":"broken_period_sales_amount",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"question":"Net Profit / (Net Loss) (Rs) for the broken period of the Current FY as per applicant ",
"question_key":"broken_period_netprofit_amount",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"question":"% of Net Profit / (Net Loss) over Sales for the broken period of the Current FY as per applicant ",
"question_key":"broken_period_netprofit_percent",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"([0-9]*)",
"message":"Numeric only",
"value":null
}
]
},
{
"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":"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"
}
],
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_any_other_working_captial_facility",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}
]
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_key":"financial_info",
"group_title":"Financial Information"
}
]
}

View File

@ -0,0 +1,396 @@
{
"section_id":"11",
"section_name":"Supplier details",
"onsubmit":null,
"questions":[
{
"question":"Is the Supplier information available?",
"question_key":"supplier_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"supplier_info_available",
"expression":"(String('supplier_info_available') == String('No'))",
"value_keys":[
"supplier_info_available"
],
"questions":[
{ "question":"Reason",
"question_key":"supplier_not_available_reason",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ] },
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"supplier_info_available",
"expression":"(String('supplier_info_available') == String('Yes'))",
"value_keys":[
"supplier_info_available"
],
"questions":[
{
"question":[{
"question":"Raw Material Name/ Trading Product Name/ Service Name",
"question_key":"provider_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Supplier Name",
"question_key":"supplier_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person name",
"question_key":"contact_person_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person Designation",
"question_key":"contact_person_designation",
"type":"8",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMPANYRELATIONSHIPS"
},
"fields":[
"company_relationship_id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person Mobile Number",
"question_key":"contact_person_mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10,12}",
"message":"Mobile number should be 10-12 digit",
"value":null
}
]
},
{
"question":"STD Code",
"sub_title":"Contact Person Landline number",
"question_key":"person_stdcode",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{3}",
"message":"Minimum 3 digit required",
"value":null
}
]
},
{
"question":"Contact Person Landline number",
"question_key":"person_landline",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{6}",
"message":"Minimum 6 digit required",
"value":null
}
]
},
{
"question":"Payment Terms",
"question_key":"payment_type",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PAYMENTMODE"
},
"fields":[
"id",
"name"
]
},
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"payment_type",
"expression":"(String('payment_type') == String('3'))",
"value_keys":[
"payment_type"
],
"questions":[
{
"question":"No. of credit period provided by supplier",
"question_key":"credit_period_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"What % of total purchases are done on credit?",
"question_key":"credit_total_purchase",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"max",
"isactive":"1",
"validator":"100",
"message":"Percentage should lower or equal to '100'",
"value":null
}
]
}
]}]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Payment Mode",
"question_key":"payment_mode",
"type":"3",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"supplier_info_available",
"answers":[
{
"answer_id":"Payment made in Cash",
"answer":"Payment made in Cash"
},
{
"answer_id":"Payment made through Banking channels",
"answer":"Payment made through Banking channels"
},
{
"answer_id":"Payment made through Cash and Banking channels",
"answer":"Payment made through Cash and Banking channels"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Supplier Details",
"group_key":"supplier_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,396 @@
{
"section_id":"12",
"section_name":"Clients details",
"onsubmit":null,
"questions":[
{
"question":"Is the Client information available?",
"question_key":"client_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"client_info_available",
"expression":"(String('client_info_available') == String('No'))",
"value_keys":[
"client_info_available"
],
"questions":[
{ "question":"Reason",
"question_key":"client_not_available_reason",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ] },
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"client_info_available",
"expression":"(String('client_info_available') == String('Yes'))",
"value_keys":[
"client_info_available"
],
"questions":[
{
"question":[{
"question":"Trading Product/Service/Manufacturing Product name",
"question_key":"provider_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Client Name",
"question_key":"client_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person name",
"question_key":"contact_person_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person Designation",
"question_key":"contact_person_designation",
"type":"8",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"COMPANYRELATIONSHIPS"
},
"fields":[
"company_relationship_id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Contact Person Mobile Number",
"question_key":"contact_person_mobile_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{10,12}",
"message":"Mobile number should be 10-12 digit",
"value":null
}
]
},
{
"question":"STD Code",
"sub_title":"Contact Person Landline number",
"question_key":"person_stdcode",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{3}",
"message":"Minimum 3 digit required",
"value":null
}
]
},
{
"question":"Contact Person Landline number",
"question_key":"person_landline",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{6}",
"message":"Minimum 6 digit required",
"value":null
}
]
},
{
"question":"Payment Terms",
"question_key":"payment_type",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PAYMENTMODE"
},
"fields":[
"id",
"name"
]
},
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"payment_type",
"expression":"(String('payment_type') == String('3'))",
"value_keys":[
"payment_type"
],
"questions":[
{
"question":"No. of credit period provided by client",
"question_key":"credit_period_no",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"What % of total purchases are done on credit?",
"question_key":"credit_total_purchase",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
},
{
"name":"max",
"isactive":"1",
"validator":"100",
"message":"Percentage should lower or equal to '100'",
"value":null
}
]
}
]}]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"payment_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Payment Mode",
"question_key":"payment_mode",
"type":"3",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"client_info_available",
"answers":[
{
"answer_id":"Payment made in Cash",
"answer":"Payment made in Cash"
},
{
"answer_id":"Payment made through Banking channels",
"answer":"Payment made through Banking channels"
},
{
"answer_id":"Payment made through Cash and Banking channels",
"answer":"Payment made through Cash and Banking channels"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Client Details",
"group_key":"client_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,188 @@
{
"section_id":"13",
"section_name":"Stock details",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Name of trading goods/manufacturing goods (raw material/finished goods)/ Service Provided",
"question_key":"provider_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z0-9]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Stock",
"question_key":"provider_observed",
"type":"3",
"api_properties":null,
"answers":[
{
"answer":"Add Stock Details",
"answer_id":"yes"
},
{
"answer":"No Stock Observed",
"answer_id":"no"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties": [ {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"provider_observed",
"expression":"(String('provider_observed') === String('yes'))",
"value_keys":[
"provider_observed"
],
"questions":[
{
"question":"Estimated Quantity",
"question_key":"estimated_quantity",
"type":"1",
"field_width":"100",
"field_type":"num",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"provider_observed",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ,
{
"question":"UOM",
"question_key":"estimated_uom",
"type":"3",
"field_width":"100",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"UOM"
},
"fields":[
"uom_id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"provider_observed",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ,
{
"question":"Estimated value of stock observed",
"question_key":"estimated_stock_value",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"provider_observed",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
] } ] }]
}
],
"is_repeatable":"1",
"group_title":"Stock details",
"group_key":"stock_details"
},
{
"question":"Is the stock of finished goods observed, sufficient considering the size of operations",
"question_key":"estimated_uom",
"type":"3",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"provider_observed",
"answers":[
{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
},
{
"answer":"Stock not required to be maintained",
"answer_id":"not applicable"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,104 @@
{
"section_id":"14",
"section_name":"Future Plans & Business Environments",
"onsubmit":null,
"questions":[
{
"question":"USP of the business- How is applicant's business different from others in the same line of business",
"question_key":"usp_of_business",
"type":"1",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Future plans for business expansion",
"question_key":"future_business_expansion",
"type":"1",
"field_type":"string",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Key competitors",
"question_key":"key_competitors",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Sucession plan- who will look after the business after applicant retire/are unable to run business due to any reason",
"question_key":"sucession_plan",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Brief of other group concerns/Business run by the applicants",
"question_key":"other_group_business_applicants",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,183 @@
{
"section_id":"15",
"section_name":"Existing Loan Obligations",
"onsubmit":null,
"questions":[
{
"question":"Loan type",
"question_key":"loan_type",
"type":"1",
"field_width":"100",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Loan amount",
"question_key":"loan_amount",
"type":"1",
"field_type":"num",
"field_width":"100",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Lender name",
"question_key":"lender_name",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Loan taken by",
"question_key":"loan_taken_by",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Instalment Amount",
"question_key":"instalment_amount",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Installment frequency",
"question_key":"instalment_frequency",
"type":"1",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Original tenure in months",
"question_key":"original_tenure_months",
"type":"1",
"field_width":"100",
"field_type":"num",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Current balance tenure in months",
"question_key":"current_tenure_months",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Elapsed tenure in mths",
"question_key":"elapsed_tenure_months",
"type":"1",
"field_width":"45",
"field_type":"num",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,122 @@
{
"section_id":"16",
"section_name":"Family Members Involved in Business",
"onsubmit":null,
"questions":[
{
"question":[
{
"question":"Name",
"question_key":"member_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Relationship",
"question_key":"relationship",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Share value Required",
"value":null
}
]
},
{
"question":"Relation to Individual Stakeholders",
"question_key":"stakeholder_relation",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
}
]
},
{
"question":"Relation to Company / Firm",
"question_key":"company_relation",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
}
]
},
{
"question":"Started Biz (Yes / No)",
"question_key":"started_biz",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Family Members Involved in Business",
"group_key":"family_details"
}
]
}

View File

@ -0,0 +1,271 @@
{
"section_id":"18",
"section_name":"Neighbourhood Details",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Neighbour name",
"question_key":"neighbourhood_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Do you know about the applicant or their business?",
"question_key":"do_know",
"type":"3",
"api_properties":null,
"answers":[
{
"answer":"Yes",
"answer_id":"yes"
},
{
"answer":"No",
"answer_id":"no"
}
],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"As per you how long has this business been in operation",
"question_key":"know_business_operation",
"place_holder":"Enter the text",
"type":"2",
"api_properties":null,
"answers":[
{
"answer":"Know",
"answer_id":"yes"
},
{
"answer":"Do not know",
"answer_id":"no"
}
],
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties": [ {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"know_business_operation",
"expression":"(String('know_business_operation') === String('yes'))",
"value_keys":[
"know_business_operation"
],
"questions":[
{
"question":"Years",
"question_key":"how_long_do_know_in_year",
"type":"1",
"field_width":"100",
"field_type":"num",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_business_operation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ,
{
"question":"Months",
"question_key":"how_long_do_know_in_month",
"type":"1",
"field_type":"num",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_business_operation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
] } ] }]
},
{
"question":"Who is the owner of organisation?",
"question_key":"know_organisation_owner",
"type":"2",
"api_properties":null,
"answers":[
{
"answer":"Know",
"answer_id":"yes"
},
{
"answer":"Do not know",
"answer_id":"no"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties": [ {
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"know_organisation_owner",
"expression":"(String('know_organisation_owner') === String('yes'))",
"value_keys":[
"know_organisation_owner"
],
"questions":[
{
"question":"Who is the owner of the organisation",
"question_key":"organisation_owner",
"type":"4",
"field_width":"100",
"field_type":"num",
"api_properties": {
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"know_organisation_owner",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
] } ] }]
}
],
"is_repeatable":"1",
"group_title":"Neighbourhood Details",
"group_key":"neighbourhood_list"
},
{
"question":"Status of the neighbour check as per PD officer",
"question_key":"neighbourhood_status",
"type":"3",
"api_properties":null,
"answers":[
{
"answer":"Select",
"answer_id":""
},
{
"answer":"Positive",
"answer_id":"Positive"
},
{
"answer":"Negative",
"answer_id":"Negative"
},
{
"answer":"Could Not Verify",
"answer_id":"Could Not Verify"
}
],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Remarks",
"question_key":"neighbourhood_remarks",
"type":"7",
"placeholder":"Enter the remarks",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,53 @@
{
"section_id":"19",
"section_name":"Credit manager specific queries",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Question",
"question_key":"question",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Answer",
"question_key":"answer",
"place_holder":"Enter the answer here",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Query",
"group_key":"cm_queries"
}
]
}

View File

@ -0,0 +1,215 @@
{
"section_id":"20",
"section_name":"Final remarks",
"onsubmit":null,
"questions":[
{
"question":"Customer Behaviour",
"question_key":"customer_behaviour",
"type":"3",
"field_width":"45",
"answers":null,
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"CUSTOMERBEHAVIOUR"
},
"fields":[
"customer_behaviour_id",
"description"
]
},
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"customer_behaviour",
"expression":"(String('customer_behaviour') == String('1'))",
"value_keys":[
"customer_behaviour"
],
"questions":[
{ "question":"Specify Customer behaviour",
"question_key":"customer_behaviour_other",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"customer_behaviour",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] }
]}] ,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is the location of the business suited to the nature of the business provided?",
"question_key":"business_location_suited",
"type":"3",
"field_width":"45",
"onchange_properties":null,
"api_properties":null,
"answers":[
{
"answer":"Well Suited",
"answer_id":"Well Suited"
},
{
"answer":"Fairly suited",
"answer_id":"Fairly suited"
},
{
"answer":"Not suited",
"answer_id":"Not suited"
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"PD officer recommendation (Positive/negative/ refer to credit)",
"question_key":"pd_officer_recommendation",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"PDOFFICERRECOMMENDATIONS"
},
"fields":[
"pdofficer_recommendation_id",
"pdofficer_recommendation"
]
},
"answers":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"pd_officer_recommendation",
"expression":"(String('pd_officer_recommendation') == String('1'))",
"value_keys":[
"pd_officer_recommendation"
],
"questions":[
{ "question":"Specify PD Officer Recommendation",
"question_key":"pd_officer_recommendation_other",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"pd_officer_recommendation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
} ] } ,
{
"insert_index":"pd_officer_recommendation",
"expression":"(String('pd_officer_recommendation') != String('1')) && (String('pdofficer_recommendation') != String(''))",
"value_keys":[
"pd_officer_recommendation"
],
"questions":[
{
"question":[{
"question":"Reasons for marking PD status as Positive/negative/ refer to credit",
"question_key":"reason",
"type":"1",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"pd_officer_recommendation",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Remarks",
"group_key":"pd_officer_recommendation_remarks"
} ] }
] }],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Common Remarks",
"question_key":"final_form_remarks",
"place_holder":"Enter the remarks here",
"type":"7",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}

View File

@ -308,9 +308,11 @@
"api_properties":null, "api_properties":null,
"answers":null, "answers":null,
"onchange_properties":[ "onchange_properties":[
{ {
"purpose":"FORM_CTRL",
"form_controls":[ {
"insert_index":"construction_status", "insert_index":"construction_status",
"expression":"(String('construction_status') == String('Under Construction'))", "expression":"(String('construction_status') != String(''))",
"value_keys":[ "value_keys":[
"construction_status" "construction_status"
], ],
@ -339,7 +341,8 @@
] ]
} }
] ]
} }]
}
], ],
"is_repeatable":null, "is_repeatable":null,
"validations":[ "validations":[

View File

@ -0,0 +1,139 @@
{
"section_id":"4",
"section_name":"General Business Information",
"onsubmit":null,
"questions":[
{
"question":"Type of Business Entity",
"question_key":"business_entity_type",
"type":"1",
"field_width":"45",
"answers":null,
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Type of Business activities",
"question_key":"select_business_activity_type",
"type":"1",
"field_width":"45",
"onchange_properties":null,
"api_properties":null,
"answers":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Area of Sale",
"question_key":"area_of_sale",
"type":"3",
"field_width":"45",
"api_properties":null,
"answers":[{
"answer":"Within India",
"answer_id":"Within India"
},
{
"answer":"Export",
"answer_id":"Export"
},
{
"answer":"Both",
"answer_id":"Both"
}],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is the business seasonal (Yes / No)",
"question_key":"seasonality",
"type":"2",
"field_width":"45",
"api_properties":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},{
"answer":"No",
"answer_id":"No"
}],
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"seasonality",
"expression":"(String('seasonality') == String('Yes'))",
"value_keys":[
"seasonality"
],
"questions":[
{
"question_key":"low_sale_month",
"question":"Months in which sales/services is low?",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"parent_question_key":"seasonality",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}
]
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,248 @@
{
"section_id":"5",
"section_name":"Key Stakeholders in Business",
"onsubmit":[
{
"key_name":"share_holding",
"expression":"(function () {let sum_val=null;let ques_key=[];control.questions_group.forEach(ques_obj=>{ques_obj.questions.map(ques=>{if(ques.question_key == 'share_holding'){ques_key.push(ques)}})});if(ques_key.length > 0){sum_val= ques_key.map(val=>val.answer_value).reduce((tot,val)=>{return parseInt(tot)+parseInt(val)})}return sum_val<=100}())",
"msg":"Sum of shareholding should be equal to 100"
}
],
"questions":[
{
"question":[
{
"question":"Name of key Stakeholder",
"question_key":"stakeholder_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Name Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Share Holding (%)",
"question_key":"share_holding",
"place_holder":"Enter number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Share value Required",
"value":null
},
{
"name":"max",
"validator":"100",
"isactive":"1",
"message":"Number must be less than 100",
"value":null
}
]
},
{
"question":"Vintage in Current Business",
"question_key":"vintage_in_current_biz",
"place_holder":"Enter in years",
"type":"1",
"api_properties":null,
"answers":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Current vintage Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[0-9]{0,3}",
"message":"Year should be 3 digit",
"value":null
}
],
"onchange_properties":[
{
"purpose":"validations",
"validations":[
{
"name":"max",
"isactive":"1",
"validator":"",
"message":"should be less or equal to Total Work Exp",
"value":"total_work_exp",
"validation_to":null,
"value_keys":null
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_work_exp",
"expression":"(total_work_exp > vintage_in_current_biz)",
"value_keys":[
"total_work_exp",
"vintage_in_current_biz"
],
"questions":[
{
"question_key":"previous_experience_details",
"question":"Previous Experience Details",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"parent_question_key":"vintage_in_current_biz",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
{
"question":"Total Work Exp",
"question_key":"total_work_exp",
"place_holder":"Enter in years",
"type":"1",
"api_properties":null,
"answers":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Total experience Required",
"value":null
},
{
"name":"maxLength",
"isactive":"1",
"validator":"2",
"message":"Year should be two digit",
"value":null
}
],
"onchange_properties":[
{
"purpose":"validations",
"validations":[
{
"name":"min",
"isactive":"1",
"validator":"",
"message":"should be greater or equal to current work exp",
"value":"vintage_in_current_biz",
"validation_to":null,
"value_keys":null
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"total_work_exp",
"expression":"(total_work_exp > vintage_in_current_biz)",
"value_keys":[
"total_work_exp",
"vintage_in_current_biz"
],
"questions":[
{
"question":"Previous Experience Details",
"question_key":"previous_experience_details",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"parent_question_key":"total_work_exp",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Previous Experience Required",
"value":null
}
]
}
]
}
]
}
]
},
{
"question":"Started Business",
"question_key":"started_biz",
"type":"1",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Started Business Required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Details of Key Stakeholders in the Business",
"group_key":"key_stakeholders"
}
]
}

View File

@ -0,0 +1,88 @@
{
"section_id":"6",
"section_name":"Key Products and Business Contribution",
"onsubmit":[],
"questions":[
{
"question":[
{
"question":"Key Product Name",
"question_key":"product_name",
"place_holder":"Enter text",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"pattern",
"isactive":"1",
"validator":"[A-Za-z ]*",
"message":"alphabets only ",
"value":null
}
]
},
{
"question":"Contribution to Business of the Product (%)",
"question_key":"contribution_business_product",
"place_holder":"Enter number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
},
{
"name":"max",
"validator":"100",
"isactive":"1",
"message":"Number must be less than 100",
"value":null
}
]
},
{
"question":"Business Process Brief",
"question_key":"business_process",
"place_holder":"Enter the text",
"type":"1",
"api_properties":null,
"answers":null,
"is_repeatable":null,
"field_type":"string",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
],
"onchange_properties":null
}
],
"is_repeatable":"1",
"group_title":"Details of Key Stakeholders in the Business",
"group_key":"key_stakeholders"
}
]
}

View File

@ -0,0 +1,138 @@
{
"section_id":"7",
"section_name":"Employee Strength",
"onsubmit":[],
"questions":[
{
"question":"Permanent Employees",
"sub_title":"No of Employees (As per person met)",
"question_key":"permanant_employees_person_met",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_person_met",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Permanent Employees",
"sub_title":"No of Employees (Sighted by Credit Manager)",
"question_key":"permanant_employees_cm",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_cm",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"num",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Permanent Employees",
"sub_title":"Approximate Salary Paid (Rs Per Month)",
"question_key":"permanant_employees_salary",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
},
{
"question":"Temporary Employees",
"question_key":"temporary_employees_salary",
"place_holder":"Enter the number",
"type":"1",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"field_type":"numtoword",
"field_width":"45",
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,677 @@
{
"section_id":"8",
"section_name":"Business Assets",
"onsubmit":null,
"questions":[
{
"question":" Is this the business address?",
"question_key":"is_business_address",
"type":"2",
"field_width":"100",
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"is_business_address",
"expression":"(String('is_business_address') == String('Yes'))",
"value_keys":[
"is_business_address"
],
"questions":[
{
"question":"Year",
"sub_title":"How Long has business been operated from visited premises?",
"question_key":"business_years",
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Month",
"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":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Was any business activities seen during visit?",
"question_key":"business_is_pd_visited",
"place_holder":"",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_is_pd_visited",
"expression":"(String('business_is_pd_visited') == String('Yes')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_is_pd_visited",
"is_business_address"
],
"questions":[
{
"question":"Remarks",
"question_key":"business_pd_visited_remark",
"place_holder":"",
"field_type":"string",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_is_pd_visited",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]}],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Ownership type",
"question_key":"business_ownership_type",
"place_holder":"",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Owned')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_ownership_type",
"is_business_address"
],
"questions":[
{
"question":"Approximate Market value",
"question_key":"business_approximate_market_value",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Factory owned by",
"question_key":"business_name_of_the_owner",
"type":"3",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Age of asset in years",
"question_key":"business_vintage",
"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":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Purchase year",
"question_key":"business_purchase_year",
"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":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
,
{
"question":"Is there a Loan Existing against this asset",
"question_key":"business_emi",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":[
{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Rented')) && (String('is_business_address') == String('Yes'))",
"value_keys":[
"business_ownership_type",
"is_business_address"
],
"questions":[
{
"question":"Monthly Rent Amount",
"question_key":"business_monthly_rented_amt",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[
{
"answer":"Owned",
"answer_id":"Owned"
},
{
"answer":"Rented",
"answer_id":"Rented"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}
],
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is there any other business asset available?",
"question_key":"asset_info_available",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":[{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"asset_info_available",
"expression":"(String('asset_info_available') == String('Yes'))",
"value_keys":[
"asset_info_available"
],
"questions":[
{
"question":[{
"question":"Asset Type",
"question_key":"business_assets_mode",
"type":"3",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ASSETTYPE"
},
"fields":[
"id",
"name"
]
},
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Description",
"question_key":"other_asset_description",
"type":"7",
"field_width":"100",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Ownership type",
"question_key":"business_ownership_type",
"place_holder":"",
"type":"2",
"field_width":"100",
"api_properties":null,
"onchange_properties":[
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Owned'))",
"value_keys":[
"business_ownership_type"
],
"questions":[
{
"question":"Approximate Market value",
"question_key":"business_approximate_market_value",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Factory owned by",
"question_key":"business_name_of_the_owner",
"type":"3",
"field_width":"45",
"api_properties":
{
"purpose":"answer_options_local",
"master_name":"pd_applicants",
"fields":["pd_co_applicant_id","applicant_name"]
},
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Age of asset in years",
"question_key":"business_vintage",
"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":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Purchase year",
"question_key":"business_purchase_year",
"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":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
,
{
"question":"Is there a Loan Existing against this asset",
"question_key":"business_emi",
"type":"2",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":[
{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
},
{
"purpose":"FORM_CTRL",
"form_controls":[
{
"insert_index":"business_ownership_type",
"expression":"(String('business_ownership_type') == String('Rented'))",
"value_keys":[
"business_ownership_type"
],
"questions":[
{
"question":"Monthly Rent Amount",
"question_key":"business_monthly_rented_amt",
"place_holder":"",
"field_type":"numtoword",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"business_ownership_type",
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}
]
}
],
"is_repeatable":null,
"is_subfield":"1",
"parent_question_key":"is_business_address",
"answers":[
{
"answer":"Owned",
"answer_id":"Owned"
},
{
"answer":"Rented",
"answer_id":"Rented"
}
],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}],
"is_repeatable":"1",
"group_title":"Business Asset Details",
"group_key":"business_assets_details"
}
]
}
]
}],
"is_repeatable":null,
"answers":[{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}],
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
]
}

View File

@ -0,0 +1,163 @@
{
"section_id":"9",
"section_name":"Business and Personal Banking Details",
"onsubmit":[],
"questions":[
{
"question":[
{
"question": "Business Account holder name",
"question_key": "applicant_name",
"type": "1",
"api_properties": {
"purpose": "answer_options_local",
"master_name": "pd_applicants",
"fields": [
"pd_co_applicant_id",
"applicant_name"
]
},
"answers": null,
"onchange_properties": null,
"is_repeatable": null,
"field_type": "string",
"validations": [
{
"name": "required",
"isactive": "1",
"validator": "Validators.required",
"message": "Required",
"value": null
}
]
},
{
"question":"Bank Name",
"question_key":"bank_name",
"type":"1",
"field_width":"45",
"api_properties":null,
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Business Account type",
"question_key":"account_type",
"type":"1",
"field_width":"45",
"api_properties":{
"api":"getListOfMaster",
"api_method":"POST",
"params":{
"master_name":"ACCOUNTTYPE"
},
"fields":[
"bt_lender_list_id",
"lender_name"
]
},
"answers":null,
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Is this the main business account",
"question_key":"is_main",
"type":"1",
"field_width":"45",
"api_properties":null,
"answers":[
{
"answer":"Select",
"answer_id":""
},
{
"answer":"Yes",
"answer_id":"Yes"
},
{
"answer":"No",
"answer_id":"No"
}
],
"onchange_properties":null,
"is_repeatable":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field Required",
"value":null
}
]
},
{
"question":"Year",
"sub_title":"Approximate vintage of the account",
"question_key":"vintage_year",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
},
{
"question":"Month",
"question_key":"vintage_month",
"place_holder":"",
"field_type":"num",
"type":"1",
"field_width":"45",
"api_properties":null,
"onchange_properties":null,
"is_repeatable":null,
"answers":null,
"validations":[
{
"name":"required",
"isactive":"1",
"validator":"Validators.required",
"message":"Field required",
"value":null
}
]
}
],
"is_repeatable":"1",
"group_title":"Details of Key Stakeholders in the Business",
"group_key":"banking_details"
}
]
}