diff --git a/Client/src/app/app-routing.module.ts b/Client/src/app/app-routing.module.ts index d59672c..d55e06c 100644 --- a/Client/src/app/app-routing.module.ts +++ b/Client/src/app/app-routing.module.ts @@ -15,6 +15,7 @@ import { MembersPageComponent } from './components/members-page/members-page.com import { AddTransactionPageComponent } from './components/add-transaction-page/add-transaction-page.component'; import { MissionaryFormPageComponent } from './components/missionary-form-page/missionary-form-page.component'; import { ContributorYearlyReportComponent } from './components/contributor-yearly-report/contributor-yearly-report.component'; +import { ContributorAllReportsComponent } from './components/contributor-all-reports/contributor-all-reports.component'; const routes = [ @@ -80,7 +81,7 @@ const routes = }, { path: 'contributor/report', - component: ContributorYearlyReportComponent + component: ContributorAllReportsComponent } ] diff --git a/Client/src/app/app.module.ts b/Client/src/app/app.module.ts index 743a11b..7c52391 100644 --- a/Client/src/app/app.module.ts +++ b/Client/src/app/app.module.ts @@ -75,6 +75,7 @@ import { AddTransactionPopupComponent } from './components/add-transaction-page/ import { MissionaryFormPageComponent } from './components/missionary-form-page/missionary-form-page.component'; import { MissionarySupportService } from './services/missionary-support-service'; import { ContributorYearlyReportComponent } from './components/contributor-yearly-report/contributor-yearly-report.component'; +import { ContributorAllReportsComponent } from './components/contributor-all-reports/contributor-all-reports.component'; @@ -121,7 +122,8 @@ import { ContributorYearlyReportComponent } from './components/contributor-yearl AddTransactionPageComponent, AddTransactionPopupComponent, MissionaryFormPageComponent, - ContributorYearlyReportComponent + ContributorYearlyReportComponent, + ContributorAllReportsComponent ], imports: [ BrowserModule, diff --git a/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.css b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.css new file mode 100644 index 0000000..2393a02 --- /dev/null +++ b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.css @@ -0,0 +1,5 @@ +@media print { + :host { + display: block; + } + } \ No newline at end of file diff --git a/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.html b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.html new file mode 100644 index 0000000..21f52ff --- /dev/null +++ b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.html @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.spec.ts b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.spec.ts new file mode 100644 index 0000000..38c680a --- /dev/null +++ b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ContributorAllReportsComponent } from './contributor-all-reports.component'; + +describe('ContributorAllReportsComponent', () => { + let component: ContributorAllReportsComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ContributorAllReportsComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContributorAllReportsComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); diff --git a/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.ts b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.ts new file mode 100644 index 0000000..72b2db9 --- /dev/null +++ b/Client/src/app/components/contributor-all-reports/contributor-all-reports.component.ts @@ -0,0 +1,21 @@ +import { Component, OnInit } from '@angular/core'; +import { PrintService } from 'src/app/services/print-service'; + +@Component({ + selector: 'app-contributor-all-reports', + templateUrl: './contributor-all-reports.component.html', + styleUrls: ['./contributor-all-reports.component.css'] +}) +export class ContributorAllReportsComponent implements OnInit { + + public contributors: number[] = []; + + constructor(private printService: PrintService) { } + + ngOnInit() { + this.contributors.push(1); + this.contributors.push(2); + this.printService.setPrinting(true); + } + +} diff --git a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.html b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.html index 96bcc6f..68df694 100644 --- a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.html +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.html @@ -1,7 +1,9 @@ + +

- Old Fashion Baptist Church Contribution Report {{taxYear}} + Old Fashion Baptist Church Contribution Report {{taxYear}} {{index}}

{{contributorName}} @@ -85,4 +87,5 @@ {{t.amount | currency}} - \ No newline at end of file + +

 
\ No newline at end of file diff --git a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.ts b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.ts index 60f84f5..1b5229f 100644 --- a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.ts +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.ts @@ -1,4 +1,4 @@ -import { Component, OnInit } from '@angular/core'; +import { Component, OnInit, Input } from '@angular/core'; import { PrintService } from '../../services/print-service'; import { Transaction } from '../add-transaction-page/transaction'; @@ -9,6 +9,7 @@ import { Transaction } from '../add-transaction-page/transaction'; }) export class ContributorYearlyReportComponent implements OnInit { + @Input() index: number; public transactions: Transaction[] = []; public contributorName: string = 'Bob and Jill Handerson'; public contributorStreet: string = '7878 Washington St'; @@ -18,6 +19,14 @@ export class ContributorYearlyReportComponent implements OnInit { public taxYear: number = 2019; public registrationCode: string = 'HDIJDHDFD*#*@'; + public rowsPerPage: number = 32; + public get pages(): number { + return Math.ceil(this.transactions.length / this.rowsPerPage) + 2; + } + public get pagesOdd(): boolean { + return !(this.pages % 2 == 0) + } + constructor(public printService: PrintService) { } ngOnInit() { @@ -31,7 +40,7 @@ export class ContributorYearlyReportComponent implements OnInit { t.goodsOrServices = false; t.taxYear = 2019; t.typeId = 1; - for(let i = 0; i < 100; i++) { + for(let i = 0; i < 90; i++) { const t2 = new Transaction(); t2.amount = 300; t2.checkNumber = 'ghff'; @@ -45,8 +54,6 @@ export class ContributorYearlyReportComponent implements OnInit { this.transactions.push(t2); } this.transactions.push(t); - this.printService.setPrinting(true); - window.print(); } public totalGeneral() {