financial-info, qc form details changes : kdk

This commit is contained in:
dineshkumarkannan 2018-11-17 13:23:41 +05:30
parent 8318819a34
commit 673ccb490f
3 changed files with 6 additions and 5 deletions

View File

@ -22,7 +22,7 @@
<input matInput placeholder="Margin" formControlName="financial_margin"> <input matInput placeholder="Margin" formControlName="financial_margin">
</mat-form-field> </mat-form-field>
<mat-form-field *ngIf="i != 0"> <mat-form-field *ngIf="i != 0">
<input matInput [ngClass]="{'highlight': details.controls['financial_variation'].value >= 40 || details.controls['financial_variation'].value >= -40}" placeholder="Variation from Previous Year" formControlName="financial_variation"> <input matInput [ngClass]="{'highlight': (details.controls['financial_variation'].value > 40) || (details.controls['financial_variation'].value < -40)}" placeholder="Variation from Previous Year" formControlName="financial_variation">
</mat-form-field> </mat-form-field>
<mat-form-field> <mat-form-field>
<input matInput placeholder="Reason For Major Difference" formControlName="financial_reason"> <input matInput placeholder="Reason For Major Difference" formControlName="financial_reason">

View File

@ -134,7 +134,7 @@ export class FinancialInfoComponent implements OnInit {
console.log('value') console.log('value')
let array = <FormArray>this.financialForm.controls['date_per_financial'] let array = <FormArray>this.financialForm.controls['date_per_financial']
let prev_profit = array.value[index - 1].financial_net_profit; let prev_profit = array.value[index - 1].financial_net_profit;
let variation = profit - prev_profit / prev_profit * 100; let variation = ((profit - prev_profit)/ prev_profit) * 100;
detail.controls.financial_variation.setValue(variation.toFixed(2)) detail.controls.financial_variation.setValue(variation.toFixed(2))
// detail.controls.financial_variation.disable() // detail.controls.financial_variation.disable()
} }
@ -144,7 +144,7 @@ export class FinancialInfoComponent implements OnInit {
let salary = detail.value.financial_annual_sale; let salary = detail.value.financial_annual_sale;
let profit = detail.value.financial_net_profit; let profit = detail.value.financial_net_profit;
if (salary != '' && profit != '') { if (salary != '' && profit != '') {
let margin = profit / salary * 100; let margin = (profit / salary) * 100;
detail.controls.financial_margin.setValue(margin.toFixed(2)) detail.controls.financial_margin.setValue(margin.toFixed(2))
// detail.controls.financial_margin.disable() // detail.controls.financial_margin.disable()
} }
@ -154,7 +154,7 @@ export class FinancialInfoComponent implements OnInit {
if ( profit != '' && index != 0) { if ( profit != '' && index != 0) {
let array = <FormArray>this.financialForm.controls['estimated_value'] let array = <FormArray>this.financialForm.controls['estimated_value']
let prev_profit = array.value[index - 1].estimate_net_profit; let prev_profit = array.value[index - 1].estimate_net_profit;
let variation = profit - prev_profit / prev_profit * 100; let variation = ((profit - prev_profit) / prev_profit) * 100;
detail.controls.estimate_variation.setValue(variation.toFixed(2)) detail.controls.estimate_variation.setValue(variation.toFixed(2))
// detail.controls.estimate_variation.disable() // detail.controls.estimate_variation.disable()
} }

View File

@ -64,7 +64,7 @@
<!-- <h6 class="mt-0">About</h6> --> <!-- <h6 class="mt-0">About</h6> -->
<p>No Records Found..</p> <p>No Records Found..</p>
</mat-card-content> </mat-card-content>
</div>
<!-- check type of questions --> <!-- check type of questions -->
<ng-container [ngSwitch]="selectedCategory.fk_question_answertype"> <ng-container [ngSwitch]="selectedCategory.fk_question_answertype">
@ -370,6 +370,7 @@
</ng-container> </ng-container>
</ng-container> </ng-container>
</div>
<!-- end check box questions section --> <!-- end check box questions section -->
<!-- start forms based questions --> <!-- start forms based questions -->
<div *ngIf="formsCategoryEnable"> <div *ngIf="formsCategoryEnable">