diff --git a/Client/src/app/app-routing.module.ts b/Client/src/app/app-routing.module.ts index d66b3b6..d59672c 100644 --- a/Client/src/app/app-routing.module.ts +++ b/Client/src/app/app-routing.module.ts @@ -14,6 +14,7 @@ import { CampPageComponent } from './components/camp-page/camp-page.component'; import { MembersPageComponent } from './components/members-page/members-page.component'; 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'; const routes = [ @@ -76,6 +77,10 @@ const routes = { path: 'transactions/add', component: AddTransactionPageComponent + }, + { + path: 'contributor/report', + component: ContributorYearlyReportComponent } ] diff --git a/Client/src/app/app.module.ts b/Client/src/app/app.module.ts index 60b1eff..743a11b 100644 --- a/Client/src/app/app.module.ts +++ b/Client/src/app/app.module.ts @@ -3,6 +3,7 @@ import { GoogleAnalyticsService } from './services/google-analytics.service'; import { WindowRefService } from './services/window-ref.service'; import { EmailService } from './services/email.service'; import { SermonService } from './services/sermon.service'; +import { PrintService } from './services/print-service'; import { LoginService } from './services/login.service'; import { FormsModule, ReactiveFormsModule } from '@angular/forms'; import { BrowserModule } from '@angular/platform-browser'; @@ -73,6 +74,7 @@ import { AddTransactionPageComponent } from './components/add-transaction-page/a import { AddTransactionPopupComponent } from './components/add-transaction-page/add-transaction-popup/add-transaction-popup.component'; 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'; @@ -118,7 +120,8 @@ import { MissionarySupportService } from './services/missionary-support-service' AddUserPopupComponent, AddTransactionPageComponent, AddTransactionPopupComponent, - MissionaryFormPageComponent + MissionaryFormPageComponent, + ContributorYearlyReportComponent ], imports: [ BrowserModule, @@ -139,7 +142,7 @@ import { MissionarySupportService } from './services/missionary-support-service' MatRadioModule, MatCheckboxModule ], - providers: [LoginService,UserService,GoogleAnalyticsService,SermonService,TransactionService,EventService,EmailService,MissionarySupportService,WindowRefService], + providers: [LoginService,PrintService,UserService,GoogleAnalyticsService,SermonService,TransactionService,EventService,EmailService,MissionarySupportService,WindowRefService], entryComponents: [AddSermonPopupComponent, LoginPopupComponent, OkPopupComponent, diff --git a/Client/src/app/components/app/app.component.css b/Client/src/app/components/app/app.component.css index 6745cfc..d385ae2 100644 --- a/Client/src/app/components/app/app.component.css +++ b/Client/src/app/components/app/app.component.css @@ -1,6 +1,6 @@ -header{ +div.header{ position:fixed; top:0; left:0; @@ -51,7 +51,7 @@ header{ padding-bottom: 140px; } -footer{ +div.footer{ background-color: rgb(50,50,50); padding-top: 20px; padding-bottom: 20px; @@ -81,7 +81,7 @@ footer{ } @media(max-width: 800px){ - footer{ + div.footer{ height: 380px; } .footer-panel{ diff --git a/Client/src/app/components/app/app.component.html b/Client/src/app/components/app/app.component.html index 73b527a..dd0ee60 100644 --- a/Client/src/app/components/app/app.component.html +++ b/Client/src/app/components/app/app.component.html @@ -1,6 +1,6 @@ -
+
@@ -12,13 +12,13 @@ (click)="mainMenuClick()"> menu -
+ -
+
- +
-
+
diff --git a/Client/src/app/components/app/app.component.ts b/Client/src/app/components/app/app.component.ts index a927116..eac58e1 100644 --- a/Client/src/app/components/app/app.component.ts +++ b/Client/src/app/components/app/app.component.ts @@ -4,6 +4,7 @@ import { Router, NavigationEnd, Event } from '@angular/router'; import { EventService } from '../../services/event.service'; import { AudioPlayerService } from '../../services/audio-player.service'; import { BibleVerseService } from '../../services/bible-verse.service'; +import { PrintService } from '../../services/print-service'; @Injectable() @@ -26,7 +27,8 @@ export class AppComponent { constructor(private router: Router, private audioPlayerService: AudioPlayerService, - private googleAnalyticsService: GoogleAnalyticsService){ + private googleAnalyticsService: GoogleAnalyticsService, + public printService: PrintService){ this.router.events.subscribe((event:Event) => { if(event instanceof NavigationEnd) { this.lastRoute = this.currRoute; diff --git a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.css b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.css new file mode 100644 index 0000000..99aa00a --- /dev/null +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.css @@ -0,0 +1,88 @@ +@media screen { + :host { + display: none; + } + } + + @media print { + :host { + display: block; + } + } + + .h-100 { + height: 300px; + } + + .d-block { + display: block; + } + + .flex { + display: flex; + } + + .flex-align-center { + align-items: center; + } + + .flex-align-top { + align-items: baseline; + } + + .flex-justify-center { + justify-content: center; + } + + .flex-justify-space-between { + justify-content: space-between; + } + + hr { + border-top: 1px solid green; + } + + .text-center { + text-align: center; + } + + .text-right { + text-align: right; + } + + .mt-20 { + margin-top: 20px; + } + + .mb-20 { + margin-bottom: 20px; + } + + .flex-direction-column { + flex-direction: column; + } + + .page-break-before { + page-break-before: always; + } + + .fw-bold { + font-weight: bold; + } + + .hilight-yellow { + background-color: yellow; + -webkit-print-color-adjust: exact; + } + + table { + border-collapse: collapse; + } + + table, th, td { + border: 1px solid black; + } + + table.cell-padding-5 td, table.cell-padding-5 th { + padding: 5px; + } \ No newline at end of file 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 new file mode 100644 index 0000000..00eb475 --- /dev/null +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.html @@ -0,0 +1,76 @@ +
+ +

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

+

+ {{contributorName}} +

+
+ +
+
+
+ +
+
+

Old Fashion Baptist Church

+

5003 Wynne Ave

+

Butte, MT 59701

+

(406) 494-5028

+

ofbbutte.com

+
+
+
+

Old Fashion Baptist Church Giving Statement {{taxYear}}

+
+
+
+

Name: {{contributorName}}

+

Tax Year: {{taxYear}}

+

Registration Code: {{registrationCode}}

+
+
+ + + + + + + + + + + + + + + + + + + + +
{{taxYear}} Giving Summary
General Fund{{totalGeneral() | currency}}
Missions Fund{{totalMissions() | currency}}
Total Giving{{(totalGeneral() + totalMissions()) | currency}}
+
+
+
+ Thank you for your contribution. The information provided in this statement reflects + your contributions on record for tax year {{taxYear}}. The chart below provides current and + historical data (if available) for informational purposes only. The data on the following + pages includes a detail listing of contributions for {{taxYear}}. +
+
+ + + + + + + + + + + + +
Date
{{t.date}}
\ No newline at end of file diff --git a/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.spec.ts b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.spec.ts new file mode 100644 index 0000000..e266882 --- /dev/null +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.spec.ts @@ -0,0 +1,25 @@ +import { async, ComponentFixture, TestBed } from '@angular/core/testing'; + +import { ContributorYearlyReportComponent } from './contributor-yearly-report.component'; + +describe('ContributorYearlyReportComponent', () => { + let component: ContributorYearlyReportComponent; + let fixture: ComponentFixture; + + beforeEach(async(() => { + TestBed.configureTestingModule({ + declarations: [ ContributorYearlyReportComponent ] + }) + .compileComponents(); + })); + + beforeEach(() => { + fixture = TestBed.createComponent(ContributorYearlyReportComponent); + component = fixture.componentInstance; + fixture.detectChanges(); + }); + + it('should create', () => { + expect(component).toBeTruthy(); + }); +}); 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 new file mode 100644 index 0000000..55cbf46 --- /dev/null +++ b/Client/src/app/components/contributor-yearly-report/contributor-yearly-report.component.ts @@ -0,0 +1,60 @@ +import { Component, OnInit } from '@angular/core'; +import { PrintService } from '../../services/print-service'; +import { Transaction } from '../add-transaction-page/transaction'; + +@Component({ + selector: 'app-contributor-yearly-report', + templateUrl: './contributor-yearly-report.component.html', + styleUrls: ['./contributor-yearly-report.component.css'] +}) +export class ContributorYearlyReportComponent implements OnInit { + + public transactions: Transaction[] = []; + public contributorName: string = 'Bob and Jill Handerson'; + public taxYear: number = 2019; + public registrationCode: string = 'HDIJDHDFD*#*@'; + + constructor(public printService: PrintService) { } + + ngOnInit() { + const t = new Transaction(); + t.amount = 400; + t.checkNumber = '3434'; + t.contributorId = 45; + t.date = '2019-10-20'; + t.description = 'Some description'; + t.fundId = 1; + t.goodsOrServices = false; + t.taxYear = 2019; + t.typeId = 1; + for(let i = 0; i < 100; i++) { + const t2 = new Transaction(); + t2.amount = 300; + t2.checkNumber = 'ghff'; + t2.contributorId = 45; + t2.date = '2019-10-23'; + t2.description = 'Missionary Family'; + t2.fundId = 2; + t2.goodsOrServices = false; + t2.taxYear = 2019; + t2.typeId = 2; + this.transactions.push(t); + } + this.transactions.push(t); + this.printService.setPrinting(true); + window.print(); + } + + public totalGeneral() { + let sum = 0; + this.transactions.filter(t => t.fundId === 1).forEach(t => sum += t.amount); + return sum; + } + + public totalMissions() { + let sum = 0; + this.transactions.filter(t => t.fundId === 2).forEach(t => sum += t.amount); + return sum; + } + +} diff --git a/Client/src/app/services/print-service.ts b/Client/src/app/services/print-service.ts new file mode 100644 index 0000000..4559483 --- /dev/null +++ b/Client/src/app/services/print-service.ts @@ -0,0 +1,15 @@ +import { Injectable } from '@angular/core'; + +@Injectable() +export class PrintService { + + public isPrinting: boolean = false; + + constructor(){} + + public setPrinting(printing: boolean) { + this.isPrinting = printing; + } +} + + diff --git a/Client/src/styles.css b/Client/src/styles.css index 8bb2be7..d225c1a 100644 --- a/Client/src/styles.css +++ b/Client/src/styles.css @@ -23,6 +23,21 @@ body { background-color: red; } + + +@media print { + header,footer { + display: none; + } + .print-hide { + display: none; + } + .print-hide-children > * { + display: none; + } +} + + /*MATERIAL FONT FOR ICONS*/ @font-face { font-family: 'Material Icons';