From 0297ef50aa2ba730ab6c78f9f49e6f76e80828f6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 5 Feb 2019 13:45:26 +0530 Subject: [PATCH 1/7] start pd options changes --- .../pd-status-change-dialogue.component.html | 12 ++ .../pd-status-change-dialogue.component.scss | 0 ...d-status-change-dialogue.component.spec.ts | 25 +++ .../pd-status-change-dialogue.component.ts | 46 ++++++ .../list-pd/start-pd/start-pd.component.html | 2 +- .../list-pd/start-pd/start-pd.component.ts | 98 ++++++------ .../manage-pd/manage-pd.module.ts | 145 +----------------- 7 files changed, 135 insertions(+), 193 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html new file mode 100644 index 000000000..d2d9b577d --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.html @@ -0,0 +1,12 @@ +

{{dialoge_title_content}}

+ +
+

+ {{dialoge_content}} +

+
+
+ + + + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.scss new file mode 100644 index 000000000..e69de29bb diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.spec.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.spec.ts new file mode 100644 index 000000000..56b4907d0 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { PdStatusChangeDialogueComponent } from './pd-status-change-dialogue.component'; + +describe('PdStatusChangeDialogueComponent', () => { + let component: PdStatusChangeDialogueComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ PdStatusChangeDialogueComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(PdStatusChangeDialogueComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts new file mode 100644 index 000000000..57eed34f7 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -0,0 +1,46 @@ +import { Component, OnInit, ViewChild , Input, Inject} from '@angular/core'; +import { NotifierService } from "angular-notifier"; +import {MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; +import { PdTrigerService } from '../../../pd-service/pd-triger.service'; + +@Component({ + selector: 'app-pd-status-change-dialogue', + templateUrl: './pd-status-change-dialogue.component.html', + styleUrls: ['./pd-status-change-dialogue.component.scss'] +}) +export class PdStatusChangeDialogueComponent implements OnInit { + + conformation: Boolean = false; + private notifier: NotifierService; + dialoge_title_content: string; + dialoge_content: string; + + constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) + { + this.notifier = notifier; + this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start PD' : this.data.pd_status=='COMPLETED' ? 'Complete PD' : 'Change PD Status'; + this.dialoge_content =this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussions ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussions and forwarding for Quality Check ?' : 'Change PD Status'; + } + + ngOnInit() { + } + changePDStatus(): void { + let update_status = { + "pd_id":this.data.pdid, + }; + this.pd.editPdMasterDetails(update_status, this.data.pd_status).subscribe(result => { + if (result.status == 200) { + this.dialogRef.close({update_status:true}); + this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'PD Started Successfully' : this.data.pd_status=='COMPLETED' ? 'PD Completed Successfully ?' : 'PD Updated Successfully'); + } + else { + this.dialogRef.close({update_status:false}); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + } + }, error => { + this.dialogRef.close({update_status:false}); + this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + }); + } + +} 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 d64492d12..0c4ce1a5f 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 @@ -30,7 +30,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 0af985710..1ea24c5e5 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 @@ -28,7 +28,7 @@ import {NeighbourHoodComponent} from './forms/neighbour-hood/neighbour-hood.comp import {FinalRemarksComponent} from './forms/final-remarks/final-remarks.component'; import { BusinessInfoGroupComponent } from './forms/business-info-group/business-info-group.component'; import { BusinessAssetsInfoComponent } from './forms/business-assets-info/business-assets-info.component'; - +import { PdStatusChangeDialogueComponent } from './../pd-status-change-dialogue/pd-status-change-dialogue.component'; @Component({ selector: 'app-start-pd', templateUrl: './start-pd.component.html', @@ -83,14 +83,9 @@ export class StartPdComponent implements OnInit, OnDestroy { // Ps.initialize(elemSidebar, { wheelSpeed: 2, suppressScrollX: true }); // Ps.initialize(elemContent, { wheelSpeed: 2, suppressScrollX: true }); } - - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,1); } - // start - - - // end - + isMac(): boolean { let bool = false; if (navigator.platform.toUpperCase().indexOf('MAC') >= 0 || navigator.platform.toUpperCase().indexOf('IPAD') >= 0) { @@ -103,7 +98,9 @@ export class StartPdComponent implements OnInit, OnDestroy { return window.matchMedia(`(max-width: 960px)`).matches; } - loadTemplates(startID:string){ + + // load templates details + loadTemplates(startID:string,type:number){ this._pd.loadPDTemplates(startID).subscribe( data => { if (data.status == 200) { @@ -117,9 +114,10 @@ export class StartPdComponent implements OnInit, OnDestroy { this.actualQuestions = this.categoryFormButtons.length; let getAnsweredFormsCount = this.categoryFormButtons.filter(item=>item.isAnswered===true); this.answeredQuestions = getAnsweredFormsCount.length; - this.pdFullDetails = data.records - - + this.pdFullDetails = data.records; + if(type==1 && data.records.pdmaster_details.pd_status=='SCHEDULED') { + this.pdStatusDialogue(this.pdStatusCheck.INPROGRESS) + } } else{ this.pdMasterList = ""; @@ -132,26 +130,22 @@ export class StartPdComponent implements OnInit, OnDestroy { }); } - - - //change pd status - changePDStatus(status: string) { - - let update_array = { - "pd_id": this.startPD - } - this._pd.editPdMasterDetails(update_array, status).subscribe(result => { - if (result.status == 200) { - this.currentPDStatus = false; - this.notifier.notify('success', 'PD Completed.'); - } - else { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); - } - }, error => { - this.notifier.notify('warning', 'Something Wents Wrong Try Again.!'); + // load pd status change dialogue + pdStatusDialogue(status: string): void { + const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { + data: { pdid: this.startPD, pd_status: status }, + disableClose: true, + minWidth:'20%', + maxWidth:'40%', + }); + dialogRef.afterClosed() + .subscribe(dataresult => { + if(dataresult.update_status==true){ + this.loadTemplates(this.startPD,2); + } }); - } +} + // start // direct form based questions OnSelectDirectForms(details: any) { @@ -168,7 +162,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==2){ @@ -181,7 +175,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==3){ @@ -194,7 +188,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==4){ @@ -207,7 +201,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==5){ @@ -220,7 +214,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==6){ @@ -233,7 +227,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==7){ @@ -246,7 +240,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } else @@ -260,7 +254,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } else @@ -274,7 +268,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==10){ @@ -287,7 +281,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==11){ @@ -300,7 +294,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==12){ @@ -313,7 +307,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==13){ @@ -326,7 +320,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==14){ @@ -339,7 +333,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==15){ @@ -352,7 +346,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } else @@ -366,7 +360,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==17){ @@ -379,7 +373,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } else if(this.selectedFormsCategory.form_id==18){ @@ -392,7 +386,7 @@ export class StartPdComponent implements OnInit, OnDestroy { generaldialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } else if(this.selectedFormsCategory.form_id==19){ @@ -405,7 +399,7 @@ export class StartPdComponent implements OnInit, OnDestroy { generaldialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==20){ const generaldialogRef = this.dialog.open(FinalRemarksComponent, { @@ -417,7 +411,7 @@ export class StartPdComponent implements OnInit, OnDestroy { generaldialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); }else if(this.selectedFormsCategory.form_id==22){ @@ -430,7 +424,7 @@ export class StartPdComponent implements OnInit, OnDestroy { dialogRef.afterClosed() .subscribe(dataresult => { // this.notifier.notify('success', 'Successfully allocated.!'); - this.loadTemplates(this.startPD); + this.loadTemplates(this.startPD,2); }); } 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 0d4c8b595..ca98cfdcc 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 @@ -108,6 +108,7 @@ import { ManageHouseHoldComponent } from './list-pd/start-pd/forms/assessed-inco import { ManageOtherBusinessIncomeComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-other-business-income/manage-other-business-income.component'; import { GrossProfitCalculationComponent } from './list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component'; import { ManageDailySalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component'; +import { PdStatusChangeDialogueComponent } from './list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component'; /** * Custom angular notifier options */ @@ -153,143 +154,8 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ -// <<<<<<< HEAD -// imports: [ -// CommonModule, -// ManagePdRoutingModule, -// NotifierModule.withConfig(pdCustomNotifierOptions), -// MatCardModule, -// MatIconModule, -// MatInputModule, -// MatRadioModule, -// MatTableModule, -// MatPaginatorModule, -// MatButtonModule, -// MatProgressBarModule, -// MatToolbarModule, -// FlexLayoutModule, -// NgxDatatableModule, -// FormsModule,MatSlideToggleModule, -// MatSelectModule, MatListModule,MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule,MatStepperModule,MatSidenavModule ,MatMenuModule, MatButtonToggleModule, -// ReactiveFormsModule, -// FileUploadModule, -// TreeModule, -// MatDatepickerModule, -// MatDialogModule,MatSortModule, -// NgxMatSelectSearchModule,MatTooltipModule, MatExpansionModule, -// 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], - -// exports: [PdAllocationComponent, -// SmartPdAllocationComponent, -// TelePdAllocationComponent, -// SchedulePdComponent, -// EditPdApplicantComponent, -// EditPdMasterComponent, -// StartPdComponent, -// CompletedPdComponent, -// QcCompletedPdComponent, -// AllocationViewMoreComponent], - -// providers: [PdTrigerService, -// GetGeometricLocationService], - -// 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], -// ======= - // imports: [ - // CommonModule, - // ManagePdRoutingModule, - // NotifierModule.withConfig(pdCustomNotifierOptions), - // MatCardModule, - // MatIconModule, - // MatInputModule, - // MatRadioModule, - // MatTableModule, - // MatPaginatorModule, - // MatButtonModule, - // MatProgressBarModule, - // MatAutocompleteModule, - // MatToolbarModule, - // FlexLayoutModule, - // NgxDatatableModule, - // FormsModule, - // MatSlideToggleModule, - // MatSelectModule, MatListModule, MatGridListModule, MatTabsModule, MatBadgeModule, MatCheckboxModule, MatStepperModule, MatSidenavModule, MatMenuModule, MatButtonToggleModule, - // ReactiveFormsModule, - // FileUploadModule, - // TreeModule, - // MatDialogModule, MatSortModule, - // NgxMatSelectSearchModule, MatTooltipModule, MatExpansionModule, - // 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, BusinessInfoGroupComponent, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent], - - // exports: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, StartPdComponent, CompletedPdComponent, QcCompletedPdComponent], - // providers: [PdTrigerService, GetGeometricLocationService], - // entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent], - imports: [ + 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, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent], + imports: [ CommonModule, ManagePdRoutingModule, NgxViewerModule, @@ -321,14 +187,13 @@ const pdCustomNotifierOptions: NotifierOptions = { AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule, 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, BusinessInfoGroupComponent,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent], + 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,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent], 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,BusinessAssetsInfoComponent, - 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,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent], + 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,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent], }) export class ManagePdModule { From 50da488c0ca2e0dd68d6f1fe660c1bb749837d2b Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 5 Feb 2019 14:30:49 +0530 Subject: [PATCH 2/7] changes in start pd --- .../manage-pd/list-pd/start-pd/start-pd.component.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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 1ea24c5e5..7ceeb53af 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 @@ -135,7 +135,7 @@ export class StartPdComponent implements OnInit, OnDestroy { const dialogRef = this.dialog.open(PdStatusChangeDialogueComponent, { data: { pdid: this.startPD, pd_status: status }, disableClose: true, - minWidth:'20%', + minWidth:'30%', maxWidth:'40%', }); dialogRef.afterClosed() From 8694da1da61a709f6e46c9e3ec8e4ee89a5960b7 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 5 Feb 2019 14:35:32 +0530 Subject: [PATCH 3/7] pd status changes --- .../pd-status-change-dialogue.component.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts index 57eed34f7..cd43e6391 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component.ts @@ -18,8 +18,8 @@ export class PdStatusChangeDialogueComponent implements OnInit { constructor(notifier: NotifierService , private pd: PdTrigerService,private dialogRef: MatDialogRef,@Inject(MAT_DIALOG_DATA) public data: any) { this.notifier = notifier; - this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start PD' : this.data.pd_status=='COMPLETED' ? 'Complete PD' : 'Change PD Status'; - this.dialoge_content =this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussions ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussions and forwarding for Quality Check ?' : 'Change PD Status'; + this.dialoge_title_content = this.data.pd_status=='INPROGRESS' ? 'Start Discussions' : this.data.pd_status=='COMPLETED' ? 'Complete Discussions' : 'Change Discussions'; + this.dialoge_content =this.data.pd_status=='INPROGRESS' ? 'Are you starting the Discussions ?' : this.data.pd_status=='COMPLETED' ? 'Please confirm you are completing the Discussions and forwarding for Quality Check ?' : 'Change Discussions'; } ngOnInit() { @@ -31,7 +31,7 @@ export class PdStatusChangeDialogueComponent implements OnInit { this.pd.editPdMasterDetails(update_status, this.data.pd_status).subscribe(result => { if (result.status == 200) { this.dialogRef.close({update_status:true}); - this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'PD Started Successfully' : this.data.pd_status=='COMPLETED' ? 'PD Completed Successfully ?' : 'PD Updated Successfully'); + this.notifier.notify('success', this.data.pd_status=='INPROGRESS' ? 'Discussions Started Successfully' : this.data.pd_status=='COMPLETED' ? 'Discussions Completed Successfully ?' : 'Discussions Updated Successfully'); } else { this.dialogRef.close({update_status:false}); From 250d18f03474de125b272db1c799409b166cbcf6 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Tue, 5 Feb 2019 19:15:39 +0530 Subject: [PATCH 4/7] pd view map changes --- .../list-pd/view-pd/view-pd.component.html | 4 +- .../manage-pd/manage-pd.module.ts | 11 +++-- .../pd-located-map-view.directive.ts | 48 +++++++++++++++++++ .../view-location.component.html | 26 ++++++++++ .../view-location.component.scss | 48 +++++++++++++++++++ .../view-location.component.spec.ts | 25 ++++++++++ .../view-location/view-location.component.ts | 17 +++++++ 7 files changed, 173 insertions(+), 6 deletions(-) create mode 100644 ng6-seed/src/app/personal-discussion/pd-directive/pd-located-map-view.directive.ts create mode 100644 ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.html create mode 100644 ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.scss create mode 100644 ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.spec.ts create mode 100644 ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html index 0597ae47a..c87152b7e 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/view-pd/view-pd.component.html @@ -93,9 +93,9 @@
-
+
- +
{{master.addressline1}},
{{master.city_name}},
{{master.state_name}}-{{master.pincode_id == 1 ? master.other_pincode : master.pincode }}
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 ca98cfdcc..9e6bf883d 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 @@ -109,6 +109,9 @@ import { ManageOtherBusinessIncomeComponent } from './list-pd/start-pd/forms/ass import { GrossProfitCalculationComponent } from './list-pd/start-pd/forms/assessed-income/gross-profit-calculation/gross-profit-calculation.component'; import { ManageDailySalesComponent } from './list-pd/start-pd/forms/assessed-income/AI-diologue/manage-daily-sales/manage-daily-sales.component'; import { PdStatusChangeDialogueComponent } from './list-pd/pd-status-change-dialogue/pd-status-change-dialogue.component'; +import { PdLocatedMapViewDirective } from './../pd-directive/pd-located-map-view.directive'; +import { ViewLocationComponent } from './../pd-directive/view-location/view-location.component'; + /** * Custom angular notifier options */ @@ -154,7 +157,7 @@ const pdCustomNotifierOptions: NotifierOptions = { }; @NgModule({ - 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, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent], + 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, SearchRelationPipe, DeleteRecordsCountPipe, BusinessAssetsInfoComponent, BusinessBankingDetailsComponent, SalesDetailsComponent, DailySalesDetailsComponent, SalesCalculationComponent, ManageSalesComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, PdLocatedMapViewDirective, ViewLocationComponent], imports: [ CommonModule, ManagePdRoutingModule, @@ -187,13 +190,13 @@ const pdCustomNotifierOptions: NotifierOptions = { AgmCoreModule.forRoot({apiKey: 'AIzaSyBtdO5k6CRntAMJCF-H5uZjTCoSGX95cdk'}),OwlDateTimeModule, OwlNativeDateTimeModule, ], - 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,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent], + 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,DailySalesDetailsComponent, SalesCalculationComponent, PurchaseDetailsComponent, BusinessExpenseDetailsComponent, HouseHoldDetailsComponent, OtherBusinessIncomeDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, GrossProfitCalculationComponent, ManageDailySalesComponent, PdStatusChangeDialogueComponent, ViewLocationComponent], 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}], + {provide: MAT_DATE_FORMATS, useValue: MAT_MOMENT_DATE_FORMATS}, PdLocatedMapViewDirective], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent, TelePdAllocationComponent, AllocationViewMoreComponent, PersonalInfoComponent,BusinessAssetsInfoComponent, - 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,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent], + 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,BusinessBankingDetailsComponent, ManageSalesComponent, ManagePurchaseComponent, ManageBusinesExpenseComponent, ManageHouseHoldComponent, ManageOtherBusinessIncomeComponent, ManageDailySalesComponent,PdStatusChangeDialogueComponent, ViewLocationComponent], }) export class ManagePdModule { diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/pd-located-map-view.directive.ts b/ng6-seed/src/app/personal-discussion/pd-directive/pd-located-map-view.directive.ts new file mode 100644 index 000000000..b4cab5324 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-directive/pd-located-map-view.directive.ts @@ -0,0 +1,48 @@ +import { Directive, OnInit, ElementRef, Renderer2 ,HostListener,HostBinding,Input} from '@angular/core'; +import { MatDialog,MatDialogRef,MAT_DIALOG_DATA } from '@angular/material'; +import { GetGeometricLocationService } from './../location-service/get-geometric-location.service'; +import { ViewLocationComponent } from './../pd-directive/view-location/view-location.component'; + +@Directive({ + selector: '[appPdLocatedMapView]' +}) +export class PdLocatedMapViewDirective { + + @Input() value:any; + @HostBinding('style.cursor') evPoint : string = 'none'; + lat : String; + lang: String; + constructor(private elm : ElementRef , private render:Renderer2,private dialog: MatDialog, private _geolocation: GetGeometricLocationService) { } + ngOnInit() + { + } + + @HostListener('mouseenter') mouseover(event: Event){ + this.evPoint = 'pointer'; + } + + @HostListener('click') onclick(event: Event) +{ + if(this.value.addressline1 && this.value.pincode && this.value.state_name && this.value.city_name){ + this._geolocation.findLocations(this.value.addressline1,this.value.pincode,this.value.state_name,this.value.city_name) + .subscribe(response => { + if (response.status == 'OK') { + this.lat = response.results[0].geometry.location.lat; + this.lang = response.results[0].geometry.location.lng; + const dialogRef = this.dialog.open(ViewLocationComponent, { + data: {"lat": this.lat, "lang":this.lang}, + disableClose: false, + minWidth:'30%', + maxWidth:'30%', + }); + } + }); + } + +} +@HostListener('mouseleave') mouseleave(event: Event) +{ + this.evPoint = 'none'; +} + +} diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.html b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.html new file mode 100644 index 000000000..1c59c9300 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.html @@ -0,0 +1,26 @@ +

+
+ PD Location +
+
+ +
+

+ +
+
+ + + + + + + +
+
+
+ + + diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.scss b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.scss new file mode 100644 index 000000000..b5967f66a --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.scss @@ -0,0 +1,48 @@ +@import "../../../../assets/styles/scss/material.variables"; + +:host { + margin-left: -5px; + margin-right: -5px; + margin-top: -5px; + display: block; + height: 100%; +} +.sebm-google-map-container { + width: 100%; + height: 350px; + display: flex; +} + +$mat-toolbar-height-desktop: 64px !default; +$mat-toolbar-height-mobile-portrait: 56px !default; +$mat-toolbar-height-mobile-landscape: 48px !default; + +.mat-card-top { + margin-top: -($mat-toolbar-height-desktop); +} +::ng-deep .mat-dialog-container{ + overflow: hidden; +} + +@media ($mat-xsmall) and (orientation: portrait) { + .mat-card-top { + margin-top: -($mat-toolbar-height-mobile-portrait); + } +} + +@media ($mat-small) and (orientation: landscape) { + .mat-card-top { + margin-top: -($mat-toolbar-height-mobile-landscape); + } +} +::-webkit-scrollbar { + width: 0px; /* remove scrollbar space */ + background: transparent; /* optional: just make scrollbar invisible */ +} +/* optional: show position indicator in red */ +::-webkit-scrollbar-thumb { + background: #FF0000; +} +::ng-deep .body-container{ + padding:0px !important; +} \ No newline at end of file diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.spec.ts b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.spec.ts new file mode 100644 index 000000000..86244b78d --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ViewLocationComponent } from './view-location.component'; + +describe('ViewLocationComponent', () => { + let component: ViewLocationComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ViewLocationComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ViewLocationComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts new file mode 100644 index 000000000..5730a5066 --- /dev/null +++ b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts @@ -0,0 +1,17 @@ +import { Component, OnInit, Input, Output, Inject } from '@angular/core'; +import { MatDialog, MatDialogRef, MAT_DIALOG_DATA , DialogPosition} from '@angular/material'; + +@Component({ + selector: 'app-view-location', + templateUrl: './view-location.component.html', + styleUrls: ['./view-location.component.scss'] +}) +export class ViewLocationComponent implements OnInit { + + constructor(@Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { } + + ngOnInit() { + console.log(this.data); + } + +} From 1a918607493a952bb584fa2c18bbf9eead73b299 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Tue, 5 Feb 2019 22:49:41 +0530 Subject: [PATCH 5/7] changes:ps --- .../forms/address/address.component.html | 11 +- .../forms/address/address.component.ts | 19 + .../assets-info/assets-info.component.html | 3 +- .../other-applicant-details.component.html | 2 +- .../other-applicant-details.component.ts | 49 +- .../family-details.component.html | 2 +- .../financial-info.component.html | 8 +- .../financial-info.component.ts | 533 +++++++++++++++--- .../general-info/general-info.component.html | 12 +- .../general-info/general-info.component.ts | 32 +- .../loan-details/loan-details.component.ts | 4 +- 11 files changed, 512 insertions(+), 163 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html index fac93f6bc..cf582b8f4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.html @@ -58,11 +58,18 @@
- +
+
+ + + requried + +
+
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts index fd6681916..8fc2f03dd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/address/address.component.ts @@ -224,6 +224,7 @@ export class AddressComponent implements OnInit { address_type_others: [''], locality: ['', Validators.compose([Validators.required])], locality_others: [''], + locality_mixuse:[''], pd_location: ['', Validators.compose([Validators.required])], comment_locality: ['', Validators.compose([Validators.required])], other_comment_locality : [''], @@ -368,6 +369,19 @@ export class AddressComponent implements OnInit { onSubmit() { + if (this.addressForm.controls.address_type.value == 1) { + this.addressForm.controls['address_type_others'].setValidators([Validators.required]); + this.addressForm.controls['address_type_others'].updateValueAndValidity(); + } + if (this.addressForm.controls.locality.value == 1) { + this.addressForm.controls['locality_others'].setValidators([Validators.required]); + this.addressForm.controls['locality_others'].updateValueAndValidity(); + } + if (this.addressForm.controls.locality.value == 5) { + this.addressForm.controls['locality_mixuse'].setValidators([Validators.required]); + this.addressForm.controls['locality_mixuse'].updateValueAndValidity(); + } + if (!this.addressForm.valid) { this.notifier.notify('warning', 'Please Fill All Mandatory Fields.!'); return; @@ -389,6 +403,9 @@ export class AddressComponent implements OnInit { if (this.locality.value == 1) { records.locality_others = this.addressForm.controls.locality_others.value; } + if(this.locality.value == 5){ + records.locality_mixuse = this.addressForm.controls.locality_mixuse.value; + } records.pd_location = this.pdLocation.value; records.comment_locality = this.commentlocality.value; records.other_comment_locality = this.other_comment_locality.value; @@ -446,6 +463,8 @@ export class AddressComponent implements OnInit { }); } + + ConvertMonthintoYear(e){ let business_year = this.addressForm.controls.business_years.value; 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 bfd8fd714..3ec76ed1b 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 @@ -176,7 +176,8 @@
- + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html index 6088e72cc..28a3a929b 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.html @@ -53,7 +53,7 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts index a6951b0ba..71efc9288 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/dialogue/other-applicant-details/other-applicant-details.component.ts @@ -15,30 +15,22 @@ export class OtherApplicantDetailsComponent implements OnInit { applicantInfo:any={'pd_co_applicant_id':"0",'applicant_name':'','is_applicant':false,'is_person_met':false, applicant_title_name:'',age:'', qualification:'',course_name:''}; titleList: any=[]; qualificationList: any=[]; - EditGeneralFormData: any=[]; - EditFlag: boolean = false; + //EditGeneralFormData: any=[]; + //EditFlag: boolean = false; constructor(private _fb: FormBuilder, private _pd: PdTrigerService, @Inject(MAT_DIALOG_DATA) public generalFormData : any, private dialogRef: MatDialogRef) { - if(generalFormData != ''){ - this.EditGeneralFormData = generalFormData.value; - this.EditFlag = true; - } - console.log(this.EditGeneralFormData); + // if(generalFormData != ''){ + // this.EditGeneralFormData = generalFormData.value; + // this.EditFlag = true; + // } + // console.log(this.EditGeneralFormData); } - ngOnInit() { - - if(!this.EditFlag){ - console.log('init if',this.EditGeneralFormData); - this.initFormDetails(null); - } - else{ - console.log('init else',this.EditGeneralFormData); - this.initFormDetails(this.EditGeneralFormData); - } + ngOnInit() { + this.initFormDetails(null); this.getMasterDetails('TITLES',1); this.getMasterDetails('EDUQUALIFICATION',2); } @@ -60,24 +52,15 @@ export class OtherApplicantDetailsComponent implements OnInit { // init form initFormDetails(data : any) { - console.log('data',data); if(data == null){ - console.log('if data',data); this._OtherForm = this._fb.group({ applicant_list: this._fb.array([this.createApplicant(this.applicantInfo)]), }); } - else{ - console.log('else data',data); - this._OtherForm = this._fb.group({ - applicant_list: this._fb.array([this.updateApplicant(this.EditGeneralFormData)]), - }); - } } // create applicant form array createApplicant(elementValue:any){ - console.log("create applicants",elementValue); return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_title_name: [elementValue.applicant_title_name, Validators.required], @@ -90,20 +73,6 @@ createApplicant(elementValue:any){ }); } -updateApplicant(elementValue:any){ - console.log("update applicants",elementValue); - return this._fb.group({ - pd_co_applicant_id: [elementValue.pd_co_applicant_id], - applicant_title_name: [elementValue.applicant_title_name, Validators.required], - applicant_name:[elementValue.applicant_name,Validators.required], - is_applicant:[elementValue.is_applicant ? true : false], - is_person_met:[elementValue.is_person_met ? true : false], - age:[elementValue.age || ''], - qualification: [elementValue.qualification || ''], - course_name:[elementValue.course_name || ''] -}); -} - // add more addMoreApplicant(){ if (this._OtherForm.invalid) { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html index 51370aed4..4bc1c1c34 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/family-details/family-details.component.html @@ -361,7 +361,7 @@
-
Address Details of {{FamilyMemberAsLabel[ix]}}
+
Family Details of {{FamilyMemberAsLabel[ix]}}
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html index 897029a2f..8497c5c64 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/financial-info/financial-info.component.html @@ -241,10 +241,10 @@ -->
- + - + @@ -272,10 +272,10 @@
- + - + 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 8eebd8b22..3aca4522f 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 @@ -205,9 +205,6 @@ export class FinancialInfoComponent implements OnInit { // } - - - /** CREATING financial Statement ( financial_year AutoGenerate ) */ createDate(date) { return this.fb.group({ @@ -418,7 +415,7 @@ export class FinancialInfoComponent implements OnInit { 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)); + detail.controls.financial_annualsales_variation.setValue(annual_sale_variation!= Infinity ? annual_sale_variation.toFixed(2):0); } } @@ -429,7 +426,7 @@ export class FinancialInfoComponent implements OnInit { 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)); + detail.controls.estimate_annualsales_variation.setValue(annual_sale_variation!= Infinity ? annual_sale_variation.toFixed(2):0); } } @@ -464,7 +461,7 @@ export class FinancialInfoComponent implements OnInit { let variation = (((profit != '' ? profit : loss ) - (prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100; - detail.controls.financial_variation.setValue(variation.toFixed(2)); + detail.controls.financial_variation.setValue(variation!= Infinity ? variation.toFixed(2):0); } } } @@ -508,7 +505,7 @@ export class FinancialInfoComponent implements OnInit { } else{ profit_margin = (profit / salary) * 100; - detail.controls.financial_margin_of_profit.setValue(profit_margin.toFixed(2)); + detail.controls.financial_margin_of_profit.setValue(profit_margin!= Infinity ? profit_margin.toFixed(2):0); } } @@ -528,7 +525,7 @@ export class FinancialInfoComponent implements OnInit { } else{ loss_margin = (loss / salary) * 100 * (-1); - detail.controls.financial_margin_of_loss.setValue(loss_margin.toFixed(2)); + detail.controls.financial_margin_of_loss.setValue(loss_margin != Infinity ? loss_margin.toFixed(2): 0); // detail.controls.financial_margin.disable() } } @@ -582,7 +579,7 @@ export class FinancialInfoComponent implements OnInit { let variation = (((profit != '' ? profit : loss ) - ( prev_profit != '' ? prev_profit : prev_loss ))/ (prev_profit != '' ? Math.abs(prev_profit) : Math.abs(prev_loss))) * 100; - detail.controls.estimate_variation.setValue(variation.toFixed(2)); + detail.controls.estimate_variation.setValue(variation!= Infinity ? variation.toFixed(2) : 0); } } @@ -598,7 +595,7 @@ export class FinancialInfoComponent implements OnInit { if (salary != '' && profit != '') { let margin = profit / salary * 100; - detail.controls.estimate_margin_of_profit.setValue(margin.toFixed(2)); + detail.controls.estimate_margin_of_profit.setValue(margin!= Infinity ? margin.toFixed(2):0); } } else if (detail.value.estimate_profit_or_loss == 2){ @@ -606,7 +603,7 @@ export class FinancialInfoComponent implements OnInit { let loss = detail.value.estimate_net_loss; if (salary != '' && loss != '') { let margin = (loss / salary) * 100 * (-1); - detail.controls.estimate_margin_of_loss.setValue(margin.toFixed(2)); + detail.controls.estimate_margin_of_loss.setValue(margin!= Infinity ? margin.toFixed(2):0); } } @@ -619,7 +616,7 @@ export class FinancialInfoComponent implements OnInit { let margin_profit = detail.value.estimate_margin_of_profit; if (salary != '' && margin_profit != '') { let profit = (margin_profit/100)*salary; - detail.controls.estimate_net_profit.setValue(profit.toFixed(2)); + detail.controls.estimate_net_profit.setValue(profit!= Infinity ? profit.toFixed(2):0); this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(profit); } @@ -628,7 +625,7 @@ export class FinancialInfoComponent implements OnInit { let margin_loss = detail.value.estimate_margin_of_loss; if (salary != '' && margin_loss != '') { let loss = (margin_loss/100)*salary*(-1); - detail.controls.estimate_net_loss.setValue(loss.toFixed(2)); + detail.controls.estimate_net_loss.setValue(loss!= Infinity ? loss.toFixed(2):0); this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(loss); } } @@ -640,6 +637,13 @@ export class FinancialInfoComponent implements OnInit { let estimate_sales_to = +details.value.estimate_sales_to; if (estimate_sales_from != null && estimate_sales_to != null){ + + if(+estimate_sales_from>+estimate_sales_to){ + alert("Given To value is lower than From Value"); + details.controls.estimate_sales_to.setValue(''); + details.controls.estimate_sales_average.setValue(''); + return; + } let C = (estimate_sales_to - estimate_sales_from) let D = (C / estimate_sales_from) * 100; @@ -648,46 +652,46 @@ export class FinancialInfoComponent implements OnInit { if(D >= 20){ var r = confirm("Given Sales Range is greater than 20%"); if (r == true) { - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); }else{ details.controls.estimate_sales_to.setValue(''); return; } } else{ - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); } } else if(estimate_sales_from > 5000000 || estimate_sales_from <= 10000000){ if(D >= 15){ var r = confirm("Given Sales Range is greater than 15%"); if (r == true) { - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); }else{ details.controls.estimate_sales_to.setValue(''); return; } } else{ - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); } } else if(estimate_sales_from > 10000000){ if(D >= 10){ var r = confirm("Given Sales Range is greater than 10%"); if (r == true) { - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); }else{ details.controls.estimate_sales_to.setValue(''); return; } } else{ - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); } } else{ - details.controls.estimate_sales_to.setValue(estimate_sales_to); + details.controls.estimate_sales_to.setValue(estimate_sales_to!= Infinity ? estimate_sales_to:0); } // if(D >= 30){ @@ -719,11 +723,11 @@ export class FinancialInfoComponent implements OnInit { let higer = ((+estimate_sales_to + +estimate_sales_from) / 2); if(lower > higer){ - details.controls.estimate_sales_average.setValue(higer.toFixed(2)); + details.controls.estimate_sales_average.setValue(higer!= Infinity ? higer.toFixed(2):0); this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); } else{ - details.controls.estimate_sales_average.setValue(lower.toFixed(2)); + details.controls.estimate_sales_average.setValue(lower!= Infinity ? lower.toFixed(2):0); this.AV_SalesInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); } @@ -737,19 +741,55 @@ export class FinancialInfoComponent implements OnInit { calculateMarginProfit( i, details){ let sales_average = details.value.estimate_sales_average; + if(sales_average == ''){ + alert("Considered Sales Average is Empty"); + details.controls.estimate_profit_range_from.setValue(''); + details.controls.estimate_profit_range_to.setValue(''); + details.controls.estimate_profit_margin.setValue(''); + details.controls.estimate_profit_margin_percent.setValue(''); + return; + } let estimate_profit_range_from = details.value.estimate_profit_range_from; + if(+estimate_profit_range_from > 100){ + alert('Given Profit percent is More Than 100'); + details.controls.estimate_profit_range_from.setValue(''); + details.controls.estimate_profit_range_to.setValue(''); + details.controls.estimate_profit_margin.setValue(''); + details.controls.estimate_profit_margin_percent.setValue(''); + return; + + } + let estimate_profit_range_to = details.value.estimate_profit_range_to; + + if(+estimate_profit_range_to > 100){ + alert('Given Profit percent is More Than 100'); + details.controls.estimate_profit_range_to.setValue(''); + details.controls.estimate_profit_margin.setValue(''); + details.controls.estimate_profit_margin_percent.setValue(''); + return; + + } if (sales_average != '' && estimate_profit_range_from != '' && estimate_profit_range_to != ''){ + if(+estimate_profit_range_from>+estimate_profit_range_to){ + alert("Given To value is lower than From Value"); + details.controls.estimate_profit_range_to.setValue(''); + details.controls.estimate_profit_margin.setValue(''); + details.controls.estimate_profit_margin_percent.setValue(''); + return; + } + let profit_percent = (estimate_profit_range_to + estimate_profit_range_from)/2; let Profit_Average = (profit_percent*sales_average)/100; + let difference = (estimate_profit_range_to - estimate_profit_range_from); - if(Profit_Average >= 3){ - var r = confirm("Given Profit Range is greater than 3%"); + if(difference > 3){ + var r = confirm("Given Profit Percent Range is greater than 3"); if (r == true) { - details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average)); - details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2)); + details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); + details.controls.estimate_profit_margin_percent.setValue(profit_percent!= Infinity ? profit_percent.toFixed(2):0); this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); }else{ details.controls.estimate_profit_range_to.setValue(''); @@ -758,10 +798,10 @@ export class FinancialInfoComponent implements OnInit { return; } } - else{ - alert('else part'); - } - + + details.controls.estimate_profit_margin.setValue(Profit_Average!= Infinity ? Math.round(Profit_Average):0); + details.controls.estimate_profit_margin_percent.setValue(profit_percent!= Infinity ? profit_percent.toFixed(2):0); + this.AV_marginProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(Profit_Average)); // details.controls.estimate_profit_margin.setValue(Math.round(Profit_Average)); // details.controls.estimate_profit_margin_percent.setValue(profit_percent.toFixed(2)); @@ -774,65 +814,214 @@ export class FinancialInfoComponent implements OnInit { calculateProfitAmount( i, details){ let sales_average = details.value.estimate_sales_average; + if(sales_average == ''){ + alert("Considered Sales Average is Empty"); + details.controls.estimate_net_profit_from.setValue(''); + details.controls.estimate_net_profit_to.setValue(''); + details.controls.estimate_net_profit.setValue(''); + details.controls.estimate_net_profit_percent.setValue(''); + return; + } let estimate_net_profit_from = details.value.estimate_net_profit_from; let estimate_net_profit_to = details.value.estimate_net_profit_to; + if(+estimate_net_profit_to>+sales_average){ + + alert("Given Profit is Greater than Sales"); + details.controls.estimate_net_profit_from.setValue(''); + details.controls.estimate_net_profit_to.setValue(''); + details.controls.estimate_net_profit.setValue(''); + details.controls.estimate_net_profit_percent.setValue(''); + return; + } + + if (sales_average != '' && estimate_net_profit_from != '' && estimate_net_profit_to != ''){ - - let profit_amount = (estimate_net_profit_to + estimate_net_profit_from)/2; - let Profit_percent = (profit_amount/sales_average)*100; + if(+estimate_net_profit_from>+estimate_net_profit_to){ + alert("Given To value is lower than From Value"); + details.controls.estimate_net_profit_to.setValue(''); + details.controls.estimate_net_profit.setValue(''); + details.controls.estimate_net_profit_percent.setValue(''); + return; + } + + let C = (estimate_net_profit_to - estimate_net_profit_from) + let D = (C / estimate_net_profit_from) * 100; + + let range1 = +estimate_net_profit_from/10; + + let lower = (+estimate_net_profit_from)+range1; + let higer = ((+estimate_net_profit_to + +estimate_net_profit_from) / 2); - // details.controls.estimate_net_profit.setValue(Math.round(profit_amount)); - // details.controls.estimate_net_profit_percent.setValue(Profit_percent.toFixed(2)); - - // this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(profit_amount)); - if(Profit_percent >= 3){ - var r = confirm("Given Profit Percentage is greater than 3%"); + if(estimate_net_profit_from <= 5000000){ + if(D >= 20){ + var r = confirm("Given Profit Range is greater than 20%"); if (r == true) { - - details.controls.estimate_net_profit.setValue(Math.round(profit_amount)); - details.controls.estimate_net_profit_percent.setValue(Profit_percent.toFixed(2)); - this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(profit_amount)); - + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); }else{ - details.controls.estimate_net_profit_to.setValue(''); details.controls.estimate_net_profit.setValue(''); details.controls.estimate_net_profit_percent.setValue(''); return; - } + } + else{ + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + } + + if(lower > higer){ + details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); + let Profit_percent = (higer/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); + let Profit_percent = (lower/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } + } + else if(estimate_net_profit_from > 5000000 || estimate_net_profit_from <= 10000000){ + if(D >= 15){ + var r = confirm("Given Sales Range is greater than 15%"); + if (r == true) { + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + + }else{ + details.controls.estimate_net_profit_to.setValue(''); + details.controls.estimate_net_profit.setValue(''); + details.controls.estimate_net_profit_percent.setValue(''); + return; + } + } + else{ + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + } + + if(lower > higer){ + details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); + let Profit_percent = (higer/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); + let Profit_percent = (lower/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } + + } + else if(estimate_net_profit_from > 10000000){ + if(D >= 10){ + var r = confirm("Given Sales Range is greater than 10%"); + if (r == true) { + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + }else{ + details.controls.estimate_net_profit_to.setValue(''); + details.controls.estimate_net_profit.setValue(''); + details.controls.estimate_net_profit_percent.setValue(''); + return; + } + } + else{ + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + } + + if(lower > higer){ + details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); + let Profit_percent = (higer/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); + let Profit_percent = (lower/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } } else{ - alert('else part'); + details.controls.estimate_net_profit_to.setValue(estimate_net_profit_to!= Infinity ? estimate_net_profit_to:0); + if(lower > higer){ + details.controls.estimate_net_profit.setValue(higer!= Infinity ? higer.toFixed(2):0); + let Profit_percent = (higer/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_profit.setValue(lower!= Infinity ? lower.toFixed(2):0); + let Profit_percent = (lower/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(Profit_percent!= Infinity ? Profit_percent.toFixed(2):0); + this.AV_netProfitAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } } } - + } calculateMarginLoss( i, details){ let sales_average = details.value.estimate_sales_average; + if(sales_average == ''){ + alert("Considered Sales Average is Empty"); + details.controls.estimate_loss_range_from.setValue(''); + details.controls.estimate_loss_range_to.setValue(''); + details.controls.estimate_loss_margin.setValue(''); + details.controls.estimate_loss_margin_percent.setValue(''); + return; + } + // else{ let estimate_loss_range_from = details.value.estimate_loss_range_from; + if(+estimate_loss_range_from > 100){ + alert('Given Loss Percent is more than 100'); + details.controls.estimate_loss_range_from.setValue(''); + details.controls.estimate_loss_range_to.setValue(''); + details.controls.estimate_loss_margin.setValue(''); + details.controls.estimate_loss_margin_percent.setValue(''); + return; + + } + let estimate_loss_range_to = details.value.estimate_loss_range_to; + if(+estimate_loss_range_to > 100){ + alert('Given Loss Percent is more than 100'); + details.controls.estimate_loss_range_from.setValue(''); + details.controls.estimate_loss_range_to.setValue(''); + details.controls.estimate_loss_margin.setValue(''); + details.controls.estimate_loss_margin_percent.setValue(''); + return; + + } + if (sales_average != '' && estimate_loss_range_from != '' && estimate_loss_range_to != ''){ + + if(+estimate_loss_range_from>+estimate_loss_range_to){ + alert("Given To value is lower than From Value"); + details.controls.estimate_loss_range_to.setValue(''); + details.controls.estimate_loss_margin.setValue(''); + details.controls.estimate_loss_margin_percent.setValue(''); + return; + } let loss_percent = (estimate_loss_range_to + estimate_loss_range_from)/2; let loss_Average = (loss_percent*sales_average)/100; + let difference = (estimate_loss_range_to - estimate_loss_range_from) // details.controls.estimate_loss_margin.setValue(Math.round(loss_Average)); // details.controls.estimate_loss_margin_percent.setValue(loss_percent.toFixed(2)); // this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); - if(loss_Average >= 3){ - var r = confirm("Given Profit Range is greater than 3%"); + if(difference > 3){ + var r = confirm("Given Loss Percent Range is greater than 3"); if (r == true) { - details.controls.estimate_loss_margin.setValue(Math.round(loss_Average)); - details.controls.estimate_loss_margin_percent.setValue(loss_percent.toFixed(2)); + details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); + details.controls.estimate_loss_margin_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); }else{ @@ -841,71 +1030,235 @@ export class FinancialInfoComponent implements OnInit { details.controls.estimate_loss_margin_percent.setValue(''); return; } - } - else{ - alert('else part'); - } + } + details.controls.estimate_loss_margin.setValue(loss_Average!= Infinity ? Math.round(loss_Average):0); + details.controls.estimate_loss_margin_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_marginLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_Average)); } } + calculateLossAmount( i, details){ let sales_average = details.value.estimate_sales_average; + if(sales_average == ''){ + alert("Considered Sales Average is Empty"); + details.controls.estimate_net_loss_from.setValue(''); + details.controls.estimate_net_loss_to.setValue(''); + details.controls.estimate_net_loss.setValue(''); + details.controls.estimate_net_loss_percent.setValue(''); + return; + } let estimate_net_loss_from = details.value.estimate_net_loss_from; let estimate_net_loss_to = details.value.estimate_net_loss_to; - if (sales_average != '' && estimate_net_loss_from != '' && estimate_net_loss_to != ''){ + if(+estimate_net_loss_to > +sales_average){ + + alert("Given Loss is Greater than Sales"); + details.controls.estimate_net_loss_from.setValue(''); + details.controls.estimate_net_loss_to.setValue(''); + details.controls.estimate_net_loss.setValue(''); + details.controls.estimate_net_loss_percent.setValue(''); + return; + } + - // let profit_percent = (estimate_net_profit_to - estimate_net_profit_from)/estimate_net_profit_from * 100; - // let Profit_Average = (profit_percent*sales_average)/100; - let loss_amount = (estimate_net_loss_to + estimate_net_loss_from)/2; - let loss_percent = (loss_amount/sales_average)*100; + if (sales_average != '' && estimate_net_loss_from != '' && estimate_net_loss_to != ''){ + if(+estimate_net_loss_from > +estimate_net_loss_to){ + alert("Given To value is Lower than From Value"); + details.controls.estimate_net_loss_to.setValue(''); + details.controls.estimate_net_loss.setValue(''); + details.controls.estimate_net_loss_percent.setValue(''); + return; + } + + + + // if(+estimate_net_loss_to > +estimate_net_loss_from){ + // alert("loss is greater than sales"); + // details.controls.estimate_net_loss_to.setValue(''); + // details.controls.estimate_net_loss.setValue(''); + // details.controls.estimate_net_loss_percent.setValue(''); + // return; + // } + + + let C = (estimate_net_loss_to - estimate_net_loss_from) + let D = (C / estimate_net_loss_from) * 100; + + let range1 = +estimate_net_loss_from/10; + + let lower = (+estimate_net_loss_from)+range1; + let higer = ((+estimate_net_loss_to + +estimate_net_loss_from) / 2); - // details.controls.estimate_net_loss.setValue(Math.round(loss_amount)); - // details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2)); - - // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount)); - if(loss_percent >= 3){ - var r = confirm("Given Loss Percentage is greater than 3%"); + if(estimate_net_loss_from <= 5000000){ + if(D >= 20){ + var r = confirm("Given Profit Range is greater than 20%"); if (r == true) { - - details.controls.estimate_net_loss.setValue(Math.round(loss_amount)); - details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2)); - - this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount)); - + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + }else{ - details.controls.estimate_net_loss_to.setValue(''); details.controls.estimate_net_loss.setValue(''); details.controls.estimate_net_loss_percent.setValue(''); return; - } + } + else{ + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + } + + if(lower > higer){ + details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); + let loss_percent = (higer/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); + let loss_percent = (lower/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } + + } + else if(estimate_net_loss_from > 5000000 || estimate_net_loss_from <= 10000000){ + if(D >= 15){ + var r = confirm("Given Sales Range is greater than 15%"); + if (r == true) { + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + }else{ + details.controls.estimate_net_loss_to.setValue(''); + details.controls.estimate_net_loss.setValue(''); + details.controls.estimate_net_loss_percent.setValue(''); + return; + } + } + else{ + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + } + + if(lower > higer){ + details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); + let loss_percent = (higer/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); + let loss_percent = (lower/sales_average)*100; + details.controls.estimate_net_profit_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } + } + else if(estimate_net_loss_from > 10000000){ + if(D >= 10){ + var r = confirm("Given Sales Range is greater than 10%"); + if (r == true) { + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + }else{ + details.controls.estimate_net_loss_to.setValue(''); + details.controls.estimate_net_loss.setValue(''); + details.controls.estimate_net_loss_percent.setValue(''); + return; + } + } + else{ + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + + } + if(lower > higer){ + details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); + let loss_percent = (higer/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); + let loss_percent = (lower/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } + } else{ - alert('else part'); + details.controls.estimate_net_loss_to.setValue(estimate_net_loss_to!= Infinity ? estimate_net_loss_to:0); + if(lower > higer){ + details.controls.estimate_net_loss.setValue(higer!= Infinity ? higer.toFixed(2):0); + let loss_percent = (higer/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(higer)); + } + else{ + details.controls.estimate_net_loss.setValue(lower!= Infinity ? lower.toFixed(2):0); + let loss_percent = (lower/sales_average)*100; + details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(lower)); + } } } - - // let estimate_net_profit_from = details.value.estimate_net_profit_from; - // let estimate_net_profit_to = details.value.estimate_net_profit_to; - - // if (estimate_net_profit_from != '' && estimate_net_profit_to != ''){ - // let AB = (estimate_net_profit_to + estimate_net_profit_from)/2; - // let C = (estimate_net_profit_to - estimate_net_profit_from); - // let D = (C / estimate_net_profit_from); - // let E = D*100; - - // details.controls.estimate_net_profit_percent.setValue(E); - // details.controls.estimate_net_profit.setValue(AB); - - // } + } + // calculateLossAmount( i, details){ + + // let sales_average = details.value.estimate_sales_average; + + // let estimate_net_loss_from = details.value.estimate_net_loss_from; + // let estimate_net_loss_to = details.value.estimate_net_loss_to; + + // if (sales_average != '' && estimate_net_loss_from != '' && estimate_net_loss_to != ''){ + + // // let profit_percent = (estimate_net_profit_to - estimate_net_profit_from)/estimate_net_profit_from * 100; + // // let Profit_Average = (profit_percent*sales_average)/100; + // let loss_amount = (estimate_net_loss_to + estimate_net_loss_from)/2; + // let loss_percent = (loss_amount/sales_average)*100; + + // // details.controls.estimate_net_loss.setValue(Math.round(loss_amount)); + // // details.controls.estimate_net_loss_percent.setValue(loss_percent.toFixed(2)); + + // // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount)); + // if(loss_percent >= 3){ + // var r = confirm("Given Loss Percentage is greater than 3%"); + // if (r == true) { + + // details.controls.estimate_net_loss.setValue(loss_amount!= Infinity ? Math.round(loss_amount):0); + // details.controls.estimate_net_loss_percent.setValue(loss_percent!= Infinity ? loss_percent.toFixed(2):0); + + // this.AV_netLossAmtInwords[i] = this._pd.convertNumberToWords(Math.round(loss_amount)); + + // }else{ + + // details.controls.estimate_net_loss_to.setValue(''); + // details.controls.estimate_net_loss.setValue(''); + // details.controls.estimate_net_loss_percent.setValue(''); + // return; + + // } + // } + // else{ + // alert('else part'); + // } + + // } + + // // let estimate_net_profit_from = details.value.estimate_net_profit_from; + // // let estimate_net_profit_to = details.value.estimate_net_profit_to; + + // // if (estimate_net_profit_from != '' && estimate_net_profit_to != ''){ + // // let AB = (estimate_net_profit_to + estimate_net_profit_from)/2; + // // let C = (estimate_net_profit_to - estimate_net_profit_from); + // // let D = (C / estimate_net_profit_from); + // // let E = D*100; + + // // details.controls.estimate_net_profit_percent.setValue(E); + // // details.controls.estimate_net_profit.setValue(AB); + + // // } + // } submitDetails() { diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html index 1dac6787f..cf0bcf0c9 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.html @@ -19,7 +19,8 @@ Name - {{details.value.applicant_name | titlecase}} + + @@ -61,11 +62,11 @@ - - @@ -257,7 +258,8 @@ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts index 2bd7823f3..0bb218c41 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/general-info/general-info.component.ts @@ -455,26 +455,24 @@ export class GeneralInfoComponent implements OnInit { } - /** Popup for EDIT Individuals */ - editIndividuals(arr) { - - console.log(arr); - - const dialogRef = this.dialog.open(OtherApplicantDetailsComponent, { - data: arr, - width:'40%', - disableClose: true - }); + // remove individuals + // removeIndividuals(findex){ + // let control = this._generalForm.controls['individuals']; + // control.removeAt(findex); + // } - dialogRef.afterClosed() - .subscribe(dataresult => { - }); - } // remove individuals - removeIndividuals(findex){ - let control = this._generalForm.controls['individuals']; - control.removeAt(findex); + removeIndividuals(findex,details){ + + let control = this._generalForm.controls['individuals']; + control.removeAt(findex); + + let controls = this._generalForm.controls['persons_with_relationships']; + let name = details.value.applicant_name; + let index1 = controls.value.map(data => data.applicant_name).indexOf(name); + controls.removeAt(index1); + } // update personal relation diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts index 02bbdf249..0cc832b9d 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/loan-details/loan-details.component.ts @@ -138,9 +138,8 @@ export class LoanDetailsComponent implements OnInit { return {id:element.company_order_id.toString(),name:element.company_name,group_id:1}; }); this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:modifyCompanyList}) - this.mergeCompanyApplicant.push({groupName:'COMPANIES',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) } - + let modifyApplicantList: any=[]; if(this.applicants.length > 0){ modifyApplicantList = this.applicants.map(element => { @@ -150,6 +149,7 @@ export class LoanDetailsComponent implements OnInit { // this.listOfLanguagues.splice(this.listOfLanguagues.indexOf(languague), 1); } + this.mergeCompanyApplicant.push({groupName:'OTHERS',groupValues:[{id:0,name:'Not Yet Finalised',group_id:2}]}) }) From a290a076173e6c61c2902623d7d4571b24c0e4e8 Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 6 Feb 2019 10:07:31 +0530 Subject: [PATCH 6/7] merge : kms --- .../pd-directive/view-location/view-location.component.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts index 5730a5066..b9704ac89 100644 --- a/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts +++ b/ng6-seed/src/app/personal-discussion/pd-directive/view-location/view-location.component.ts @@ -11,7 +11,6 @@ export class ViewLocationComponent implements OnInit { constructor(@Inject(MAT_DIALOG_DATA) public data: any, private dialogRef: MatDialogRef) { } ngOnInit() { - console.log(this.data); } } From bafcea1556e096b83722688bb2ceee74cd42fadd Mon Sep 17 00:00:00 2001 From: gandhimathi Date: Wed, 6 Feb 2019 16:00:49 +0530 Subject: [PATCH 7/7] assessed income sumary changes --- .../assessed-income.component.html | 186 ++++++++++++------ .../assessed-income.component.scss | 36 ++-- .../assessed-income.component.ts | 78 ++------ 3 files changed, 169 insertions(+), 131 deletions(-) diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html index 8ec856cb6..90286cb5a 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.html @@ -17,87 +17,155 @@ - + + + +
+

a) Cost of Goods Sold

+
+
+

{{sumary_details.sales_revenue !='' && sumary_details.sales_revenue!=null ? sumary_details.sales_revenue : '0'}}

+
+ +
+ +
+

{{subDetails.sales_item}}

+
+
+

{{subDetails.annual_sale_value !='' && subDetails.annual_sale_value!=null ? subDetails.annual_sale_value : '0'}}

+
+ +
+
- -
-

a) Cost of Goods Sold

+ + + +
+

b) Purchases

+
+
+

{{sumary_details.purchase !='' && sumary_details.purchase!=null ? sumary_details.purchase : '0'}}

+
+ +
+ +
+

{{subDetails.purchase_item}}

-
-

{{sales_value}}

+
+

{{subDetails.annual_purchase_value !='' && subDetails.annual_purchase_value!=null ? subDetails.annual_purchase_value : '0'}}

- -
-

b) Purchases

-
-
-

{{purchase_value}}

-
+ + + + +
+

c) Gross Profit (a-b)

+
+
+

{{sumary_details.gross_profit}}

+
+ +
+
+ + + +
+

d) Other Income

+
+
+

{{sumary_details.other_business_income !='' && sumary_details.other_business_income !=null ? sumary_details.other_business_income : '0' }}

+
+
- -
-

c) Gross Profit (a-b)

+ +
+

{{subDetails.business_income_item}}

-
-

{{gross_profit_value}}

+
+

{{subDetails.annual_income_value !='' && subDetails.annual_income_value!=null ? subDetails.annual_income_value : '0'}}

- -
-

d) Other Income

+ + + + +
+

e) Other Expenses

+
+
+

{{sumary_details.business_expense !='' && sumary_details.business_expense !=null ? sumary_details.business_expense : '0'}}

+
+ +
+ +
+

{{subDetails.expense_item}}

-
-

{{other_income_value}}

+
+

{{subDetails.annual_expenses_value !='' && subDetails.annual_expenses_value!=null ? subDetails.annual_expenses_value : '0'}}

- -
-

e) Other Expenses

