| @@ -1,7 +1,7 @@ | |||
| export class PayInAAARowModel { | |||
| public Period: Date; | |||
| public LoanNumber: string; | |||
| public Settlement: Date; | |||
| public LoanAmount: number; | |||
| @@ -9,6 +9,7 @@ export class PayInAAARowModel { | |||
| public InTrail: number; | |||
| constructor(payload: Partial<PayInAAARowModel>){ | |||
| this.Period = new Date(payload.Period); | |||
| this.LoanNumber = payload.LoanNumber || ''; | |||
| this.Settlement = new Date(payload.Settlement); | |||
| this.LoanAmount = payload.LoanAmount || 0; | |||
| @@ -1,19 +0,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; | |||
| } | |||
| } | |||
| @@ -1,15 +0,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)); | |||
| }); | |||
| } | |||
| } | |||
| } | |||
| @@ -1,6 +1,7 @@ | |||
| import {UploadMetaModel} from './uploadMetaModel'; | |||
| import {PayInModel} from './pay-in.model'; | |||
| import {FunderAaaTrailModel} from './funder.aaa.trail.model'; | |||
| import {PayInAAARowModel} from './Pay.In.AAA.Row.model'; | |||
| export class UploadAnalysisModel { | |||
| @@ -9,7 +10,7 @@ export class UploadAnalysisModel { | |||
| public Mime: string; | |||
| public PayIn: PayInModel[]; | |||
| public AAA?: FunderAaaTrailModel[]; | |||
| public AAA?: PayInAAARowModel[]; | |||
| public IsDuplicate: boolean; | |||
| public Uid?: string; // client side unique id when upload | |||
| @@ -35,11 +36,7 @@ export class UploadAnalysisModel { | |||
| this.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; | |||
| @@ -52,16 +52,13 @@ | |||
| </div> | |||
| </div> | |||
| <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> | |||
| {{ua.Funder }} | |||
| <button kendoGridAddCommand icon="plus" >Add new Income</button> | |||
| Show Uploads <kendo-switch></kendo-switch> | |||
| </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="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="Balance"> </kendo-grid-column> | |||
| <kendo-grid-column field="InTrail"> </kendo-grid-column> | |||
| @@ -5,7 +5,8 @@ import {UploadAnalysisModel} from '../models/upload.analysis.model'; | |||
| import {UploadMetaModel} from '../models/uploadMetaModel'; | |||
| import {FloatingActionButtonComponent} from '@progress/kendo-angular-buttons'; | |||
| import {DrawerSelectEvent, TabStripComponent} from '@progress/kendo-angular-layout'; | |||
| import {AnalysisAaaModel} from '../models/analysis.aaa.model'; | |||
| import {PayInAAARowModel} from '../models/Pay.In.AAA.Row.model'; | |||
| @@ -40,7 +41,7 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { | |||
| public tabText: string[] = ['Preview', 'Content', 'Analysis']; | |||
| public tabTitle: string[] = this.tabText; | |||
| public analysisAAA: AnalysisAaaModel[] = []; | |||
| public analysisAAA: PayInAAARowModel[] = []; | |||
| constructor(private us: UploadAttachService, private actRoute: ActivatedRoute, private router: Router) { | |||
| this.uploadAsPicUrl = location.origin + 'assets/img/no_preview.jpg'; | |||
| @@ -74,7 +75,9 @@ export class UploadDetailComponent implements OnInit, AfterViewInit { | |||
| this.us.getUploadAnalysis(this.uploadId).subscribe( | |||
| 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.analysisIsDone = true; | |||
| }, err => { | |||