changes:ps

This commit is contained in:
venbatechnologies@gmail.com 2019-01-31 21:10:38 +05:30
parent 1213937b84
commit 0c1f37200d
17 changed files with 459 additions and 407 deletions

Binary file not shown.

View File

@ -178,7 +178,8 @@
</mat-form-field>
<mat-form-field style="width: 24%" *ngIf="pdMain.pincode.value == 1" >
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" type="number">
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.other_pincode.hasError('maxlength') || pdMain.other_pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field>
</mat-card-content>

View File

@ -95,7 +95,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
fk_city: [null],
fk_state: [null],
  pincode : [null],/** ,Validators.compose([Validators.minLength(6),Validators.maxLength(6)]) */
other_pincode:[null],
other_pincode:[null,Validators.compose([Validators.minLength(6),Validators.maxLength(6)])],
remarks:[null],
  // allocation_type: [null],
  // sub_allocation_type: [null],
@ -168,6 +168,7 @@ export class AddPdComponent implements OnInit, OnDestroy {
this.subProductList= this.productList.filter(item => item.product_id == productID);
this.subProductList=this.subProductList[0].subproducts;
this.subProductList = this.subProductList.filter(item => item.is_others == 0);
}
// get city list details based on state id

View File

@ -152,7 +152,8 @@
</mat-form-field>
<mat-form-field style="width: 24%" *ngIf="pdMain.pincode.value == 1" >
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" type="number">
<input matInput autocomplete="off" placeholder="Specify Pincode" formControlName="other_pincode" (keypress)="keyPress($event)">
<mat-error *ngIf="pdMain.other_pincode.hasError('pattern') || pdMain.other_pincode.hasError('maxlength') || pdMain.other_pincode.hasError('minlength')">Enter Valid Pincode. </mat-error>
</mat-form-field>
</mat-card-content>

View File

