finanical issues : ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-10 16:28:29 +05:30
parent 121ff7b31b
commit 376ffeaef8
2 changed files with 102 additions and 99 deletions

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) {