| @@ -103,6 +103,8 @@ import { LoansAllComponent } from './loans-all/loans-all.component'; | |||
| import {LenderNameService} from './service/lender-name.service'; | |||
| import { LenderAaaIncomeComponent } from './pay-in/lender-aaa-income/lender-aaa-income.component'; | |||
| import { LenderConnectiveIncomeComponent } from './pay-in/lender-connective-income/lender-connective-income.component'; | |||
| import { LenderResimacXlsIncomeComponent } from './pay-in/lender-resimac-xls-income/lender-resimac-xls-income.component'; | |||
| import { LenderResimacPdfIncomeComponent } from './pay-in/lender-resimac-pdf-income/lender-resimac-pdf-income.component'; | |||
| @@ -175,6 +177,8 @@ export function initializeApp(appConfig: AppConfig): () => Promise<void> { | |||
| LoansAllComponent, | |||
| LenderAaaIncomeComponent, | |||
| LenderConnectiveIncomeComponent, | |||
| LenderResimacXlsIncomeComponent, | |||
| LenderResimacPdfIncomeComponent, | |||
| ], | |||
| imports: [ | |||
| BrowserModule, | |||
| @@ -0,0 +1,76 @@ | |||
| import {PayInLenderIncomeModel} from '../abstract/pay-in-lender.income.model'; | |||
| import {PayInModel} from './pay-in.model'; | |||
| import {PayInResimacXlsModel} from './pay-in-resimac-xls.mode'; | |||
| export class PayInResimacPdfModel extends PayInLenderIncomeModel { | |||
| public Period: Date; | |||
| public LoanNumber: string; | |||
| public Borrower: string; | |||
| public LoanAmount: number; | |||
| public InterestRate: number; | |||
| public Margin: number; | |||
| public Settlement: Date; | |||
| public Balance: number; | |||
| public OffsetBalance: number; | |||
| public GrossManFee: number; | |||
| public IncentiveP: number; | |||
| public Months: number; | |||
| public SacrificeP: number; | |||
| public Fee: number; | |||
| public MoFee: number; | |||
| public NetManFee: number; | |||
| public IncomeAmount: number; | |||
| constructor(payload: Partial<PayInResimacPdfModel>) { | |||
| super('Resimac', payload); | |||
| if ( payload.Period !== undefined && payload.Period !== null){ | |||
| this.Period = new Date(payload.Period); | |||
| }else{ | |||
| this.Period = new Date('1800-01-01'); // some invalid date before 1900-01-01 | |||
| } | |||
| this.LoanNumber = payload.LoanNumber || ''; | |||
| this.Borrower = payload.Borrower || ''; | |||
| this.LoanAmount = payload.LoanAmount || 0; | |||
| this.InterestRate = payload.InterestRate || 0; | |||
| this.Margin = payload.Margin || 0; | |||
| if ( payload.Settlement !== undefined && payload.Settlement !== null){ | |||
| this.Settlement = new Date (payload.Settlement); | |||
| }else{ | |||
| this.Settlement = new Date('1800-01-01'); | |||
| } | |||
| this.Balance = payload.Balance || 0; | |||
| this.OffsetBalance = Math.abs(payload.OffsetBalance || 0); | |||
| this.GrossManFee = payload.GrossManFee || 0; | |||
| this.IncentiveP = payload.IncentiveP || 0; | |||
| this.Months = payload.Months || 0; | |||
| this.SacrificeP = payload.SacrificeP || 0; | |||
| this.Fee = payload.Fee || 0 ; | |||
| this.MoFee = payload.MoFee || 0; | |||
| this.NetManFee = payload.NetManFee || 0; | |||
| this.IncomeAmount = payload.IncomeAmount || 0; | |||
| } | |||
| public convertToPayIn(): PayInModel { | |||
| const pi = new PayInModel({}); | |||
| pi.Lender = 'Resimac'; | |||
| pi.LoanNumber = this.LoanNumber; | |||
| pi.Amount = this.LoanAmount; | |||
| pi.Settlement = this.Settlement; | |||
| pi.IncomeAmount = this.IncomeAmount; | |||
| pi.IncomeType = 'Trail'; | |||
| pi.Balance = this.Balance; | |||
| pi.OffsetBalance = -1; | |||
| pi.Ts = this.Period; | |||
| return pi; | |||
| } | |||
| public isMatch(pi: PayInModel): boolean{ | |||
| return this.LoanNumber === pi.LoanNumber && this.LoanNumber !== '' && | |||
| this.AgencyName === pi.Lender && this.AgencyName !== '' && | |||
| this.IncomeAmount === pi.IncomeAmount && | |||
| this.Balance === pi.Balance && | |||
| 'Trail' === pi.IncomeType; | |||
| } | |||
| } | |||
| @@ -0,0 +1,105 @@ | |||
| import {PayInLenderIncomeModel} from '../abstract/pay-in-lender.income.model'; | |||
| import {PayInModel} from './pay-in.model'; | |||
| export class PayInResimacXlsModel extends PayInLenderIncomeModel { | |||
| public TRSTCD: number; | |||
| public ORGNTR: number; | |||
| public LOANNO: number; | |||
| public PORTN: string; | |||
| public BRNAMX: string; // Brower | |||
| public LNAMT: number; // Loan amount | |||
| public INTRTE: number; | |||
| public DELRTE: number; | |||
| public MARGIN: number; | |||
| public SETLDX: Date; // settled date | |||
| public LNBAL: number; | |||
| public MANFEE: number; | |||
| public RSINCP: number; | |||
| public RSSACT: number; | |||
| public RSSACP: number; | |||
| public SACAMT: number; | |||
| public MOFEE: number; | |||
| public MANTOT: number; | |||
| public NEWLON: number; | |||
| public REFADJ: number; | |||
| public NETNEW: number; | |||
| public FIXED: string; | |||
| public LNFORT: string; | |||
| public ORGNAM: string; | |||
| public LNEOM: Date; | |||
| // Derived attributes | |||
| LoanNumber: string; | |||
| Borrower: string; | |||
| LoanAmount: number; | |||
| Balance: number; | |||
| IncomeAmount: number; | |||
| constructor(payload: Partial<PayInResimacXlsModel>){ | |||
| super('Resimac', payload); | |||
| this.TRSTCD = payload.TRSTCD || 0 ; | |||
| this.ORGNTR = payload.ORGNTR || 0 ; | |||
| this.LOANNO = payload.LOANNO || 0 ; | |||
| this.PORTN = payload.PORTN || '' ; | |||
| this.BRNAMX = payload.BRNAMX || ''; | |||
| this.LNAMT = payload.LNAMT || 0; | |||
| this.INTRTE = payload.INTRTE || 0; | |||
| this.DELRTE = payload.DELRTE || 0; | |||
| this.MARGIN = payload.MARGIN || 0; | |||
| if ( payload.SETLDX !== undefined && payload.SETLDX !== null){ | |||
| this.SETLDX = new Date(payload.SETLDX); | |||
| }else{ | |||
| this.SETLDX = new Date('1800-01-01'); // some invalid date before 1900-01-01 | |||
| } | |||
| this.LNBAL = payload.LNBAL || 0; | |||
| this.MANFEE = payload.MANFEE || 0; | |||
| this.RSINCP = payload.RSINCP || 0; | |||
| this.RSSACT = payload.RSSACT || 0; | |||
| this.RSSACP = payload.RSSACP || 0; | |||
| this.SACAMT = payload.SACAMT || 0; | |||
| this.MOFEE = payload.MOFEE || 0; | |||
| this.MANTOT = payload.MANTOT || 0; | |||
| this.NEWLON = payload.NEWLON || 0; | |||
| this.REFADJ = payload.REFADJ || 0; | |||
| this.NETNEW = payload.NETNEW || 0; | |||
| this.FIXED = payload.FIXED || ''; | |||
| this.LNFORT = payload.LNFORT || ''; | |||
| this.ORGNAM = payload.ORGNAM || ''; | |||
| if ( payload.LNEOM !== undefined && payload.LNEOM !== null){ | |||
| this.LNEOM = new Date (payload.LNEOM); | |||
| }else{ | |||
| this.LNEOM = new Date('1800-01-01'); | |||
| } | |||
| // Derived attributes, but provided by Server | |||
| this.LoanNumber = payload.LoanNumber || ''; | |||
| this.Borrower = payload.Borrower || ''; | |||
| this.LoanAmount = payload.LoanAmount || 0; | |||
| this.Balance = payload.Balance || 0; | |||
| this.IncomeAmount = payload.IncomeAmount || 0; | |||
| } | |||
| public convertToPayIn(): PayInModel { | |||
| const pi = new PayInModel({}); | |||
| pi.Lender = 'Resimac'; | |||
| pi.LoanNumber = this.LoanNumber; | |||
| pi.Amount = this.LoanAmount; | |||
| pi.Settlement = this.SETLDX; | |||
| pi.IncomeAmount = this.IncomeAmount; | |||
| pi.IncomeType = 'Trail'; | |||
| pi.Balance = this.Balance; | |||
| pi.OffsetBalance = -1; | |||
| pi.Ts = this.LNEOM; | |||
| return pi; | |||
| } | |||
| public isMatch(pi: PayInModel): boolean { | |||
| return this.LoanNumber === pi.LoanNumber && this.LoanNumber !== '' && | |||
| this.AgencyName === pi.Lender && this.AgencyName !== '' && | |||
| this.IncomeAmount === pi.IncomeAmount && | |||
| this.Balance === pi.Balance && | |||
| 'Trail' === pi.IncomeType; | |||
| } | |||
| } | |||
| @@ -2,6 +2,8 @@ import {UploadMetaModel} from './uploadMetaModel'; | |||
| import {PayInModel} from './pay-in.model'; | |||
| import {PayInAAARowModel} from './Pay.In.AAA.Row.model'; | |||
| import {PayInConnectiveModel} from './pay-in-connective.model'; | |||
| import {PayInResimacXlsModel} from './pay-in-resimac-xls.mode'; | |||
| import {PayInResimacPdfModel} from './pay-in-resimac-pdf.model'; | |||
| @@ -13,6 +15,8 @@ export class UploadAnalysisModel { | |||
| public AAA?: PayInAAARowModel[]; | |||
| public Connective?: PayInConnectiveModel[]; | |||
| public ResimacXls?: PayInResimacXlsModel[]; | |||
| public ResimacPdf?: PayInResimacPdfModel[]; | |||
| public IsDuplicate: boolean; | |||
| public Uid?: string; // client side unique id when upload | |||
| @@ -42,9 +46,17 @@ export class UploadAnalysisModel { | |||
| } | |||
| this.Connective = []; | |||
| if ( payload.Connective ) { | |||
| if ( Array.isArray(payload.Connective) ) { | |||
| payload.Connective.forEach( v => { this.Connective.push(new PayInConnectiveModel(v)); }); | |||
| } | |||
| this.ResimacXls = []; | |||
| if ( Array.isArray(payload.ResimacXls) ) { | |||
| payload.ResimacXls.forEach( v => { this.ResimacXls.push(new PayInResimacXlsModel(v)); }); | |||
| } | |||
| this.ResimacPdf = []; | |||
| if (Array.isArray(payload.ResimacPdf)){ | |||
| payload.ResimacPdf.forEach( v => { this.ResimacPdf.push(new PayInResimacPdfModel(v)); }); | |||
| } | |||
| this.IsDuplicate = payload.IsDuplicate || false; | |||
| this.Uid = payload.Uid || '' ; | |||
| @@ -0,0 +1,3 @@ | |||
| kendo-grid{ | |||
| height: 100%; | |||
| } | |||
| @@ -0,0 +1,33 @@ | |||
| <kendo-grid [data]="data" (cellClick)="onCellClick($event)"> | |||
| <ng-template kendoGridToolbarTemplate> | |||
| {{this.AgencyName}} | |||
| </ng-template> | |||
| <kendo-grid-column field="Period" title="Period" format='{0:yyyy MMMM}' width="150"> </kendo-grid-column> | |||
| <kendo-grid-column field="LoanNumber" width="250"> </kendo-grid-column> | |||
| <kendo-grid-column field="Borrower" width="150"> </kendo-grid-column> | |||
| <kendo-grid-column field="LoanAmount" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="InterestRate" width="100" > </kendo-grid-column> | |||
| <kendo-grid-column field="Margin" width="100" > </kendo-grid-column> | |||
| <kendo-grid-column field="Settlement" width="150" format='{0:MM/dd/yyyy}'> </kendo-grid-column> | |||
| <kendo-grid-column field="Balance" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="OffsetBalance" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="GrossManFee" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="IncentiveP" title="Incentive %" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="Months" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="SacrificeP" title="Sacrifice %" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="Fee" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="MoFee" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="NetManFee" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="IncomeAmount" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="matchedPayIn" title="Matched" width="200" format='{0:c}'> | |||
| <ng-template kendoGridCellTemplate let-dataItem> | |||
| <kendo-icon *ngIf="dataItem.matchedPayIn === -1" [name]="'close-circle'" [size]="'small'" [themeColor]="'warning'"></kendo-icon> | |||
| <kendo-icon *ngIf="dataItem.matchedPayIn !== -1" [name]="'tick'" [size]="'small'" [themeColor]="'success'"></kendo-icon> | |||
| {{ dataItem.matchedPayIn === -1? 'Not matched': dataItem.matchedPayIn.Id}} | |||
| </ng-template> | |||
| </kendo-grid-column> | |||
| </kendo-grid> | |||
| @@ -0,0 +1,3 @@ | |||
| kendo-grid{ | |||
| height: 100%; | |||
| } | |||
| @@ -0,0 +1,25 @@ | |||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||
| import { LenderResimacPdfIncomeComponent } from './lender-resimac-pdf-income.component'; | |||
| describe('LenderResimacPdfIncomeComponent', () => { | |||
| let component: LenderResimacPdfIncomeComponent; | |||
| let fixture: ComponentFixture<LenderResimacPdfIncomeComponent>; | |||
| beforeEach(async () => { | |||
| await TestBed.configureTestingModule({ | |||
| declarations: [ LenderResimacPdfIncomeComponent ] | |||
| }) | |||
| .compileComponents(); | |||
| }); | |||
| beforeEach(() => { | |||
| fixture = TestBed.createComponent(LenderResimacPdfIncomeComponent); | |||
| component = fixture.componentInstance; | |||
| fixture.detectChanges(); | |||
| }); | |||
| it('should create', () => { | |||
| expect(component).toBeTruthy(); | |||
| }); | |||
| }); | |||
| @@ -0,0 +1,25 @@ | |||
| import {Component, OnChanges, OnInit} from '@angular/core'; | |||
| import {LenderIncomeAbstractDirective} from '../../abstract/lender-income-abstract.directive'; | |||
| import {PayInResimacPdfModel} from '../../models/pay-in-resimac-pdf.model'; | |||
| @Component({ | |||
| selector: 'app-lender-resimac-pdf-income', | |||
| templateUrl: './lender-resimac-pdf-income.component.html', | |||
| styleUrls: ['./lender-resimac-pdf-income.component.scss'] | |||
| }) | |||
| export class LenderResimacPdfIncomeComponent extends LenderIncomeAbstractDirective implements OnInit, OnChanges { | |||
| constructor() { super('Resimac'); } | |||
| ngOnInit(): void { | |||
| this.analysis.ResimacPdf.forEach(v => { | |||
| v.matchedPayIn = this.matchPayIn(v); | |||
| this.data.push(new PayInResimacPdfModel(v)); | |||
| }); | |||
| } | |||
| ngOnChanges(changes): void { | |||
| super.OnChanges(changes); | |||
| } | |||
| } | |||
| @@ -0,0 +1,46 @@ | |||
| <kendo-grid [data]="data" (cellClick)="onCellClick($event)"> | |||
| <ng-template kendoGridToolbarTemplate> | |||
| {{this.AgencyName}} | |||
| </ng-template> | |||
| <kendo-grid-column field="LNEOM" title="Period" format='{0:yyyy MMMM}' width="150"> </kendo-grid-column> | |||
| <kendo-grid-column field="LoanNumber" width="250"> </kendo-grid-column> | |||
| <kendo-grid-column field="Borrower" width="150"> </kendo-grid-column> | |||
| <kendo-grid-column field="SETLDX" width="150" title="Settlement Date" format='{0:MM/dd/yyyy}'> </kendo-grid-column> | |||
| <kendo-grid-column field="LoanAmount" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="Balance" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="IncomeAmount" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="matchedPayIn" title="Matched" width="200" format='{0:c}'> | |||
| <ng-template kendoGridCellTemplate let-dataItem> | |||
| <kendo-icon *ngIf="dataItem.matchedPayIn === -1" [name]="'close-circle'" [size]="'small'" [themeColor]="'warning'"></kendo-icon> | |||
| <kendo-icon *ngIf="dataItem.matchedPayIn !== -1" [name]="'tick'" [size]="'small'" [themeColor]="'success'"></kendo-icon> | |||
| {{ dataItem.matchedPayIn === -1? 'Not matched': dataItem.matchedPayIn.Id}} | |||
| </ng-template> | |||
| </kendo-grid-column> | |||
| <kendo-grid-column field="TRSTCD" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="ORGNTR" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="LOANNO" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="PORTN" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="BRNAMX" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="LNAMT" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="INTRTE" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="DELRTE" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="SETLDX" width="150" format='{0:MM/dd/yyyy}'> </kendo-grid-column> | |||
| <kendo-grid-column field="LNBAL" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="MANFEE" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="RSINCP" width="150" format='{0:p}' > </kendo-grid-column> | |||
| <kendo-grid-column field="RSSACT" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="RSSACP" width="150" format='{0:p}' > </kendo-grid-column> | |||
| <kendo-grid-column field="SACAMT" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="MOFEE" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="MANTOT" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="NEWLON" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="REFADJ" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="NETNEW" width="150" format='{0:c}' > </kendo-grid-column> | |||
| <kendo-grid-column field="FIXED" > </kendo-grid-column> | |||
| <kendo-grid-column field="LNFORT" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="ORGNAM" width="150" > </kendo-grid-column> | |||
| <kendo-grid-column field="LNEOM" width="150" format='{0:yyyy MMMM}'> </kendo-grid-column> | |||
| </kendo-grid> | |||
| @@ -0,0 +1,3 @@ | |||
| kendo-grid{ | |||
| height: 100%; | |||
| } | |||
| @@ -0,0 +1,25 @@ | |||
| import { ComponentFixture, TestBed } from '@angular/core/testing'; | |||
| import { LenderResimacXlsIncomeComponent } from './lender-resimac-xls-income.component'; | |||
| describe('LenderResimacXlsIncomeComponent', () => { | |||
| let component: LenderResimacXlsIncomeComponent; | |||
| let fixture: ComponentFixture<LenderResimacXlsIncomeComponent>; | |||
| beforeEach(async () => { | |||
| await TestBed.configureTestingModule({ | |||
| declarations: [ LenderResimacXlsIncomeComponent ] | |||
| }) | |||
| .compileComponents(); | |||
| }); | |||
| beforeEach(() => { | |||
| fixture = TestBed.createComponent(LenderResimacXlsIncomeComponent); | |||
| component = fixture.componentInstance; | |||
| fixture.detectChanges(); | |||
| }); | |||
| it('should create', () => { | |||
| expect(component).toBeTruthy(); | |||
| }); | |||
| }); | |||
| @@ -0,0 +1,25 @@ | |||
| import {Component, OnChanges, OnInit} from '@angular/core'; | |||
| import {LenderIncomeAbstractDirective} from '../../abstract/lender-income-abstract.directive'; | |||
| import {PayInResimacXlsModel} from '../../models/pay-in-resimac-xls.mode'; | |||
| @Component({ | |||
| selector: 'app-lender-resimac-xls-income', | |||
| templateUrl: './lender-resimac-xls-income.component.html', | |||
| styleUrls: ['./lender-resimac-xls-income.component.scss'] | |||
| }) | |||
| export class LenderResimacXlsIncomeComponent extends LenderIncomeAbstractDirective implements OnInit, OnChanges { | |||
| constructor() { super('Resimac'); } | |||
| ngOnInit(): void { | |||
| this.analysis.ResimacXls.forEach(v => { | |||
| v.matchedPayIn = this.matchPayIn(v); | |||
| this.data.push(new PayInResimacXlsModel(v)); | |||
| }); | |||
| } | |||
| ngOnChanges(changes): void { | |||
| super.OnChanges(changes); | |||
| } | |||
| } | |||
| @@ -161,6 +161,9 @@ export class PayInComponent implements OnInit { | |||
| const Loan = this.filterLoan.Id !== '' ? this.filterLoan : dataItem.Loan; | |||
| const UploadMeta = this.filterUploadMeta.Id !== 0 ? this.filterUploadMeta : dataItem.UploadMeta ; | |||
| this.showBalance = dataItem.Balance >= 0 ; | |||
| this.showOffsetBalance = dataItem.OffsetBalance >= 0 ; | |||
| return new FormGroup({ | |||
| Id: new FormControl({value: dataItem.Id, disabled: true}, Validators.required), | |||
| Lender: new FormControl({value: dataItem.Lender, disabled: Loan.Id !== '' }, Validators.required), | |||
| @@ -53,17 +53,28 @@ | |||
| </div> | |||
| <div *ngIf="scanDone" class="analysis-result"> | |||
| <div *ngIf="ua.Lender === undefined || ua.Lender == ''"> AI has no results </div> | |||
| <app-lender-aaa-income *ngIf="ua.Lender === 'AAA'" [analysis]="ua" | |||
| <app-lender-aaa-income *ngIf="LenderFormat === 'AAA'" [analysis]="ua" | |||
| [payIn]="payIn.gridData.data" | |||
| [newPayInUpdate]="newPayInUpdateSubject | async" | |||
| (Selected)="onSelected($event)"> | |||
| </app-lender-aaa-income> | |||
| <app-lender-connective-income *ngIf="ua.Lender === 'Connective'" [analysis]="ua" | |||
| <app-lender-connective-income *ngIf="LenderFormat === 'Connective'" [analysis]="ua" | |||
| [payIn]="payIn.gridData.data" | |||
| [newPayInUpdate]="newPayInUpdateSubject | async" | |||
| (Selected)="onSelected($event)"> | |||
| </app-lender-connective-income> | |||
| <app-lender-resimac-xls-income *ngIf="LenderFormat === 'ResimacXls' " | |||
| [analysis]="ua" | |||
| [payIn]="payIn.gridData.data" | |||
| [newPayInUpdate]="newPayInUpdateSubject | async" | |||
| (Selected)="onSelected($event)"> | |||
| </app-lender-resimac-xls-income> | |||
| <app-lender-resimac-pdf-income *ngIf="LenderFormat === 'ResimacPdf'" | |||
| [analysis]="ua" | |||
| [payIn]="payIn.gridData.data" | |||
| [newPayInUpdate]="newPayInUpdateSubject | async" | |||
| (Selected)="onSelected($event)"> | |||
| </app-lender-resimac-pdf-income> | |||
| </div> | |||
| </ng-template> | |||
| @@ -46,7 +46,7 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { | |||
| public tabText: string[] = ['Preview', 'Content', 'Analysis']; | |||
| public tabTitle: string[] = this.tabText; | |||
| public LenderFormat: string; | |||
| constructor(private us: UploadAttachService, private actRoute: ActivatedRoute, private router: Router) { | |||
| this.uploadAsPicUrl = location.origin + 'assets/img/no_preview.jpg'; | |||
| @@ -81,6 +81,7 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { | |||
| resp => { | |||
| this.ua = new UploadAnalysisModel(resp); | |||
| this.uploadId = this.ua.Id; | |||
| this.setLenderFormat(resp); | |||
| this.analysisIsDone = true; | |||
| }, err => { | |||
| this.analysisIsDone = true; | |||
| @@ -89,6 +90,18 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { | |||
| } | |||
| ); | |||
| } | |||
| private setLenderFormat( payload: Partial<UploadAnalysisModel>): void { | |||
| this.LenderFormat = this.ua.Lender; | |||
| if ( payload.Lender === 'Resimac' ){ | |||
| if ( Array.isArray(payload.ResimacPdf) ) { | |||
| this.LenderFormat = 'ResimacPdf'; | |||
| }else if (Array.isArray(payload.ResimacXls) ) { | |||
| this.LenderFormat = 'ResimacXls'; | |||
| } | |||
| } | |||
| } | |||
| private loadUploadMeta(): void { | |||
| this.us.getUploadMeta(this.uploadId).subscribe( | |||
| resp => { | |||