@ -134,6 +134,7 @@ export class EditPdMasterComponent implements OnInit {
loadFormData() {
console.log('this.data.record',this.data.records);
console.log('this.reocrds',this.data.records.pincode_id);
let stdcode;
let landline;
if(this.data.records.pd_contact_landline){
@ -170,15 +171,10 @@ export class EditPdMasterComponent implements OnInit {
  addressline1: [this.data.records.addressline1],
fk_city: [this.data.records.fk_city],
fk_state: [this.data.records.fk_state],
  pincode : [this.data.records.pincode],/** Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])], */
other_pincode:[this.data.records.other_pincode],
  pincode : [this.data.records.pincode_id],
other_pincode:[this.data.records.other_pincode,Validators.compose([Validators.minLength(6),Validators.maxLength(6),Validators.pattern('^[0-9]*$')])],
remarks: [this.data.records.remarks],
});
console.log('this.pincodeList.filter(data => data.pincode == formValue.pincode).pincode_id',this.pincodeList.filter(data => data.pincode == this.data.records.pincode).pincode_id);
console.log('this.pincodeList.filter(data => data.pincode == formValue.pincode)',this.pincodeList.filter(data => data.pincode == this.data.records.pincode));
console.log('this',this.pincodeList);
console.log(this.data.records.pincode);
this._EditPDtriggerForm.controls.pincode.setValue(1);
}
get pdMain() { return this._EditPDtriggerForm.controls; }

View File

@ -159,7 +159,7 @@ export class AddressComponent implements OnInit {
// }
this.addressForm.controls.other_premises_bussiness_activity.setValue(data.records.other_premises_bussiness_activity);
if(data.records.other_premises_bussiness_activity != '' && data.records.other_premises_bussiness_activity !=null) {
this.addressForm.controls.bussiness_activity_remark.setValue(data.records.other_premises_bussiness_activity);
this.addressForm.controls.bussiness_activity_remark.setValue(data.records.bussiness_activity_remark);
}
else{
this.addressForm.controls.bussiness_activity_remark.setValue('');

View File

@ -35,9 +35,9 @@
<div formArrayName="business_details" class="example-full-width">
<!--Property-->
<div *ngIf="sup.get('business_assets_mode').value == 2 ">
<div *ngIf="sup.get('business_assets_mode').value == 2">
<div *ngFor="let detail of sup['controls'].business_details['controls']; let s = index">
<div [formGroupName]="s">
<div [formGroupName]="s">
<div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:40%">
@ -45,10 +45,18 @@
<mat-option *ngFor="let prop of m_propertyType" [value]="prop.id">{{ prop.name | titlecase }}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('property_type').value == 5">
<mat-form-field style="width:40%" *ngIf="detail.get('property_type').value == 1">
<input matInput placeholder="Other Property Type" formControlName="other_property_type" autocomplete="off">
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('property_type').value != ''">
<mat-select placeholder="Ownership Type" formControlName="properties_ownership_type" (selectionChange)="selectedPropertyOwnedType($event.value,s,i)">
<mat-option value="owned">Owned</mat-option>
<mat-option value="rented">Rented</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:40%" *ngIf="detail.get('properties_ownership_type').value == 'rented'">
<input matInput autocomplete="off" placeholder="Monthly Rented Amount" formControlName="properties_monthly_rented_amt" (keypress)="keyPress($event)">
</mat-form-field>
</div>
</div>
</div>
@ -200,12 +208,12 @@
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<!-- <mat-form-field *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 5" style="width:45%"> -->
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 2" style="width:45%">
<mat-form-field *ngIf="(sup.get('business_assets_mode').value == 2 && PropertyOwnedType[i])" style="width:45%">
<input matInput placeholder="Approximate Market Value" formControlName="business_approximate_market_value" (keypress)="keyPress($event)" autocomplete="off" (keyup)="inWords($event,i,1)">
<mat-hint align="start" style="font-size:90%" *ngIf="sup.get('business_approximate_market_value').value != ''">{{"&#8377;"}} {{appxMarketAmtInwords[i]}} Only</mat-hint>
</mat-form-field>
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<mat-form-field *ngIf="sup.get('business_assets_mode').value == 1 || (sup.get('business_assets_mode').value == 2 && PropertyOwnedType[i])|| sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4" style="width:45%">
<mat-select placeholder="Asset Owned by"
formControlName="business_name_of_the_owner" [compareWith]="compareObjects" required>
<mat-optgroup *ngFor="let group of mergeCompanyApplicant" [label]="group.groupName">
@ -229,11 +237,9 @@
</mat-form-field> -->
</div>
<span *ngIf="sup.get('business_assets_mode').value == 1 || sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3">
<span *ngIf="sup.get('business_assets_mode').value == 1 || (sup.get('business_assets_mode').value == 2 && PropertyOwnedType[i]) || sup.get('business_assets_mode').value == 3">
<mat-form-field style="width:45%">
<mat-label>Vintage</mat-label>
<mat-label>Approx Vintage</mat-label>
<input matInput autocomplete="off" placeholder="eg.999" formControlName="business_vintage" minlength="1" maxlength="3" (keypress)="keyPress($event)" (keyup)="calculateVintagePurchase($event.target.value,i,1)">
<!-- <mat-error> Invalid format</mat-error> -->
</mat-form-field>
@ -244,9 +250,9 @@
<!-- <mat-error> Invalid year format</mat-error> -->
</mat-form-field>
</span>
<!-- <span *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4 || sup.get('business_assets_mode').value == 5 || sup.get('business_assets_mode').value == 6"> -->
<span *ngIf="sup.get('business_assets_mode').value == 2 || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4">
</span>
<span *ngIf="(sup.get('business_assets_mode').value == 2 && PropertyOwnedType[i]) || sup.get('business_assets_mode').value == 3 || sup.get('business_assets_mode').value == 4">
<div fxLayout="row wrap" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field style="width:95%">
@ -257,13 +263,12 @@
</mat-form-field>
</div>
</span>
</div>
</mat-card-content>
<mat-card-actions>
<div align="right">
<button type="button" mat-raised-button mat-icon-button (click)="removeAssetsDetails(i)"
matTooltip="Delete Business Assets" matTooltipPosition="above" class="mr-1 mb-1 hover-icon" *ngIf="!last" >
<button type="button" mat-raised-button mat-icon-button *ngIf="_businessAssetsQuesFrom.controls.business_assets_details.controls.length > 1" (click)="removeAssetsDetails(i)"
matTooltip="Delete Business Assets" matTooltipPosition="above" class="mr-1 mb-1 hover-icon">
<mat-icon>delete</mat-icon>
</button>
</div>

View File

@ -14,10 +14,15 @@
::ng-deep .cdk-global-overlay-wrapper{
justify-content: center !important;
}
.matcard mat-form-field {
margin: 0 2%;
}
mat-form-field {
mat-form-field {
margin: 0 2%;
}
}
$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);
.p-list-main {

View File

@ -16,7 +16,7 @@ import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
})
export class BusinessAssetsInfoComponent implements OnInit {
pageTitle: string ="Business Assets";
pageTitle: string ="Assets used for Business";
pdid:string;
public _businessAssetsQuesFrom: FormGroup;
@ -36,6 +36,7 @@ export class BusinessAssetsInfoComponent implements OnInit {
AssetValueInwords: any = [];
// B_emiAmtInwords: any = [];
public m_propertyType = [];
PropertyOwnedType : any = [];
// public m_investmentType = [];
// public m_freqOfPurchase = [];
private notifier: NotifierService;
@ -228,7 +229,22 @@ export class BusinessAssetsInfoComponent implements OnInit {
business_emi: [''],
});
}
selectedPropertyOwnedType(e,s,i){
// const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(i).get('business_details') as FormArray ;
if(e == "owned"){
// console.log('e o',e);
// console.log('s o',s);
// console.log('i o',i);
this.PropertyOwnedType[i] = true;
}
else{
// console.log('e r',e);
// console.log('s r',s);
// console.log('i r',i);
this.PropertyOwnedType[i] = false;
}
}
show: boolean;
selectedAssetsType(e: any, i: any): void {
let val = i;
@ -287,7 +303,9 @@ export class BusinessAssetsInfoComponent implements OnInit {
loadProperty() {
return this._formBuilder.group({
property_type: [''],
other_property_type: ['']
other_property_type: [''],
properties_ownership_type : [''],
properties_monthly_rented_amt:['']
});
}
@ -352,7 +370,9 @@ export class BusinessAssetsInfoComponent implements OnInit {
loadPropertyWithData(data) {
return this._formBuilder.group({
property_type: [data.property_type],
other_property_type: [data.other_property_type]
other_property_type: [data.other_property_type],
properties_ownership_type : [data.properties_ownership_type],
properties_monthly_rented_amt:[data.properties_monthly_rented_amt]
//property_type:['']
});
}
@ -477,7 +497,8 @@ export class BusinessAssetsInfoComponent implements OnInit {
case '2': {
let business_property_datas : any;
data.forEach((datas,i) => {
business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type };
business_property_datas = { 'property_type':datas.property_type,'other_property_type':datas.other_property_type,'properties_ownership_type':datas.properties_ownership_type,'properties_monthly_rented_amt':datas.properties_monthly_rented_amt };
this.selectedPropertyOwnedType(datas.properties_ownership_type,i,val);
});
const control = (<FormArray>this._businessAssetsQuesFrom.controls['business_assets_details']).at(val).get('business_details') as FormArray ;
control.push(this.loadPropertyWithData(business_property_datas));

View File

@ -43,7 +43,7 @@
<mat-icon>delete</mat-icon>
</button>
</div>
<div fxLayout="row nowrap" class="state-margin">
<div fxLayout="row nowrap" class="state-margin" *ngIf='!EntityTypeFlag'>
<mat-form-field style="width: 45%;" *ngIf="generalExistEntityType!='4' && generalExistEntityType!='9' && generalExistEntityType.value!=''">
<input matInput placeholder="Share of Profit / Shareholding (%)" (keypress)="keyPress($event)"
formControlName="shareholding">
@ -57,8 +57,8 @@
</mat-form-field>
</div>
<p style="margin-left: 2% !important">No of Years in Current Business</p>
<div fxLayout="row nowrap" class="state-margin">
<p style="margin-left: 2% !important" *ngIf='!EntityTypeFlag'>No of Years since formation of {{pageTitle}} </p>
<div fxLayout="row nowrap" class="state-margin" *ngIf='!EntityTypeFlag'>
<mat-form-field style="width: 20%;">
<input matInput placeholder="Year" formControlName="current_business_experiance_year" (keyup)="getWorkExperience(members.value,i)" required autocomplete="off" (keypress)="keyPress($event)" (change)="checkWithExistBusinessYear($event.target.value,i)" >
@ -70,19 +70,21 @@
<mat-form-field style="width: 35%;">
<input matInput placeholder="Total Work Experience"
formControlName="total_business_experiance" (keypress)="keyPress($event)" (keyup)="getWorkExperience(members.value,i)" autocomplete="off" required>
<mat-hint style="color: red;" *ngIf="members.value.current_business_experiance_year > members.value.total_business_experiance"> Total Experience is Lower than Experience's Year </mat-hint>
</mat-form-field>
</div>
<div fxLayout="row nowrap" *ngIf="members.value.total_business_previous_experience!=undefined">
<div fxLayout="row nowrap" *ngIf="members.value.total_business_previous_experience!=undefined && !EntityTypeFlag">
<mat-form-field style="width: 82%;">
<input matInput placeholder="Previous Work Experience Details"
formControlName="total_business_previous_experience" required>
</mat-form-field>
</div>
</div>
</div>
</mat-card-content>
<mat-card-actions align="center">
<mat-card-actions align="center" *ngIf='!EntityTypeFlag'>
<button type="button" mat-flat-button (click)="addPartnerDetails()"
matTooltip="Add More" matTooltipPosition="above" color="primary">
<strong>Add More {{businessEntityTypeList.section_label}}</strong>
@ -270,7 +272,7 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-label>Cities Where Max Sales Done for {{manufacturing.value.main_products}}</mat-label>
<mat-label>Countries Where Max Sales Done for {{manufacturing.value.main_products}}</mat-label>
<mat-select multiple placeholder="Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name,manufacturing.get('india_where_sale_done').value)" [value]="MCL.city_id">
{{MCL.city_name}}
@ -283,9 +285,9 @@
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done ==undefined">
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<div fxLayout="row wrap" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:35%;">
<mat-form-field style="width:70%;">
<mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label>
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
<mat-select placeholder="Countries" formControlName="country_name">
@ -294,9 +296,11 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
</mat-form-field>
<mat-form-field style="width:70%;">
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
<!-- <input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Approx % of Sale' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required> -->
<!-- <input matInput [placeholder]=" 'Out of Total Export Sales what % of Sales is done in ' getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required> -->
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeState(m,c,'2')" *ngIf="c>0"
@ -378,8 +382,8 @@
</div>
<p>Export</p>
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:55%;">
<div fxLayout="row wrap" class="tab_class" *ngFor="let countryList of manufacturing.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:70%;">
<mat-label>Countries Where The Export Is Being Done for {{manufacturing.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
@ -387,8 +391,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:35%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<mat-form-field style="width:70%;">
<!-- <input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required> -->
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
</mat-form-field>
@ -416,7 +421,8 @@
<textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Manufacturing Details" matTooltipPosition="above" (click)="deleteManufacturing(m)" *ngIf="!mlast">
<button mat-raised-button mat-icon-button matTooltip="Delete Products" matTooltipPosition="above" (click)="deleteManufacturing(m)"
*ngIf="businessForm.controls.manufacturing_activity_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -426,8 +432,8 @@
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addMoreManufacturing()"
matTooltip="Add More Manufacturing Details" matTooltipPosition="left" color="primary">
<strong>Add More Manufacturing Details</strong>
matTooltip="Add More Products" matTooltipPosition="left" color="primary">
<strong>Add More Products</strong>
</button>
</mat-card-actions>
</mat-card>
@ -514,9 +520,9 @@
<ng-container *ngIf="retail.value.india_where_sale_done ==undefined && retail.value.countries_where_export_done !=undefined">
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<div fxLayout="row wrap" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:55%;">
<mat-form-field style="width:70%;">
<mat-label>Countries Where Export Is Being Done for {{retail.value.main_products}}</mat-label>
<!-- <input matInput placeholder="Countries Where The Export Is Being Done" formControlName="country_name" > -->
@ -526,8 +532,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:35%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<mat-form-field style="width:70%;">
<!-- <input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required> -->
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeRetailState(r,c,'2')" *ngIf="c>0"
@ -611,8 +618,8 @@
</div>
<p>Export</p>
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:55%;">
<div fxLayout="row wrap" class="tab_class" *ngFor="let countryList of retail.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:70%;">
<mat-label>Countries Where The Export Is Being Done for {{retail.value.main_products}}</mat-label>
<mat-select placeholder="Countries Where The Export Is Being Done" formControlName="country_name">
@ -621,8 +628,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:35%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<mat-form-field style="width:70%;">
<!-- <input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required> -->
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
</mat-form-field>
@ -652,7 +660,8 @@
<textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Retail Details" matTooltipPosition="above" (click)="deleteRetail(c)" *ngIf="!rlast">
<button mat-raised-button mat-icon-button matTooltip="Delete Products" matTooltipPosition="above" (click)="deleteRetail(c)"
*ngIf="businessForm.controls.retail_trading_activity_details.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -662,8 +671,8 @@
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addMoreRetail()"
matTooltip="Add More Retail Details" matTooltipPosition="left" color="primary">
<strong>Add More Retail Details</strong>
matTooltip="Add More Products" matTooltipPosition="left" color="primary">
<strong>Add More Products</strong>
</button>
</mat-card-actions>
</mat-card>
@ -750,9 +759,9 @@
<ng-container *ngIf="wholesale.value.india_where_sale_done ==undefined && wholesale.value.countries_where_export_done !=undefined">
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<div fxLayout="row wrap" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:55%;">
<mat-form-field style="width:70%;">
<mat-label>Countries Where The Export Is Being Done for {{wholesale.value.main_products}}</mat-label>
<mat-select placeholder="Countries" formControlName="country_name">
<mat-option *ngFor="let CL of countryDataList" [value]="CL.country_id">
@ -760,8 +769,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:35%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<mat-form-field style="width:70%;">
<!-- <input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required> -->
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeWholesaleState(w,c,'2')" *ngIf="c>0"
@ -845,8 +855,8 @@
</div>
<p>Export</p>
<div formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:55%;">
<div fxLayout="row wrap" class="tab_class" *ngFor="let countryList of wholesale.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
<mat-form-field style="width:70%;">
<mat-label>Cities Where Max Sales Done for {{wholesale.value.main_products}}</mat-label>
<mat-label>Countries Where The Export Is Being Done for {{wholesale.value.main_products}}</mat-label>
@ -856,8 +866,9 @@
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:35%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<mat-form-field style="width:70%;">
<!-- <input matInput placeholder="Approx % of Sale" c -->
<input matInput [placeholder]="countryList.get('country_name').value == '' ? 'Out of Total Export Sales what % of Sales is done in' : getPlaceHolderName(countryList.get('country_name').value)" formControlName="approx_sale" required>
</mat-form-field>
@ -886,7 +897,8 @@
<textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Wholesale Details" matTooltipPosition="above" (click)="deleteWholesale(w)" *ngIf="!wlast">
<button mat-raised-button mat-icon-button matTooltip="Delete Products" matTooltipPosition="above" (click)="deleteWholesale(w)"
*ngIf="businessForm.controls.wholesale_trading_activity_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -896,8 +908,8 @@
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addMoreWholesale()"
matTooltip="Add More Wholesale Details" matTooltipPosition="left" color="primary">
<strong>Add More Wholesale Details</strong>
matTooltip="Add More Products" matTooltipPosition="left" color="primary">
<strong>Add More Products</strong>
</button>
</mat-card-actions>
</mat-card>
@ -1116,7 +1128,8 @@
<textarea matInput placeholder="Description" formControlName="description"></textarea>
</mat-form-field>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Service Provider Details" matTooltipPosition="above" (click)="deleteServiceprovider(sp)" *ngIf="!splast">
<button mat-raised-button mat-icon-button matTooltip="Delete Service" matTooltipPosition="above" (click)="deleteServiceprovider(sp)"
*ngIf="businessForm.controls.service_provider_activity_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -1126,8 +1139,8 @@
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addMoreServiceprovider()"
matTooltip="Add More Service Provider Details" matTooltipPosition="left" color="primary">
<strong>Add More Service Provider Details</strong>
matTooltip="Add More Service " matTooltipPosition="left" color="primary">
<strong>Add More Service </strong>
</button>
</mat-card-actions>
</mat-card>
@ -1143,7 +1156,8 @@
</mat-form-field>
</mat-card-content>
<div align="right">
<button mat-raised-button mat-icon-button matTooltip="Delete Details" matTooltipPosition="above" (click)="deleteOthersActivity(o)" *ngIf="!olast">
<button mat-raised-button mat-icon-button matTooltip="Delete Products" matTooltipPosition="above" (click)="deleteOthersActivity(o)"
*ngIf="businessForm.controls.others_activity_details.controls.length > 1">
<mat-icon>delete</mat-icon>
</button>
</div>
@ -1153,8 +1167,8 @@
</mat-card-content>
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addMoreOthersActivity()"
matTooltip="Add More Details" matTooltipPosition="left" color="primary">
Add More Details
matTooltip="Add More Products" matTooltipPosition="left" color="primary">
Add More Products
</button>
</mat-card-actions>
</mat-card>

View File

@ -46,6 +46,7 @@ export class BusinessInfoComponent implements OnInit {
relativeNames: any;
applicants: any;
EntityTypeFlag : boolean = false;
public businessForm: FormGroup;
private notifier: NotifierService;
// businessEntityTypeList: any=["Private Limited Company","Proprietorship","Partnership","Limited Liability Partnership (LLP)","One Person Company (OPC)","Hindu Undivided Family (HUF)","Society","Cooperative","Trust","Public Ltd Company","Others"]
@ -117,6 +118,7 @@ export class BusinessInfoComponent implements OnInit {
this.getCountryDataList();
this.initBusinessForm();
this.getCompanyRelation();
this.getTitle();
// const Desgn = <FormArray>this.businessForm.controls['designation'];
// const Partnr = <FormArray>this.businessForm.controls['partners'];
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
@ -1087,8 +1089,40 @@ export class BusinessInfoComponent implements OnInit {
this.businessEntityTypeList.business_entity_type_id = filterList[0].business_entity_type_id==1;
this.businessEntityTypeList.business_entity_type_name = filterList[0].business_entity_type_id!=1 ? filterList[0].business_entity_type_name : this.generalExistEntityType_other;
this.businessEntityTypeList.section_label = filterList[0].business_entity_type_id!=1 ? filterList[0].section_label : this.generalExistEntityType_other;
// console.log(this.businessEntityTypeList.business_entity_type_id+' , '+this.businessEntityTypeList.business_entity_type_name+' , '+this.businessEntityTypeList.section_label);
// if(this.businessEntityTypeList.business_entity_type_name == 'OPC (One Person Company)' || this.businessEntityTypeList.business_entity_type_name == 'Sole proprietorship'){
// console.log('condition');
// this.EntityTypeFlag = true;
// const Partnr: any = <FormArray>this.businessForm.controls['partners'];
// Partnr.partner_other_name.updateValueAndValidity();
// Partnr.partner_other_name.clearValidators();
// // Partnr.partner_other_name.setValue('');
// Partnr.shareholding.setValue('');
// Partnr.started_business.setValue('');
// Partnr.current_business_experiance_year.clearValidators();
// Partnr.current_business_experiance_year.updateValueAndValidity();
// Partnr.current_business_experiance_year.setValue('');
// Partnr.current_business_experiance_month.setValue('');
// Partnr.total_business_experiance.clearValidators();
// Partnr.total_business_experiance.updateValueAndValidity();
// Partnr.total_business_experiance.setValue('');
// Partnr.total_business_previous_experience.clearValidators();
// Partnr.total_business_previous_experience.updateValueAndValidity();
// Partnr.total_business_previous_experience.setValue('');
// Partnr.total_business_previous_experience.setValue('');
// }
// data.records.forEach(val => {
// this.businessEntityTypeList.push(val);
// this.sourceNames[val.business_entity_type_id] = val.section_label
@ -1234,6 +1268,16 @@ export class BusinessInfoComponent implements OnInit {
let control: any = this.businessForm.get('partners') as FormArray;
value=='Others' ? control.controls[key].addControl('partner_other_name', new FormControl('', Validators.required)) : control.controls[key].removeControl('partner_other_name');
}
// Out of Total Export Sales what % of Sales is done in Albania?
getPlaceHolderName(id){
let name = this.countryDataList.filter(value=>value.country_id == id);
// console.log(name);
// console.log(name[0].country_name);
// console.log(id);
return 'Out of Total Export Sales what % of Sales is done in '+ name[0].country_name +' ?';
// return name[0].country_name +'?';
}
// get work experience based on create form control
getWorkExperience(event, key) {
let current_experience = event.current_business_experiance_year=='' ? 0 : parseInt(event.current_business_experiance_year);
@ -1294,6 +1338,7 @@ export class BusinessInfoComponent implements OnInit {
}
// let design: any;
let records = this.businessForm.value;
// console.log(records);
//to check the Appx. sale validation.
// this.validateAppxSales(records);
@ -1310,6 +1355,18 @@ export class BusinessInfoComponent implements OnInit {
let validationFlag : number = 0;
// let shareHoldValidationFlag : number = 0;
// console.log(records.partners.length);
// console.log(records.partners);
if(records.partners.length > 0){
let total = records.partners.map(shares => shares.shareholding).reduce((a, b) => a + +b, 0);
if(total > 100){
this.notifier.notify('warning',"Shareholding is greater than 100%");
return;
}
}
// return;
//type 1: Checking manufacturing_activity_details
if(records.manufacturing_activity_details.length > 0){
@ -1321,7 +1378,7 @@ export class BusinessInfoComponent implements OnInit {
});
let total = ManufacturingArray.reduce((sum, item) => sum + +item.approx_sale, 0);
if(total > 100 || total < 100){
validationFlag++;
this.notifier.notify('warning',"Approximate sales doesn't add upto 100%");
}
}
});

View File

@ -27,16 +27,17 @@
</mat-card-header>
<div style="width:100%">
<mat-form-field style="width:25%">
<mat-form-field style="width:31%">
<mat-select placeholder="Financial Statements ?" formControlName="is_financial_statements" (selectionChange)="selectedStatement($event)">
<mat-select placeholder="Financial Statements Available ?" formControlName="is_financial_statements" (selectionChange)="selectedStatement($event)">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<span *ngIf="isDisplay">
<div *ngIf="isDisplay">
<mat-form-field style="width:37%">
<mat-label>Enter year from which financials provided</mat-label>
<input matInput autocomplete="off" placeholder="YYYY eg.2018" formControlName="financial_starting_year" (keypress)="keyPress($event)" [readonly]="isReadOnly">
@ -50,8 +51,8 @@
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Number of Financial Years" formControlName="financial_no_of_year" (change)="dynamicalFinYear($event)" (keypress)="keyPress($event)" [readonly]="isReadOnly">
</mat-form-field>
</span>
</div>
<div *ngIf="financial_no_of_year != ''" formArrayName="date_per_financial">
<!-- <div formArrayName="date_per_financial"> -->
@ -92,8 +93,7 @@
<div style="width:100%">
<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" > -->
<mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" >
<!-- (selectionChange)="selectedProfitOrLossType($event,1)> -->
<mat-select placeholder="Is there Net Profit or Net Loss?" formControlName="finanical_profit_or_loss" (selectionChange)="selectedProfitOrLossType($event,details)">
<mat-option value="1" >Net Profit</mat-option>
<mat-option value="2" >Net Loss</mat-option>
</mat-select>
@ -160,7 +160,7 @@
</div>
<span *ngIf="isDisplay">
<mat-form-field *ngIf="financial_no_of_year != '' && customerCommentsFlag" style="width:90%">
<input matInput autocomplete="off" placeholder="Customer Comments on Financials" formControlName="financial_reason" >
<input matInput autocomplete="off" placeholder="Comments on Financials" formControlName="financial_reason" >
</mat-form-field>
</span>
</mat-card>
@ -176,7 +176,7 @@
</mat-card-header>
<mat-form-field *ngIf="isDisplay" style="width:35%">
<mat-select placeholder="Same as Financial Statements?" formControlName="is_financial_customer" (selectionChange)="selectedFinancialCustomer($event)">
<mat-select placeholder="Same as Financial Statements ?" formControlName="is_financial_customer" (selectionChange)="selectedFinancialCustomer($event)">
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
@ -196,11 +196,13 @@
<!-- <br> -->
<!-- <span style="width:10%;padding-left:2%"><p>Sales</p></span> -->
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Sales From" formControlName="estimate_sales_from" (change)="calculateSalesAverage(i, details);">
<input matInput autocomplete="off" placeholder="Annual Sales From" formControlName="estimate_sales_from" (change)="calculateSalesAverage(i, details);" (keyup)="inWords($event,i,11)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_from').value != ''">{{"&#8377;"}} {{AV_SalesFrmInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- <span style="width:10%;padding-left:2%"><p>to</p></span> -->
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Sales To" formControlName="estimate_sales_to" (change)="confirmAlert(i, details);">
<input matInput autocomplete="off" placeholder="Annual Sales To" formControlName="estimate_sales_to" (change)="confirmAlert(i, details);" (keyup)="inWords($event,i,12)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_sales_to').value != ''">{{"&#8377;"}} {{AV_SalesToInwords[i]}} Only</mat-hint>
</mat-form-field>
<!-- <span style="width:10%;padding-left:2%"><p>Average</p></span> -->
<mat-form-field style="width:25%">
@ -212,15 +214,23 @@
<!-- </div> -->
<div style="width:100%">
<mat-form-field style="width:30%">
<mat-form-field style="width:39%">
<!-- <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="estimate_profit_or_loss" >
<mat-select placeholder="Was there Net Profit or Net Loss?" formControlName="estimate_profit_or_loss" >
<!-- (selectionChange)="selectedProfitOrLossType($event.value,2)"> -->
<mat-option value="1" >Net Profit</mat-option>
<mat-option value="2" >Net Loss</mat-option>
</mat-select>
</mat-form-field>
<span *ngIf="details.get('estimate_profit_or_loss').value == 1 ">
<mat-form-field style="width:40%" *ngIf="details.get('estimate_profit_or_loss').value != '' ">
<mat-select placeholder="Is there Net Margin information Available?" formControlName="estimate_net_margin_availablity" >
<mat-option value="yes" >Yes</mat-option>
<mat-option value="no" >No</mat-option>
</mat-select>
</mat-form-field>
<!-- <span *ngIf="details.get('estimate_profit_or_loss').value == 1 "> -->
<!-- <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit Amount" formControlName="estimate_net_profit" (change)="calMarginVal( i, details); calVariation( i, details)" (keyup)="inWords($event,i,5)">
@ -229,7 +239,7 @@
<mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Profit to Sales in %" formControlName="estimate_margin_of_profit" (change)="calProfitAndLossVal(i,details); calVariation( i, details)" (keypress)="keyPress($event)" >
</mat-form-field> -->
<div style="width:100%">
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'yes' ">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit From" formControlName="estimate_profit_range_from" type="number" (change)="calculateMarginProfit( i, details);">
</mat-form-field>
@ -241,12 +251,14 @@
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_profit_margin').value != ''"> {{"&#8377;"}} {{AV_marginProfitAmtInwords[i]}} Only ( {{"&#8377;"}} {{details.get('estimate_profit_margin').value}} ) </mat-hint>
</mat-form-field>
</div>
<div style="width:100%">
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 1 && details.get('estimate_net_margin_availablity').value == 'no' ">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit Amount From" formControlName="estimate_net_profit_from" type="number" (change)="calculateProfitAmount(i, details);">
<input matInput autocomplete="off" placeholder="Net Profit Amount From" formControlName="estimate_net_profit_from" type="number" (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,7)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_from').value != ''">{{"&#8377;"}} {{AV_netProfitAmtFrmInwords[i]}} Only </mat-hint>
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Profit Amount To" formControlName="estimate_net_profit_to" type="number" (change)="calculateProfitAmount(i, details);">
<input matInput autocomplete="off" placeholder="Net Profit Amount To" formControlName="estimate_net_profit_to" type="number" (change)="calculateProfitAmount(i, details);" (keyup)="inWords($event,i,8)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_profit_to').value != ''">{{"&#8377;"}} {{AV_netProfitAmtToInwords[i]}} Only </mat-hint>
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Profit Amount" formControlName="estimate_net_profit" type="number">
@ -254,11 +266,11 @@
<!-- // -->
</mat-form-field>
</div>
</span>
<!-- </span> -->
<span *ngIf="details.get('estimate_profit_or_loss').value == 2 ">
<div style="width:100%">
<!-- <span *ngIf="details.get('estimate_profit_or_loss').value == 2 "> -->
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'yes' ">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Loss From" formControlName="estimate_loss_range_from" type="number" (change)="calculateMarginLoss( i, details);">
</mat-form-field>
@ -271,12 +283,14 @@
<!-- // -->
</mat-form-field>
</div>
<div style="width:100%">
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2 && details.get('estimate_net_margin_availablity').value == 'no' ">
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Loss Amount From" formControlName="estimate_net_loss_from" type="number" (change)="calculateLossAmount(i, details);">
<input matInput autocomplete="off" placeholder="Net Loss Amount From" formControlName="estimate_net_loss_from" type="number" (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,9)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_from').value != ''">{{"&#8377;"}} {{AV_netLossAmtFrmInwords[i]}} Only </mat-hint>
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Net Loss Amount To" formControlName="estimate_net_loss_to" type="number" (change)="calculateLossAmount(i, details);">
<input matInput autocomplete="off" placeholder="Net Loss Amount To" formControlName="estimate_net_loss_to" type="number" (change)="calculateLossAmount(i, details);" (keyup)="inWords($event,i,10)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss_to').value != ''">{{"&#8377;"}} {{AV_netLossAmtToInwords[i]}} Only </mat-hint>
</mat-form-field>
<mat-form-field style="width:25%">
<input matInput autocomplete="off" placeholder="Considered Loss Amount" formControlName="estimate_net_loss" type="number">
@ -284,7 +298,12 @@
<!-- // -->
</mat-form-field>
</div>
</div>
<div style="width:100%" *ngIf="details.get('estimate_profit_or_loss').value == 2">
<mat-form-field style="width:83%">
<input matInput autocomplete="off" placeholder="What is the reason for the Loss?" formControlName="estimate_reason_for_loss">
</mat-form-field>
</div>
<!-- <mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss" formControlName="estimate_net_loss" (change)="calMarginVal( i, details); calVariation( i, details)" (keyup)="inWords($event,i,6)">
<mat-hint align="start" style="font-size:70%" *ngIf="details.get('estimate_net_loss').value != ''">{{"&#8377;"}} {{AV_netLossAmtInwords[i]}} Only</mat-hint>
@ -292,7 +311,7 @@
<mat-form-field style="width:28%">
<input matInput autocomplete="off" placeholder="Net Loss to Sales" formControlName="estimate_margin_of_loss" (keypress)="keyPress($event)" (change)="calProfitAndLossVal(i,details); calVariation( i, details)" >
</mat-form-field> -->
</span>
<!-- </span> -->
</div>
<!-- <mat-form-field *ngIf="i != 0" style="width:65%">
<input matInput autocomplete="off" [ngClass]="{'highlight': details.controls['estimate_variation'].value >= 40 || details.controls['estimate_variation'].value >= -40}" placeholder="Variation from Previous Year in %" formControlName="estimate_variation" (keypress)="keyPress($event)">

View File

@ -39,11 +39,6 @@ export class FinancialInfoComponent implements OnInit {
public financialForm: FormGroup;
private notifier: NotifierService;
// SalesStatement : any = [];
// marginVal: any = [] ;
// placeholderName : any = [];
// setmargin: AbstractControl;
customerCommentsFlag :boolean;
//Array for Amount Inwords
@ -60,6 +55,13 @@ export class FinancialInfoComponent implements OnInit {
//isreadonly for edit(no of year Fields and Starting Years )
isReadOnly : boolean = false;
isDisplay : boolean ;
AV_netProfitAmtFrmInwords: any = [];
AV_netProfitAmtToInwords: any = [];
AV_netLossAmtFrmInwords: any = [];
AV_netLossAmtToInwords: any = [];
AV_SalesFrmInwords: any = [];
AV_SalesToInwords: any = [];
constructor(notifier: NotifierService,
private fb: FormBuilder,
@ -110,7 +112,6 @@ export class FinancialInfoComponent implements OnInit {
if (value.status == 200) {
let retriveData = value.records;
// this.isReadOnly = true;
if(value.records.is_financial_statements == 'yes'){
/** Backend Data of Asper Statement */
@ -141,21 +142,16 @@ export class FinancialInfoComponent implements OnInit {
if (result_val.length > 0) {
result_val.forEach((val,index) => {
// console.log(val);
// console.log('val.estimate_sales_average',val.estimate_sales_average);
// if(isNaN(val.estimate_sales_average)){
// alert(val.estimate_sales_average + " is not a number <br/>");
// }else{
// alert(val.estimate_sales_average + " is a number <br/>");
// }
//console.log('dedrf',val.estimate_annual_sale);
// this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.estimate_annual_sale);
// this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.estimate_net_profit);
// this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.estimate_net_loss);
this.AV_SalesInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_average));
this.AV_SalesFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_from));
this.AV_SalesToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_sales_to));
this.AV_marginProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_profit));
this.AV_marginLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_loss_margin));
this.AV_netLossAmtFrmInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtToInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_profit_margin));
this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(Math.round(val.estimate_net_loss));
estimated_val.push(this.createValue(''));
});
@ -227,26 +223,13 @@ export class FinancialInfoComponent implements OnInit {
/** CREATING financial Customer ( financial_year AutoGenerate ) */
createValue(date) {
return this.fb.group({
// estimate_year: [date, Validators.compose([Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
// estimate_annual_sale: ['', Validators.compose([Validators.pattern(/^[0-9\(\)]+$/)])],
// estimate_sales_from: [''],
// estimate_sales_to: [''],
// estimate_sales_average: [''],
// estimate_profit_or_loss:[''],
// estimate_net_profit: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
// estimate_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
// //estimate_margin: [''],
// estimate_margin_of_profit: [''],
// estimate_margin_of_loss: [''],
// estimate_variation: [''],
// estimate_annualsales_variation : [''],
// estimate_reason: [''],
// estimate_year: ['', Validators.compose([Validators.pattern(/^[0-9]{4}-[0-9]{2}$/)])],
estimate_sales_from: [''],
estimate_sales_to: [''],
estimate_sales_average: [''],
estimate_profit_or_loss:[''],
estimate_net_margin_availablity:[''],
estimate_profit_range_from:[''],
estimate_profit_range_to:[''],
estimate_profit_margin_percent:[''],
@ -263,15 +246,8 @@ export class FinancialInfoComponent implements OnInit {
estimate_net_loss_to:[''],
estimate_net_loss_percent:[''],
estimate_net_loss:[''],
estimate_reason_for_loss:['']
// estimate_net_profit: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
// estimate_net_loss: ['', Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
// estimate_margin: [''],
// estimate_margin_of_profit: [''],
// estimate_margin_of_loss: [''],
// estimate_variation: [''],
// estimate_annualsales_variation : [''],
// estimate_reason: [''],
});
}
@ -284,6 +260,7 @@ export class FinancialInfoComponent implements OnInit {
estimate_sales_to: [value.estimate_sales_to],
estimate_sales_average: [value.estimate_sales_average],
estimate_profit_or_loss:[value.estimate_profit_or_loss],
estimate_net_margin_availablity:[value.estimate_net_margin_availablity],
estimate_profit_range_from:[value.estimate_profit_range_from],
estimate_profit_range_to:[value.estimate_profit_range_to],
estimate_profit_margin_percent:[value.estimate_profit_margin_percent],
@ -300,19 +277,7 @@ export class FinancialInfoComponent implements OnInit {
estimate_net_loss_to:[value.estimate_net_loss_to],
estimate_net_loss_percent:[value.estimate_net_loss_percent],
estimate_net_loss:[value.estimate_net_loss],
// estimate_annual_sale: [value.estimate_annual_sale, Validators.compose([ Validators.pattern(/^[0-9\(\)]+$/)])],
// estimate_sales_from: [''],
// estimate_sales_to: [''],
// estimate_sales_average: [''],
// estimate_profit_or_loss:[value.estimate_profit_or_loss],
// estimate_net_loss: [value.estimate_net_loss, Validators.compose([Validators.pattern(/^-?[1-9]\d*|0$/)])],
// estimate_net_profit: [value.estimate_net_profit, Validators.compose([ Validators.pattern(/^-?[1-9]\d*|0$/)])],
// //estimate_margin: [value.],
// estimate_margin_of_profit: [value.estimate_margin_of_profit],
// estimate_margin_of_loss: [value.estimate_margin_of_loss],
// estimate_variation: [value.estimate_variation],
// estimate_annualsales_variation : [value.estimate_annualsales_variation],
// estimate_reason: [''],
estimate_reason_for_loss:[value.estimate_reason_for_loss],
});
}
@ -334,11 +299,21 @@ export class FinancialInfoComponent implements OnInit {
control.removeAt(index);
}
selectedProfitOrLossType(e,detail){
console.log(e);
if(e.value == 1){
detail.controls.financial_net_loss.setValue('');
detail.controls.financial_margin_of_loss.setValue('');
}
else if(e.value == 2){
detail.controls.financial_net_profit.setValue('');
detail.controls.financial_margin_of_profit.setValue('');
}
}
/** For Auto-generating FinYear */
dynamicalFinYear($event){
//console.log(this.financialForm.controls['financial_no_of_year'].value);
//console.log('data',$event.target.value);
let e = $event.target.value;
if(e == 1){
this.customerCommentsFlag = false;
@ -359,7 +334,6 @@ export class FinancialInfoComponent implements OnInit {
for(let i = 1 ; i<= e ; i++ ){
let Year = (+startingYear+(i-1)) +'-'+ ((+startingYear)+(+i));
control.push(this.createDate(Year));
//console.log(this.financialForm.controls['financial_starting_year'].value);
}
}
}
@ -380,9 +354,7 @@ export class FinancialInfoComponent implements OnInit {
else if (e.value == 'no'){
this.isDisplay = false;
// let startingYear = this.financialForm.controls['financial_starting_year'].value;
// let totalFinYear = this.financialForm.controls['financial_no_of_year'].value;
const control = <FormArray>this.financialForm.controls['estimated_value'];
while (control.length !== 0) {
@ -417,105 +389,24 @@ export class FinancialInfoComponent implements OnInit {
control.removeAt(0);
}
}
// if(e.value == 'yes'){
// let startingYear = this.financialForm.controls['financial_starting_year'].value;
// const control = <FormArray>this.financialForm.controls['date_per_financial'];
// while (control.length !== 0) {
// control.removeAt(0);
// }
// if(e > 0 ){
// for(let i = 1 ; i<= e ; i++ ){
// let Year = (+startingYear+(i-1)) +'-'+ ((+startingYear)+(+i));
// control.push(this.createDate(Year));
// //console.log(this.financialForm.controls['financial_starting_year'].value);
// }
// }
// }
// if(e.value == 'yes'){
// let startingYear = this.financialForm.controls['financial_starting_year'].value;
// let totalFinYear = this.financialForm.controls['financial_no_of_year'].value;
// const control = <FormArray>this.financialForm.controls['estimated_value'];
// while (control.length !== 0) {
// control.removeAt(0);
// }
// if(totalFinYear > 0 ){
// for(let i = 1 ; i<= totalFinYear ; i++ ){
// let Year = (+startingYear+(i-1)) +'-'+ ((+startingYear)+(+i));
// control.push(this.createValue(Year));
// //console.log(this.financialForm.controls['financial_starting_year'].value);
// }
// }
// if(array.length > 0 ){
// array.value.forEach((val,index)=>{
// let vals = {
// estimate_year: val.financial_year,
// estimate_sales_from: '',
// estimate_sales_to: '',
// estimate_sales_average: '',
// // estimate_annual_sale: val.financial_annual_sale,
// estimate_profit_or_loss:val.finanical_profit_or_loss,
// estimate_net_loss: val.financial_net_loss,
// estimate_net_profit: val.financial_net_profit,
// estimate_margin_of_profit: val.financial_margin_of_profit,
// estimate_margin_of_loss: val.financial_margin_of_loss,
// estimate_variation: val.financial_variation,
// estimate_annualsales_variation : val.financial_annualsales_variation,
// };
// this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.financial_annual_sale);
// this.AV_netProfitAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_profit);
// this.AV_netLossAmtInwords[index] = this._pd.convertNumberToWords(val.financial_net_loss);
// control.push(this.createValuewithData(vals));
// });
// }
//control.controls[0].get('raw_quantity').setValidators([Validators.required]);
//control.push(this.createValue(YearParam));
// }
else if (e.value == 'no'){
// let startingYear = this.financialForm.controls['financial_starting_year'].value;
// let totalFinYear = this.financialForm.controls['financial_no_of_year'].value;
const control = <FormArray>this.financialForm.controls['estimated_value'];
while (control.length !== 0) {
control.removeAt(0);
}
// alert((new Date()).getFullYear());
let year1 = (new Date()).getFullYear();
let year2 = ((new Date()).getFullYear() - 1);
let Year = year2 +'-'+ year1;
// alert(Year);
control.push(this.createValue(Year));
}
}
// calYearVariation(index, detail) {
// let profit = detail.value.financial_net_profit;
// if ( profit != '' && index != 0) {
// console.log('value')
// let array = <FormArray>this.financialForm.controls['date_per_financial']
// let prev_profit = array.value[index - 1].financial_net_profit;
// let variation = ((profit - prev_profit)/ prev_profit) * 100;
// detail.controls.financial_variation.setValue(variation.toFixed(2))
// // detail.controls.financial_variation.disable()
// }
// }
/**calculating Annual Sale for financial Statement */
calFinAnnualSale(index,detail){
let annual_sale = detail.value.financial_annual_sale;
@ -544,7 +435,8 @@ export class FinancialInfoComponent implements OnInit {
let profit = detail.value.financial_net_profit;
let loss = detail.value.financial_net_loss;
console.log('current profit',profit);
console.log('current loss',loss);
if ( (profit != '' || loss != '') && index != 0) {
let array = <FormArray>this.financialForm.controls['date_per_financial'];
@ -552,8 +444,13 @@ export class FinancialInfoComponent implements OnInit {
let prev_profit = array.value[index - 1].financial_net_profit != '' ? array.value[index - 1].financial_net_profit : 0;
let prev_loss = array.value[index - 1].financial_net_loss !='' ? array.value[index - 1].financial_net_loss : 0 ;
console.log('prev_profit',prev_profit);
console.log('prev_loss',prev_loss);
loss = loss != 0 ? loss * (-1) : loss;
console.log('-1',loss);
prev_loss = prev_loss != 0 ? prev_loss * (-1) : prev_loss ;
console.log('prev_loss',prev_loss);
let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
@ -583,10 +480,9 @@ export class FinancialInfoComponent implements OnInit {
let salary = detail.value.financial_annual_sale;
let profit_margin;
let loss_margin;
// let prev_annual_sale = array.value[index-1].financial_annual_sale;
// let annual_sale_variation = ((prev_annual_sale - salary)/salary ) * 100 ;
if(detail.value.finanical_profit_or_loss == 1){
loss_margin = '';
detail.controls.financial_margin_of_loss.setValue('');
@ -620,45 +516,36 @@ export class FinancialInfoComponent implements OnInit {
if ((profit_margin != '' || loss_margin != '') && index != 0) {
// console.log('profit_margin',profit_margin);
// console.log('loss_margin',loss_margin);
// console.log('index',index);
console.log('Current profit_margin',profit_margin);
let array = <FormArray>this.financialForm.controls['date_per_financial'];
// console.log('array',array);
let prev_profit_margin = array.value[index - 1].financial__margin_of_profit != '' ? array.value[index - 1].financial_margin_of_profit : 0;
let prev_loss_margin = array.value[index - 1].financial__margin_of_loss !='' ? array.value[index - 1].financial_margin_of_loss : 0 ;
// console.log('preprofit_margin',prev_profit_margin);
// console.log('preloss_margin',prev_profit_margin);
console.log('pre profit_margin',prev_profit_margin);
loss_margin = loss_margin != 0 ? loss_margin * (-1) : loss_margin;
prev_loss_margin = prev_loss_margin != 0 ? prev_loss_margin * (-1) : prev_loss_margin ;
loss_margin = loss_margin != 0 ? loss_margin : loss_margin;
prev_loss_margin = prev_loss_margin != 0 ? prev_loss_margin : prev_loss_margin ;
console.log('Current loss_margin',loss_margin);
console.log('pre loss_margin',prev_loss_margin);
let variation_percent = (((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100;
console.log((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ));
console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))));
console.log((((profit_margin != '' ? profit_margin : loss_margin ) - (prev_profit_margin != '' ? prev_profit_margin : prev_loss_margin ))/ (prev_profit_margin != '' ? Math.abs(prev_profit_margin) : Math.abs(prev_loss_margin))) * 100);
detail.controls.financial_profit_to_sale_variation.setValue(variation_percent.toFixed(2));
}
//detail.controls.financial_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
}
/** For Financial Customer
* Calculating Yearwise Variation
*/
calVariation(index, detail) {
// console.log('CalVar In');
// let profit = detail.value.estimate_net_profit;
// let curr_year = detail.value.financial_year;
// if ( profit != '' && index != 0) {
// let array = <FormArray>this.financialForm.controls['estimated_value']
// let prev_profit = array.value[index - 1].estimate_net_profit;
// let variation = ((profit - prev_profit) / prev_profit) * 100;
// detail.controls.estimate_variation.setValue(variation.toFixed(2))
// let prev_year = array.value[index - 1].financial_year;
// // detail.controls.estimate_variation.disable()
// }
let profit = detail.value.estimate_net_profit;
let loss = detail.value.estimate_net_loss;
//let curr_year = detail.value.estimate_year;
@ -674,15 +561,8 @@ export class FinancialInfoComponent implements OnInit {
prev_loss = prev_loss != 0 ? prev_loss * (-1) : prev_loss ;
let variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
// let variation ;
// if(profit != ''){
// variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? prev_profit : prev_loss)) * 100 ;
// }
// else if(loss != ''){
// variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? prev_profit : prev_loss)) * 100 * (profit != '' ? (1) : (-1));
// }
detail.controls.estimate_variation.setValue(variation.toFixed(2));
detail.controls.estimate_variation.setValue(variation.toFixed(2));
}
}
@ -692,12 +572,6 @@ export class FinancialInfoComponent implements OnInit {
calMarginVal(index, detail) {
let salary = detail.value.estimate_annual_sale;
// if (salary != '' && profit != '') {
// let margin = profit / salary * 100;
// detail.controls.estimate_margin.setValue(margin.toFixed(2))
// // detail.controls.estimate_margin.disable()
// }
if(detail.value.estimate_profit_or_loss == 1){
let profit = detail.value.estimate_net_profit;
@ -719,34 +593,6 @@ export class FinancialInfoComponent implements OnInit {
}
// selectedProfitOrLossType($event,index,flag){
// if(flag == 1){
// let array = <FormArray>this.financialForm.controls['date_per_financial'];
// if($event == 1){
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// }
// else if($event == 2){
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// }
// }
// else if(flag == 2){
// let array = <FormArray>this.financialForm.controls['estimated_value'];
// if($event == 1){
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// }
// else if($event == 2){
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// }
// }
// }
calProfitAndLossVal( i, detail) {
let salary = detail.value.estimate_annual_sale;
if(detail.value.estimate_profit_or_loss == 1){
@ -768,46 +614,6 @@ export class FinancialInfoComponent implements OnInit {
}
}
// calAmount(i, detail) {
// console.log(detail);
// let salary = detail.value.estimate_annual_sale;
// if(detail.value.estimate_profit_or_loss == 1){
// // let profit = detail.value.estimate_net_profit;
// let margin_profit = detail.value.estimate_margin_of_profit;
// if (salary != '' && margin_profit != '') {
// //let margin = profit / salary * 100;
// let profit = margin_profit / salary * 100;
// console.log('margin',margin_profit);
// console.log('profit',profit);
// //detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
// detail.controls.estimate_net_profit.setValue(profit.toFixed(2));
// }
// }
// else if (detail.value.estimate_profit_or_loss == 2){
// let loss = detail.value.estimate_net_profit;
// console.log('else if Margin loss',loss);
// if (salary != '' && loss != '') {
// console.log('elseif if Margin Estimate salary',salary);
// console.log('alseif if Margin loss',loss);
// let margin = (loss / salary) * 100;
// detail.controls.estimate_margin_of_loss.setValue(margin.toFixed(2));
// }
// }
//}
confirmAlert(i, details){
let estimate_sales_from = +details.value.estimate_sales_from;
@ -817,20 +623,65 @@ export class FinancialInfoComponent implements OnInit {
let C = (estimate_sales_to - estimate_sales_from)
let D = (C / estimate_sales_from) * 100;
// % Decrease = Decrease ÷ Original Number × 100
if(D >= 30){
var r = confirm("Given Sales Range is greater than 30%");
if (r == true) {
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}else{
details.controls.estimate_sales_to.setValue('');
return;
if(estimate_sales_from <= 5000000){
if(D >= 20){
var r = confirm("Given Sales Range is greater than 20%");
if (r == true) {
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}else{
details.controls.estimate_sales_to.setValue('');
return;
}
}
else{
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}
}
else if(estimate_sales_from > 5000000 || estimate_sales_from <= 10000000){
if(D >= 15){
var r = confirm("Given Sales Range is greater than 15%");
if (r == true) {
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}else{
details.controls.estimate_sales_to.setValue('');
return;
}
}
else{
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}
}
else if(estimate_sales_from > 10000000){
if(D >= 10){
var r = confirm("Given Sales Range is greater than 10%");
if (r == true) {
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}else{
details.controls.estimate_sales_to.setValue('');
return;
}
}
else{
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}
}
else{
details.controls.estimate_sales_to.setValue(estimate_sales_to);
}
// if(D >= 30){
// var r = confirm("Given Sales Range is greater than 30%");
// if (r == true) {
// details.controls.estimate_sales_to.setValue(estimate_sales_to);
// }else{
// details.controls.estimate_sales_to.setValue('');
// return;
// }
// }
// else{
// details.controls.estimate_sales_to.setValue(estimate_sales_to);
// }
}
this.calculateSalesAverage(i, details);
}
@ -843,19 +694,13 @@ export class FinancialInfoComponent implements OnInit {
if(estimate_sales_from != '' && estimate_sales_to != ''){
let range1 = +estimate_sales_from/10;
// console.log('range1',range1);
let lower = (+estimate_sales_from)+range1;
let higer = ((+estimate_sales_to + +estimate_sales_from) / 2);
// console.log(lower);
// console.log(higer);
if(lower > higer){
details.controls.estimate_sales_average.setValue(higer.toFixed(2));
this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer));
}
else{
details.controls.estimate_sales_average.setValue(lower.toFixed(2));
@ -864,7 +709,6 @@ export class FinancialInfoComponent implements OnInit {
}
else{
// alert('Check Both Sales Range Fields');
details.controls.estimate_sales_average.setValue('');
}
@ -878,13 +722,30 @@ export class FinancialInfoComponent implements OnInit {
if (sales_average != '' && estimate_profit_range_from != '' && estimate_profit_range_to != ''){
let profit_percent = (estimate_profit_range_to + estimate_profit_range_from)/2;
let profit_percent = (estimate_profit_range_to + estimate_profit_range_from)/2;
let Profit_Average = (profit_percent*sales_average)/100;
details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average));
details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2));
if(Profit_Average >= 3){
var r = confirm("Given Profit Range is greater than 3%");
if (r == true) {
details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average));
details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2));
this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
}else{
details.controls.estimate_profit_range_to.setValue('');
details.controls.estimate_profit_margin.setValue('');
details.controls.estimate_profit_margin_percent.setValue('');
return;
}
}
else{
alert('else part');
}
// details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average));
// details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2));
this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average));
}
@ -899,31 +760,36 @@ export class FinancialInfoComponent implements OnInit {
if (sales_average != '' && estimate_net_profit_from != '' && estimate_net_profit_to != ''){
// let profit_percent = (estimate_net_profit_to - estimate_net_profit_from)/estimate_net_profit_from * 100;
// let Profit_Average = (profit_percent*sales_average)/100;
let profit_amount = (estimate_net_profit_to + estimate_net_profit_from)/2;
let Profit_percent = (profit_amount/sales_average)*100;
details.controls.estimate_net_profit.setValue(Math.round(profit_amount));
details.controls.estimate_net_profit_percent.setValue(Profit_percent.toFixed(2));
// details.controls.estimate_net_profit.setValue(Math.round(profit_amount));
// details.controls.estimate_net_profit_percent.setValue(Profit_percent.toFixed(2));
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(profit_amount));
// this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(profit_amount));
if(Profit_percent >= 3){
var r = confirm("Given Profit Percentage is greater than 3%");
if (r == true) {
details.controls.estimate_net_profit.setValue(Math.round(profit_amount));
details.controls.estimate_net_profit_percent.setValue(Profit_percent.toFixed(2));
this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(profit_amount));
}else{
details.controls.estimate_net_profit_to.setValue('');
details.controls.estimate_net_profit.setValue('');
details.controls.estimate_net_profit_percent.setValue('');
return;
}
}
else{
alert('else part');
}
}
// let estimate_net_profit_from = details.value.estimate_net_profit_from;
// let estimate_net_profit_to = details.value.estimate_net_profit_to;
// if (estimate_net_profit_from != '' && estimate_net_profit_to != ''){
// let AB = (estimate_net_profit_to + estimate_net_profit_from)/2;
// let C = (estimate_net_profit_to - estimate_net_profit_from);
// let D = (C / estimate_net_profit_from);
// let E = D*100;
// details.controls.estimate_net_profit_percent.setValue(E);
// details.controls.estimate_net_profit.setValue(AB);
// }
}
calculateMarginLoss( i, details){
@ -937,10 +803,28 @@ export class FinancialInfoComponent implements OnInit {
let loss_percent = (estimate_loss_range_to + estimate_loss_range_from)/2;
let loss_Average = (loss_percent*sales_average)/100;
details.controls.estimate_loss_margin.setValue(Math.round(loss_Average));
details.controls.estimate_loss_margin_percent.setValue(loss_percent.toFixed(2));
// details.controls.estimate_loss_margin.setValue(Math.round(loss_Average));
// details.controls.estimate_loss_margin_percent.setValue(loss_percent.toFixed(2));
this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average));
// this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average));
if(loss_Average >= 3){
var r = confirm("Given Profit Range is greater than 3%");
if (r == true) {
details.controls.estimate_loss_margin.setValue(Math.round(loss_Average));
details.controls.estimate_loss_margin_percent.setValue(loss_percent.toFixed(2));
this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average));
}else{
details.controls.estimate_loss_range_to.setValue('');
details.controls.estimate_loss_margin.setValue('');
details.controls.estimate_loss_margin_percent.setValue('');
return;
}
}
else{
alert('else part');
}
}
@ -960,10 +844,31 @@ export class FinancialInfoComponent implements OnInit {
let loss_amount = (estimate_net_loss_to + estimate_net_loss_from)/2;
let loss_percent = (loss_amount/sales_average)*100;
details.controls.estimate_net_loss.setValue(Math.round(loss_amount));
details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2));
// details.controls.estimate_net_loss.setValue(Math.round(loss_amount));
// details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2));
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount));
// this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount));
if(loss_percent >= 3){
var r = confirm("Given Loss Percentage is greater than 3%");
if (r == true) {
details.controls.estimate_net_loss.setValue(Math.round(loss_amount));
details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2));
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount));
}else{
details.controls.estimate_net_loss_to.setValue('');
details.controls.estimate_net_loss.setValue('');
details.controls.estimate_net_loss_percent.setValue('');
return;
}
}
else{
alert('else part');
}
}
@ -1081,6 +986,24 @@ export class FinancialInfoComponent implements OnInit {
case 6 :
this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 7 :
this.AV_netProfitAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 8 :
this.AV_netProfitAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 9 :
this.AV_netLossAmtFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 10 :
this.AV_netLossAmtToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 11 :
this.AV_SalesFrmInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
case 12 :
this.AV_SalesToInwords[i] = this._pd.convertNumberToWords(e.target.value);
break;
default:
break;
}

