diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
index a70160469..35a61dc4e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.html
@@ -28,7 +28,7 @@
- {{ asset.name }}
+ {{ asset.name | titlecase }}
@@ -43,7 +43,7 @@
- {{ prop.name }}
+ {{ prop.name | titlecase }}
@@ -107,7 +107,7 @@
- {{ freqn.name }}
+ {{ freqn.name | titlecase }}
@@ -138,7 +138,7 @@
- {{ ins_type.name }}
+ {{ ins_type.name | titlecase }}
@@ -175,7 +175,7 @@
- {{data.viewValue}}
+ {{data.viewValue | titlecase}}
@@ -219,8 +219,13 @@
-
-
+
+
+ {{company.company_name | titlecase}}
+
+
+
@@ -301,7 +306,7 @@
- {{ asset.name }}
+ {{ asset.name | titlecase }}
@@ -314,7 +319,7 @@
- {{ prop.name }}
+ {{ prop.name | titlecase }}
@@ -386,7 +391,7 @@
- {{ freqn.name }}
+ {{ freqn.name | titlecase }}
@@ -418,7 +423,7 @@
- {{ ins_type.name }}
+ {{ ins_type.name | titlecase }}
@@ -457,7 +462,7 @@
- {{owner.applicant_name}}
+ {{owner.applicant_name | titlecase}}
@@ -470,7 +475,7 @@
- {{relations.name}}
+ {{relations.name | titlecase}}
@@ -487,7 +492,7 @@
- {{data.viewValue}}
+ {{data.viewValue | titlecase}}
@@ -512,7 +517,7 @@
- {{owner.applicant_name}}
+ {{owner.applicant_name | titlecase}}
@@ -525,7 +530,7 @@
- {{relations.name}}
+ {{relations.name | titlecase}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
index 40db78e79..fd418e308 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assets-info/assets-info.component.ts
@@ -31,7 +31,7 @@ export class AssetsInfoComponent implements OnInit {
pageTitle: string ="Assets Details";
//@Input() pdid: number;
pdid:string;
- businessProfessionName :string;
+ //businessProfessionName :string;
public _assetsQuesFrom: FormGroup;
public submitted = false;
@@ -183,6 +183,7 @@ public m_investmentType = [];
// ]
private notifier: NotifierService;
+ existCompanyList: any =[];
constructor(
notifier: NotifierService,
private _formBuilder: FormBuilder,
@@ -216,9 +217,14 @@ public m_investmentType = [];
ngOnInit() {
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
- this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
- });
+ // this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,'').subscribe(data => {
+ // this.businessProfessionName = (data.status == 200) ? data.records.profession_name : '' ;
+ // });
+ this.pdTrigerService.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
+ if(data.dataStatus){
+ this.existCompanyList = data.records.filter(val =>val.is_active);
+ }
+ })
this.getPdSupplierFormDetails();
this.getM_Assets_Type();
@@ -348,7 +354,7 @@ public m_investmentType = [];
this.initDetails(),
]),
business_assets_details : this._formBuilder.array([
- this.initBusinessDetails(this.businessProfessionName),
+ this.initBusinessDetails(),
]),
assets_form_remark:['']
});
@@ -382,12 +388,12 @@ public m_investmentType = [];
});
}
- initBusinessDetails(data) {
+ initBusinessDetails() {
return this._formBuilder.group({
business_assets_mode: [''],
business_details: this._formBuilder.array([]),
business_approximate_market_value: [''],
- business_name_of_the_owner: [data],
+ business_name_of_the_owner: [],
//other_owner:[''],
//relation:[''],
//purchase_year: [''],
@@ -402,9 +408,6 @@ public m_investmentType = [];
show: boolean;
selectedAssetsType(e: any, i: any,flag : any): void {
- console.log(e);
- console.log(i);
- console.log(flag);
let val = i;
if(flag == 1){
const arr = (
this._assetsQuesFrom.controls['assets_details']).at(val).get('details') as FormArray;
@@ -878,7 +881,7 @@ public m_investmentType = [];
control.push(this.initDetails());
}else if(flag == 2){
const control = this._assetsQuesFrom.controls['business_assets_details'];
- control.push(this.initBusinessDetails(this.businessProfessionName));
+ control.push(this.initBusinessDetails());
}
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html
new file mode 100644
index 000000000..a5a1581a8
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.html
@@ -0,0 +1,29 @@
+
+
{{pageTitle}}
+
+
+
+
+
+
+
+
+
+ {{companyList.company_name | titlecase}}
+
+
+
+
+
+
+
+ {{ formButton.form_name }}
+
+
+
+
+
+
+
+
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss
new file mode 100644
index 000000000..eb88eeecc
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.scss
@@ -0,0 +1,33 @@
+.paragraph_change {
+ color: #fff !important;
+ background-color: #e00201 !important;
+ }
+
+ .p-text {
+ color:#e00201 !important;
+ font-weight: bold;
+ }
+ ::ng-deep .mat-card-header-text{
+ margin:0px !important;
+}
+.mat-purple{
+ background-color: gray !important;
+}
+ .cdk-global-overlay-wrapper{
+ justify-content: center !important;
+}
+
+ $base-card-box-shadow:1.5px 2.6px 24px 0 rgba(0, 35, 136, 0.08) !important;
+mat-card .child_mat_card > mat-card {
+ border-radius: 0px 0px 0px 15px;
+ box-shadow: $base-card-box-shadow;
+ transform: scale(0.95);
+ transition: box-shadow 0.5s, transform 0.5s;
+ &:hover {
+ cursor: pointer;
+ // background-color: #e00201 !important;
+ transform: scale(1);
+ box-shadow: 5px 20px 30px rgba(0, 0, 0, 0.2);
+ }
+
+ }
\ No newline at end of file
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts
new file mode 100644
index 000000000..ee3eb698a
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.spec.ts
@@ -0,0 +1,25 @@
+import { async, ComponentFixture, TestBed } from '@angular/core/testing';
+
+import { BusinessInfoGroupComponent } from './business-info-group.component';
+
+describe('BusinessInfoGroupComponent', () => {
+ let component: BusinessInfoGroupComponent;
+ let fixture: ComponentFixture;
+
+ beforeEach(async(() => {
+ TestBed.configureTestingModule({
+ declarations: [ BusinessInfoGroupComponent ]
+ })
+ .compileComponents();
+ }));
+
+ beforeEach(() => {
+ fixture = TestBed.createComponent(BusinessInfoGroupComponent);
+ component = fixture.componentInstance;
+ fixture.detectChanges();
+ });
+
+ it('should create', () => {
+ expect(component).toBeTruthy();
+ });
+});
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts
new file mode 100644
index 000000000..8e3afd45b
--- /dev/null
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info-group/business-info-group.component.ts
@@ -0,0 +1,110 @@
+import { Component,OnInit,Inject,Input} from '@angular/core';
+import { NotifierService } from 'angular-notifier';
+import {MatDialog,MatDialogRef,MAT_DIALOG_DATA, MatTableDataSource} from '@angular/material';
+/** Service */
+import { PdTrigerService } from './../../../../../pd-service/pd-triger.service';
+import {ActivatedRoute, Router} from "@angular/router";
+import {SupplierInfoComponent} from './../../forms/supplier-info/supplier-info.component';
+import {ClientInfoComponent} from './../../forms/client-info/client-info.component';
+import {StockComponent} from './../../forms/stock/stock.component';
+import {FinancialInfoComponent} from './../../forms/financial-info/financial-info.component';
+import {BusinessInfoComponent} from './../../forms/business-info/business-info.component';
+
+@Component({
+ selector: 'app-business-info-group',
+ templateUrl: './business-info-group.component.html',
+ styleUrls: ['./business-info-group.component.scss']
+})
+export class BusinessInfoGroupComponent implements OnInit {
+ pageTitle: string ="Business Informations";
+ existCompanyList: any = [];
+ pdid: number;
+ form_id: number;
+ constructor(notifier: NotifierService,
+ private route: ActivatedRoute,
+ private router: Router,
+ private _pd: PdTrigerService,
+ @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
+ this.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.form_id = 13;
+ }
+
+ ngOnInit() {
+ this.getCompanyListForBusiness();
+ }
+ getCompanyListForBusiness(): void{
+ this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
+ if(data.dataStatus){
+ this.existCompanyList = data.records.filter(val =>val.is_active);
+ }
+ })
+ }
+
+ // direct form based questions
+ OnSelectBusinessGroupForms(details: any, company: any) {
+ this.pd_all_details.company_id =company.company_order_id;
+ this.pd_all_details.company_name =company.company_name;
+ if(details.form_id==1){
+ const dialogRef = this.dialog.open(SupplierInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==2){
+ const dialogRef = this.dialog.open(ClientInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==11){
+ const dialogRef = this.dialog.open(StockComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==13){
+ const dialogRef = this.dialog.open(BusinessInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+ else if(details.form_id==14){
+ const dialogRef = this.dialog.open(FinancialInfoComponent, {
+ data: this.pd_all_details,
+ position: { right: '0'},
+ width:'80%',
+ disableClose: true
+ });
+ dialogRef.afterClosed()
+ .subscribe(dataresult => {
+ this.getCompanyListForBusiness();
+ });
+ }
+
+}
+
+}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
index 5ce935af8..eb4f59014 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.html
@@ -26,8 +26,8 @@
- {{company | titlecase}}
- Others
+ {{company.company_name | titlecase}}
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
index 3bb8344ef..c83451042 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-info/business-info.component.ts
@@ -32,8 +32,10 @@ import {DatePipe } from '@angular/common';
export class BusinessInfoComponent implements OnInit {
pipe = new DatePipe('en-US');
pdid: number;
+ company_id: String;
+ company_name: String;
form_id: number;
- pageTitle: string ="Business Details";
+ pageTitle: string ="Business Information";
relationData: any = [];
companyRelationShipList: any =[];
//industryData: any = [];
@@ -60,6 +62,8 @@ export class BusinessInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialog: MatDialog) {
//this.adapter.setLocale('fr');
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
+ this.company_id = this.pd_all_details.company_id;
+ this.company_name = this.pd_all_details.company_name;
this.applicants = this.pd_all_details.pdapplicants_detials;
this.form_id = 13;
this.notifier = notifier;
@@ -101,6 +105,7 @@ export class BusinessInfoComponent implements OnInit {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(data => {
let businessVal = data.records;
let constVal: any;
@@ -163,6 +168,7 @@ export class BusinessInfoComponent implements OnInit {
businessVal.pdid = this.pdid;
businessVal.formid = this.form_id;
+ businessVal.company_id = this.company_id;
businessVal.fk_createdby = this.pdid;
//businessVal.designation = DesgnArray;
businessVal.partners = PartnrArray;
@@ -562,8 +568,9 @@ export class BusinessInfoComponent implements OnInit {
this.businessForm = this.fb.group({
pdid: this.pdid,
formid: this.form_id,
+ company_id: this.company_id,
fk_createdby: this.pdid,
- profession_name: ['', Validators.compose([Validators.required])],
+ profession_name: [this.company_name, Validators.compose([Validators.required])],
business_entity_type: ['', Validators.compose([Validators.required])],
business_years: ['', Validators.compose([Validators.required])],
business_month: ['', Validators.compose([Validators.required])],
@@ -1266,7 +1273,7 @@ export class BusinessInfoComponent implements OnInit {
getCompanyListForBusiness(): void{
this._pd.getCompaniesListsForBusiness(this.pdid).subscribe(data=>{
if(data.dataStatus){
- this.existCompanyList = data.records;
+ this.existCompanyList = data.records.filter(val =>val.is_active && val.company_order_id==this.company_id);
}
})
}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts
index 913f9c583..e8fc68ee6 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/client-info/client-info.component.ts
@@ -35,7 +35,7 @@ export class ClientInfoComponent implements OnInit {
//@Input() pdid: number;
pdid: string;
form_id: number;
-
+ company_id: string;
public _supplierQuesFrom: FormGroup;
public submitted = false;
@@ -78,6 +78,7 @@ export class ClientInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 2;
+ this.company_id = this.pd_all_details.company_id;
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -103,8 +104,7 @@ export class ClientInfoComponent implements OnInit {
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
-
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
+ this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid,this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
@@ -151,7 +151,11 @@ export class ClientInfoComponent implements OnInit {
retaildTradingForm: Boolean = false;
initFormLoadDetails(record) {
- this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '2').subscribe(
+ let params: any = {};
+ params.pd_id = this.pdid;
+ params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
+ this.pdTrigerService.retriveForm(params).subscribe(
data => {
if (data.dataStatus) {
let dataForm = data.records;
@@ -159,6 +163,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
+ company_id:[this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
@@ -244,6 +249,7 @@ export class ClientInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['2'],
+ company_id:[this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
service_provider_details: this._formBuilder.array([this.serviceProviderFormCreation(record)]),
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
index 11e24e847..8858a3f4f 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.ts
@@ -33,6 +33,7 @@ export class FinancialInfoComponent implements OnInit {
pageTitle: string ="Financial Information";
pdid: string;
form_id: number;
+ company_id: string;
public financialForm: FormGroup;
private notifier: NotifierService;
SalesStatement : any = [];
@@ -57,6 +58,7 @@ export class FinancialInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 14;
+ this.company_id =this.pd_all_details.company_id;
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -84,6 +86,7 @@ export class FinancialInfoComponent implements OnInit {
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(value => {
const financial_date = this.financialForm.controls['date_per_financial'];
const estimated_val = this.financialForm.controls['estimated_value'];
@@ -110,7 +113,6 @@ export class FinancialInfoComponent implements OnInit {
financial_date.push(this.createDate(''));
}
if (result_val.length > 0) {
- console.log(result_val);
result_val.forEach((val,index) => {
//console.log('dedrf',val.estimate_annual_sale);
this.AV_annualSalesInwords[index] = this._pd.convertNumberToWords(val.estimate_annual_sale);
@@ -124,6 +126,7 @@ export class FinancialInfoComponent implements OnInit {
}
retriveData.pdid = this.pdid;
retriveData.formid = this.form_id;
+ retriveData.company_id = this.company_id;
retriveData.fk_createdby = this.pdid;
this.financialForm.setValue(retriveData);
} else {
@@ -136,6 +139,7 @@ export class FinancialInfoComponent implements OnInit {
this.financialForm = this.fb.group({
pdid: this.pdid,
formid: this.form_id,
+ company_id: this.company_id,
fk_createdby: this.pdid,
financial_remarks: [''],
staring_financial_year : ['',Validators.compose([Validators.minLength(4),Validators.maxLength(4)])],
@@ -247,7 +251,6 @@ export class FinancialInfoComponent implements OnInit {
}
selectedType(e: any): void {
- console.log(e);
if(e.value == 'yes'){
let startingYear = this.financialForm.controls['staring_financial_year'].value;
let totalFinYear = this.financialForm.controls['total_financial_year'].value;
@@ -260,7 +263,6 @@ export class FinancialInfoComponent implements OnInit {
}
if(array.length > 0 ){
- console.log(array.length);
array.value.forEach((val,index)=>{
let vals = {
@@ -325,32 +327,23 @@ export class FinancialInfoComponent implements OnInit {
// }
// }
calFinAnnualSale(index,detail){
- //alert('FIn Annual Sales Data');
- console.log(index);
- console.log()
let annual_sale = detail.value.financial_annual_sale;
if (index != 0) {
let array = this.financialForm.controls['date_per_financial'];
let prev_annual_sale = array.value[index-1].financial_annual_sale;
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
detail.controls.financial_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
- console.log('annual sales variation in %',annual_sale_variation);
}
}
calculateEstimationAnnualSale(index,detail){
//alert('Function Inside');
- console.log(detail);
let annual_sale = detail.value.estimate_annual_sale;
- console.log(annual_sale);
- console.log(index);
- // console.log(annual_sale);
if (index != 0) {
let array = this.financialForm.controls['estimated_value'];
let prev_annual_sale = array.value[index-1].estimate_annual_sale;
let annual_sale_variation = (( annual_sale - prev_annual_sale)/prev_annual_sale) * 100 ;
detail.controls.estimate_annualsales_variation.setValue(annual_sale_variation.toFixed(2));
- console.log('estimate annual sales variation in %',annual_sale_variation);
}
}
@@ -362,25 +355,16 @@ export class FinancialInfoComponent implements OnInit {
if ( (profit != '' || loss != '') && index != 0) {
let array = this.financialForm.controls['date_per_financial'];
-
- console.log('Profit',profit);
- console.log(Math.abs(profit));
+
let prev_profit = array.value[index - 1].financial_net_profit != '' ? array.value[index - 1].financial_net_profit : 0;
- console.log('Profitpre',prev_profit);
let prev_loss = array.value[index - 1].financial_net_loss !='' ? array.value[index - 1].financial_net_loss : 0 ;
let prev_year = array.value[index - 1].financial_year;
let prev_annual_sale = array.value[index-1].financial_annual_sale;
- console.log('loss',loss);
loss = loss != 0 ? loss * (-1) : loss;
- console.log('-1 loss',loss);
- console.log('pre_loss',prev_loss);
prev_loss = prev_loss != 0 ? prev_loss * (-1) : prev_loss ;
- console.log('-1 pre loss',prev_loss);
- console.log(Math.abs(profit));
//let variation2 = ((()))
let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100;
//console.log('console.log(Math.abs(profit));',Math.abs(variation));
- console.log(variation);
// let variation ;
// if(profit != ''){
// variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? prev_profit : prev_loss)) * 100 * (profit != '' ? (1) : (-1)) ;
@@ -395,7 +379,6 @@ export class FinancialInfoComponent implements OnInit {
detail.controls.financial_variation.setValue(variation.toFixed(2));
//Increase in Sales in FY 2017-18 over sales in FY 2016-17 is 11.11%
- console.log('variation in %',variation);
// this.SalesStatement[index] = ( variation <= 0 ? 'Decreases ' : 'Increases ' ) + 'in Sales in FY ' + curr_year + ' Over Sales in FY '+ prev_year + ' is ' + variation.toFixed(2) + '%';
// console.log('this.SlesStatement',this.SalesStatement);
@@ -437,7 +420,6 @@ export class FinancialInfoComponent implements OnInit {
// }
calMargin(index, detail) {
- console.log('detail', detail);
// let array = this.financialForm.controls['date_per_financial'];
let salary = detail.value.financial_annual_sale;
// let prev_annual_sale = array.value[index-1].financial_annual_sale;
@@ -499,7 +481,6 @@ export class FinancialInfoComponent implements OnInit {
if ( (profit != '' || loss != '') && index != 0) {
let array = this.financialForm.controls['estimated_value'];
- console.log(array.value[index - 1].financial_net_profit);
let prev_profit = array.value[index - 1].estimate_net_profit != '' ? array.value[index - 1].estimate_net_profit : 1;
let prev_loss = array.value[index - 1].estimate_net_loss !='' ? array.value[index - 1].estimate_net_loss : 1;
@@ -521,9 +502,7 @@ export class FinancialInfoComponent implements OnInit {
}
calMarginVal(index, detail) {
- console.log('Margin Estimate VAR',detail);
let salary = detail.value.estimate_annual_sale;
- console.log('Margin Estimate Vsalary',salary);
// if (salary != '' && profit != '') {
// let margin = profit / salary * 100;
@@ -534,23 +513,16 @@ export class FinancialInfoComponent implements OnInit {
if(detail.value.estimate_profit_or_loss == 1){
let profit = detail.value.estimate_net_profit;
- console.log('if Margin Profit',profit);
if (salary != '' && profit != '') {
- console.log('if if Margin Estimate salary',salary);
- console.log('if if Margin Profit',profit);
let margin = profit / salary * 100;
- console.log('margin',margin);
detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2));
}
}
else if (detail.value.estimate_profit_or_loss == 2){
let loss = detail.value.estimate_net_loss;
- 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 * (-1);
detail.controls.estimate_margin_of_loss.setValue(margin.toFixed(2));
@@ -588,7 +560,6 @@ export class FinancialInfoComponent implements OnInit {
// }
calProfitAndLossVal( i, detail) {
- console.log(detail);
let salary = detail.value.estimate_annual_sale;
if(detail.value.estimate_profit_or_loss == 1){
let margin_profit = detail.value.estimate_margin_of_profit;
@@ -682,9 +653,7 @@ export class FinancialInfoComponent implements OnInit {
// return;
// }
let records = this.financialForm.value;
- console.log('data', records);
this._pd.saveForm(records).subscribe(data => {
- console.log('data', data);
this.notifier.notify('success', 'Saved Successfully.');
//this.dialogRef.close();
}, error => {
@@ -715,10 +684,6 @@ export class FinancialInfoComponent implements OnInit {
/** To Convert Amount into Words */
inWords(e,i,flag:number){
-
- // console.log(e);
- // console.log(i);
- // console.log(flag);
switch(flag){
case 1 :
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
index 45d918e60..949f141f1 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.html
@@ -527,7 +527,7 @@
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
index e6660afc0..494ceaf1f 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/stock/stock.component.ts
@@ -22,6 +22,7 @@ export class StockComponent implements OnInit {
pageTitle: string ="Stock Details";
pdid: number;
form_id: number;
+ company_id: string;
public stockForms: FormGroup;
private notifier: NotifierService;
public uomData : any = [];
@@ -50,6 +51,7 @@ export class StockComponent implements OnInit {
private _pd: PdTrigerService,@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 11;
+ this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -82,7 +84,7 @@ export class StockComponent implements OnInit {
// })
//this._pd.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(
- this._pd.stockFormAccess({pd_id:this.pdid}).subscribe(data => {
+ this._pd.stockFormAccess({pd_id:this.pdid,company_id:this.company_id}).subscribe(data => {
if(data.dataStatus == true){
let datas = data.records;
@@ -109,21 +111,20 @@ export class StockComponent implements OnInit {
}
public initstockForms(record){
- console.log(record);
let params: any = {};
params.pd_id = this.pdid;
params.pd_form_id = this.form_id;
-
+ params.company_id = this.company_id;
this._pd.retriveForm(params).subscribe(value => {
if (value.status == 200) {
let dataForm = value.records;
if(dataForm !== undefined) {
- console.log(dataForm);
this.stockForms = this.fb.group({
pdid: [this.pdid],
formid: [this.form_id],
+ company_id: [this.company_id],
stock_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
retail_details : this.fb.array([this.retailFormCreation(record)]),
@@ -131,7 +132,6 @@ export class StockComponent implements OnInit {
});
let arr = record.filter(data => data.type_of_activity_id == 1);
- console.log(133,arr.length);
if(arr.length > 0) {
// console.log(1,dataForm);
// console.log(164,dataForm.manufacturing_details);
@@ -257,6 +257,7 @@ export class StockComponent implements OnInit {
this.stockForms = this.fb.group({
pdid: [this.pdid],
formid: [this.form_id],
+ company_id: [this.company_id],
stock_remarks: [''],
manufacturing_details: this.fb.array([this.manufacturingFormCreation(record)]),
retail_details : this.fb.array([this.retailFormCreation(record)]),
@@ -320,11 +321,8 @@ export class StockComponent implements OnInit {
manufacturingForm: Boolean = false;
manufacturingFormCreation(record) {
- console.log(record);
let arr = record.filter(data => data.type_of_activity_id == 1);
- console.log(arr);
if (arr.length > 0) {
- console.log(arr.length);
this.manufacturingForm = true;
return this.fb.group({
manufacturing_raw_materials: this.fb.array([]),
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
index 4b328836f..62520e33b 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/supplier-info/supplier-info.component.ts
@@ -37,7 +37,7 @@ export class SupplierInfoComponent implements OnInit {
//@Input() pdid: number;
pdid: string;
form_id: number;
-
+ company_id: string;
public _supplierQuesFrom: FormGroup;
public submitted = false;
@@ -51,6 +51,7 @@ export class SupplierInfoComponent implements OnInit {
@Inject(MAT_DIALOG_DATA) public pd_all_details: any) {
this.pdid = this.pd_all_details.pdmaster_details.pd_id;
this.form_id = 1;
+ this.company_id = this.pd_all_details.company_id
this.notifier = notifier;
}
public viewerOptions: any = {
@@ -76,7 +77,7 @@ export class SupplierInfoComponent implements OnInit {
noRecordsFound: Boolean = false;
errorMessage: any = '';
ngOnInit() {
- this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid).subscribe(data => {
+ this.pdTrigerService.getTypeofActivityForSuppliedInfoForm(this.pdid, this.company_id).subscribe(data => {
if(data.dataStatus){
// let datas = {
// "profession_name": "Others",
@@ -116,8 +117,12 @@ export class SupplierInfoComponent implements OnInit {
serviceProviderForm: Boolean = false;
initFormLoadDetails(record) {
+ let params: any = {};
+ params.pd_id = this.pdid;
+ params.pd_form_id = this.form_id;
+ params.company_id = this.company_id;
// alert(JSON.stringify(record));
- this.pdTrigerService.getPDFormDetailsWithID(this.pdid, '1').subscribe(
+ this.pdTrigerService.retriveForm(params).subscribe(
data => {
if(data.dataStatus){
let dataForm = data.records;
@@ -125,6 +130,7 @@ export class SupplierInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
+ company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
@@ -154,6 +160,7 @@ export class SupplierInfoComponent implements OnInit {
this._supplierQuesFrom = this._formBuilder.group({
pdid: [this.pdid],
formid: ['1'],
+ company_id: [this.company_id],
manufacturing_details: this._formBuilder.array([this.manufacturingFormCreation(record)]),
trade_details: this._formBuilder.array([this.tradingFormCreation(record)]),
supplier_info_form_remark: [dataForm.supplier_info_form_remark || null]
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
index 17292f75b..5210ebc7e 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.html
@@ -26,7 +26,7 @@
-->
-
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
index 70d19e4b3..4ae08c3ed 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/start-pd.component.ts
@@ -26,6 +26,7 @@ import {LoanDetailsComponent} from './forms/loan-details/loan-details.component'
import {GeneralInfoComponent} from './forms/general-info/general-info.component';
import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.component';
import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component';
+import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component';
@Component({
selector: 'app-start-pd',
@@ -314,7 +315,7 @@ export class StartPdComponent implements OnInit, OnDestroy {
});
}else
if(this.selectedFormsCategory.form_id==13){
- const dialogRef = this.dialog.open(BusinessInfoComponent, {
+ const dialogRef = this.dialog.open(BusinessInfoGroupComponent, {
data: this.pdFullDetails,
position: { right: '0'},
width:'80%',
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
index 90d398715..eefb41512 100755
--- a/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
+++ b/ng6-seed/src/app/personal-discussion/manage-pd/manage-pd.module.ts
@@ -89,6 +89,7 @@ import { FinalRemarksComponent } from './list-pd/start-pd/forms/final-remarks/fi
import { BusinessOtherFamilyMemberComponent } from './list-pd/start-pd/forms/dialogue/business-other-family-member/business-other-family-member.component';
import { QcReviewComponent } from './list-pd/pd-report/qc-review/qc-review.component';
import { SharedModule } from "app/shared/shared.module";
+import { BusinessInfoGroupComponent } from './list-pd/start-pd/forms/business-info-group/business-info-group.component';
/**
* Custom angular notifier options
@@ -266,7 +267,7 @@ const pdCustomNotifierOptions: NotifierOptions = {
// AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}), OwlDateTimeModule,
// OwlNativeDateTimeModule,
// ],
- declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent],
+ declarations: [RentalInfoComponent, TelePdAllocationComponent, FinancialInfoComponent, BusinessInfoComponent, EmploymentInfoComponent, StockComponent, BankingDetailsComponent, ListPdComponent, FamilyDetailsComponent, AddressComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, CurrentLoanComponent, AssetsInfoComponent, LoanDetailsComponent, OtherIncomeComponent, SupplierInfoComponent, PersonalInfoComponent, LenderRepresentativeComponent, PdReportComponent, AssessedIncomeComponent, AllocationViewMoreComponent, PdRequirementComponent, GeneralInfoComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
// exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent],
// providers: [PdTrigerService, GetGeometricLocationService],
@@ -304,13 +305,13 @@ const pdCustomNotifierOptions: NotifierOptions = {
OwlNativeDateTimeModule,
],
// declarations: [ListPdComponent, ManagePdComponent, MapPdViewComponent, AddPdComponent, ViewPdComponent, PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, InprogressPdComponent, AllPdComponent, ScheduledPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, AssetsInfoComponent],
- exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent],
+ exports: [PdAllocationComponent, SmartPdAllocationComponent, TelePdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent, ClientInfoComponent, SupplierInfoComponent, PersonalInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, AllocationViewMoreComponent, GeneralInfoComponent, PdRequirementComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, BusinessOtherFamilyMemberComponent, BusinessInfoGroupComponent],
providers: [PdTrigerService, GetGeometricLocationService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'},
{provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},
{provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}],
entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,
- ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent],
+ ClientInfoComponent, SupplierInfoComponent, CurrentLoanComponent, LoanDetailsComponent, OtherIncomeComponent, AssetsInfoComponent, AddressComponent, FamilyDetailsComponent, BankingDetailsComponent, StockComponent, EmploymentInfoComponent, BusinessInfoComponent, FinancialInfoComponent, LenderRepresentativeComponent,RentalInfoComponent, AssessedIncomeComponent, GeneralInfoComponent, PdRequirementComponent, ModelEditPdReportComponent, OtherApplicantDetailsComponent, NeighbourHoodComponent, DialogChangeCurrentVenrsion, FinalRemarksComponent, BusinessOtherFamilyMemberComponent, QcReviewComponent, BusinessInfoGroupComponent],
})
export class ManagePdModule {
diff --git a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
index c7ced0d9d..42efd209c 100755
--- a/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
+++ b/ng6-seed/src/app/personal-discussion/pd-service/pd-triger.service.ts
@@ -322,15 +322,14 @@ export class PdTrigerService {
swapOlderPDReportToLatest(pdId: any): Observable {
pdId.fk_createdby = this._aws.getlocale();
- alert(JSON.stringify(pdId));
return this._http.post(this.apiUrl + "swapOlderPDReportToLatest", { "records": pdId })
.pipe(
catchError(this.handleError('operation', []))
)
}
- getTypeofActivityForSuppliedInfoForm(pd_id: any): Observable {
- return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id } })
+ getTypeofActivityForSuppliedInfoForm(pd_id: any,company_id:any): Observable {
+ return this._http.post(this.apiUrl + "getTypeOfActivetyFromBusinessForm", { "records": { "pd_id": pd_id,"company_id":company_id } })
.pipe(
catchError(this.handleError('operation', []))
)