This commit is contained in:
venbatechnologies@gmail.com 2018-12-30 12:24:43 +05:30
commit c55c60a1c7
2 changed files with 613 additions and 163 deletions

View File

@ -19,7 +19,7 @@
<div fxFlex="100">
<mat-card>
<mat-card-header>
<p>About Business</p>
<mat-card-title>About Business</mat-card-title>
</mat-card-header>
<mat-card-content>
<div flexLayout="row wrap">
@ -31,24 +31,24 @@
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.profession_name.value=='Others'">
<input matInput placeholder="Other Name in Which The Business is Run" formControlName="profession_name_other" required>
<input matInput placeholder="Name in Which The Business is Run" formControlName="profession_name_other" required>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-select placeholder="Business Entity Type"
formControlName="business_entity_type" required>
<mat-option value="{{entity}}" *ngFor="let entity of businessEntityTypeList">{{entity | titlecase}}</mat-option>
<mat-option [value]="entity.business_entity_type_id" *ngFor="let entity of businessEntityTypeList">{{entity.business_entity_type_name | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='Others'">
<mat-form-field style="width: 45%;" *ngIf="businessForm.controls.business_entity_type.value=='11'">
<input matInput placeholder="Other Business Entity Type" formControlName="business_entity_type_other" required>
</mat-form-field>
<mat-form-field style="width: 45%">
<!-- <mat-form-field style="width: 45%">
<mat-select placeholder="Industry"
formControlName="industry">
<mat-option value="{{list.industry_classification_id}}" *ngFor="let list of industryData">{{list.name}}</mat-option>
</mat-select>
</mat-form-field>
</mat-form-field> -->
</div>
<!-- <div fxLayout="row" fxLayoutGap="2px" fxLayoutAlign="start none">
<mat-form-field>
@ -95,7 +95,7 @@
<mat-card>
<mat-card-header>
<p>{{businessForm.controls.business_entity_type.value =='Others' ? businessForm.controls.business_entity_type_other.value : sourceNames[businessForm.controls.business_entity_type.value]}}</p>
<mat-card-title>{{businessForm.controls.business_entity_type.value =='11' ? businessForm.controls.business_entity_type_other.value : sourceNames[businessForm.controls.business_entity_type.value]}}</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="partners">
<mat-card *ngFor="let members of businessForm.controls.partners['controls']; let i=index"
@ -136,7 +136,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>Number of Years For Which The Business Has Been Running</p>
<mat-card-title>Number of Years For Which The Business Has Been Running</mat-card-title>
</mat-card-header>
<mat-card-content>
<mat-form-field style="width: 20%;">
@ -145,8 +145,8 @@
<mat-form-field style="width: 20%;">
<input matInput type="number" placeholder="Month" formControlName="business_month" required min='0' max='12'>
</mat-form-field>
<mat-form-field style="width: 30%;">
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="business_date_object" placeholder="Choose a date">
<mat-form-field style="width: 40%;">
<input matInput [max]="maxDate" [matDatepicker]="picker" formControlName="business_date_object" placeholder="Enter Date of Formation, If Available">
<mat-datepicker-toggle matSuffix [for]="picker"></mat-datepicker-toggle>
<mat-datepicker touchUi #picker></mat-datepicker>
</mat-form-field>
@ -155,7 +155,7 @@
<mat-card>
<mat-card-header>
<p>List of Persons With Relationships</p>
<mat-card-title>Add Other Family Members Involved In Business</mat-card-title>
</mat-card-header>
<mat-card-content>
@ -166,51 +166,67 @@
<ng-container matColumnDef="family_member_name">
<mat-header-cell *matHeaderCellDef> Name </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
{{details.value.family_member_name | titlecase}} ( {{ details.value.other_family_relationship_name | titlecase}})
</mat-cell>
<!-- {{details.value.family_member_name | titlecase}} ( {{ details.value.other_family_relationship_name | titlecase}}) -->
<mat-form-field style="width: 90%;">
<input matInput formControlName="family_member_name" type="text">
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="relation">
<mat-header-cell *matHeaderCellDef> Relation </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-form-field style="width: 90%;">
<mat-select formControlName="other_family_relationship_id">
<mat-option [value]="member.relationship_id" *ngFor="let member of relationData">{{member.name | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="relation_to">
<mat-header-cell *matHeaderCellDef> Relationship To </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
{{details.value.relation_to | titlecase}}
<mat-form-field style="width: 90%;">
<mat-select
formControlName="relation_to_id" style="width: 90%;">
<mat-option *ngFor="let appc of applicants" [value]="appc.pd_co_applicant_id">{{appc.applicant_name | titlecase}}</mat-option>
</mat-select>
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="relationship">
<ng-container matColumnDef="relationship_with_company">
<mat-header-cell *matHeaderCellDef> Relationship With Company </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
{{details.value.relationship_with_company | titlecase}}
<mat-form-field style="width: 90%;">
<mat-select formControlName="relationship_with_company_id">
<mat-option *ngFor="let comrelShip of companyRelationShipList" [value]="comrelShip.company_relationship_id">{{comrelShip.name}}</mat-option>
</mat-select>
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="started_business">
<mat-header-cell *matHeaderCellDef class="mat-header-color"> Started Business </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-form-field>
<mat-form-field style="width: 75%;">
<mat-select formControlName="started_business">
<mat-option value="">Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
</mat-cell>
</ng-container>
<ng-container matColumnDef="currently_active_status">
<mat-header-cell *matHeaderCellDef class="mat-header-color"> Currently Actively Involved In Running The Business </mat-header-cell>
<mat-cell *matCellDef="let details;let i = index;" [formGroupName]="i">
<mat-form-field>
<mat-select formControlName="currently_active_status">
<mat-option value="">Select</mat-option>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
</mat-select>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="removeFamilyMember(i)"
matTooltip="Remove Family Member" matTooltipPosition="below">
<mat-icon>delete</mat-icon>
</button>
</mat-cell>
</ng-container>
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row>
<mat-row *matRowDef="let row; columns: displayedColumns;">
</mat-row>
</mat-table>
</mat-card-content>
<mat-card-actions align="end">
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="otherFamilyMemberDialogue()"
@ -221,7 +237,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>Type of Business Activity</p>
<mat-card-title>Type of Business Activity</mat-card-title>
</mat-card-header>
<mat-card-content>
<!-- <mat-select placeholder="Type of Activity"
@ -237,7 +253,7 @@
</mat-card>
<mat-card *ngIf="businessForm.controls.manufacturing_activity_details['controls'].length>0">
<mat-card-header>
<p>Manufacturing Details</p>
<mat-card-title>Manufacturing Details</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="manufacturing_activity_details">
<mat-card *ngFor="let manufacturing of businessForm.controls.manufacturing_activity_details['controls']; let m=index" [formGroupName]="m">
@ -245,17 +261,26 @@
<mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeManufacturingAreaSale(manufacturing,m)" required>
<mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="manufacturing.value.india_where_sale_done !=undefined && manufacturing.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<!-- this is under manufacture -->
<mat-form-field style="width: 20%;" *ngIf="manufacturing.value.pan_india_options !=undefined && manufacturing.value.area_of_sale =='Within India'">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(1,m,manufacturing.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="manufacturing.value.india_where_sale_done !=undefined && manufacturing.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<!-- this is for other than pan india -->
<div fxFlex="100" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-form-field style="width:35%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
@ -269,8 +294,7 @@
</mat-select>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addMoreState(m,'1')" *ngIf="s==0"
matTooltip="Add More State" matTooltipPosition="right" color="primary">
<mat-icon>add</mat-icon>
@ -279,9 +303,28 @@
matTooltip="Remove State" matTooltipPosition="right">
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
</div>
</ng-container>
<div *ngIf="manufacturing.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of manufacturing.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</ng-container>
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done ==undefined">
<div formArrayName="countries_where_export_done">
@ -306,11 +349,19 @@
</div>
</ng-container>
<ng-container *ngIf="manufacturing.value.countries_where_export_done !=undefined && manufacturing.value.india_where_sale_done !=undefined">
<mat-tab-group>
<mat-tab label="Within India" formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-tab-group>
<mat-tab label="Within India">
<div fxLayout="row nowrap" class="tab_class">
<mat-form-field style="width: 35%;" *ngIf="manufacturing.value.pan_india_options !=undefined">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(1,m,manufacturing.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of manufacturing.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-select placeholder="State" formControlName="state_name" required>
<mat-option *ngFor="let SL of stateList" [value]="SL.state_id">
@ -334,6 +385,25 @@
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
<div formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of manufacturing.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of manufacturing.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,manufacturing.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="manufacturing.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-tab>
<mat-tab label="Export" 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">
@ -355,8 +425,12 @@
</div>
</mat-tab>
</mat-tab-group>
</ng-container>
<div fxLayout="row">
<mat-form-field style="width:84%;">
<input matInput placeholder="Export Sale As A % of Total Sales" formControlName="export_sale_of_total_sales">
</mat-form-field>
</div>
</ng-container>
</mat-card-content>
<mat-card-actions>
@ -377,21 +451,28 @@
</mat-card>
<mat-card *ngIf="businessForm.controls.retail_trading_activity_details['controls'].length>0">
<mat-card-header>
<p>Retail Trading</p>
<mat-card-title>Retail Trading Details</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="retail_trading_activity_details">
<mat-card *ngFor="let retail of businessForm.controls.retail_trading_activity_details['controls']; let r=index" [formGroupName]="r">
<mat-card-content>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeRetailAreaSale(retail,r)" required>
<mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option>
</mat-select>
</mat-form-field>
<!-- this is under Retail -->
<mat-form-field style="width: 20%;" *ngIf="retail.value.pan_india_options !=undefined && retail.value.area_of_sale =='Within India'">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(2,r,retail.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="retail.value.india_where_sale_done !=undefined && retail.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
@ -421,6 +502,24 @@
</button>
</div>
</div>
<div *ngIf="retail.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of retail.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,retail.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="retail.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</ng-container>
<ng-container *ngIf="retail.value.india_where_sale_done ==undefined && retail.value.countries_where_export_done !=undefined">
@ -449,8 +548,16 @@
<ng-container *ngIf="retail.value.countries_where_export_done !=undefined && retail.value.india_where_sale_done !=undefined">
<mat-tab-group>
<mat-tab label="Within India" formArrayName="india_where_sale_done">
<mat-tab label="Within India">
<div fxLayout="row nowrap" class="tab_class">
<mat-form-field style="width: 35%;" *ngIf="retail.value.pan_india_options !=undefined">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(2,r,retail.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of retail.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-select placeholder="State" formControlName="state_name" required>
@ -475,6 +582,26 @@
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
<div formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of retail.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of retail.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,retail.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="retail.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-tab>
<mat-tab label="Export" 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">
@ -496,6 +623,11 @@
</div>
</mat-tab>
</mat-tab-group>
<div fxLayout="row">
<mat-form-field style="width:84%;">
<input matInput placeholder="Export Sale As A % of Total Sales" formControlName="export_sale_of_total_sales">
</mat-form-field>
</div>
</ng-container>
@ -518,7 +650,7 @@
</mat-card>
<mat-card *ngIf="businessForm.controls.wholesale_trading_activity_details['controls'].length>0">
<mat-card-header>
<p>Wholesale Trade</p>
<mat-card-title>Wholesale Trade Details</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="wholesale_trading_activity_details">
<mat-card *ngFor="let wholesale of businessForm.controls.wholesale_trading_activity_details['controls']; let w=index" [formGroupName]="w">
@ -526,13 +658,20 @@
<mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Main Product" formControlName="main_products" required>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Sale" (selectionChange)="changeWholesaleAreaSale(wholesale,w)" required>
<mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option>
</mat-select>
</mat-form-field>
<!-- this is under whole sale -->
<mat-form-field style="width: 20%;" *ngIf="wholesale.value.pan_india_options !=undefined && wholesale.value.area_of_sale =='Within India'">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(3,w,wholesale.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="wholesale.value.india_where_sale_done !=undefined && wholesale.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
@ -562,6 +701,24 @@
</button>
</div>
</div>
<div *ngIf="wholesale.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of wholesale.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="wholesale.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</ng-container>
<ng-container *ngIf="wholesale.value.india_where_sale_done ==undefined && wholesale.value.countries_where_export_done !=undefined">
@ -589,8 +746,16 @@
<ng-container *ngIf="wholesale.value.countries_where_export_done !=undefined && wholesale.value.india_where_sale_done !=undefined">
<mat-tab-group>
<mat-tab label="Within India" formArrayName="india_where_sale_done">
<mat-tab label="Within India">
<div fxLayout="row nowrap" class="tab_class">
<mat-form-field style="width: 35%;" *ngIf="wholesale.value.pan_india_options !=undefined">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(3,w,wholesale.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of wholesale.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-select placeholder="State" formControlName="state_name" required>
@ -615,6 +780,25 @@
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
<div formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of wholesale.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Sales Done In Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of wholesale.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,wholesale.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="wholesale.value.pan_india_options=='No'">
<mat-select multiple placeholder="Max Sales Done In Which Cities" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-tab>
<mat-tab label="Export" 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">
@ -636,6 +820,11 @@
</div>
</mat-tab>
</mat-tab-group>
<div fxLayout="row">
<mat-form-field style="width:84%;">
<input matInput placeholder="Export Sale As A % of Total Sales" formControlName="export_sale_of_total_sales">
</mat-form-field>
</div>
</ng-container>
@ -658,21 +847,28 @@
</mat-card>
<mat-card *ngIf="businessForm.controls.service_provider_activity_details['controls'].length>0">
<mat-card-header>
<p>Service Provider Details</p>
<mat-card-title>Service Provider Details</mat-card-title>
</mat-card-header>
<mat-card-content formArrayName="service_provider_activity_details">
<mat-card *ngFor="let serviceprovider of businessForm.controls.service_provider_activity_details['controls']; let sp=index" [formGroupName]="sp">
<mat-card-content>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 35%;">
<input matInput type="text" placeholder="Services Provided" formControlName="main_products" required>
</mat-form-field>
<mat-form-field style="width: 45%;">
<mat-form-field style="width: 30%;">
<mat-select formControlName="area_of_sale" placeholder="Area of Service" (selectionChange)="changeServiceArea(serviceprovider,sp)" required>
<mat-option value="Within India">Within India</mat-option>
<mat-option value="Export">Export</mat-option>
<mat-option value="Both">Both</mat-option>
</mat-select>
</mat-form-field>
<!-- this is under service -->
<mat-form-field style="width: 20%;" *ngIf="serviceprovider.value.pan_india_options !=undefined && serviceprovider.value.area_of_sale =='Within India'">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(4,sp,serviceprovider.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
<ng-container *ngIf="serviceprovider.value.india_where_sale_done !=undefined && serviceprovider.value.countries_where_export_done ==undefined">
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
@ -702,6 +898,24 @@
</button>
</div>
</div>
<div *ngIf="serviceprovider.value.max_sale_state_name !=undefined" formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of serviceprovider.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Revenue From Services From Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="serviceprovider.value.pan_india_options=='No'">
<mat-select multiple placeholder="Where Is The Maximum Service Provided" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</ng-container>
<ng-container *ngIf="serviceprovider.value.countries_where_export_done !=undefined && serviceprovider.value.india_where_sale_done ==undefined">
@ -712,7 +926,7 @@
<input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" >
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<input matInput placeholder="Approx % of Revenue From Service" formControlName="approx_sale" required>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addServiceMoreState(sp,'2')" *ngIf="c==0"
@ -729,8 +943,16 @@
<ng-container *ngIf="serviceprovider.value.countries_where_export_done !=undefined && serviceprovider.value.india_where_sale_done !=undefined">
<mat-tab-group>
<mat-tab label="Within India" formArrayName="india_where_sale_done">
<mat-tab label="Within India">
<div fxLayout="row nowrap" class="tab_class">
<mat-form-field style="width: 35%;" *ngIf="serviceprovider.value.pan_india_options !=undefined">
<mat-select formControlName="pan_india_options" placeholder="Is PAN India" (selectionChange)="changePanIndiaOptions(4,sp,serviceprovider.value.pan_india_options)" required>
<mat-option value="Yes">Yes</mat-option>
<mat-option value="No">No</mat-option>
</mat-select>
</mat-form-field>
</div>
<div formArrayName="india_where_sale_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let saleList of serviceprovider.get('india_where_sale_done').controls; let s = index" [formGroupName]="s">
<mat-form-field style="width:35%;">
<mat-select placeholder="Where, In India, Is The Service Provided" formControlName="state_name" required>
@ -756,6 +978,26 @@
<mat-icon>delete</mat-icon>
</button>
</div>
</div>
<div formArrayName="max_sale_state_name">
<div fxLayout="row nowrap" *ngFor="let maxStateList of serviceprovider.get('max_sale_state_name').controls; let mx = index" [formGroupName]="mx">
<mat-form-field style="width:84%;">
<mat-select multiple placeholder="Max Revenue From Services From Which States" formControlName="state_name">
<mat-option *ngFor="let MSL of serviceprovider.value.pan_india_options=='Yes' ? stateList : filterMaxSaleState(stateList,serviceprovider.value.india_where_sale_done)" [value]="MSL.state_id">
{{MSL.state_name}}
</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field style="width:84%;" *ngIf="serviceprovider.value.pan_india_options=='No'">
<mat-select multiple placeholder="Where Is The Maximum Service Provided" formControlName="city_name">
<mat-option *ngFor="let MCL of filterMaxSaleCities(stateList,maxStateList.value.state_name)" [value]="MCL.city_id">
{{MCL.city_name}}
</mat-option>
</mat-select>
</mat-form-field>
</div>
</div>
</mat-tab>
<mat-tab label="Export" formArrayName="countries_where_export_done">
<div fxLayout="row nowrap" class="tab_class" *ngFor="let countryList of serviceprovider.get('countries_where_export_done').controls; let c = index" [formGroupName]="c">
@ -763,7 +1005,7 @@
<input matInput placeholder="Countries Where Services Are Being Exported" formControlName="country_name" >
</mat-form-field>
<mat-form-field style="width:45%;">
<input matInput placeholder="Approx % of Sale" formControlName="approx_sale" required>
<input matInput placeholder="Approx % of Revenue From Service" formControlName="approx_sale" required>
</mat-form-field>
<button type="button" class="mr-1 mb-1 hover-icon" mat-raised-button mat-icon-button (click)="addServiceMoreState(sp,'2')" *ngIf="c==0"
@ -777,6 +1019,11 @@
</div>
</mat-tab>
</mat-tab-group>
<div fxLayout="row">
<mat-form-field style="width:84%;">
<input matInput placeholder="Export Revenue As A % of Total Revenue" formControlName="export_sale_of_total_sales">
</mat-form-field>
</div>
</ng-container>
@ -799,7 +1046,7 @@
</mat-card>
<mat-card *ngIf="businessForm.controls.others_activity_details['controls'].length>0">
<mat-card-header>
<p>Other Details</p>
<mat-card-title>Other Details</mat-card-title>>
</mat-card-header>
<mat-card-content formArrayName="others_activity_details">
<mat-card *ngFor="let others of businessForm.controls.others_activity_details['controls']; let o=index" [formGroupName]="o">
@ -898,8 +1145,8 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>Employees As Per Applicant
</p>
<mat-card-title>Employees As Per Applicant </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
@ -918,8 +1165,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>No of Employees Sighted Ny PD Officer During His Visit
</p>
<mat-card-title>No of Employees Sighted Ny PD Officer During His Visit </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
@ -938,8 +1184,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>Investment In Business By Applicants
</p>
<mat-card-title>Investment In Business By Applicants </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
@ -954,8 +1199,7 @@
</mat-card>
<mat-card>
<mat-card-header>
<p>Location
</p>
<mat-card-title>Location </mat-card-title>
</mat-card-header>
<mat-card-content class="matcards">
<mat-form-field>
@ -996,8 +1240,7 @@
</mat-card> -->
<mat-card>
<mat-card-header>
<p>Documents Sighted
</p>
<mat-card-title>Documents Sighted </mat-card-title>
</mat-card-header>
<mat-card-content class="matcard">
<mat-form-field>
@ -1005,6 +1248,7 @@
formControlName="shop_eat_act_cert" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1012,6 +1256,7 @@
formControlName="gst_Regn_cert" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1019,6 +1264,7 @@
formControlName="export_import_cert" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1026,6 +1272,7 @@
formControlName="factory_cert" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1033,6 +1280,7 @@
formControlName="practice_cert" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1040,6 +1288,7 @@
formControlName="pf_regn" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>
@ -1047,6 +1296,7 @@
formControlName="esic_regn" required>
<mat-option value="yes">Yes</mat-option>
<mat-option value="no">No</mat-option>
<mat-option value="not applicable">Not Applicable</mat-option>
</mat-select>
</mat-form-field>
<mat-form-field>

View File

@ -23,7 +23,6 @@ import {
import { PdTrigerService } from '../../../../../pd-service/pd-triger.service';
import {ActivatedRoute, Router} from "@angular/router";
import {DatePipe } from '@angular/common';
import { BusinessOtherFamilyMemberComponent } from './../dialogue/business-other-family-member/business-other-family-member.component';
@Component({
selector: 'app-business-info',
@ -36,7 +35,8 @@ export class BusinessInfoComponent implements OnInit {
form_id: number;
pageTitle: string ="Business Details";
relationData: any = [];
industryData: any = [];
companyRelationShipList: any =[];
//industryData: any = [];
activityData: any = [];
stateList: any = [];
relativeNames: any;
@ -44,12 +44,14 @@ export class BusinessInfoComponent implements OnInit {
public businessForm: FormGroup;
private notifier: NotifierService;
existCompanyList: any = [];
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"]
// this is for automatic bind entitity name for display
sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'};
// 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"]
businessEntityTypeList: any =[];
// this is for automatic bind entitity name for display
//sourceNames: any = {"Private Limited Company": 'Director / Shareholder Details',"Proprietorship": 'Proprietor Details', "Sole Proprietorship": 'Proprietor Details',"Partnership": 'Partner Details',"Limited Liability Partnership (LLP)": 'Partner Details',"One Person Company (OPC)": 'Director Details',"Hindu Undivided Family (HUF)": 'Karta Details',"Society": 'Member Details',"Cooperative": 'Member Details',"Trust": 'Trustee Details',"Public Ltd Company": 'Director / Shareholder Details','Individual':'Self',"Others": 'Other Enitity Details'};
sourceNames: {[k: string]: any} = {};
maxDate:any;
public relationSource= new MatTableDataSource();
displayedColumns = ['family_member_name','relation_to','relationship','started_business','currently_active_status'];
displayedColumns = ['family_member_name','relation','relation_to','relationship_with_company','started_business'];
constructor(notifier: NotifierService,
private fb: FormBuilder,
private route: ActivatedRoute,
@ -85,11 +87,13 @@ export class BusinessInfoComponent implements OnInit {
ngOnInit() {
let get_max_date = this.pd_all_details.pdmaster_details.pd_date_of_initiation.split('/').reverse().join("/");
this.maxDate = new Date(get_max_date);
this.getBusinessEntity();
this.getRelation();
this.getIndustry();
//this.getIndustry();
this.getActivity();
this.getStateCityList();
this.initBusinessForm();
this.getCompanyRelation();
// const Desgn = <FormArray>this.businessForm.controls['designation'];
// const Partnr = <FormArray>this.businessForm.controls['partners'];
// const otherDoc = <FormArray>this.businessForm.controls['documents'];
@ -217,7 +221,7 @@ export class BusinessInfoComponent implements OnInit {
this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required));
}
if(data.records.business_entity_type.toUpperCase()=='OTHERS'){
if(data.records.business_entity_type.toUpperCase()=='11'){
this.businessForm.addControl('business_entity_type_other', new FormControl('', Validators.required));
}
if(data.records.seasonality.toUpperCase()=='YES'){
@ -235,10 +239,17 @@ export class BusinessInfoComponent implements OnInit {
manufacturingControl.push(this.createActivity());
if(element.area_of_sale=='Within India'){
manufacturingControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
manufacturingControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = manufacturingControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
manufacturingControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = manufacturingControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
}
else if(element.area_of_sale=='Export'){
manufacturingControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
@ -249,10 +260,19 @@ export class BusinessInfoComponent implements OnInit {
}
else if(element.area_of_sale=='Both'){
manufacturingControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
manufacturingControl.controls[index].addControl('export_sale_of_total_sales',new FormControl(''));
manufacturingControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
manufacturingControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = manufacturingControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = manufacturingControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
manufacturingControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = manufacturingControl.controls[index].get('countries_where_export_done') as FormArray;
@ -281,10 +301,17 @@ export class BusinessInfoComponent implements OnInit {
retailControl.push(this.createActivity());
if(element.area_of_sale=='Within India'){
retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
}
else if(element.area_of_sale=='Export'){
retailControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
@ -295,10 +322,17 @@ export class BusinessInfoComponent implements OnInit {
}
else if(element.area_of_sale=='Both'){
retailControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
retailControl.controls[index].addControl('export_sale_of_total_sales',new FormControl(''));
retailControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
retailControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = retailControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = retailControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
retailControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = retailControl.controls[index].get('countries_where_export_done') as FormArray;
@ -327,10 +361,17 @@ export class BusinessInfoComponent implements OnInit {
wholesaleControl.push(this.createActivity());
if(element.area_of_sale=='Within India'){
wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
}
else if(element.area_of_sale=='Export'){
wholesaleControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
@ -341,10 +382,17 @@ export class BusinessInfoComponent implements OnInit {
}
else if(element.area_of_sale=='Both'){
wholesaleControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
wholesaleControl.controls[index].addControl('export_sale_of_total_sales',new FormControl(''));
wholesaleControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
wholesaleControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = wholesaleControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = wholesaleControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
wholesaleControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = wholesaleControl.controls[index].get('countries_where_export_done') as FormArray;
@ -374,10 +422,17 @@ export class BusinessInfoComponent implements OnInit {
serviceProviderControl.push(this.createServiceActivity());
if(element.area_of_sale=='Within India'){
serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
}
else if(element.area_of_sale=='Export'){
serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
@ -388,15 +443,25 @@ export class BusinessInfoComponent implements OnInit {
}
else if(element.area_of_sale=='Both'){
serviceProviderControl.controls[index].addControl('india_where_sale_done', this.fb.array([]));
serviceProviderControl.controls[index].addControl('export_sale_of_total_sales',new FormControl(''));
serviceProviderControl.controls[index].addControl('pan_india_options',new FormControl('', Validators.required));
serviceProviderControl.controls[index].addControl('max_sale_state_name',this.fb.array([]));
element.india_where_sale_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('india_where_sale_done') as FormArray;
innercontrol.push(this.createStateSale())
});
element.max_sale_state_name.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('max_sale_state_name') as FormArray;
innercontrol.push(this.createMaxSaleState())
});
serviceProviderControl.controls[index].addControl('countries_where_export_done', this.fb.array([]));
element.countries_where_export_done.forEach((innerElement,innerIndex) => {
let innercontrol:any = serviceProviderControl.controls[index].get('countries_where_export_done') as FormArray;
innercontrol.push(this.createCountrySale())
});
}
});
businessVal.service_provider_activity_details=selectedService;
@ -457,7 +522,7 @@ export class BusinessInfoComponent implements OnInit {
val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('profession_name_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('profession_name_other');
});
this.businessForm.controls['business_entity_type'].valueChanges.subscribe(val => {
val.toUpperCase()=='OTHERS' ? this.businessForm.addControl('business_entity_type_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('business_entity_type_other');
val.toUpperCase()=='11' ? this.businessForm.addControl('business_entity_type_other', new FormControl('', Validators.required)) : this.businessForm.removeControl('business_entity_type_other');
});
this.businessForm.controls['business_date_object'].valueChanges.subscribe(val=>{
@ -502,7 +567,7 @@ export class BusinessInfoComponent implements OnInit {
business_years: ['', Validators.compose([Validators.required])],
business_month: ['', Validators.compose([Validators.required])],
business_date_object: [''],
industry: [''],
//industry: [''],
seasonality: ['', Validators.compose([Validators.required])],
//month_of_business_run : [''],
// peak_period_of_business : [''],
@ -549,13 +614,8 @@ export class BusinessInfoComponent implements OnInit {
changeBusinessActivity(event: any){
if(event.value.exist_status==true && event.value.type_of_activity_id==1){
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
// manufacturingControl.controls = [];
//manufacturingControl.setValue([]);
manufacturingControl.controls.forEach((element,index) => {
manufacturingControl.removeAt(index);
});
manufacturingControl.controls = [];
manufacturingControl.setValue([]);
}
else if(event.value.exist_status==false && event.value.type_of_activity_id==1){
let manufacturingControl = <FormArray>this.businessForm.controls['manufacturing_activity_details'];
@ -563,10 +623,8 @@ export class BusinessInfoComponent implements OnInit {
}
if(event.value.exist_status==true && event.value.type_of_activity_id==2){
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
//retailControl.controls = [];
retailControl.controls.forEach((element,index) => {
retailControl.removeAt(index);
});
retailControl.controls = [];
retailControl.setValue([]);
}
else if(event.value.exist_status==false && event.value.type_of_activity_id==2){
let retailControl = <FormArray>this.businessForm.controls['retail_trading_activity_details'];
@ -574,10 +632,8 @@ export class BusinessInfoComponent implements OnInit {
}
if(event.value.exist_status==true && event.value.type_of_activity_id==3){
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
//wholesaleControl.controls = [];
wholesaleControl.controls.forEach((element,index) => {
wholesaleControl.removeAt(index);
});
wholesaleControl.controls = [];
wholesaleControl.setValue([]);
}
else if(event.value.exist_status==false && event.value.type_of_activity_id==3){
let wholesaleControl = <FormArray>this.businessForm.controls['wholesale_trading_activity_details'];
@ -585,10 +641,8 @@ export class BusinessInfoComponent implements OnInit {
}
if(event.value.exist_status==true && event.value.type_of_activity_id==4){
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
//serviceControl.controls = [];
serviceControl.controls.forEach((element,index) => {
serviceControl.removeAt(index);
});
serviceControl.controls = [];
serviceControl.setValue([]);
}
else if(event.value.exist_status==false && event.value.type_of_activity_id==4){
let serviceControl = <FormArray>this.businessForm.controls['service_provider_activity_details'];
@ -597,41 +651,51 @@ export class BusinessInfoComponent implements OnInit {
if(event.value.exist_status==true && event.value.type_of_activity_id==5){
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
// othersControl.controls = [];
othersControl.controls.forEach((element,index) => {
othersControl.removeAt(index);
});
othersControl.controls = [];
othersControl.setValue([]);
}
else if(event.value.exist_status==false && event.value.type_of_activity_id==5){
let othersControl = <FormArray>this.businessForm.controls['others_activity_details'];
othersControl.push(this.createOthersActivity());
}
}
// change area of sale options in manufacturing
changeManufacturingAreaSale(getDetails: any, getIndex){
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
if(getDetails.value.area_of_sale=="Within India"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
}
else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
}
else if(getDetails.value.area_of_sale=="Both") {
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
control.controls[getIndex].addControl('export_sale_of_total_sales',new FormControl(''));
}
}
// change retail options
changeRetailAreaSale(getDetails: any, getIndex){
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
@ -639,18 +703,33 @@ export class BusinessInfoComponent implements OnInit {
if(getDetails.value.area_of_sale=="Within India"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
}
else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
}
else if(getDetails.value.area_of_sale=="Both"){
control.controls[getIndex].removeControl('countries_where_export_done');
else if(getDetails.value.area_of_sale=="Both") {
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
control.controls[getIndex].addControl('export_sale_of_total_sales',new FormControl(''));
}
}
@ -661,18 +740,33 @@ export class BusinessInfoComponent implements OnInit {
if(getDetails.value.area_of_sale=="Within India"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
}
else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
}
else if(getDetails.value.area_of_sale=="Both"){
control.controls[getIndex].removeControl('countries_where_export_done');
else if(getDetails.value.area_of_sale=="Both") {
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
control.controls[getIndex].addControl('export_sale_of_total_sales',new FormControl(''));
}
}
// change service provider
@ -682,18 +776,80 @@ export class BusinessInfoComponent implements OnInit {
if(getDetails.value.area_of_sale=="Within India"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
}
else if(getDetails.value.area_of_sale=="Export"){
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('export_sale_of_total_sales');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
}
else if(getDetails.value.area_of_sale=="Both"){
control.controls[getIndex].removeControl('countries_where_export_done');
else if(getDetails.value.area_of_sale=="Both") {
control.controls[getIndex].removeControl('india_where_sale_done');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[getIndex].removeControl('countries_where_export_done');
control.controls[getIndex].removeControl('pan_india_options');
control.controls[getIndex].removeControl('max_sale_state_name');
control.controls[getIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[getIndex].addControl('pan_india_options',new FormControl('', Validators.required));
control.controls[getIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()]));
control.controls[getIndex].addControl('countries_where_export_done', this.fb.array([this.createCountrySale()]));
control.controls[getIndex].addControl('export_sale_of_total_sales',new FormControl(''));
}
}
// change pan india options
changePanIndiaOptions(type,selectedIndex,value) {
if(type==1){
let control: any = this.businessForm.get('manufacturing_activity_details') as FormArray;
control.controls[selectedIndex].removeControl('india_where_sale_done');
control.controls[selectedIndex].removeControl('max_sale_state_name');
if(value=='Yes') {
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
else if(value=='No'){
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
}
else if(type==2){
let control: any = this.businessForm.get('retail_trading_activity_details') as FormArray;
control.controls[selectedIndex].removeControl('india_where_sale_done');
control.controls[selectedIndex].removeControl('max_sale_state_name');
if(value=='Yes') {
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
else if(value=='No'){
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
}
else if(type==3){
let control: any = this.businessForm.get('wholesale_trading_activity_details') as FormArray;
control.controls[selectedIndex].removeControl('india_where_sale_done');
control.controls[selectedIndex].removeControl('max_sale_state_name');
if(value=='Yes') {
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
else if(value=='No'){
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
}
else if(type==4){
let control: any = this.businessForm.get('service_provider_activity_details') as FormArray;
control.controls[selectedIndex].removeControl('india_where_sale_done');
control.controls[selectedIndex].removeControl('max_sale_state_name');
if(value=='Yes') {
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
else if(value=='No'){
control.controls[selectedIndex].addControl('india_where_sale_done', this.fb.array([this.createStateSale()]));
control.controls[selectedIndex].addControl('max_sale_state_name',this.fb.array([this.createMaxSaleState()])); }
}
}
@ -717,14 +873,20 @@ export class BusinessInfoComponent implements OnInit {
document: ['']
});
}
// create other than pan india state
createStateSale() {
return this.fb.group({
state_name: ['', Validators.compose([Validators.required])],
city_name: ['', Validators.compose([Validators.required])]
city_name: ['', Validators.compose([Validators.required])],
});
}
// create max sale state
createMaxSaleState() {
return this.fb.group({
state_name: [''],
city_name: [''],
});
}
createCountrySale() {
return this.fb.group({
country_name: ['',Validators.compose([Validators.required])],
@ -874,22 +1036,45 @@ export class BusinessInfoComponent implements OnInit {
})
});
}
getCompanyRelation() {
let master_name = 'COMPANYRELATIONSHIPS';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
data.records.forEach(val => {
if (val.isactive == 1) {
this.companyRelationShipList.push(val);
}
})
});
}
relationChanged(event) {
this.relativeNames = [];
event.value.forEach(option => {
this.relativeNames.push({member: option});
});
}
getIndustry() {
let master_name = 'INDUSTRYCLASSIFICATION';
// getIndustry() {
// let master_name = 'INDUSTRYCLASSIFICATION';
// this._pd.getAllMasterDatas(master_name).subscribe(data => {
// data.records.forEach(val => {
// if (val.isactive == 1) {
// this.industryData.push(val);
// }
// })
// });
// }
// get business entity type
getBusinessEntity() {
let master_name = 'BUSINESSENTITYTYPE';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
data.records.forEach(val => {
if (val.isactive == 1) {
this.industryData.push(val);
}
})
this.businessEntityTypeList.push(val);
this.sourceNames[val.business_entity_type_id] = val.section_label
});
});
}
}
getActivity() {
let master_name = 'TYPEOFACTIVITY';
this._pd.getAllMasterDatas(master_name).subscribe(data => {
@ -915,15 +1100,11 @@ export class BusinessInfoComponent implements OnInit {
// add and create person with relationship details
createPersonRelationhip(details: any):FormGroup {
return this.fb.group({
other_family_relationship_id: [details.other_family_relationship_id],
other_family_relationship_name: [details.other_family_relationship_name],
family_member_name: [details.family_member_name],
relationship_with_company_id: [details.relationship_with_company_id],
relationship_with_company: [details.relationship_with_company],
relation_to_id: [details.relation_to_id],
relation_to: [details.relation_to],
other_family_relationship_id: [details.other_family_relationship_id,Validators.required],
family_member_name: [details.family_member_name,Validators.required],
relationship_with_company_id: [details.relationship_with_company_id,Validators.required],
relation_to_id: [details.relation_to_id,Validators.required],
started_business: [details.started_business],
currently_active_status: [details.currently_active_status],
});
}
@ -986,11 +1167,11 @@ export class BusinessInfoComponent implements OnInit {
othersControl.push(this.createOthersActivity());
}
submitDetails() {
let family: any = [];
// let family: any = [];
if (!this.businessForm.valid) {
return;
}
let design: any;
// let design: any;
let records = this.businessForm.value;
if (records.other_documents == 'no') {
delete records.documents;
@ -1012,23 +1193,16 @@ export class BusinessInfoComponent implements OnInit {
// open other family family member details
otherFamilyMemberDialogue() {
const dialogRef = this.dialog.open(BusinessOtherFamilyMemberComponent, {
data: this.pd_all_details,
width:'60%',
disableClose: true
});
dialogRef.afterClosed()
.subscribe(dataresult => {
if(dataresult.data.length>0){
let relationControl = <FormArray>this.businessForm.controls['persons_with_relationships'];
dataresult.data.forEach(element => {
let other_family_member: any= {'other_family_relationship_id':element.family_members_involved.relationship_id,'other_family_relationship_name':element.family_members_involved.name,'family_member_name':element.name,'relationship_with_company_id':element.relationship_with_company.company_relationship_id,'relationship_with_company':element.relationship_with_company.name,'relation_to_id':element.relation_to.pd_co_applicant_id,'relation_to':element.relation_to.applicant_name,'started_business':'','currently_active_status':''};
relationControl.push(this.createPersonRelationhip(other_family_member));
});
}
});
let relationControl = <FormArray>this.businessForm.controls['persons_with_relationships'];
let other_family_member: any= {'other_family_relationship_id':'','other_family_relationship_name':'','family_member_name':'','relationship_with_company_id':'','relationship_with_company':'','started_business':'','currently_active_status':''};
relationControl.push(this.createPersonRelationhip(other_family_member));
}
// remove other famil membre
removeFamilyMember(findex){
let relationControl = <FormArray>this.businessForm.controls['persons_with_relationships'];
relationControl.removeAt(findex);
}
validateAllFormFields(formGroup: FormGroup) {
@ -1052,13 +1226,39 @@ export class BusinessInfoComponent implements OnInit {
}
}
// filter cities for other than pan india
filterCity(datasource: any,filterid:number) {
if(filterid){
let filter = datasource.filter(x=>x.state_id==filterid);
return filter.length > 0 ? filter[0].cities : [];
}
}
// filter max sale options
filterMaxSaleState(datasource: any,filterValues:any){
if(filterValues){
let getOriginalStateList = datasource.map(dval => dval.state_id);
let getStateValues = filterValues.filter(val =>val.state_name).map(mapVal => mapVal.state_name);
let setStateFilter: any=[];
setStateFilter = getStateValues.map(x => {
let findIndex = getOriginalStateList.indexOf(x);
return datasource[findIndex];
});
return setStateFilter.length > 0 ? setStateFilter : [];
}
}
// filter max sale cities options
filterMaxSaleCities(datasource: any,filterValues:any) {
if(filterValues){
let getOriginalStateList = datasource.map(dval => dval.state_id);
let setCityFilter = filterValues.map(x => {
let findIndex = getOriginalStateList.indexOf(x);
findIndex = datasource[findIndex].cities;
return findIndex;
});
let merged = [].concat.apply([], setCityFilter);
return merged.length > 0 ? merged : [];
}
}
}