| export class PayInAAARowModel { | export class PayInAAARowModel { | ||||
| public Period: Date; | |||||
| public LoanNumber: string; | public LoanNumber: string; | ||||
| public Settlement: Date; | public Settlement: Date; | ||||
| public LoanAmount: number; | public LoanAmount: number; | ||||
| public InTrail: number; | public InTrail: number; | ||||
| constructor(payload: Partial<PayInAAARowModel>){ | constructor(payload: Partial<PayInAAARowModel>){ | ||||
| this.Period = new Date(payload.Period); | |||||
| this.LoanNumber = payload.LoanNumber || ''; | this.LoanNumber = payload.LoanNumber || ''; | ||||
| this.Settlement = new Date(payload.Settlement); | this.Settlement = new Date(payload.Settlement); | ||||
| this.LoanAmount = payload.LoanAmount || 0; | this.LoanAmount = payload.LoanAmount || 0; |
| export class AnalysisAaaModel { | |||||
| Year: number; | |||||
| Month: number; | |||||
| LoanNumber: string; | |||||
| Settlement: Date; | |||||
| LoanAmount: number; | |||||
| Balance: number; | |||||
| InTrail: number; | |||||
| constructor(payload: Partial<AnalysisAaaModel>) { | |||||
| this.Year = payload.Year || 0; | |||||
| this.Month = payload.Month || 0; | |||||
| this.LoanNumber = payload.LoanNumber || ''; | |||||
| this.Settlement = new Date(payload.Settlement); | |||||
| this.LoanAmount = payload.LoanAmount || 0; | |||||
| this.Balance = payload.Balance || 0; | |||||
| this.InTrail = payload.Year || 0; | |||||
| } | |||||
| } |
| import {PayInAAARowModel} from './Pay.In.AAA.Row.model'; | |||||
| export class FunderAaaTrailModel{ | |||||
| public Period: Date; // valid only year, and month | |||||
| public Rows: PayInAAARowModel[]; | |||||
| constructor(payload: Partial<FunderAaaTrailModel>) { | |||||
| this.Period = new Date(payload.Period); | |||||
| this.Rows = []; | |||||
| if ( payload.Rows ){ | |||||
| payload.Rows.forEach( v => { | |||||
| this.Rows.push (new PayInAAARowModel(v)); | |||||
| }); | |||||
| } | |||||
| } | |||||
| } |
| import {UploadMetaModel} from './uploadMetaModel'; | import {UploadMetaModel} from './uploadMetaModel'; | ||||
| import {PayInModel} from './pay-in.model'; | import {PayInModel} from './pay-in.model'; | ||||
| import {FunderAaaTrailModel} from './funder.aaa.trail.model'; | |||||
| import {PayInAAARowModel} from './Pay.In.AAA.Row.model'; | |||||
| export class UploadAnalysisModel { | export class UploadAnalysisModel { | ||||
| public Mime: string; | public Mime: string; | ||||
| public PayIn: PayInModel[]; | public PayIn: PayInModel[]; | ||||
| public AAA?: FunderAaaTrailModel[]; | |||||
| public AAA?: PayInAAARowModel[]; | |||||
| public IsDuplicate: boolean; | public IsDuplicate: boolean; | ||||
| public Uid?: string; // client side unique id when upload | public Uid?: string; // client side unique id when upload | ||||
| this.AAA = []; | this.AAA = []; | ||||
| if ( payload.AAA ) { | if ( payload.AAA ) { | ||||
| payload.AAA.forEach( v => { | |||||
| const r = new FunderAaaTrailModel(v); | |||||
| this.AAA.push(r); | |||||
| }); | |||||
| payload.AAA.forEach( v => { this.AAA.push(new PayInAAARowModel(v)); }); | |||||
| } | } | ||||
| this.IsDuplicate = payload.IsDuplicate || false; | this.IsDuplicate = payload.IsDuplicate || false; |
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div *ngIf="scanDone" class="analysis-result"> | <div *ngIf="scanDone" class="analysis-result"> | ||||
| <kendo-grid *ngIf="ua.Funder ==='AAA Financial'" [data]="analysisAAA"> | |||||
| <kendo-grid *ngIf="ua.AAA !==undefined && ua.AAA !== null" [data]="analysisAAA"> | |||||
| <ng-template kendoGridToolbarTemplate> | <ng-template kendoGridToolbarTemplate> | ||||
| {{ua.Funder }} | {{ua.Funder }} | ||||
| <button kendoGridAddCommand icon="plus" >Add new Income</button> | |||||
| Show Uploads <kendo-switch></kendo-switch> | |||||
| </ng-template> | </ng-template> | ||||
| <kendo-grid-column field="Year"> </kendo-grid-column> | |||||
| <kendo-grid-column field="Month"> </kendo-grid-column> | |||||
| <kendo-grid-column field="Period" format='{0:yyyy MMMM}'> </kendo-grid-column> | |||||
| <kendo-grid-column field="LoanNumber"> </kendo-grid-column> | <kendo-grid-column field="LoanNumber"> </kendo-grid-column> | ||||
| <kendo-grid-column field="Settlement"> </kendo-grid-column> | |||||
| <kendo-grid-column field="Settlement" format='{0:MM/dd/yyyy h:mm a}'> </kendo-grid-column> | |||||
| <kendo-grid-column field="Amount"> </kendo-grid-column> | <kendo-grid-column field="Amount"> </kendo-grid-column> | ||||
| <kendo-grid-column field="Balance"> </kendo-grid-column> | <kendo-grid-column field="Balance"> </kendo-grid-column> | ||||
| <kendo-grid-column field="InTrail"> </kendo-grid-column> | <kendo-grid-column field="InTrail"> </kendo-grid-column> |
| import {UploadMetaModel} from '../models/uploadMetaModel'; | import {UploadMetaModel} from '../models/uploadMetaModel'; | ||||
| import {FloatingActionButtonComponent} from '@progress/kendo-angular-buttons'; | import {FloatingActionButtonComponent} from '@progress/kendo-angular-buttons'; | ||||
| import {DrawerSelectEvent, TabStripComponent} from '@progress/kendo-angular-layout'; | import {DrawerSelectEvent, TabStripComponent} from '@progress/kendo-angular-layout'; | ||||
| import {AnalysisAaaModel} from '../models/analysis.aaa.model'; | |||||
| import {PayInAAARowModel} from '../models/Pay.In.AAA.Row.model'; | |||||
| public tabText: string[] = ['Preview', 'Content', 'Analysis']; | public tabText: string[] = ['Preview', 'Content', 'Analysis']; | ||||
| public tabTitle: string[] = this.tabText; | public tabTitle: string[] = this.tabText; | ||||
| public analysisAAA: AnalysisAaaModel[] = []; | |||||
| public analysisAAA: PayInAAARowModel[] = []; | |||||
| constructor(private us: UploadAttachService, private actRoute: ActivatedRoute, private router: Router) { | constructor(private us: UploadAttachService, private actRoute: ActivatedRoute, private router: Router) { | ||||
| this.uploadAsPicUrl = location.origin + 'assets/img/no_preview.jpg'; | this.uploadAsPicUrl = location.origin + 'assets/img/no_preview.jpg'; | ||||
| this.us.getUploadAnalysis(this.uploadId).subscribe( | this.us.getUploadAnalysis(this.uploadId).subscribe( | ||||
| resp => { | resp => { | ||||
| this.ua = new UploadAnalysisModel(resp); | this.ua = new UploadAnalysisModel(resp); | ||||
| // this.TranslateForDisplay() // TODO: use database for this structure | |||||
| this.ua.AAA.forEach(v => { | |||||
| this.analysisAAA.push(new PayInAAARowModel(v)); | |||||
| }); | |||||
| this.uploadId = this.ua.Id; | this.uploadId = this.ua.Id; | ||||
| this.analysisIsDone = true; | this.analysisIsDone = true; | ||||
| }, err => { | }, err => { |