+ + + + +
+

f) Net Profit (c+d-e)

+ +
+
+

{{sumary_details.net_profit_value!='' && sumary_details.net_profit_value!=null ? sumary_details.net_profit_value : '0'}}

+
+ +
+
+ + + + +
+

g) Household Expenses

+
-
-

{{other_expense_value}}

+
+

{{sumary_details.household_expenses}}

- + - -
-

f) Net Profit (c+d-e)

- + +
+

{{subDetails.expense_item}}

-
-

{{net_profit_value}}

+
+

{{subDetails.annual_expense_value !='' && subDetails.annual_expense_value!=null ? subDetails.annual_expense_value : '0'}}

- -
-

g) Household Expenses

- -
-
-

{{house_hold_value}}

-
- -
- -
-

h) Net Disposable Income (f-g)

- - -
-
-

{{net_disable_income_value}}

-
- -
- - - + + + + +
+

h) Net Disposable Income (f-g)

+ + +
+
+

{{sumary_details.net_disable_income_value !='' && sumary_details.net_disable_income_value !=null ? sumary_details.net_disable_income_value : 0}}

+
+ +
+
+ diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss index 71e617ab3..a63b81ec4 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.scss @@ -119,21 +119,35 @@ display: flex; border:1px solid rgba(0, 0, 0, 0.12); } - - mat-list-item:nth-child(3) { - background-color: #f5f5f5; - } - mat-list-item:nth-child(6) { - background-color: #f5f5f5; - } - mat-list-item:nth-child(8) { - background-color: #f5f5f5; - } + +// mat-list-item:nth-child(3) { +// background-color: #f5f5f5; +// } +// mat-list-item:nth-child(6) { +// background-color: #f5f5f5; +// } +// mat-list-item:nth-child(8) { +// background-color: #f5f5f5; +// } + mat-list-item:not(:first-child) { + cursor: auto; + .sub_item{ + margin-left: 35% !important; + } + p{ + font-size: 1rem !important; + } + + } + mat-list-item:first-child { + background-color: papayawhip; + } + .mat_list_right_div { text-align: left; } .mat_list_center_div { - text-align: center; + text-align: right; } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts index bdb939669..29ef95b94 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/assessed-income.component.ts @@ -21,15 +21,8 @@ export class AssessedIncomeComponent implements OnInit { // @Input() form_id: number; pdid: number; form_id: number; - displayedColumns = ['sno','list','amount']; - sales_value: number; - purchase_value: number; - gross_profit_value: number; - other_income_value: number; - other_expense_value: number; - net_profit_value: number; - house_hold_value: number; - net_disable_income_value: number; + sumary_details:any={"sales_revenue":0,"sales_revenue_details":[],"purchase":0,"purchase_details":[],"gross_profit":0,"other_business_income":0,"other_business_income_details":[] + ,"business_expense":0,"business_expense_details":[],"net_profit_value":0,"household_expenses":0,"house_hold_expense_details":[],"net_disable_income_value":0}; public salesCaluatedItem:any= []; public salesItemMonthWise:any= []; public purchaseDetails:any= []; @@ -65,15 +58,7 @@ public getCustomValues:any = { UOMList: this.UOMList,frequencyList: this.frequen this.getAIMaster('BUSINESSEXPENSES',3); this.getAIMaster('BUSINESSINCOME',4); this.getCustomValues.pdid = this.pd_all_details.pdmaster_details.pd_id; - this.sales_value=0; - this.purchase_value=0; - this.gross_profit_value=0; - this.other_income_value=0; - this.other_expense_value=0; - this.net_profit_value=0; - this.house_hold_value=0; - this.net_disable_income_value=0; - + } public viewerOptions: any = { navbar: false, @@ -117,35 +102,6 @@ public viewerOptions: any = { } if(value.records.sales_items_by_monthwise){ this.salesItemMonthWise = value.records.sales_items_by_monthwise; - // hide table format start - - // this.salesItemMonthWise.forEach((itemElement, itemIndex) => { - // this.salesItemMonthWiseBody= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] })); - // let combineTableColumn = Object.keys(itemElement.items).map(key => (itemElement.items[key])); - // let sumItems: any=[]; - // combineTableColumn.forEach((sumValue, sumIndex) => { - // let calculateItems = sumValue.reduce((acc, calculate) => acc + Number(calculate.sales_value), 0); - // sumItems.push({bodyElement:sumValue, bodyElementTotal:calculateItems}); - // }) - // let calculateAllItemsTotal:number=sumItems.reduce((racc, rcalculate) => racc + Number(rcalculate.bodyElementTotal), 0); - // let convertYear : number = 12 / sumItems.length; - // let tableFooterMessage: any=[]; - // tableFooterMessage.push({ - // message: sumItems.length + ' Months ' + itemElement.sales_item + ' Sales ', - // value:calculateAllItemsTotal, - // cols_span_length:sumItems.length * 2 -1, - // }) - // tableFooterMessage.push({ - // message: ' Yearly ' + itemElement.sales_item + ' Sales Arrived', - // value: calculateAllItemsTotal * convertYear, - // cols_span_length:sumItems.length * 2 -1 , - // }) - // this.salesMonthWiseTable.push({salesItem:itemElement.sales_item,headerElement:this.salesItemMonthWiseBody, bodyElements:sumItems, parentTableFooter:tableFooterMessage}); - // //console.log(this.salesMonthWiseTable) - // }); - // hide table format end - - this.salesItemMonthWise.forEach((itemElement, itemIndex) => { let expandBodyContent= Object.keys(itemElement.items).map(key => ({ header:key, value: itemElement.items[key] })); let listItems: any=[]; @@ -185,26 +141,26 @@ public viewerOptions: any = { if(value.records.final_data.length >0){ // this.finalData = value.records.final_data[0]; - - this.sales_value = value.records.final_data[0].income.sales_revenue !='' && value.records.final_data[0].income.sales_revenue !=null ? value.records.final_data[0].income.sales_revenue : 0; - this.purchase_value = value.records.final_data[0].expense.purchase !='' && value.records.final_data[0].expense.purchase !=null ? value.records.final_data[0].expense.purchase : 0; - this.gross_profit_value = value.records.final_data[0].gross_profit !='' && value.records.final_data[0].gross_profit !=null ? value.records.final_data[0].gross_profit : 0; - this.other_income_value = value.records.final_data[0].income.other_business_income !='' && value.records.final_data[0].income.other_business_income !=null ? value.records.final_data[0].income.other_business_income : 0; - this.other_expense_value = value.records.final_data[0].expense.business_expense !='' && value.records.final_data[0].expense.business_expense !=null ? value.records.final_data[0].expense.business_expense : 0; - this.net_profit_value = value.records.final_data[0].expense.net_profit !='' && value.records.final_data[0].expense.net_profit !=null ? value.records.final_data[0].expense.net_profit : 0; - this.house_hold_value = 0; - this.net_disable_income_value = this.net_profit_value-this.house_hold_value; + this.sumary_details = value.records.final_data[0]; + this.sumary_details["sales_revenue"] = value.records.final_data[0].sales_revenue; + this.sumary_details["sales_revenue_details"] = value.records.final_data[0].sales_revenue_details; + this.sumary_details["purchase"] = value.records.final_data[0].purchase; + this.sumary_details["purchase_details"] = value.records.final_data[0].purchase_details; + this.sumary_details["gross_profit"] = value.records.final_data[0].gross_profit; + this.sumary_details["other_business_income"] = value.records.final_data[0].other_business_income; + this.sumary_details["other_business_income_details"] = value.records.final_data[0].other_business_income_details; + this.sumary_details["business_expense"] = value.records.final_data[0].business_expense; + this.sumary_details["business_expense_details"] = value.records.final_data[0].business_expense_details; + this.sumary_details["net_profit_value"] = value.records.final_data[0].net_profit_value !='' && value.records.final_data[0].net_profit_value!=null ? value.records.final_data[0].net_profit_value : 0; + this.sumary_details["household_expenses"] = value.records.final_data[0].household_expenses; + this.sumary_details["house_hold_expense_details"] = value.records.final_data[0].house_hold_expense_details !='' && value.records.final_data[0].house_hold_expense_details !=null ? value.records.final_data[0].house_hold_expense_details : 0; + this.sumary_details["net_disable_income_value"] = Number(this.sumary_details.net_profit_value) - Number(this.sumary_details.household_expenses); } } }) } - // get total cost - getTotalCost(getItems:any) { - return getItems.map(t => t.sales_value).reduce((acc, value) => acc + Number(value), 0); - } - // get common drop down list getAIMaster(table:string, type:Number):void { this._pd.getAllMasterDatas(table).subscribe(