View File

@ -52,6 +52,12 @@
</mat-select>
</mat-cell>
</ng-container>
<ng-container matColumnDef="qualification_reason">
<mat-header-cell *matHeaderCellDef> </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i" [style.visibility]="_generalForm.controls.individuals.value[i].qualification == '' ? 'hidden':'visible'">
<input matInput [placeholder]="_generalForm.controls.individuals.value[i].qualification == 1 ? 'Specify Qualification ': 'Qualification Reason'" formControlName="qualification_reason" autocomplete="off">
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
@ -238,7 +244,7 @@
<mat-card-actions align="center">
<button type="button" mat-flat-button (click)="addCompanyRelationshipDialogue()"
matTooltip="Add More" matTooltipPosition="left" color="primary">
<strong>Add More Company Relationship</strong>
<strong>Add Company Relationship</strong>
</button>
</mat-card-actions>
</mat-card>

View File

@ -24,7 +24,7 @@ export class GeneralInfoComponent implements OnInit {
count : number = 1;
private notifier: NotifierService;
public _generalForm: FormGroup;
displayedColumns = ['applicant_name','is_person_met','is_applicant','age','qualification'];
displayedColumns = ['applicant_name','is_person_met','is_applicant','age','qualification','qualification_reason'];
public individualsSource= new MatTableDataSource();
public relationSource= new MatTableDataSource();
public CompanySource = new MatTableDataSource();
@ -112,7 +112,7 @@ export class GeneralInfoComponent implements OnInit {
this.companyRelationShipList=data.records.filter(item => item.name != 'Others');
}
if(type==3){
this.qualificationList = data.records.filter(item => item.qualification_name != 'Others');
this.qualificationList = data.records;
}
if(type==4) {
this.businessEntityTypeList = data.records;
@ -231,6 +231,7 @@ export class GeneralInfoComponent implements OnInit {
element.individuals_order_id = key+1;
element.age = '',
element.qualification = '',
element.qualification_reason = '',
individualsControl.push(this.createIndividulas(element));
personsWithRelationshipsControl.push(this.createPersonsWithRelationships(element));
//let relationControl = <FormArray>this._generalForm.controls['applicant_relation'];
@ -268,7 +269,8 @@ export class GeneralInfoComponent implements OnInit {
is_new:[elementValue.is_new],
individuals_order_id: [elementValue.individuals_order_id],
age: [elementValue.age],
qualification: [elementValue.qualification]
qualification: [elementValue.qualification],
qualification_reason:[elementValue.qualification_reason]
});
}
createPersonsWithRelationships(elementValue:any){

View File

@ -98,7 +98,7 @@
<span><i class="fa-1x fa fa-map-marker" style="width: 37px;padding: 8px 9px 8px 9px;border-bottom: 2px solid red;" (click)="Maponclick(master)" matTooltip="Map View" matTooltipPosition="left"></i></span>
</div>
<div fxFlex="90">
<span *ngIf="master.state_name" class="hover-icon"> {{master.addressline1}},<br> {{master.city_name}},<br>{{master.state_name}}-{{master.pincode}} </span>
<span *ngIf="master.state_name" class="hover-icon"> {{master.addressline1}},<br> {{master.city_name}},<br>{{master.state_name}}-{{master.pincode_id == 1 ? master.other_pincode : master.pincode }} </span>
</div>
</div>
</div>

View File

@ -134,6 +134,7 @@ export class ViewPdComponent implements OnInit, OnDestroy {
if (data.status == 200) {
let masterData: any = data.records.pd_master_details;
this.pdMasterData.push(masterData[0]);
console.log('this.pdMasterData',this.pdMasterData);
this.mandatoryFieldsValidations = masterData[1].mandatory_fields;
this.pd_QC_Rating = Number(this.pdMasterData.qc_rating);
this.pdApplicantData= data.records.applicants_details;