From bd5eadb7b105a9e9e28a7f122dd52f558ed41027 Mon Sep 17 00:00:00 2001 From: "venbatechnologies@gmail.com" Date: Wed, 29 May 2019 12:15:45 +0530 Subject: [PATCH] new changes :: ps --- .../list-pd/add-pd/add-pd.component.html | 9 +- .../list-pd/add-pd/add-pd.component.ts | 13 +- .../list-pd/all-pd/all-pd.component.html | 9 +- .../list-pd/all-pd/all-pd.component.ts | 27 +++- .../completed-pd/completed-pd.component.html | 5 + .../completed-pd/completed-pd.component.ts | 18 ++- .../edit-pd-applicant.component.html | 3 +- .../edit-pd-applicant.component.ts | 13 +- .../edit-pd-master.component.ts | 11 +- .../inprogress-pd.component.html | 5 + .../inprogress-pd/inprogress-pd.component.ts | 21 ++- .../qc-completed-pd.component.html | 5 + .../qc-completed-pd.component.ts | 11 +- .../scheduled-pd/scheduled-pd.component.html | 4 + .../scheduled-pd/scheduled-pd.component.ts | 11 +- .../forms/address/address.component.html | 4 +- .../forms/address/address.component.ts | 16 +- .../manage-busines-expense.component.html | 7 +- .../manage-busines-expense.component.ts | 2 + .../business-assets-info.component.html | 4 +- .../financial-info.component.html | 16 +- .../financial-info.component.ts | 97 ++++++------ .../general-info/general-info.component.html | 5 +- .../general-info/general-info.component.ts | 22 +-- .../manage-pd/manage-pd.module.ts | 1 - .../qc-pd-report/qc-pd-report.component.scss | 9 +- .../qc-pd-report/qc-pd-report.component.ts | 4 +- .../qc-list/qc-view/qc-view.component.html | 6 +- .../qc-pipe/number-to-words.pipe.spec.ts | 8 + .../qc-pipe/number-to-words.pipe.ts | 139 ++++++++++++++++++ .../app/quality-check/quality-check.module.ts | 5 +- 31 files changed, 382 insertions(+), 128 deletions(-) create mode 100644 ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.spec.ts create mode 100644 ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.ts diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html index 5f1f8e32c..e9c2b4848 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.html @@ -129,7 +129,8 @@
- + @@ -198,7 +199,8 @@ - + @@ -238,7 +240,8 @@ - + diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts index 177d25bc5..b13f91512 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/add-pd/add-pd.component.ts @@ -6,12 +6,14 @@ import { NotifierService } from 'angular-notifier'; import { PdTrigerService } from '../../../pd-service/pd-triger.service'; import { ListPdComponent } from '../list-pd.component'; import { AwsService } from '../../../../AwsService/aws.service'; +import { TitleCasePipe } from '@angular/common'; /**sweet alert */ import Swal from 'sweetalert2'; @Component({ selector: 'app-add-pd', templateUrl: './add-pd.component.html', styleUrls: ['./add-pd.component.scss'], + providers:[TitleCasePipe], encapsulation: ViewEncapsulation.None }) export class AddPdComponent implements OnInit, OnDestroy { @@ -48,7 +50,8 @@ export class AddPdComponent implements OnInit, OnDestroy { disableAfterSubmit: boolean; pincodeflag : any = []; constructor(notifier: NotifierService, private _fb: FormBuilder, private route: ActivatedRoute, - private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent) { + private router: Router, private _pd: PdTrigerService, private _aws: AwsService, private ListPdComponent: ListPdComponent, + private titleCase : TitleCasePipe) { this.notifier = notifier; this.disableAfterSubmit = false; } @@ -495,7 +498,7 @@ export class AddPdComponent implements OnInit, OnDestroy { "fk_pd_type": formValue.fk_pd_type, "fk_customer_segment": formValue.fk_customer_segment, "loan_amount": formValue.loan_amount, - "addressline1": !formValue.addresses[0].addressline1 ? null : formValue.addresses[0].addressline1.toUpperCase(), + "addressline1": !formValue.addresses[0].addressline1 ? null : this.titleCase.transform(formValue.addresses[0]), "fk_city": formValue.addresses[0].fk_city, "fk_state": formValue.addresses[0].fk_state, "pincode": formValue.addresses[0].pincode, @@ -510,7 +513,7 @@ export class AddPdComponent implements OnInit, OnDestroy { var addresses_details: any = []; if (formValue.applicant_name) { pd_applicant_details.push({ - "applicant_name": formValue.applicant_name, + "applicant_name": this.titleCase.transform(formValue.applicant_name), "applicant_title_name": formValue.applicant_title_name, "company_name": formValue.company_name, "mobile_no": formValue.mobile_no, @@ -550,7 +553,7 @@ export class AddPdComponent implements OnInit, OnDestroy { // } let obj1 = { - "applicant_name":itemElement.coapplicant_name, + "applicant_name":this.titleCase.transform(itemElement.coapplicant_name), "applicant_title_name": itemElement.applicant_title_name, "company_name": itemElement.company_name, "mobile_no":itemElement.coapplicant_mobile_no, @@ -564,7 +567,7 @@ export class AddPdComponent implements OnInit, OnDestroy { if (formValue.addresses.length > 0) { formValue.addresses.forEach((addressElement, itemIndex) => { let addressobj = { - "addressline1": !addressElement.addressline1 ? null : addressElement.addressline1.toUpperCase(), + "addressline1": !addressElement.addressline1 ? null : this.titleCase.transform(addressElement.addressline1), "fk_city": addressElement.fk_city, "fk_state": addressElement.fk_state, "pincode": addressElement.pincode, diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html index f750486f6..a104e0d45 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.html @@ -51,10 +51,17 @@
+ + + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts index 604e1f9b5..f737a83bd 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/all-pd/all-pd.component.ts @@ -42,11 +42,11 @@ export class AllPdComponent implements OnInit, OnChanges { PdListData:any[] = []; // pagination variable details - length = 50; + length = 5; pageIndex = 0; pageSize = 10; pageEvent: PageEvent; - + constructor(private _pd: PdTrigerService,private _fb:FormBuilder) { this.searchForm = this._fb.group( @@ -69,11 +69,7 @@ export class AllPdComponent implements OnInit, OnChanges { // this.loadPDDetails(); //this.getcommonDropDown(); } - ngAfterViewInit() { - this.dataSourceTab1.paginator = this.paginator; - this.dataSourceTab1.sort = this.sort; - } - + // get changes for filter from parent componnet filter ngOnChanges(changes: SimpleChanges) { let filteredText = changes.bindFilterValue.currentValue ? changes.bindFilterValue.currentValue.trim() : changes.bindFilterValue.currentValue; @@ -171,6 +167,7 @@ export class AllPdComponent implements OnInit, OnChanges { { console.log(e); } + searchItem() { @@ -198,12 +195,26 @@ export class AllPdComponent implements OnInit, OnChanges { this.xpandStatus = false; if(res['dataStatus']==true) { - this.dataSourceTab1 = res['records']; + this.dataSourceTab1.data = res['records']; + this.dataSourceTab1.paginator = this.paginator; + }else{ // this.notifier.notify('warning', 'No Records Found'); this.dataSourceTab1 = this.tempStore; + this.dataSourceTab1.paginator = this.paginator; } }) } + onReset(){ + this.searchForm.reset(); + this.dataSourceTab1 = this.tempStore; + this.dataSourceTab1.paginator = this.paginator; + this.xpandStatus = false; + } + + ngAfterViewInit() { + this.dataSourceTab1.paginator = this.paginator; + this.dataSourceTab1.sort = this.sort; + } } diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html index 706b2e4aa..1d4e13f38 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/completed-pd/completed-pd.component.html @@ -51,6 +51,11 @@
+ + + + + + + +
diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts index 27023c224..66e281b79 100644 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/assessed-income/AI-diologue/manage-busines-expense/manage-busines-expense.component.ts @@ -46,6 +46,7 @@ export class ManageBusinesExpenseComponent implements OnInit { fk_pd_id:[this.data.masterData.pdid], company_id:[this.data.masterData.company_id], expense_item_id:['',Validators.compose([Validators.required])], + other_expense_item:[''], expense_value:['',Validators.compose([Validators.required])], fk_frequency_id:['',Validators.compose([Validators.required])], annual_expenses_value:['',Validators.compose([Validators.required])], @@ -60,6 +61,7 @@ createBusinessItemWithData(values: any) { fk_pd_id:[this.data.masterData.pdid], company_id:[this.data.masterData.company_id], expense_item_id:[values.expense_item_id,Validators.compose([Validators.required])], + other_expense_item:[values.other_expense_item || ''], expense_value:[values.expense_value,Validators.compose([Validators.required])], fk_frequency_id:[values.fk_frequency_id,Validators.compose([Validators.required])], annual_expenses_value:[values.annual_expenses_value,Validators.compose([Validators.required])], diff --git a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html index 214e12f36..ea5fc2794 100755 --- a/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html +++ b/ng6-seed/src/app/personal-discussion/manage-pd/list-pd/start-pd/forms/business-assets-info/business-assets-info.component.html @@ -128,7 +128,7 @@ - Age of Asset in Year + Age of Asset in Years @@ -329,7 +329,7 @@ - Age of Asset in Year + Age of Asset in Years 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 e4f54efd0..45df62bc6 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 @@ -520,52 +520,52 @@ - other_reason_for_working_capital_facilities_availed Required + Other Reason For Working Capital Facilities Availed Required - reason_for_working_capital_facilities_availed Required + Reason For Working Capital Facilities Availed Required - reason_for_working_capital_facilities_availed Required + Bank Guarantee Required - cash_credit_limit Required + Cash Credit Limit Required - cash_credit_limit Required + Factoring Required - letter_of_credit Required + Letter Of Credit Required - forfaiting Required + Forfaiting Required - forfaiting Required + OD Limit Required
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 ad4fa489e..fd408bdcb 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 @@ -404,12 +404,9 @@ export class FinancialInfoComponent implements OnInit { changeWorkingCapitalFacilities(event: any) { console.log('event',event); if (event.value.exist_status == true && event.value.id == 2) { - console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id) - this.financialForm.removeControl('bank_guarantee'); } else if (event.value.exist_status == false && event.value.id == 2) { - console.log('event.value.exist_status == true && event.value.id == 2',event.value.exist_status,event.value.id) this.financialForm.addControl('bank_guarantee', new FormControl('')); } if (event.value.exist_status == true && event.value.id == 3) { @@ -560,53 +557,53 @@ export class FinancialInfoComponent implements OnInit { } } - selectedWorkkingCptl(e){ - console.log(e); - const workingCptlControl = this.financialForm.controls['select_working_capital_facilities_availed']; - let CtrlLength = workingCptlControl.controls.length; - if (CtrlLength > 0) { - let cnt = 0; - while(cnt < CtrlLength){ - let ChildCtrl : any = workingCptlControl.controls[cnt] - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 2){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('bank_guarantee'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 3){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('cash_credit_limit'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 4){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('factoring'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 5){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('forfaiting'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 6){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('letter_of_credit'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 7){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('od_limit'); - } - if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 1){ - ChildCtrl.controls['exist_status'].setValue(0); - ChildCtrl.controls['exist_status'].updateValueAndValidity(); - this.financialForm.removeControl('other_reason_for_working_capital_facilities_availed'); - this.financialForm.removeControl('reason_for_working_capital_facilities_availed'); - } - } - } - } + // selectedWorkkingCptl(e){ + // console.log(e); + // const workingCptlControl = this.financialForm.controls['select_working_capital_facilities_availed']; + // let CtrlLength = workingCptlControl.controls.length; + // if (CtrlLength > 0) { + // let cnt = 0; + // while(cnt < CtrlLength){ + // let ChildCtrl : any = workingCptlControl.controls[cnt] + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 2){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('bank_guarantee'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 3){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('cash_credit_limit'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 4){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('factoring'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 5){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('forfaiting'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 6){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('letter_of_credit'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 7){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('od_limit'); + // } + // if(ChildCtrl.controls.exist_status.value == 1 && ChildCtrl.controls.id.value == 1){ + // ChildCtrl.controls['exist_status'].setValue(0); + // ChildCtrl.controls['exist_status'].updateValueAndValidity(); + // this.financialForm.removeControl('other_reason_for_working_capital_facilities_availed'); + // this.financialForm.removeControl('reason_for_working_capital_facilities_availed'); + // } + // } + // } + // } /** For Auto-generating FinYear */ dynamicalFinYear(){ 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 f41942342..1bcc6b451 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 @@ -92,10 +92,10 @@ matTooltipPosition="below"> delete -
+
-
+
@@ -149,6 +149,7 @@ + Select {{entity.business_entity_type_name}} Business Entity Type Required 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 b0cc7319f..6772213da 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 @@ -6,7 +6,7 @@ import { PdTrigerService } from './../../../../../pd-service/pd-triger.service'; import { OtherApplicantDetailsComponent } from './../dialogue/other-applicant-details/other-applicant-details.component'; import { element } from '@angular/core/src/render3/instructions'; import { ELEMENT_PROBE_PROVIDERS } from '@angular/platform-browser/src/dom/debug/ng_probe'; -import { DatePipe } from '@angular/common'; +import { DatePipe,TitleCasePipe } from '@angular/common'; import { SearchRelationPipe } from './../../../../../pd-pipes/search-relation.pipe'; import { Options } from 'selenium-webdriver/edge'; // import { ImageCropperComponent } from '../dialogue/image-cropper/image-cropper.component'; @@ -15,7 +15,7 @@ import { Options } from 'selenium-webdriver/edge'; selector: 'app-general-info', templateUrl: './general-info.component.html', styleUrls: ['./general-info.component.scss'], - providers: [SearchRelationPipe], + providers: [SearchRelationPipe,TitleCasePipe], }) export class GeneralInfoComponent implements OnInit { @@ -64,7 +64,7 @@ export class GeneralInfoComponent implements OnInit { /********************** Declaration Section Ends Here *****************/ /** Constructor Section */ - constructor(notifier: NotifierService, private _fb: FormBuilder, private _pd: PdTrigerService, private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialogRef: MatDialogRef) { + constructor(notifier: NotifierService, private _fb: FormBuilder, private _pd: PdTrigerService, private dialog: MatDialog, @Inject(MAT_DIALOG_DATA) public pd_all_details: any, private dialogRef: MatDialogRef,private titleCase:TitleCasePipe) { this.pdid = this.pd_all_details.pdmaster_details.pd_id; this.parent_pdid = this.pd_all_details.pdmaster_details.parent_pd_id; this.notifier = notifier; @@ -350,7 +350,7 @@ export class GeneralInfoComponent implements OnInit { return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], applicant_title_name: [elementValue.applicant_title_name], - applicant_name: [elementValue.applicant_name], + applicant_name: [this.titleCase.transform(elementValue.applicant_name)], is_applicant: [elementValue.is_applicant], is_person_met: [elementValue.is_person_met], is_person_met_pic :[elementValue.is_person_met_pic], @@ -368,7 +368,7 @@ export class GeneralInfoComponent implements OnInit { createPersonsWithRelationships(elementValue: any) { return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], - applicant_name: [elementValue.applicant_name], + applicant_name: [this.titleCase.transform(elementValue.applicant_name)], relationship: [elementValue.relationship], relation_to: [elementValue.relation_to], individuals_order_id: [elementValue.individuals_order_id], @@ -411,7 +411,7 @@ export class GeneralInfoComponent implements OnInit { createCompaniesRelationshipWithData(elementValue: any) { return this._fb.group({ - applicant_name: [elementValue.applicant_name], + applicant_name: [this.titleCase.transform(elementValue.applicant_name)], company_relationship: [elementValue.company_relationship], relation_to_company: [elementValue.relation_to_company] }); @@ -458,7 +458,7 @@ export class GeneralInfoComponent implements OnInit { createApplicant(elementValue: any) { return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], - applicant_name: [elementValue.applicant_name], + applicant_name: [this.titleCase.transform(elementValue.applicant_name)], company_name: [elementValue.company_name,], exist_status: [elementValue.exist_status == 1 && elementValue.pd_co_applicant_id > 0 ? true : false] }); @@ -468,7 +468,7 @@ export class GeneralInfoComponent implements OnInit { createApplicantRelation(elementValue: any) { return this._fb.group({ pd_co_applicant_id: [elementValue.pd_co_applicant_id], - applicant_name: [elementValue.applicant_name], + applicant_name: [this.titleCase.transform(elementValue.applicant_name)], multiple_relation: this._fb.array([]), multiple_company_relation: this._fb.array([]), individuals_order_id: [elementValue.individuals_order_id] @@ -542,7 +542,7 @@ export class GeneralInfoComponent implements OnInit { element.is_main_applicant = false; individualsControl.push(this.createIndividulas(element)); let relationControl = this._generalForm.controls['persons_with_relationships']; - let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': element.applicant_name, 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id, 'is_active': element.is_active }; + let applicant_details: any = { 'pd_co_applicant_id': element.pd_co_applicant_id, 'applicant_name': this.titleCase.transform(element.applicant_name), 'relationship': '', 'relation_to': '', 'individuals_order_id': element.individuals_order_id, 'is_active': element.is_active }; relationControl.push(this.createPersonsWithRelationships(applicant_details)); }); @@ -561,7 +561,7 @@ export class GeneralInfoComponent implements OnInit { // details.value.applicant_name let control = relationControl.controls[index1] as FormArray; - control.controls['applicant_name'].setValue(event.target.value); + control.controls['applicant_name'].setValue(this.titleCase.transform(event.target.value)); // event.target.value // controls.controls[index1].disable(); @@ -598,7 +598,7 @@ export class GeneralInfoComponent implements OnInit { let controls = this._generalForm.controls['persons_with_relationships']; - let name = details.value.applicant_name; + let name = this.titleCase.transform(details.value.applicant_name); let index1 = controls.value.map(data => data.applicant_name).indexOf(name); // controls.controls[index1].disable(); // let personsWithRelationshipsControl : any = control.controls[index1]; 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 7c6266f33..e11920926 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 @@ -1,7 +1,6 @@ import {NgModule} from '@angular/core'; import {CommonModule} from '@angular/common'; - import { CKEditorModule } from 'ng2-ckeditor'; import { PdfViewerModule } from 'ng2-pdf-viewer'; diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss index 293864e96..eeed339b4 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.scss @@ -128,4 +128,11 @@ $product-bg-color-hover: rgba(103, 58, 183, 0.7); } .empty-spacer { flex: 1 1 auto; -} \ No newline at end of file +} + +@-moz-document url-prefix() { + iframe { + width:100px; + height: 3000px !important; + } + } \ No newline at end of file diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts index 272a2b4fd..c68f319b4 100644 --- a/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts +++ b/ng6-seed/src/app/quality-check/qc-list/qc-pd-report/qc-pd-report.component.ts @@ -208,7 +208,7 @@ export class QcPdReportComponent implements OnInit { if (data.status == 200) { console.log('getPdReportDetails',data); this.pdReportRecords = data.records; - this.qcStatus = data.records.pdstatus; + this.qcStatus = data.records.pd_status; console.log(this.qcStatus); this.generateBtn = data.records.is_original_report_created == 1 ? false : true; console.log(this.generateBtn); @@ -230,6 +230,8 @@ export class QcPdReportComponent implements OnInit { // load pd view component loadPdViewCompoent() { + let getItem = localStorage.getItem('userEdits'); + localStorage.removeItem('userEdits'); this.router.navigate(['../../../viewpd',this.startPD], { relativeTo: this.route }); } diff --git a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html index 69268336c..182ab2304 100755 --- a/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html +++ b/ng6-seed/src/app/quality-check/qc-list/qc-view/qc-view.component.html @@ -71,12 +71,12 @@
- - --> +
Lender Contact Details diff --git a/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.spec.ts b/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.spec.ts new file mode 100644 index 000000000..a67a5af9b --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.spec.ts @@ -0,0 +1,8 @@ +import { NumberToWordsPipe } from './number-to-words.pipe'; + +describe('NumberToWordsPipe', () => { + it('create an instance', () => { + const pipe = new NumberToWordsPipe(); + expect(pipe).toBeTruthy(); + }); +}); diff --git a/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.ts b/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.ts new file mode 100644 index 000000000..dc0f33472 --- /dev/null +++ b/ng6-seed/src/app/quality-check/qc-pipe/number-to-words.pipe.ts @@ -0,0 +1,139 @@ +import { Pipe, PipeTransform } from '@angular/core'; + +@Pipe({ + name: 'numberToWords' +}) +export class NumberToWordsPipe implements PipeTransform { + transform(price: any): any{ + + price = price.toString(); + let atemp = price.split("."); + let amount = atemp[0]; + + var sglDigit = ["Zero", "One", "Two", "Three", "Four", "Five", "Six", "Seven", "Eight", "Nine"], + dblDigit = ["Ten", "Eleven", "Twelve", "Thirteen", "Fourteen", "Fifteen", "Sixteen", "Seventeen", "Eighteen", "Nineteen"], + tensPlace = ["", "Ten", "Twenty", "Thirty", "Forty", "Fifty", "Sixty", "Seventy", "Eighty", "Ninety"], + + handle_tens = function(dgt, prevDgt) { + return 0 == dgt ? "" : " " + (1 == dgt ? dblDigit[prevDgt] : tensPlace[dgt]) + }, + handle_utlc = function(dgt, nxtDgt, denom) { + return (0 != dgt && 1 != nxtDgt ? " " + sglDigit[dgt] : "") + (0 != nxtDgt || dgt > 0 ? " " + denom : "") + }; + + var str = "", + digitIdx = 0, + digit = 0, + nxtDigit = 0, + words = []; + if (amount += "", isNaN(parseInt(amount))) str = ""; + else if (parseInt(amount) > 0 && amount.length <= 10) { + for (digitIdx = amount.length - 1; digitIdx >= 0; digitIdx--) + switch (digit = amount[digitIdx] - 0, nxtDigit = digitIdx > 0 ? amount[digitIdx - 1] - 0 : 0, amount.length - digitIdx - 1) { + case 0: + words.push(handle_utlc(digit, nxtDigit, "")); + break; + case 1: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 2: + words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] && 0 != amount[digitIdx + 2] ? " and" : "") : ""); + break; + case 3: + words.push(handle_utlc(digit, nxtDigit, "Thousand")); + break; + case 4: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 5: + words.push(handle_utlc(digit, nxtDigit, "Lakh")); + break; + case 6: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 7: + words.push(handle_utlc(digit, nxtDigit, "Crore")); + break; + case 8: + words.push(handle_tens(digit, amount[digitIdx + 1])); + break; + case 9: + words.push(0 != digit ? " " + sglDigit[digit] + " Hundred" + (0 != amount[digitIdx + 1] || 0 != amount[digitIdx + 2] ? " and" : " Crore") : "") + // break; + // case 10: + // words.push(0 != digit ? " " + sglDigit[digit] + " Lakh" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] ? " and" : " Hundred" + (0 != price[digitIdx + 1] || 0 != price[digitIdx + 2] || 0 != price[digitIdx + 3] ? " and" : " Crore")) + // : "") + // break; + } + str = words.reverse().join("") + // str =(str.length > 2 && str.charAt(str.length-2)==',') ? str.slice(0, -2) : str; + } else str = ""; + return str + +} + +//References +// transform(amount: any): any { +// let words: any = ['', 'One', 'Two', 'Three', 'Four', 'Five', 'Six', 'Seven', 'Eight', 'Nine', 'Ten', 'Eleven', 'Twelve', 'Thirteen', 'Fourteen', 'Fifteen', 'Sixteen', 'Seventeen', 'Eighteen', 'Nineteen', 'Twenty']; +// words[30] = 'Thirty'; +// words[40] = 'Forty'; +// words[50] = 'Fifty'; +// words[60] = 'Sixty'; +// words[70] = 'Seventy'; +// words[80] = 'Eighty'; +// words[90] = 'Ninety'; +// amount = amount.toString(); +// let atemp = amount.split("."); +// let number = atemp[0].split(",").join(""); +// let n_length = number.length; +// let words_string = ""; +// let value: any; +// if (n_length <= 9) { +// var n_array = new Array(0, 0, 0, 0, 0, 0, 0, 0, 0); +// var received_n_array = new Array(); +// for (var i = 0; i < n_length; i++) { +// received_n_array[i] = number.substr(i, 1); +// } +// for (var i = 9 - n_length, j = 0; i < 9; i++ , j++) { +// n_array[i] = received_n_array[j]; +// } +// for (var i = 0, j = 1; i < 9; i++ , j++) { +// if (i == 0 || i == 2 || i == 4 || i == 7) { +// if (n_array[i] == 1) { +// n_array[j] = 10 + (+n_array[j]); +// n_array[i] = 0; +// } +// } +// } +// value = ""; +// for (var i = 0; i < 9; i++) { +// if (i == 0 || i == 2 || i == 4 || i == 7) { +// value = n_array[i] * 10; +// } else { +// value = n_array[i]; +// } +// if (value != 0) { +// words_string += words[value] + " "; +// } +// if ((i == 1 && value != 0) || (i == 0 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Crores, "; +// } +// if ((i == 3 && value != 0) || (i == 2 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Lakhs, "; +// } +// if ((i == 5 && value != 0) || (i == 4 && value != 0 && n_array[i + 1] == 0)) { +// words_string += "Thousand, "; +// } +// if (i == 6 && value != 0 && (n_array[i + 1] != 0 && n_array[i + 2] != 0)) { +// words_string += "Hundred and "; +// } else if (i == 6 && value != 0) { +// words_string += "Hundred "; +// } +// } +// words_string = words_string.split(" ").join(" "); +// words_string=(words_string.length > 2 && words_string.charAt(words_string.length-2)==',') ? words_string.slice(0, -2) : words_string; +// } +// return words_string; +// } + +} diff --git a/ng6-seed/src/app/quality-check/quality-check.module.ts b/ng6-seed/src/app/quality-check/quality-check.module.ts index 771bc58c9..bc52ce653 100755 --- a/ng6-seed/src/app/quality-check/quality-check.module.ts +++ b/ng6-seed/src/app/quality-check/quality-check.module.ts @@ -42,8 +42,7 @@ import { QcReviewComponent } from './qc-list/qc-pd-report/qc-review/qc-review.co import { ModelEditPdReportComponent } from './qc-list/qc-pd-report/model-edit-pd-report/model-edit-pd-report.component'; import { PdLocatedMapViewDirective } from './../personal-discussion/pd-directive/pd-located-map-view.directive'; import { InitiateAdditionalPdComponent } from './../personal-discussion/manage-pd/list-pd/initiate-additional-pd/initiate-additional-pd.component'; - - +import { NumberToWordsPipe } from './qc-pipe/number-to-words.pipe'; /** * Custom angular notifier options @@ -115,7 +114,7 @@ const customNotifierOptions: NotifierOptions = { PdfViewerModule, ManagePdModule, ], - declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent], + declarations: [QualityCheckComponent,QcListComponent, QcViewComponent, QcStartComponent, QcPdReportComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, NumberToWordsPipe], entryComponents: [PdAllocationComponent, SmartPdAllocationComponent, SchedulePdComponent, EditPdApplicantComponent, EditPdMasterComponent,DialogChangeCurrentVenrsion, QcReviewComponent, ModelEditPdReportComponent, InitiateAdditionalPdComponent], providers : [QcService,{provide: MAT_DATE_LOCALE, useValue: 'en-GB'}, {provide: DateAdapter, useClass: MomentDateAdapter, deps: [MAT_DATE_LOCALE]},