diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index f8197bd..a7e29c0 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -65,12 +65,17 @@ - + Select {{person.user_name}} + + Lender Sales Person + + Required + Select diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 5ebb4be..4f94394 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -162,6 +162,7 @@ export class AddPdComponent implements OnInit, OnDestroy { pd_branch_id: [null], lender_applicant_id: [null, Validators.compose([Validators.required])], lender_sales_person:[null], + mwise_sales_person:[null], lender_credit_person:[{value:this.lenderShortName != 'MWISE' ? this.userDetails.userid : '',disabled:false} || ''], imgc_fin_institute:[null], // lender_contact_person: [null], @@ -747,6 +748,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "lender_applicant_id": formValue.lender_applicant_id, "pd_branch_id": formValue.pd_branch_id, "lender_sales_person":formValue.lender_sales_person, + "mwise_sales_person":formValue.mwise_sales_person, "lender_credit_person":this.lenderShortName != 'MWISE' ? this._PDtriggerForm.controls['lender_credit_person'].value : '', "imgc_fin_institute":formValue.imgc_fin_institute, // "pd_contact_person": formValue.lender_contact_person, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts index 680dd93..5816e9e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/list-pd.component.ts @@ -58,14 +58,24 @@ export class ListPdComponent implements OnInit, OnDestroy { localStorage.setItem('len_user_role',role_name); this.user_role_name=role_name }) + if(localStorage.getItem('LocalSetEntity')) { + let entity_id = localStorage.getItem('LocalSetEntity') + if(entity_id) { + this.allTabC.loadPDDetails(); + } + } + else{ // for Listening the local storage LocalSetEntity this.userService.messageSubject.subscribe(rr=>{ console.log(rr) let entity_id = localStorage.getItem('LocalSetEntity') if(entity_id) { this.allTabC.loadPDDetails(); + this.userService.messageSubject.unsubscribe() } }) + } + } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts index 68f300c..f32feb0 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/dynamic-question-template/dynamic-question-template.component.ts @@ -167,7 +167,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { } //FOR API CALLS // console.log(sec_control.value); - if(sec_control.onchange_properties != null && sec_control.onchange_properties.length >0){ + if(sec_control && sec_control.onchange_properties != null && sec_control.onchange_properties.length >0){ let onChangeProperties_value=sec_control.onchange_properties @@ -304,7 +304,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { // this.creteNewField(onChangeProperty,this.quesAnsForm,sec_control,sec_index) // } } - if(onChangeProperty.purpose == 'answer_value') { + if(onChangeProperty.purpose == 'answer_value' || onChangeProperty.purpose == 'question_label') { this.setModifiedValuetoControl(onChangeProperty,this.formGroupN,sec_index) } // for calculation field from multiple arr values @@ -335,7 +335,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { } 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] : '' + let control_value = formArray.getRawValue()[value_index] ? formArray.getRawValue()[value_index][value] : '' if(control_value) { expression_value = expression_value.split(value+'['+index_str+']').join(control_value) } @@ -371,9 +371,9 @@ export class DynamicQuestionTemplateComponent implements OnInit { // curr_obj.value_keys.forEach(val=>{ for(let val of curr_obj.value_keys) { let control_value - control_value =form_control_obj.value[val] + control_value =form_control_obj.getRawValue()[val] if(control_value) { - expression_value = expression_value.replace(val,control_value) + expression_value = expression_value.split(val).join(control_value) } else{ return; @@ -384,11 +384,22 @@ export class DynamicQuestionTemplateComponent implements OnInit { 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(typeof(calc_exp) == 'number'){ + // calc_exp = calc_exp.toFixed(2) + // } if(curr_obj.insert_control) { + // FOR SETTING THE ANSWER TO OTHER OR SAME FIELD + if(curr_obj.purpose == 'answer_value') { form_control_obj.controls[curr_obj.insert_control].setValue(calc_exp) + } + // FOR SETTING THE Question Label TO OTHER OR SAME Question + if(curr_obj.purpose == 'question_label') { + let curr_question_obj = this.whole_json.filter(val=>val.question_key == curr_obj.insert_control) + if(curr_question_obj && curr_question_obj.length > 0) { + curr_question_obj[0].question = calc_exp + } + + } } } } @@ -413,7 +424,7 @@ export class DynamicQuestionTemplateComponent implements OnInit { // if(control_value_obj.answer_value == ''){ // control_value_obj.answer_value =0 // } - expression_value=expression_value.replace(res,control_value_obj) + expression_value=expression_value.split(res).join(control_value_obj) } }) console.log("Expression",expression_value) @@ -544,12 +555,12 @@ export class DynamicQuestionTemplateComponent implements OnInit { let expression_value=validation_obj.value validation_obj.value_keys.forEach(res=>{ - let validator_value_obj=this.formGroupN.value[res] - if(validator_value_obj){ - expression_value=expression_value.replace(res,validator_value_obj) - } + let validator_value_obj=group_ques.value[res] + // if(validator_value_obj){ + expression_value=expression_value.split(res).join(validator_value_obj) + // } }) - + console.log("Validation expresseion final ",expression_value) // validation_obj.value=expression_value validation_obj.validator=eval(expression_value) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts index 2efad49..0440b4f 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dynamic-form/ques-form/ques-form.service.ts @@ -371,6 +371,11 @@ export class QuesFormService { } } + // FOR DISABLE THE CONTROL + if(data.hasOwnProperty('is_disabled') && data.is_disabled == '1') { + curr_control.controls[data.question_key].disable(); + } + //FOR SETTING THE VALIDATORS this.settingArrayofValidators(data,curr_control,curr_index) this.setAnswerOptionsorValue(data,curr_control) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.html index d5cd6c0..cc58df3 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.html @@ -2,5 +2,5 @@ camera_alt add_a_photo - + \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts index 454515d..d67b5fc 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/image-capture/capture-btn/capture-btn.component.ts @@ -1,4 +1,5 @@ -import { Component, OnInit, Output, EventEmitter, Input } from '@angular/core'; +import { Component, OnInit, Output, EventEmitter, Input, ElementRef, ViewChild } from '@angular/core'; +import { CameraService } from 'app/personal-discussion/pd-service/camera.service'; import { Ng2ImgMaxService } from 'ng2-img-max'; @Component({ @@ -7,15 +8,16 @@ import { Ng2ImgMaxService } from 'ng2-img-max'; styleUrls: ['./capture-btn.component.scss'] }) export class CaptureBtnComponent implements OnInit { - + @ViewChild('input_file') fileBtn :ElementRef @Input() addMoreBtn; @Output() imageDataEmitter = new EventEmitter - constructor(private ng2ImgMax:Ng2ImgMaxService) { } + constructor(private ng2ImgMax:Ng2ImgMaxService,private cameraService:CameraService) { } ngOnInit(): void { console.log(this.addMoreBtn) } capturedImage(event){ + // event.stopPropagation() console.log(event); let imageData= event.target.files[0] this.ng2ImgMax.resizeImage(imageData, 450, 650).subscribe( @@ -30,7 +32,19 @@ export class CaptureBtnComponent implements OnInit { } capture(event){ event.preventDefault(); - let element:HTMLElement = document.getElementById('input-file') as HTMLElement - element.click(); + this.cameraService.getPosition().then(geoCords=>{ + let geoCoordinates + if(geoCords != 'error') { + geoCoordinates = geoCords + // let element:HTMLElement = document.getElementById('input-file') as HTMLElement + // element.click(); + console.log(this.fileBtn) + this.fileBtn.nativeElement.click() + console.log("After Click") + } + else{ + alert("Location is OFF. Make sure Location is turned ON in your device before capturing images") + } + }) } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index a5f401b..1dc2149 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -163,7 +163,7 @@
- +
@@ -204,7 +204,7 @@
- +
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/camera.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/camera.service.ts index c6ca863..c8ec40b 100644 --- a/ng6-seed/src/app/personal-discussion/pd-service/camera.service.ts +++ b/ng6-seed/src/app/personal-discussion/pd-service/camera.service.ts @@ -7,6 +7,7 @@ import * as watermark from 'watermarkjs'; }) export class CameraService { pipe = new DatePipe('en-US') + isLocationAlertShowed: boolean = false; constructor() { setTimeout(()=>{ this.getPosition().then(res=>{ @@ -96,7 +97,7 @@ export class CameraService { { return new Promise((resolve, reject) => { - navigator.geolocation.getCurrentPosition(resp => { + return navigator.geolocation.getCurrentPosition(resp => { console.log("Geo",resp.coords); let latLong:string = resp.coords.latitude+', '+resp.coords.longitude // resolve({lng: resp.coords.longitude, lat: resp.coords.latitude}); @@ -104,9 +105,55 @@ export class CameraService { }, err => { console.log("Error Getting Geolocation",err) + if(err.code == 1) { + // alert("Make sure Location ") + // let is_mobile = this.getMobileOperatingSystem() + // console.log("isMobile",is_mobile); + if( !this.isLocationAlertShowed) { + this.isLocationAlertShowed = true + // alert("Make sure Location is turned ON in your device before capturing images"); + } + } resolve('error'); - }); + },{enableHighAccuracy:true}); }); } + /** + * Determine the mobile operating system. + * This function returns one of 'iOS', 'Android', 'Windows Phone', or 'unknown'. + * + * @returns {String} + */ +// getMobileOperatingSystem() { +// var userAgent = navigator.userAgent || navigator.vendor; +// console.log(userAgent) + +// // Windows Phone must come first because its UA also contains "Android" +// if (/windows phone/i.test(userAgent)) { +// return "Windows Phone"; +// } + +// if (/android/i.test(userAgent)) { +// return "Android"; +// } + +// // iOS detection from: http://stackoverflow.com/a/9039885/177710 +// if (/iPad|iPhone|iPod/.test(userAgent) && !window.MSStream) { +// return "iOS"; +// } + +// return "unknown"; +// } +// getMobileOperatingSystem() { +// if(/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|ipad|iris|kindle|Android|Silk|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i.test(navigator.userAgent) +// || /1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i.test(navigator.userAgent.substr(0,4))) { + +// let isMobile = true; +// return isMobile +// } +// else{ +// return false +// } +// } } diff --git a/ng6-seed/src/app/sales-pd/sales-pd.component.html b/ng6-seed/src/app/sales-pd/sales-pd.component.html index 35a711c..7e22299 100644 --- a/ng6-seed/src/app/sales-pd/sales-pd.component.html +++ b/ng6-seed/src/app/sales-pd/sales-pd.component.html @@ -73,8 +73,8 @@ - + diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json index 7ad1c84..6179faf 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/1.json @@ -49,7 +49,56 @@ "field_width":"100", "api_properties":null, "answers":null, - "onchange_properties":null, + "onchange_properties":[{ + "purpose":"FORM_CTRL", + "form_controls":[ + { + "insert_index":"relationship", + "expression":"(String('entity_type').toLowerCase() == String('individual'))", + "value_keys":[ + "entity_type" + ], + "questions":[ + { + "question":"Met / Not Met", + "question_key":"borrower_met", + "type":"2", + "field_width":"100", + "api_properties":null, + "answers":[ + { + "answer_id":"Yes", + "answer":"Yes" + }, + { + "answer_id":"No", + "answer":"No" + } + ], + "onchange_properties":null, + "is_repeatable":null, + "validations":[ + { + "name":"required", + "isactive":"1", + "validator":"Validators.required", + "message":"Field Required", + "value":null + } + ] + } + ] + } + ] + }, + { + "purpose":"question_label", + "expression":"(function () {let label= '';(String('entity_type').toLowerCase().includes('individual')) ? label= 'Number of years the borrower has been in this business.' : label = 'Number of years for which the business has been running';return label}())", + "value_keys":[ + "entity_type" + ], + "insert_control":"numbers_of_years_business_running" + }], "is_repeatable":null, "validations":[ { @@ -118,38 +167,12 @@ } ] }, - { - "question":"Met / Not Met", - "question_key":"borrower_met", - "type":"2", - "field_width":"100", - "api_properties":null, - "answers":[ - { - "answer_id":"Yes", - "answer":"Yes" - }, - { - "answer_id":"No", - "answer":"No" - } - ], - "onchange_properties":null, - "is_repeatable":null, - "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field Required", - "value":null - } - ] - }, + { "question":"Age", "question_key":"borrower_age", "type":"1", + "field_type":"num", "field_width":"45", "api_properties":null, "answers":null, @@ -170,6 +193,7 @@ "question_key":"numbers_of_years_business_running", "type":"1", "field_width":"45", + "field_type":"num", "api_properties":null, "answers":null, "onchange_properties":null, diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json index 1eb7c13..883ce03 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/10.json @@ -73,7 +73,7 @@ "onchange_properties":[ { "purpose":"answer_value", - "expression":"(Number(net_profit)/Number(sales_revenue))*100", + "expression":"((Number(net_profit)/Number(sales_revenue))*100).toFixed(2)", "value_keys":[ "sales_revenue","net_profit" ], @@ -154,6 +154,7 @@ "question":"Net Profit or (Net Loss) to Sales % ", "question_key":"net_profit_sales_percent", "type":"1", + "is_disabled":"1", "field_width":"45", "answers":null, "api_properties":null, @@ -184,6 +185,7 @@ "question":"% (↑ /↓) in Sales over PY", "question_key":"sales_py", "type":"1", + "is_disabled":"1", "field_width":"45", "answers":null, "api_properties":null, @@ -204,6 +206,7 @@ "question":"% (↑ /↓) in Net Profit over PY", "question_key":"netprofit_py", "type":"1", + "is_disabled":"1", "field_width":"45", "answers":null, "api_properties":null, @@ -225,6 +228,7 @@ "question":"% (↑ /↓) in Net Profit % over PY", "question_key":"netprofit_py_percent", "type":"1", + "is_disabled":"1", "field_width":"45", "answers":null, "api_properties":null, @@ -297,6 +301,118 @@ ] }, + { + "question":"No of Months", + "question_key":"broken_period_no_of_months", + "type":"1", + "field_width":"45", + "answers":null, + "api_properties":null, + "onchange_properties":null, + "is_repeatable":null, + "field_type":"num", + "validations":[ + { + "name":"required", + "isactive":"1", + "validator":"Validators.required", + "message":"Required", + "value":null + }, + { + "name":"pattern", + "isactive":"1", + "validator":"([0-9]*)", + "message":"Numeric only", + "value":null + } + + ] + }, + { + "question":"Turnover for Broken Period in CY (Rs)", + "question_key":"broken_period_turnover_cy", + "type":"1", + "field_width":"45", + "answers":null, + "api_properties":null, + "onchange_properties":null, + "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":"Turnover for Broken Period in PY (Rs)", + "question_key":"broken_period_turnover_py", + "type":"1", + "field_width":"45", + "answers":null, + "api_properties":null, + "onchange_properties":null, + "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":"Increase / Decrease in Turnover for Broken Period %", + "question_key":"broken_period_turnover_percent", + "type":"1", + "field_width":"45", + "answers":null, + "api_properties":null, + "onchange_properties":null, + "is_repeatable":null, + "field_type":"num", + "validations":[ + { + "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", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json index 684047f..135293a 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/11.json @@ -136,13 +136,6 @@ "parent_question_key":"supplier_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] }, { @@ -188,13 +181,6 @@ "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", @@ -217,13 +203,6 @@ "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", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json index 0304763..318e9b3 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/12.json @@ -136,13 +136,6 @@ "parent_question_key":"client_info_available", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] }, { @@ -188,13 +181,6 @@ "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", @@ -217,13 +203,6 @@ "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", diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json index 084fde2..8a934e9 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/13.json @@ -67,19 +67,36 @@ "field_width":"100", "field_type":"num", "api_properties":null, - "onchange_properties":null, + "onchange_properties":[ + { + "purpose": "validations", + "validations": [ + { + "name": "required", + "isactive": "1", + "validator": "", + "message": "Required", + "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "validation_to": null, + "value_keys": ["estimated_quantity","estimated_stock_value"] + }, + { + "name": "required", + "isactive": "1", + "validator": "", + "message": "Required", + "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "validation_to": "estimated_stock_value", + "value_keys": ["estimated_quantity","estimated_stock_value"] + } + ] + } + ], "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 - } ] } , { @@ -120,19 +137,36 @@ "field_type":"num", "field_width":"100", "api_properties":null, - "onchange_properties":null, + "onchange_properties":[ + { + "purpose": "validations", + "validations": [ + { + "name": "required", + "isactive": "1", + "validator": "", + "message": "Required", + "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "validation_to": null, + "value_keys": ["estimated_quantity","estimated_stock_value"] + }, + { + "name": "required", + "isactive": "1", + "validator": "", + "message": "Required", + "value": "(String('estimated_quantity') != String('')) || (String('estimated_stock_value') != String('')) ", + "validation_to": "estimated_quantity", + "value_keys": ["estimated_quantity","estimated_stock_value"] + } + ] + } + ], "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 - } ] } ] } ] }] diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json index 644a16a..db2dd99 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/15.json @@ -81,11 +81,33 @@ } ] }, + { + "question":"Monthly Obligations", + "question_key":"monthly_obligations", + "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":"Instalment Amount", "question_key":"instalment_amount", "type":"1", "field_width":"100", + "field_type":"numtoword", "api_properties":null, "answers":null, "onchange_properties":null, @@ -103,10 +125,39 @@ { "question":"Installment frequency", "question_key":"instalment_frequency", - "type":"1", + "type":"3", "field_width":"100", "api_properties":null, - "answers":null, + "answers":[ + { + "answer_id":"Daily", + "answer":"Daily" + }, + { + "answer_id":"Every 12 days", + "answer":"Every 12 days" + }, + { + "answer_id":"Every 15 days", + "answer":"Every 15 days" + }, + { + "answer_id":"Monthly", + "answer":"Monthly" + }, + { + "answer_id":"Every 3 months", + "answer":"Every 3 months" + }, + { + "answer_id":"Every 6 months", + "answer":"Every 6 months" + }, + { + "answer_id":"Yearly", + "answer":"Yearly" + } + ], "onchange_properties":null, "is_repeatable":null, "validations":[ diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/16.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/16.json index 187171f..da9cc1f 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/16.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/16.json @@ -2,6 +2,22 @@ "section_id":"16", "section_name":"Family Members Involved in Business", "onsubmit":null, + "questions":[ + { + "question":"Is any other family member involved in the business", + "question_key":"is_family_details_available", + "type":"2", + "field_width":"45", + "api_properties":null, + "onchange_properties":[{ + "purpose":"FORM_CTRL", + "form_controls":[ + { + "insert_index":"is_family_details_available", + "expression":"(String('is_family_details_available') == String('Yes'))", + "value_keys":[ + "is_family_details_available" + ], "questions":[ { "question":[ @@ -14,7 +30,6 @@ "answers":null, "onchange_properties":null, "is_repeatable":null, - "field_type":"string", "validations":[ { "name":"required", @@ -36,18 +51,27 @@ "question":"Relationship", "question_key":"relationship", "place_holder":"Enter the text", - "type":"1", - "api_properties":null, + "type":"8", + "api_properties":{ + "api":"getListOfMaster", + "api_method":"POST", + "params":{ + "master_name":"RELATIONSHIPS" + }, + "fields":[ + "relationship_id", + "name" + ] + }, "answers":null, "onchange_properties":null, "is_repeatable":null, - "field_type":"string", "validations":[ { "name":"required", "isactive":"1", "validator":"Validators.required", - "message":"Share value Required", + "message":"Required", "value":null } ] @@ -56,18 +80,21 @@ "question":"Relation to Individual Stakeholders", "question_key":"stakeholder_relation", "place_holder":"Enter text", - "type":"1", - "api_properties":null, + "type":"3", + "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":"Name Required", + "message":"Required", "value":null } ] @@ -76,18 +103,27 @@ "question":"Relation to Company / Firm", "question_key":"company_relation", "place_holder":"Enter text", - "type":"1", - "api_properties":null, + "type":"8", + "api_properties":{ + "api":"getListOfMaster", + "api_method":"POST", + "params":{ + "master_name":"COMPANYRELATIONSHIPS" + }, + "fields":[ + "company_relationship_id", + "name" + ] + }, "answers":null, "onchange_properties":null, "is_repeatable":null, - "field_type":"string", "validations":[ { "name":"required", "isactive":"1", "validator":"Validators.required", - "message":"Name Required", + "message":"Required", "value":null } ] @@ -96,18 +132,26 @@ "question":"Started Business (Yes / No)", "question_key":"started_biz", "place_holder":"Enter text", - "type":"1", + "type":"2", "api_properties":null, - "answers":null, + "answers":[ + { + "answer_id":"Yes", + "answer":"Yes" + }, + { + "answer_id":"No", + "answer":"No" + } + ], "onchange_properties":null, "is_repeatable":null, - "field_type":"string", "validations":[ { "name":"required", "isactive":"1", "validator":"Validators.required", - "message":"Name Required", + "message":"Required", "value":null } ] @@ -118,5 +162,27 @@ "group_title":"Family Members Involved in Business", "group_key":"family_details" } + ]}] + }], + "is_repeatable":null, + "answers":[{ + "answer":"Yes", + "answer_id":"Yes" + }, + { + "answer":"No", + "answer_id":"No" + }], + "validations":[ + { + "name":"required", + "isactive":"1", + "validator":"Validators.required", + "message":"Required", + "value":null + } + ] + } + ] } \ No newline at end of file diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/18.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/18.json index ba64c06..e09078b 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/18.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/18.json @@ -16,13 +16,6 @@ "is_repeatable":null, "field_type":"string", "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } ] }, { @@ -35,13 +28,6 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } ] } ], diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/19.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/19.json index 592c7eb..0ede0b8 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/19.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/19.json @@ -200,13 +200,6 @@ "onchange_properties":null, "is_repeatable":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Required", - "value":null - } ] } diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json index 6edb1fe..4927a89 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/2.json @@ -227,18 +227,29 @@ "question_key":"uom", "type":"8", "field_width":"45", - "api_properties":{ - "api":"getListOfMaster", - "api_method":"POST", - "params":{ - "master_name":"UOM" - }, - "fields":[ - "uom_id", - "name" - ] - }, - "answers":null, + "api_properties":null, + "answers":[ + { + "answer":"Acres", + "answer_id":"Acres" + }, + { + "answer":"Hectares", + "answer_id":"Hectares" + }, + { + "answer":"Square Feet", + "answer_id":"Square Feet" + }, + { + "answer":"Square Meters", + "answer_id":"Square Meters" + }, + { + "answer":"Square Yards", + "answer_id":"Square Yards" + } + ], "onchange_properties": [{ "purpose":"FORM_CTRL", "form_controls":[ diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json index 9167cca..e2bf318 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/3.json @@ -7,6 +7,7 @@ "question":"Loan amount applied for", "question_key":"loan_amount", "type":"1", + "field_type":"numtoword", "field_width":"100", "answers":null, "api_properties":null, @@ -26,6 +27,7 @@ "question":"Loan Tenure", "question_key":"loan_tenure", "type":"1", + "field_type":"num", "field_width":"100", "onchange_properties": null, "api_properties":null, diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json index 69aca78..f883d6c 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/8.json @@ -29,8 +29,8 @@ ], "questions":[ { - "question":"Year", - "sub_title":"How Long has business been operated from visited premises?", + "question":"No of Years", + "sub_title":"How Long has business been operated from visited premises? (Eg. If operating for 5 years and 4 months enter 5 in Years field and 4 in months field)", "question_key":"business_years", "place_holder":"", "field_type":"num", @@ -53,7 +53,7 @@ ] }, { - "question":"Month", + "question":"No of Months", "question_key":"business_months", "place_holder":"", "field_type":"num", @@ -66,13 +66,6 @@ "parent_question_key":"is_business_address", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] }, { @@ -88,7 +81,7 @@ "form_controls":[ { "insert_index":"business_is_pd_visited", - "expression":"(String('business_is_pd_visited') == String('Yes')) && (String('is_business_address') == String('Yes'))", + "expression":"(String('business_is_pd_visited') != String('')) && (String('is_business_address') == String('Yes'))", "value_keys":[ "business_is_pd_visited", "is_business_address" @@ -223,13 +216,6 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] }, { @@ -246,13 +232,6 @@ "parent_question_key":"business_ownership_type", "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] } , @@ -508,19 +487,22 @@ "type":"1", "field_width":"45", "api_properties":null, - "onchange_properties":null, + "onchange_properties":[ + { + "purpose":"answer_value", + "expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_vintage)}())", + "value_keys":[ + "business_vintage" + ], + "insert_control":"business_purchase_year" + } + ], "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 - } + ] }, { @@ -531,19 +513,22 @@ "type":"1", "field_width":"45", "api_properties":null, - "onchange_properties":null, + "onchange_properties":[ + { + "purpose":"answer_value", + "expression":"(function(){let current_year = new Date().getFullYear(); return current_year-Number(business_purchase_year)}())", + "value_keys":[ + "business_purchase_year" + ], + "insert_control":"business_vintage" + } + ], "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 - } + ] } , diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json index 776f695..edabbe6 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/LFMP/9.json @@ -112,13 +112,13 @@ ] }, { - "question":"Year", + "question":"No of Years", "sub_title":"Approximate vintage of the account", "question_key":"vintage_year", "place_holder":"", "field_type":"num", "type":"1", - "field_width":"45", + "field_width":"100", "api_properties":null, "onchange_properties":null, "is_repeatable":null, @@ -134,7 +134,7 @@ ] }, { - "question":"Month", + "question":"No of Months", "question_key":"vintage_month", "place_holder":"", "field_type":"num", @@ -145,13 +145,6 @@ "is_repeatable":null, "answers":null, "validations":[ - { - "name":"required", - "isactive":"1", - "validator":"Validators.required", - "message":"Field required", - "value":null - } ] } ], diff --git a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json index b162d8f..6195577 100644 --- a/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json +++ b/ng6-seed/src/assets/data/SMC_CREDIT_TEMPLATES/WCTL/3.json @@ -7,6 +7,7 @@ "question":"Loan amount applied for", "question_key":"loan_amount", "type":"1", + "field_typ":"numtoword", "field_width":"100", "answers":null, "api_properties":null, @@ -26,6 +27,7 @@ "question":"Loan Tenure", "question_key":"loan_tenure", "type":"1", + "field_type":"num", "field_width":"100", "onchange_properties": null, "api_properties":null,