merge : kms

This commit is contained in:
gandhimathi 2019-01-11 12:31:03 +05:30
parent 1061d03edd
commit 04f5f882b2
24 changed files with 362 additions and 212 deletions

View File

@ -108,7 +108,7 @@ export class DashboardComponent {
ngOnInit(){ ngOnInit(){
// console.clear();
this.getDoughnutChartData(); this.getDoughnutChartData();
@ -203,7 +203,7 @@ getDoughnutChartData(){
this._dashboardService.getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr).subscribe(data => { this._dashboardService.getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr).subscribe(data => {
this.flag = 1; this.flag = 1;
console.log(' ***** Doughnut Chart Data *****',data); // console.log(' ***** Doughnut Chart Data *****',data);
let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft'); let DraftIndexvalue = this.doughnutChartLabels.indexOf('Draft');
let TriggedIndexvalue = this.doughnutChartLabels.indexOf('Triggered'); let TriggedIndexvalue = this.doughnutChartLabels.indexOf('Triggered');
@ -215,7 +215,7 @@ getDoughnutChartData(){
if(data.records.current_month.length != 0){ if(data.records.current_month.length != 0){
//console.log('If Condition monthLY'); //console.log('If Condition monthLY');
console.log('Monthly Status',data.records.current_month); // console.log('Monthly Status',data.records.current_month);
let MonthlyFullPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'FULL' ); let MonthlyFullPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'FULL' );
let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' ); let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' );
@ -496,9 +496,9 @@ getDoughnutChartData(){
this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0); this.total2 = this.tempDataSmartPD.reduce((a, b) => a + b, 0);
this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0); this.total3 = this.tempDataTelePD.reduce((a, b) => a + b, 0);
console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1); // console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1);
console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2); // console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2);
console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3); // console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3);
}) })
} }
@ -552,7 +552,7 @@ onChange(e: any,flag: any) {
this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedCity,this.selectedLender).subscribe(data => { this._dashboardService.getPDDetailForDoughnut(fromdate,todate,this.selectedCity,this.selectedLender).subscribe(data => {
console.log(' *****Updated Date Doughnut Chart Data *****',data); // console.log(' *****Updated Date Doughnut Chart Data *****',data);
if(data.records.current_month.length != 0){ if(data.records.current_month.length != 0){
this.total1 = 0; this.total1 = 0;
@ -578,7 +578,7 @@ onChange(e: any,flag: any) {
if(data.records.current_month.length != 0){ if(data.records.current_month.length != 0){
//console.log('If Condition monthLY'); //console.log('If Condition monthLY');
console.log('Monthly Status',data.records.current_month); // console.log('Monthly Status',data.records.current_month);
let MonthlyFullPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'FULL' ); let MonthlyFullPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'FULL' );
let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' ); let MonthlySmartPDArr = data.records.current_month.filter(arr=>arr.PDTYPE == 'SMART' );
@ -866,9 +866,9 @@ onChange(e: any,flag: any) {
this.SmartCanvas.chart.update(); this.SmartCanvas.chart.update();
this.TeleCanvas.chart.update(); this.TeleCanvas.chart.update();
console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1); // console.log('Final Full Data '+ this.doughnutChartDataForFullPD+'Temp Data'+this.tempDataFullPD+'Full Total '+this.total1);
console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2); // console.log('Final Smart Data '+ this.doughnutChartDataForSmartPD+' Temp Data '+this.tempDataSmartPD+'Smart Total '+this.total2);
console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3); // console.log('Final Tele Data '+ this.doughnutChartDataForTelePD+' Temp Data'+this.tempDataTelePD+'Tele Total '+this.total3);
}) })

View File

@ -53,9 +53,9 @@ export class DashboardService {
getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr): Observable<any> { getPDDetailForDoughnut(fromdate,todate,cityarr,lenderarr): Observable<any> {
console.log(' From : ' + fromdate + ' To : ' + todate + ' Lender Array : ' + lenderarr + ' City Array : ' + cityarr); // console.log(' From : ' + fromdate + ' To : ' + todate + ' Lender Array : ' + lenderarr + ' City Array : ' + cityarr);
return this._http.post(this.apiUrl+'getDashBoardMaster', { return this._http.post(this.apiUrl+'getDashBoardMaster', {
"fromdate":fromdate != '' && fromdate != null && fromdate != undefined ? fromdate : '', "fromdate":fromdate != '' && fromdate != null && fromdate != undefined ? fromdate : '',
"todate": todate != '' && todate != null && todate != undefined ? todate : '', "todate": todate != '' && todate != null && todate != undefined ? todate : '',
"cityarr":cityarr,"lenderarr": lenderarr}) "cityarr":cityarr,"lenderarr": lenderarr})

View File

@ -87,21 +87,22 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
/** 3) Getting PD Details For Alert Message */ /** 3) Getting PD Details For Alert Message */
this._dashboardService.getAlertDetail().subscribe(data => { this._dashboardService.getAlertDetail().subscribe(data => {
console.log(' *****Layout Alert Message *****'); // console.log(' *****Layout Alert Message *****');
console.log('Layout Alert Message Whole Data',data); // console.log('Layout Alert Message Whole Data',data);
this.alertCount = data.records.length; this.alertCount = data.records.length;
this.alertMsgTriggerType = data.records.filter(trigger=>trigger.pd_status == "TRIGGERED" ); this.alertMsgTriggerType = data.records.filter(trigger=>trigger.pd_status == "TRIGGERED" );
this.alertMsgAllocateType = data.records.filter(allocate=>allocate.pd_status == "ALLOCATED" ); this.alertMsgAllocateType = data.records.filter(allocate=>allocate.pd_status == "ALLOCATED" );
console.log('Layout Alert Message',this.alertMsgTriggerType); // console.log('Layout Alert Message',this.alertMsgTriggerType);
console.log('Layout Alert Message',this.alertMsgAllocateType); // console.log('Layout Alert Message',this.alertMsgAllocateType);
console.log('Layout Alert Count',this.alertCount); // console.log('Layout Alert Count',this.alertCount);
}); });
} }
ngOnInit(): void { ngOnInit(): void {
// console.clear();
const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container '); const elemSidebar = <HTMLElement>document.querySelector('.sidebar-container ');
if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') { if (window.matchMedia(`(min-width: 960px)`).matches && !this.isMac() && !this.compactSidebar && this.layoutDir != 'rtl') {
@ -185,7 +186,7 @@ export class AdminLayoutComponent implements OnInit, OnDestroy {
changeMenuLayout(value) changeMenuLayout(value)
{ {
console.log(value) // console.log(value)
if(value) if(value)
{ {
this.menuLayout = 'top-menu'; this.menuLayout = 'top-menu';

View File

@ -48,14 +48,14 @@
<!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> --> <!-- <mat-error *ngIf="pdMain.lender_contact_person.hasError('required')">Lender Contact Person Required</mat-error> -->
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 28%"> <mat-form-field style="width: 28%">
<input matInput autocomplete="off" placeholder="Lender Mobile Number" formControlName="" type="text" maxlength="10"> <input matInput autocomplete="off" placeholder="Lender's Mobile Number" formControlName="" type="text" maxlength="10">
</mat-form-field> </mat-form-field>
<mat-form-field style="width: 32%"> <!--<mat-form-field style="width: 32%">
<input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10" required> <input matInput autocomplete="off" placeholder="Lender Contact Number" formControlName="lender_contact_mobile" type="text" (keypress)="keyPress($event)" maxlength="10" required>
<mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error> <mat-error *ngIf="pdMain.lender_contact_mobile.hasError('pattern') || pdMain.lender_contact_mobile.hasError('maxlength') || pdMain.lender_contact_mobile.hasError('minlength')">Enter Valid Mobile Number. </mat-error>
</mat-form-field> </mat-form-field>-->
<mat-form-field style="width: 8%"> <mat-form-field style="width: 8%">
<input matInput autocomplete="off" placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="STD Code" formControlName="stdcode" type="text" (keypress)="keyPress($event)">

View File

@ -97,8 +97,8 @@ export class AddressComponent implements OnInit {
} }
ngOnInit() { ngOnInit() {
console.clear(); // console.clear();
console.log('this.address',this.pdAddress); // console.log('this.address',this.pdAddress);
this.getMasterDetails('PDLOCATIONAPPROACH',1); this.getMasterDetails('PDLOCATIONAPPROACH',1);
this.getMasterDetails('COMMENTSONLOCALITY',2); this.getMasterDetails('COMMENTSONLOCALITY',2);
//this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e //this.getMasterDetails('CUSTOMERBEHAVIOUR',3);review doc s.no 3.e
@ -113,7 +113,7 @@ export class AddressComponent implements OnInit {
params.pd_form_id = '5'; params.pd_form_id = '5';
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
console.log('data', data); // console.log('data', data);
//const control = <FormArray>this.addressForm.controls['neighbourhood']; //const control = <FormArray>this.addressForm.controls['neighbourhood'];
const control = <FormArray>this.addressForm.controls['additional_address_units']; const control = <FormArray>this.addressForm.controls['additional_address_units'];
//const additionalPremisesControl = <FormArray>this.addressForm.controls['additional_premises']; //const additionalPremisesControl = <FormArray>this.addressForm.controls['additional_premises'];

View File

@ -90,17 +90,26 @@
<mat-expansion-panel class="banlFields" [expanded]="step == i"> <mat-expansion-panel class="banlFields" [expanded]="step == i">
<mat-expansion-panel-header> <mat-expansion-panel-header>
<mat-panel-title> <mat-panel-title>
<p>{{i+1}} , Banking Details <p>Banking Details #{{i+1}}
</p> </p>
</mat-panel-title> </mat-panel-title>
</mat-expansion-panel-header> </mat-expansion-panel-header>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Account Name" formControlName="applicant_name" (selectionChange)="selectedBorrower($event.value,i)"> <mat-select placeholder="Account Name" formControlName="applicant_name" [compareWith]="compareObjects">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option> <mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
</mat-select> <mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field *ngIf="itemrow.get('applicant_name').value == 0"> --> <!-- <mat-select placeholder="Account Name" formControlName="applicant_name" (selectionChange)="selectedBorrower($event.value,i)">
<mat-form-field *ngIf="this.OtherFlag[i]"> <mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
</mat-select> --
!-- <mat-form-field *ngIf="itemrow.get('applicant_name').value == 0"> --
!-- <mat-form-field *ngIf="this.OtherFlag[i]"> -->
<mat-form-field *ngIf="checkOthers(itemrow.get('applicant_name').value)===true" style="width:45%">
<input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off"> <input matInput placeholder="Specify Applicant Name" formControlName="other_applicant" autocomplete="off">
</mat-form-field> </mat-form-field>

View File

@ -42,6 +42,9 @@ export class BankingDetailsComponent implements OnInit {
limitCaseFlag : any = []; limitCaseFlag : any = [];
amtInwords : any = []; amtInwords : any = [];
emiAmtInwords : any = []; emiAmtInwords : any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -79,6 +82,30 @@ export class BankingDetailsComponent implements OnInit {
ngOnInit() { ngOnInit() {
this.step = 0; this.step = 0;
this.initBankingForm(); this.initBankingForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active);
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
})
this.getM_AccountType(); this.getM_AccountType();
this.getM_BTLenderList(); this.getM_BTLenderList();
@ -89,11 +116,12 @@ export class BankingDetailsComponent implements OnInit {
// // console.log(this.pd_cus_segment); // // console.log(this.pd_cus_segment);
// this.pd_cus_segment = this.pd_cus_segment.substring(0,3); // this.pd_cus_segment = this.pd_cus_segment.substring(0,3);
// this.applicants = this.pd_all_details.pdapplicants_detials; // this.applicants = this.pd_all_details.pdapplicants_detials;
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = '7'; params.pd_form_id = '7';
this._pd.retriveForm(params).subscribe(data => { this._pd.retriveForm(params).subscribe(data => {
console.log('data', data); // console.log('data', data);
const control = <FormArray>this.bankingForm.controls['itemRows']; const control = <FormArray>this.bankingForm.controls['itemRows'];
if (data.status == 200) { if (data.status == 200) {
this.bankingForm.controls.banking_form_remark.setValue(data.records.banking_form_remark); this.bankingForm.controls.banking_form_remark.setValue(data.records.banking_form_remark);
@ -105,7 +133,7 @@ export class BankingDetailsComponent implements OnInit {
} else { } else {
result.forEach((datas,index) => { result.forEach((datas,index) => {
this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit); this.amtInwords[index] = this._pd.convertNumberToWords(+datas.limit);
this.selectedBorrower(datas.applicant_name,index); // this.selectedBorrower(datas.applicant_name,index);
this.selectedAccTypeChanges(+datas.account_type,index) this.selectedAccTypeChanges(+datas.account_type,index)
// this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi); // this.emiAmtInwords[index] = this._pd.convertNumberToWords(val.emi);
@ -180,7 +208,7 @@ export class BankingDetailsComponent implements OnInit {
} }
deleteBankdetails(index: number) { deleteBankdetails(index: number) {
console.log('index value -', index); // console.log('index value -', index);
const control = <FormArray>this.bankingForm.controls['itemRows']; const control = <FormArray>this.bankingForm.controls['itemRows'];
control.removeAt(index); control.removeAt(index);
} }
@ -196,9 +224,9 @@ export class BankingDetailsComponent implements OnInit {
records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value; records.banking_form_remark = this.bankingForm.controls.banking_form_remark.value;
// records.fk_createdby = '252'; // records.fk_createdby = '252';
records.banking_details = this.bankingForm.controls['itemRows'].value; records.banking_details = this.bankingForm.controls['itemRows'].value;
console.log('data', records); // console.log('data', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); // console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => { }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');
@ -216,14 +244,34 @@ export class BankingDetailsComponent implements OnInit {
}); });
} }
selectedBorrower(e,i){ // selectedBorrower(e,i){
if(e == 0){ // if(e == 0){
this.OtherFlag[i] = true; // this.OtherFlag[i] = true;
} // }
else{ // else{
this.OtherFlag[i] = false; // this.OtherFlag[i] = false;
} // }
// }
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
} }
else {
return false;
}
}
selectedAccTypeChanges(event: any,i){ selectedAccTypeChanges(event: any,i){

View File

@ -1118,7 +1118,7 @@ export class BusinessInfoComponent implements OnInit {
data.records.forEach(val => { data.records.forEach(val => {
if (val.isactive == 1) { if (val.isactive == 1) {
this.countryDataList.push(val); this.countryDataList.push(val);
console.log(this.countryDataList); // console.log(this.countryDataList);
} }
}) })
}); });
@ -1232,7 +1232,7 @@ export class BusinessInfoComponent implements OnInit {
submitDetails() { submitDetails() {
// let family: any = []; // let family: any = [];
console.log(this.businessForm.value); // console.log(this.businessForm.value);
if (!this.businessForm.valid) { if (!this.businessForm.valid) {
//console.log(' Requried validation error'); //console.log(' Requried validation error');

View File

@ -42,16 +42,17 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('loan_amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('loan_amount').value != ''">{{"&#8377;"}} {{amtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select (selectionChange)="selectedfrequency($event.value,i)" placeholder="Frequency" <mat-select placeholder="Frequency" (selectionChange)="selectedfrequency($event.value,i)"
formControlName="frequency" > formControlName="frequency" >
<mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option> <mat-option *ngFor="let freq of frequencyData" value="{{freq.frequency_id}}">{{freq.name}}</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value == 8"> <mat-form-field *ngIf="details.get('frequency').value == 7">
<input matInput autocomplete="off" placeholder="Specify Frequency" formControlName="other_frequency"> <input matInput autocomplete="off" placeholder="Specify Frequency" formControlName="other_frequency">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="details.get('frequency').value != ''" style="width:35%"> <mat-form-field *ngIf="details.get('frequency').value != ''" style="width:35%">
<input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)"> <input matInput autocomplete="off" [placeholder]="placeholderName[i] != '' ? placeholderName[i] : 'Instalment Amount' " formControlName="emi" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)">
<!-- <input matInput autocomplete="off" placeholder="details.get('loan_type').value + Instalment Amount " formControlName="emi" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)"> -->
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('emi').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('emi').value != ''">{{"&#8377;"}} {{emiAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
@ -64,14 +65,21 @@
<input matInput autocomplete="off" placeholder="Specify Loan Type" formControlName="others_loan_type"> <input matInput autocomplete="off" placeholder="Specify Loan Type" formControlName="others_loan_type">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" (selectionChange)="selectedBorrower($event.value,i)"> <!-- <mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" (selectionChange)="selectedBorrower($event.value,i)">
<mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option> <mat-option value="{{owner.pd_co_applicant_id}}" *ngFor="let owner of applicants">{{owner.applicant_name}}</mat-option>
<!-- <mat-option value= 0 >Others</mat-option> --> <!-- <mat-option value= 0 >Others</mat-option> ->
</mat-select> </mat-select> -->
<mat-select placeholder="Loan Taken By" formControlName="loan_taken_by" [compareWith]="compareObjects">
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
<mat-option *ngFor="let val of group.groupValues" [value]="val">
{{val.name}}
</mat-option>
</mat-optgroup>
</mat-select>
</mat-form-field> </mat-form-field>
<!-- {{details.get('loan_taken_by').value}} --> <!-- {{details.get('loan_taken_by').value}} -->
<!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> --> <!-- <mat-form-field *ngIf="details.get('loan_taken_by').value == 0"> -->
<mat-form-field *ngIf="this.OtherFlag[i]"> <mat-form-field *ngIf="checkOthers(details.get('loan_taken_by').value)===true" style="width:45%">
<input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken"> <input matInput autocomplete="off" placeholder="Specify Borrower" formControlName="others_loan_taken">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
@ -87,10 +95,12 @@
</mat-form-field> --> </mat-form-field> -->
<div style="width:100%"> <div style="width:100%">
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" > <input matInput autocomplete="off" placeholder="Original Tenure in Months" formControlName="original_tenure" (change)="checkTenure(details)">
</mat-form-field> </mat-form-field>
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure" > <input matInput autocomplete="off" placeholder="Current Balance Tenure in Months" formControlName="current_balance_tenure">
<mat-error>Invalid Balance Tenure.</mat-error>
<!-- //*ngIf="current_balance_tenure.hasError('min')" class="mat-text-warn" -->
</mat-form-field> </mat-form-field>
</div> </div>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button matTooltip="Add More Loan Details" matTooltipPosition="above" color="primary" (click)="addLoanDetails()"

View File

@ -22,19 +22,24 @@
color: #fff !important; color: #fff !important;
background-color: #e00201 !important; background-color: #e00201 !important;
} }
.my-mat-hint {
line-height: 1.2em;
transform: translateY(10px);
font-size: 75%;
}
.mat-card-content { .mat-card-content {
background-color: white; background-color: white;
} }
.mat-card-actions { .mat-card-actions {
background-color: white; background-color: white;
} }
::ng-deep .cdk-global-overlay-wrapper{ ::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important; justify-content: center !important;
} }
mat-form-field { mat-form-field {
margin: 0 2%; margin: 0 2%;
} }
$base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important; $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
$product-bg-color-hover: rgba(103, 58, 183, 0.7); $product-bg-color-hover: rgba(103, 58, 183, 0.7);
.p-list-main { .p-list-main {
background: white; background: white;

View File

@ -47,6 +47,9 @@ export class CurrentLoanComponent implements OnInit {
OtherFlag : any = []; OtherFlag : any = [];
amtInwords : any = []; amtInwords : any = [];
emiAmtInwords : any = []; emiAmtInwords : any = [];
existCompanyList: any =[];
mergeCompanyApplicant: any=[];
constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute, constructor(notifier: NotifierService, private fb: FormBuilder, private route: ActivatedRoute,
private router: Router, private router: Router,
@ -83,12 +86,36 @@ export class CurrentLoanComponent implements OnInit {
this.getMasterDetails('FREQUENCY',2); this.getMasterDetails('FREQUENCY',2);
this.getMasterDetails('EXISTINGLOANTYPES',3); this.getMasterDetails('EXISTINGLOANTYPES',3);
this.initCurrentloanForm(); this.initCurrentloanForm();
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
this.existCompanyList = data.records.filter(val =>val.is_active);
}
let modifyCompanyList : any=[];
if(this.existCompanyList.length>0){
modifyCompanyList = this.existCompanyList.map(element => {
return {id:element.company_order_id.toString(),name:element.company_name,group_id:1};
});
this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList})
}
let modifyApplicantList: any=[];
if(this.applicants.length > 0){
modifyApplicantList = this.applicants.map(element => {
return {id:element.pd_co_applicant_id,name:element.applicant_name,group_id:2};
});
this.mergeCompanyApplicant.push({groupName:'APPLICANTS',groupValues:modifyApplicantList})
}
})
let params: any = {}; let params: any = {};
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = this.form_id; params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => { this._pd.retriveForm(params).subscribe(value => {
console.log('value', value); // console.log('value', value);
const control = <FormArray>this.currentLoanForm.controls['loan_details']; const control = <FormArray>this.currentLoanForm.controls['loan_details'];
if (value.status == 200) { if (value.status == 200) {
@ -118,6 +145,33 @@ export class CurrentLoanComponent implements OnInit {
} }
}) })
} }
checkTenure(details){
let originalTenure = details.value.original_tenure;
// alert(originalTenure);
details.controls.current_balance_tenure.setValidators([Validators.required, Validators.max(+originalTenure)]);
details.controls.current_balance_tenure.updateValueAndValidity();
// details.controls.current_balance_tenure.setValidators([Validators.max(+originalTenure)]);
// details.controls.current_balance_tenure.updateValueAndValidity();
// let BalanceTenure = details.value.current_balance_tenure;
// if( originalTenure < BalanceTenure){
// alert('Greater');
// details.controls.current_balance_tenure.setValue('');
// alert('validation setted For');
// details.controls.current_balance_tenure.setValidators([Validators.min(+originalTenure)]);
// details.controls.current_balance_tenure.updateValueAndValidity();
// }
}
// validateNumber(input: AbstractControl) {
// const wordControl = input.get("word");
// if(wordControl.value != null && wordControl.value.length > 4) {
// wordControl.setValidators([Validators.required, Validators.minLength(8)]);
// wordControl.updateValueAndValidity();
// }
// }
public initCurrentloanForm(): void { public initCurrentloanForm(): void {
this.currentLoanForm = this.fb.group({ this.currentLoanForm = this.fb.group({
existing_loan: [''], existing_loan: [''],
@ -127,7 +181,7 @@ export class CurrentLoanComponent implements OnInit {
} }
selectedLoanChanges(e): void { selectedLoanChanges(e): void {
console.log(e); // console.log(e);
if (e.value == 'Yes') { if (e.value == 'Yes') {
// console.log('if()'); // console.log('if()');
const control = <FormArray>this.currentLoanForm.controls['loan_details']; const control = <FormArray>this.currentLoanForm.controls['loan_details'];
@ -138,26 +192,25 @@ export class CurrentLoanComponent implements OnInit {
arr.removeAt(0); arr.removeAt(0);
} }
} }
selectedBorrower(e,i){ // selectedBorrower(e,i){
if(e == 0){ // if(e == 0){
this.OtherFlag[i] = true; // this.OtherFlag[i] = true;
} // }
else{ // else{
this.OtherFlag[i] = false; // this.OtherFlag[i] = false;
} // }
} // }
selectedfrequency(e,i){ selectedfrequency(e,i){
switch(+e){ switch(+e){
case 1: this.placeholderName[i] = 'Weekly Instalment Amount'; break; case 1: this.placeholderName[i] = 'Monthly Instalment Amount'; break;
case 2: this.placeholderName[i] = 'Daily Instalment Amount'; break; case 2: this.placeholderName[i] = 'Annual Instalment Amount'; break;
case 3: this.placeholderName[i] = 'Annual Instalment Amount'; break; case 3: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break;
case 4: this.placeholderName[i] = 'Hourly Instalment Amount'; break; case 4: this.placeholderName[i] = 'Fortnightly Instalment Amount'; break;
case 5: this.placeholderName[i] = 'EMI Amount'; break; case 5: this.placeholderName[i] = 'Daily Instalment Amount'; break;
case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break; case 6: this.placeholderName[i] = 'Quarterly Instalment Amount'; break;
case 7: this.placeholderName[i] = 'Halfyearly Instalment Amount'; break; default: this.placeholderName[i] = 'Instalment Amount'; break;
default : this.placeholderName[i] = ''; break;
} }
} }
@ -177,6 +230,26 @@ export class CurrentLoanComponent implements OnInit {
current_balance_tenure: [''], current_balance_tenure: [''],
}); });
} }
// compare objects for merge two master table details
compareObjects(o1: any, o2: any) {
if(o1.id == o2.id && o1.group_id == o2.group_id)
return true;
else return false
}
// check others
checkOthers(values){
if(values!=null) {
return values.id==0 ? true : false;
}
else {
return false;
}
}
addLoanDetails() { addLoanDetails() {
const control = <FormArray>this.currentLoanForm.controls['loan_details']; const control = <FormArray>this.currentLoanForm.controls['loan_details'];
control.push(this.createLoanDetail()); control.push(this.createLoanDetail());
@ -187,7 +260,7 @@ export class CurrentLoanComponent implements OnInit {
} }
submitCurrentloan() { submitCurrentloan() {
if (!this.currentLoanForm.valid) { if (!this.currentLoanForm.valid) {
console.log("data invalid") // console.log("data invalid")
return; return;
} }
let records: any = {}; let records: any = {};
@ -199,9 +272,9 @@ export class CurrentLoanComponent implements OnInit {
if (records.existing_loan == 'Yes') { if (records.existing_loan == 'Yes') {
records.loan_details = this.currentLoanForm.controls['loan_details'].value; records.loan_details = this.currentLoanForm.controls['loan_details'].value;
} }
console.log('data', records); // console.log('data', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); // console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => { }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');

View File

@ -13,117 +13,117 @@
<mat-dialog-content> <mat-dialog-content>
<mat-tab-group> <mat-tab-group>
<mat-tab label="Questions"> <mat-tab label="Questions">
<ng-template matTabContent> <ng-template matTabContent>
<div fxLayout="row wrap"> <div fxLayout="row wrap">
<div fxFlex="100"> <div fxFlex="100">
<mat-card> <mat-card>
<mat-card-header> <mat-card-header>
<mat-card-title><p> Data as Per Financial Statements</p></mat-card-title> <mat-card-title><p> Data as Per Financial Statements</p></mat-card-title>
</mat-card-header> </mat-card-header>
<div style="width:100%"> <div style="width:100%">
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
<mat-label>Enter year from which financials provided</mat-label> <mat-label>Enter year from which financials provided</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="staring_financial_year" (keypress)="keyPress($event)" [readonly]="isReadOnly"> <input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="staring_financial_year" (keypress)="keyPress($event)" [readonly]="isReadOnly">
<mat-error> Invalid year format</mat-error> <mat-error> Invalid year format</mat-error>
</mat-form-field> </mat-form-field>
<!-- <mat-form-field hintLabel="Max 10 characters"> <!-- <mat-form-field hintLabel="Max 10 characters">
<input matInput #input maxlength="10" placeholder="Enter some input"> <input matInput #input maxlength="10" placeholder="Enter some input">
<mat-hint align="start" style="font-size:70%">{{input.value?.length || 0}}/10</mat-hint> <mat-hint align="start" style="font-size:70%">{{input.value?.length || 0}}/10</mat-hint>
</mat-form-field> --> </mat-form-field> -->
<mat-form-field style="width:35%"> <mat-form-field style="width:35%">
<input matInput autocomplete="off" placeholder="Number of Financial Years" formControlName="total_financial_year" (change)="dynamicalFinYear($event)" (keypress)="keyPress($event)" [readonly]="isReadOnly"> <input matInput autocomplete="off" placeholder="Number of Financial Years" formControlName="total_financial_year" (change)="dynamicalFinYear($event)" (keypress)="keyPress($event)" [readonly]="isReadOnly">
</mat-form-field> </mat-form-field>
</div> </div>
<div *ngIf="total_financial_year != ''" formArrayName="date_per_financial"> <div *ngIf="total_financial_year != ''" formArrayName="date_per_financial">
<!-- <div formArrayName="date_per_financial"> --> <!-- <div formArrayName="date_per_financial"> -->
<div *ngFor="let details of financialForm.controls.date_per_financial['controls']; let i=index" <div *ngFor="let details of financialForm.controls.date_per_financial['controls']; let i=index" [formGroupName]="i">
[formGroupName]="i">
<mat-card-content class="matcard"> <mat-card-content class="matcard">
<mat-label class="highlight"> <i>Financial Year : {{details.get('financial_year').value}} </i> </mat-label> <mat-label class="highlight"> <i>Financial Year : {{details.get('financial_year').value}} </i> </mat-label>
<hr> <hr>
<div style="width:100%"> <div style="width:100%">
<br> <br>
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<!-- <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" > --> <!-- <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calMargin(i, details)" type="number" > -->
<input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calFinAnnualSale(i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,1)"> <input matInput autocomplete="off" placeholder="Annual Sale" formControlName="financial_annual_sale" (change)="calFinAnnualSale(i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}} {{FY_annualSalesInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annual_sale').value != ''">{{"&#8377;"}} {{FY_annualSalesInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<span *ngIf="i != 0"> <span *ngIf="i != 0">
<mat-form-field style="width:60%"> <mat-form-field style="width:60%">
<input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Sale Variation from Previous Year in %" formControlName="financial_annualsales_variation" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' " > <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_annualsales_variation').value != '' " >
<span *ngIf="details.get('financial_annualsales_variation').value == 0"> <span *ngIf="details.get('financial_annualsales_variation').value == 0">
No differents in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> No differents in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
</span> </span>
<span *ngIf="details.get('financial_annualsales_variation').value > 0" class="greenhighlight"> <span *ngIf="details.get('financial_annualsales_variation').value > 0" class="greenhighlight">
Increase in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{details.get('financial_annualsales_variation').value}} % </b> Increase in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{details.get('financial_annualsales_variation').value}} % </b>
</span> </span>
<span *ngIf="details.get('financial_annualsales_variation').value < 0" class="highlight"> <span *ngIf="details.get('financial_annualsales_variation').value < 0" class="highlight">
Decrease in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i>{{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{(details.get('financial_annualsales_variation').value).replace('-', '')}} % </b> Decrease in Sales in FY <i> {{details.get('financial_year').value}} </i> over Sales in FY <i>{{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{(details.get('financial_annualsales_variation').value).replace('-', '')}} % </b>
</span> </span>
</mat-hint> </mat-hint>
</mat-form-field> </mat-form-field>
</span> </span>
</div> </div>
<div style="width:100%"> <div style="width:100%">
<mat-form-field style="width:30%"> <mat-form-field style="width:30%">
<!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" > --> <!-- <input matInput autocomplete="off" placeholder="Net Profit / Loss" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" type="number" > -->
<mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" > <mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" >
<!-- (selectionChange)="selectedProfitOrLossType($event,1)> --> <!-- (selectionChange)="selectedProfitOrLossType($event,1)> -->
<mat-option value="1" >Net Profit</mat-option> <mat-option value="1" >Net Profit</mat-option>
<mat-option value="2" >Net Loss</mat-option> <mat-option value="2" >Net Loss</mat-option>
</mat-select> </mat-select>
</mat-form-field> </mat-form-field>
<span *ngIf="details.get('finanical_profit_or_loss').value == 1 "> <span *ngIf="details.get('finanical_profit_or_loss').value == 1 ">
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit Amount" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)"> <input matInput autocomplete="off" placeholder="Net Profit Amount" formControlName="financial_net_profit" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,2)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} {{FY_netProfitAmtInwords[i]}} Only</mat-hint> <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_profit').value != ''">{{"&#8377;"}} {{FY_netProfitAmtInwords[i]}} Only</mat-hint>
</mat-form-field> </mat-form-field>
<mat-form-field style="width:28%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit to Sales in %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" > <input matInput autocomplete="off" placeholder="Net Profit to Sales in %" formControlName="financial_margin_of_profit" (keypress)="keyPress($event)" >
</mat-form-field> </mat-form-field>
</span> </span>
<span *ngIf="details.get('finanical_profit_or_loss').value == 2 ">
<mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss Amount" formControlName="financial_net_loss" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} {{FY_netLossAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss to Sales in %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)">
</mat-form-field>
</span>
</div>
<span *ngIf="i != 0"> <span *ngIf="details.get('finanical_profit_or_loss').value == 2 ">
<mat-form-field style="width:65%"> <mat-form-field style="width:28%">
<input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)"> <input matInput autocomplete="off" placeholder="Net Loss Amount" formControlName="financial_net_loss" (change)="calMargin( i, details); calYearVariation( i, details)" (keypress)="keyPress($event)" (keyup)="inWords($event,i,3)">
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" > <mat-hint align="start" style="font-size:70%" *ngIf="details.get('financial_net_loss').value != ''">{{"&#8377;"}} {{FY_netLossAmtInwords[i]}} Only</mat-hint>
<span *ngIf="details.get('financial_variation').value == 0"> </mat-form-field>
No differents in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <mat-form-field style="width:28%">
</span> <input matInput autocomplete="off" placeholder="Net Loss to Sales in %" formControlName="financial_margin_of_loss" (keypress)="keyPress($event)">
<span *ngIf="details.get('financial_variation').value > 0" class="greenhighlight"> </mat-form-field>
Increase in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{details.get('financial_variation').value}} % </b> </span>
</span> </div>
<span *ngIf="details.get('financial_variation').value < 0" class="highlight">
Decrease in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{(details.get('financial_variation').value).replace('-', '')}} % </b> <span *ngIf="i != 0">
</span> <mat-form-field style="width:65%">
</mat-hint> <input matInput autocomplete="off" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Profit Variation from Previous Year in %" formControlName="financial_variation" (keypress)="keyPress($event)">
<mat-hint align="start" style="font-size:70%" *ngIf="i != 0 && details.get('financial_variation').value != '' " [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >
<span *ngIf="details.get('financial_variation').value == 0">
No differents in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i>
</span>
<span *ngIf="details.get('financial_variation').value > 0" class="greenhighlight">
Increase in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{details.get('financial_variation').value}} % </b>
</span>
<span *ngIf="details.get('financial_variation').value < 0" class="highlight">
Decrease in Profit in FY <i> {{details.get('financial_year').value}} </i> over Profit in FY <i> {{financialForm.controls.date_per_financial['controls'][i-1].get('financial_year').value}} </i> <b> {{(details.get('financial_variation').value).replace('-', '')}} % </b>
</span>
</mat-hint>
<!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” --> <!-- “Increase in Sales in FY 2017-2018 over sales in FY 2016-2017 is 11.11%” -->
<!-- <mat-hint align="start" style="font-size:70%" *ngIf="i != 0" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >{{SalesStatement[i]}}</mat-hint> --> <!-- <mat-hint align="start" style="font-size:70%" *ngIf="i != 0" [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" >{{SalesStatement[i]}}</mat-hint> -->
</mat-form-field> </mat-form-field>
</span> </span>
@ -135,15 +135,16 @@
matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="i>0"> matTooltip="Delete" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="i>0">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> --> </button> -->
</mat-card-content> </mat-card-content>
</div> </div>
</div> </div>
<mat-form-field *ngIf="i != 0 && customerCommentsFlag" style="width:65%"> <mat-form-field *ngIf="total_financial_year != '' && customerCommentsFlag" style="width:100%">
<!-- <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="financial_reason" > --> <!-- <input matInput autocomplete="off" placeholder="Reason For Major Difference" formControlName="financial_reason" > -->
<input matInput autocomplete="off" placeholder="Customer Comments on Financials" formControlName="financial_reason" > <input matInput autocomplete="off" placeholder="Customer Comments on Financials" formControlName="financial_reason" >
</mat-form-field> </mat-form-field>
</mat-card> </mat-card>
</div> </div>
</div> </div>
<div fxLayout="row wrap"> <div fxLayout="row wrap">

View File

@ -90,6 +90,7 @@ export class FinancialInfoComponent implements OnInit {
this._pd.retriveForm(params).subscribe(value => { this._pd.retriveForm(params).subscribe(value => {
const financial_date = <FormArray>this.financialForm.controls['date_per_financial']; const financial_date = <FormArray>this.financialForm.controls['date_per_financial'];
const estimated_val = <FormArray>this.financialForm.controls['estimated_value']; const estimated_val = <FormArray>this.financialForm.controls['estimated_value'];
if (value.status == 200) { if (value.status == 200) {
let retriveData = value.records; let retriveData = value.records;
this.isReadOnly = true; this.isReadOnly = true;
@ -145,6 +146,7 @@ export class FinancialInfoComponent implements OnInit {
financial_remarks: [''], financial_remarks: [''],
staring_financial_year : ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])], staring_financial_year : ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
total_financial_year : [''], total_financial_year : [''],
financial_reason: [''],
same_as_financial_statements:[''], same_as_financial_statements:[''],
date_per_financial: this.fb.array([]), date_per_financial: this.fb.array([]),
estimated_value: this.fb.array([]) estimated_value: this.fb.array([])
@ -171,7 +173,7 @@ export class FinancialInfoComponent implements OnInit {
financial_margin_of_loss: [''], financial_margin_of_loss: [''],
financial_variation: [''], financial_variation: [''],
financial_annualsales_variation : [''], financial_annualsales_variation : [''],
financial_reason: [''],
}); });
} }
createValue(date) { createValue(date) {

View File

@ -62,15 +62,16 @@
</mat-card-header> </mat-card-header>
<mat-card-content> <mat-card-content>
<div fxLayout="row wrap" formArrayName="companies"> <div fxLayout="row wrap" formArrayName="companies">
<div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let com of _generalForm.controls.companies['controls']; let c = index;" [formGroupName]="c"> <div fxFlex.xs="100" fxFlex.sm="100" fxFlex.md="100" fxFlex.lg="100" fxFlex.xl="100" *ngFor="let com of _generalForm.controls.companies['controls']; let c = index; let last = last;" [formGroupName]="c">
<mat-form-field style="width: 60%" *ngIf="com.value.is_active==true"> <mat-form-field style="width: 60%" *ngIf="com.value.is_active==true">
<input matInput placeholder="Company/Firm" formControlName="company_name" type="text"> <input matInput placeholder="Company/Firm" formControlName="company_name" type="text">
</mat-form-field> </mat-form-field>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company/Firm" matTooltipPosition="above" color="primary" (click)="addMoreCompanies()" *ngIf="c==0"><mat-icon>add</mat-icon></button>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0 && com.value.is_active==true" <button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeCompanies(c)" *ngIf="c>0 && com.value.is_active==true"
matTooltip="Remove Company/Firm" matTooltipPosition="above"> matTooltip="Remove Company/Firm" matTooltipPosition="above">
<mat-icon>delete</mat-icon> <mat-icon>delete</mat-icon>
</button> </button>
<button mat-raised-button mat-icon-button class="mr-1 mb-1 hover-icon" type="button" matTooltip="Add More Company/Firm" matTooltipPosition="above" color="primary" (click)="addMoreCompanies()" *ngIf="last"><mat-icon>add</mat-icon></button>
</div> </div>
</div> </div>
</mat-card-content> </mat-card-content>

View File

@ -312,7 +312,7 @@ export class GeneralInfoComponent implements OnInit {
// remove companies // remove companies
removeCompanies(indexValues) { removeCompanies(indexValues) {
this.count = this.count-1; this.count = this.count-1;
console.log('removed Count',this.count); // console.log('removed Count',this.count);
let control: any = this._generalForm.get('companies') as FormArray; let control: any = this._generalForm.get('companies') as FormArray;
control.controls[indexValues].controls.is_active.setValue(false); control.controls[indexValues].controls.is_active.setValue(false);
control.controls[indexValues].controls.company_name.clearValidators(); control.controls[indexValues].controls.company_name.clearValidators();
@ -444,7 +444,7 @@ export class GeneralInfoComponent implements OnInit {
// submit form details // submit form details
submitGeneralForm(formData:any) { submitGeneralForm(formData:any) {
if (this._generalForm.invalid) { if (this._generalForm.invalid) {
console.log('if',this._generalForm.value); // console.log('if',this._generalForm.value);
this.validateAllFormFields(this._generalForm); this.validateAllFormFields(this._generalForm);
return; return;
} }

View File

@ -84,7 +84,7 @@ public viewerOptions: any = {
params.pd_id = this.pdid; params.pd_id = this.pdid;
params.pd_form_id = this.form_id; params.pd_form_id = this.form_id;
this._pd.retriveForm(params).subscribe(value => { this._pd.retriveForm(params).subscribe(value => {
console.log('value', value); // console.log('value', value);
const control = <FormArray>this.otherIncomeForm.controls['income_details']; const control = <FormArray>this.otherIncomeForm.controls['income_details'];
if (value.status == 200) { if (value.status == 200) {
@ -140,7 +140,7 @@ public viewerOptions: any = {
getFrequency() { getFrequency() {
let master_name = 'FREQUENCY'; let master_name = 'FREQUENCY';
this._pd.getAllMasterDatas(master_name).subscribe(data => { this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data); // console.log('data', data);
data.records.forEach(val => { data.records.forEach(val => {
if (val.isactive == 1) { if (val.isactive == 1) {
this.frequencyData.push(val); this.frequencyData.push(val);
@ -151,7 +151,7 @@ public viewerOptions: any = {
getSourceOtherIncome() { getSourceOtherIncome() {
let master_name = 'SOURCEOFOTHERINCOME'; let master_name = 'SOURCEOFOTHERINCOME';
this._pd.getAllMasterDatas(master_name).subscribe(data => { this._pd.getAllMasterDatas(master_name).subscribe(data => {
console.log('data', data); // console.log('data', data);
data.records.forEach(val => { data.records.forEach(val => {
if (val.isactive == 1) { if (val.isactive == 1) {
this.sourceData.push(val); this.sourceData.push(val);
@ -182,9 +182,9 @@ public viewerOptions: any = {
records.income_details = this.otherIncomeForm.controls['income_details'].value; records.income_details = this.otherIncomeForm.controls['income_details'].value;
} }
console.log('data', records); // console.log('data', records);
this._pd.saveForm(records).subscribe(data => { this._pd.saveForm(records).subscribe(data => {
console.log('data', data); // console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.'); this.notifier.notify('success', 'Saved Successfully.');
}, error => { }, error => {
this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); this.notifier.notify('warning', 'Something Wents Wrong Try Again.!');

View File

@ -142,7 +142,7 @@ export class StockComponent implements OnInit {
let arr = record.filter(data => data.type_of_activity_id == 1); let arr = record.filter(data => data.type_of_activity_id == 1);
if(arr.length > 0) { if(arr.length > 0) {
this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => { this._pd.retriveForm({pd_id:this.pdid,pd_form_id:1}).subscribe(value => {
console.log('136',value); // console.log('136',value);
if(value.status == 200){ if(value.status == 200){
this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials; this.suppliers_raw_materials = value.records.manufacturing_details[0].main_raw_materials;
let manufacturing_temparr = []; let manufacturing_temparr = [];

View File

@ -24,7 +24,7 @@
<br> <br>
<small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small> <small *ngIf="master.pd_allocated_to && master.fk_pd_type==1" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.pd_allocated_to | titlecase}}</small>
<small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small> <small *ngIf="master.executive_name && master.centralofficer && master.fk_pd_type==2" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.executive_name | titlecase}}/{{master.centralofficer | titlecase}}</small>
<small *ngIf="master.centralofficer && master.fk_pd_type==3" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.centralofficer | titlecase}}<br></small> <small *ngIf="master.centralofficer && master.fk_pd_type==3" style="text-align:left" matTooltip="PD Officer" matTooltipPosition="above">{{master.centralofficer | titlecase}}</small> <br>
<small *ngIf="master.pd_status==pdStatusCheck.SCHEDULED">{{master.scheduled_on}}</small> <small *ngIf="master.pd_status==pdStatusCheck.SCHEDULED">{{master.scheduled_on}}</small>

View File

@ -69,7 +69,7 @@ export class ProductListComponent implements OnInit {
//To open dialog for edit the data //To open dialog for edit the data
editProductMaster(arr: any[]) { editProductMaster(arr: any[]) {
//alert(arr); //alert(arr);
console.log(arr); // console.log(arr);
this.isPopupOpened = true; this.isPopupOpened = true;
//const contact = this._ProductService.getAllProductMaster().find(c => c.ID === id); //const contact = this._ProductService.getAllProductMaster().find(c => c.ID === id);
// let contact = this._ProductService.getProd().map(res=>res.filter(data =>data.product_id == id))[0]; // let contact = this._ProductService.getProd().map(res=>res.filter(data =>data.product_id == id))[0];

View File

@ -67,7 +67,7 @@ export class UomDialogComponent implements OnInit {
if(isNaN(this.data.uom_id)) { if(isNaN(this.data.uom_id)) {
Object.keys(UOMFormValues).forEach((key) => ( UOMFormValues[key] == null) && delete UOMFormValues[key]); Object.keys(UOMFormValues).forEach((key) => ( UOMFormValues[key] == null) && delete UOMFormValues[key]);
console.log(UOMFormValues); // console.log(UOMFormValues);
this._mastersService.addMasterDetails(UOMFormValues,'UOM').subscribe( this._mastersService.addMasterDetails(UOMFormValues,'UOM').subscribe(
dataresult=>{ dataresult=>{

View File

@ -59,7 +59,7 @@ export class PdTeamListComponent implements OnInit {
/** To edit data */ /** To edit data */
toEditPdTeam(pdteam_id){ toEditPdTeam(pdteam_id){
//this.router.navigate(['/setting/pdteam/editpdteam',pdteam_id]); //this.router.navigate(['/setting/pdteam/editpdteam',pdteam_id]);
console.log(btoa(pdteam_id)); // console.log(btoa(pdteam_id));
this.router.navigate(['/setting/pdteam/editpdteam',btoa(pdteam_id)]); this.router.navigate(['/setting/pdteam/editpdteam',btoa(pdteam_id)]);
} }

View File

@ -47,7 +47,7 @@ onNoClick(): void {
this.viewpage = true; this.viewpage = true;
this.pdTeamManageData = this.pdTeamManageData.records; this.pdTeamManageData = this.pdTeamManageData.records;
console.log(this.pdTeamManageData); // console.log(this.pdTeamManageData);
}else }else
{ {
@ -65,10 +65,10 @@ onNoClick(): void {
let [bagName, el, target, source] = args; let [bagName, el, target, source] = args;
//console.log(el); //console.log(el);
console.log(this.bag1.nativeElement); // console.log(this.bag1.nativeElement);
console.log(this.bag1.nativeElement === target); // console.log(this.bag1.nativeElement === target);
if(this.bag1.nativeElement){ // needed since dropModel triggers for all bags, not only on the dropped bag if(this.bag1.nativeElement){ // needed since dropModel triggers for all bags, not only on the dropped bag
console.log(this.bag1.nativeElement); // console.log(this.bag1.nativeElement);
let transferData:any = { let transferData:any = {
userid: el.dataset.id, userid: el.dataset.id,
@ -76,7 +76,7 @@ onNoClick(): void {
newTeamName: target.dataset.id, newTeamName: target.dataset.id,
oldIndex: el.dataset.index oldIndex: el.dataset.index
} }
console.log(el); // console.log(el);
for(let i = 0; i < that.pdTeamManageData.length; i++){ for(let i = 0; i < that.pdTeamManageData.length; i++){
let users = that.pdTeamManageData[i].USERPROFILE; let users = that.pdTeamManageData[i].USERPROFILE;
for(let us of users){ for(let us of users){
@ -85,7 +85,7 @@ onNoClick(): void {
//console.log(transferData); //console.log(transferData);
this.pdTeamNewList.push(transferData); this.pdTeamNewList.push(transferData);
//console.log(that.transferData); //console.log(that.transferData);
console.log(this.pdTeamNewList); // console.log(this.pdTeamNewList);
this.btnsave = false; this.btnsave = false;
break; break;
} }

View File

@ -101,7 +101,7 @@ export class RegisterComponent implements OnInit {
//console.log(this.types); //console.log(this.types);
this.regForm.controls['type'].setValue(this.types[0]); this.regForm.controls['type'].setValue(this.types[0]);
this.users.roles().subscribe(res=>{ this.users.roles().subscribe(res=>{
console.log(res); // console.log(res);
this.roleload = false; this.roleload = false;
//console.log(roleload); //console.log(roleload);
this.role = res; this.role = res;
@ -156,7 +156,7 @@ export class RegisterComponent implements OnInit {
var reader = new FileReader(); var reader = new FileReader();
//if($event.target.files[0] < 0 ){ //if($event.target.files[0] < 0 ){
this.files = $event.target.files[0]; this.files = $event.target.files[0];
console.log(this.files); // console.log(this.files);
reader.onload = ($event: ProgressEvent) => { reader.onload = ($event: ProgressEvent) => {
// console.log((<FileReader>$event.target).result); // console.log((<FileReader>$event.target).result);
@ -170,7 +170,7 @@ export class RegisterComponent implements OnInit {
register(userData) { register(userData) {
console.log(userData); // console.log(userData);
let data:any; let data:any;
// console.log(this.files); // console.log(this.files);
@ -199,7 +199,7 @@ this.loader = true;
if (data.status == 200) { if (data.status == 200) {
this.AWS.adminUpdateuser(userData, data.record).subscribe(res => { this.AWS.adminUpdateuser(userData, data.record).subscribe(res => {
this.loader =false; this.loader =false;
console.log(res); // console.log(res);
Swal('User Created'); Swal('User Created');
this.router.navigate(['setting/users/userlist']); this.router.navigate(['setting/users/userlist']);
}); });
@ -227,7 +227,7 @@ this.loader = true;
} }
toggleAllSelection(e,enitiyid) { toggleAllSelection(e,enitiyid) {
console.log(enitiyid); // console.log(enitiyid);
// if(e.value){ // if(e.value){
// if(e.value.role_name == pdoff && enitiyid.entity_type_id == 1){ // if(e.value.role_name == pdoff && enitiyid.entity_type_id == 1){
@ -255,8 +255,8 @@ this.loader = true;
} }
getcity(e){ getcity(e){
console.log(e); // console.log(e);
console.log(this.Cities); // console.log(this.Cities);
this.City = this.Cities.filter(city=>city.fk_state_id == e.value.state_id); this.City = this.Cities.filter(city=>city.fk_state_id == e.value.state_id);
@ -296,7 +296,7 @@ this.loader = true;
let role = this.role.filter(role=>role.role_type == this.usersData.fk_entity_type_id && role.role_id == this.usersData.user_role)[0]; let role = this.role.filter(role=>role.role_type == this.usersData.fk_entity_type_id && role.role_id == this.usersData.user_role)[0];
this.regForm.controls['role'].setValue(role); this.regForm.controls['role'].setValue(role);
console.log(role); // console.log(role);
this.toggleAllSelection(role,this.types[0]); this.toggleAllSelection(role,this.types[0]);
// this.regForm.controls['role'].setValue(role); // this.regForm.controls['role'].setValue(role);
@ -313,7 +313,7 @@ this.loader = true;
if (this.State.status == 200) { if (this.State.status == 200) {
this.State = this.State.records.filter(ent=>ent.isactive ==1); this.State = this.State.records.filter(ent=>ent.isactive ==1);
let states = this.State.filter(state => state.state_id == this.usersData.fk_state)[0]; let states = this.State.filter(state => state.state_id == this.usersData.fk_state)[0];
console.log(states); // console.log(states);
this.regForm.controls['state'].setValue(states); this.regForm.controls['state'].setValue(states);
this.users.City().subscribe(res => { this.users.City().subscribe(res => {
this.Cities = res; this.Cities = res;
@ -388,7 +388,7 @@ this.loader = true;
checktype(e){ checktype(e){
console.log(e); // console.log(e);
this.roleAccess= false; this.roleAccess= false;
let userRole:any; let userRole:any;
if(e !== undefined){ if(e !== undefined){
@ -396,7 +396,7 @@ this.loader = true;
//console.log(roleload); //console.log(roleload);
this.roles = this.role.filter(role=>role.role_type == e.entity_type_id); this.roles = this.role.filter(role=>role.role_type == e.entity_type_id);
console.log(this.roles); // console.log(this.roles);
// let role = this.roles.filter(role=>role.role_id == this.usersData.user_role_id); // let role = this.roles.filter(role=>role.role_id == this.usersData.user_role_id);
// console.log(role); // console.log(role);
// this.regForm.controls['role'].setValue(role); // this.regForm.controls['role'].setValue(role);

View File

@ -65,11 +65,11 @@ export class UserListComponent implements OnInit {
let data:any; let data:any;
this.users.getuserdata().subscribe(res => { this.users.getuserdata().subscribe(res => {
this.loader = false; this.loader = false;
console.log(res); // console.log(res);
data = res; data = res;
if (data.status == 200) { if (data.status == 200) {
this.userdata = data.records; this.userdata = data.records;
console.log(data.records.length); // console.log(data.records.length);
this.dataLength = data.records.length; this.dataLength = data.records.length;
this.dataSource.data = this.userdata; this.dataSource.data = this.userdata;
if(data.records.length >= 1){ if(data.records.length >= 1){