-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #27 from Gepardec/feature/749
Feature/749
- Loading branch information
Showing
14 changed files
with
237 additions
and
139 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
export interface BillInfoData { | ||
description: string; | ||
icon?: string; | ||
value: string; | ||
} |
7 changes: 7 additions & 0 deletions
7
src/app/domains/monthly-report/data-model/MonthlyBillInfoData.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
export interface MonthlyBillInfoData { | ||
sumBills: number, | ||
sumPrivateBills: number, | ||
sumCompanyBills: string, | ||
hasAttachmentWarnings: boolean, | ||
employeeHasCreditCard: boolean | ||
} |
91 changes: 38 additions & 53 deletions
91
src/app/domains/monthly-report/feature-monthly-report/bills/bills.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,75 +1,60 @@ | ||
<mat-card appearance="raised" class="fill-parent"> | ||
<mat-card appearance="raised" class="fill-parent bills-card"> | ||
<mat-card-header> | ||
<mat-card-title> | ||
{{ 'monthly-report.title.bills' | translate }} | ||
<ngx-skeleton-loader *ngIf="!billInfo else title" | ||
[theme]="{ height: '30px', width: '250px' }" | ||
appearance="line"></ngx-skeleton-loader> | ||
|
||
<ng-template #title> | ||
{{ 'monthly-report.title.bills' | translate }} | ||
</ng-template> | ||
</mat-card-title> | ||
</mat-card-header> | ||
<mat-card-content [class.no-warnings]="bills?.length === 0"> | ||
<ng-container *ngIf="!bills else billData"> | ||
|
||
<mat-card-content [class.no-warnings]="!billInfo?.hasAttachmentWarnings && billInfo?.sumBills === 0 && !billInfo.employeeHasCreditCard" > | ||
<ng-container *ngIf="!billInfo"> | ||
<ngx-skeleton-loader [theme]="{ height: '56px' }" | ||
appearance="line"></ngx-skeleton-loader> | ||
<ngx-skeleton-loader [theme]="{ height: '75px' }" | ||
<ngx-skeleton-loader [theme]="{ height: '56px' }" | ||
appearance="line"></ngx-skeleton-loader> | ||
</ng-container> | ||
|
||
<ng-template #billData> | ||
<ng-container *ngIf="!bills || bills?.length === 0; else billsTable"> | ||
<app-state-indicator [state]="State.DONE" size="large"></app-state-indicator> | ||
<p>{{ 'monthly-report.bills.noBillsForThisMonthAvailable' | translate }}</p> | ||
</ng-container> | ||
|
||
<ng-template #billsTable> | ||
<mat-table [dataSource]="bills" class="mat-elevation-z1"> | ||
|
||
<ng-container matColumnDef="billDate"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.billDate' | translate }}</mat-header-cell> | ||
<mat-cell *matCellDef="let bill">{{ bill.billDate | date:'dd.MM.yyyy' }}</mat-cell> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="bruttoValue"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.bruttoValue' | translate }}</mat-header-cell> | ||
<mat-cell *matCellDef="let bill">{{ bill.bruttoValue | currency: 'EUR' }}</mat-cell> | ||
</ng-container> | ||
|
||
<ng-container *ngIf="!billInfo?.employeeHasCreditCard && billInfo?.sumBills === 0"> | ||
<app-state-indicator [state]="State.DONE" size="large"></app-state-indicator> | ||
<p>{{ 'monthly-report.bills.noBillsForThisMonthAvailable' | translate }}</p> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="billType"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.billType' | translate }}</mat-header-cell> | ||
<mat-cell *matCellDef="let bill">{{ bill.billType }}</mat-cell> | ||
<ng-container *ngIf="billInfo?.sumBills > 0 || billInfo?.employeeHasCreditCard"> | ||
<div *ngIf="billInfo"> | ||
<mat-table *ngIf="billInfo" [dataSource]="toBillsData(billInfo)" class="mat-elevation-z1"> | ||
|
||
<ng-container matColumnDef="icon"> | ||
<mat-header-cell *matHeaderCellDef></mat-header-cell> | ||
<mat-cell *matCellDef="let row"> | ||
<ng-container *ngIf="row.icon"> | ||
<app-state-indicator size="small"></app-state-indicator> | ||
</ng-container> | ||
</mat-cell> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="paymentMethodType"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.paymentMethodType' | translate }} | ||
</mat-header-cell> | ||
<mat-cell *matCellDef="let bill">{{ bill.paymentMethodType }}</mat-cell> | ||
<ng-container matColumnDef="description"> | ||
<mat-header-cell *matHeaderCellDef></mat-header-cell> | ||
<mat-cell *matCellDef="let row">{{ row.description }}</mat-cell> | ||
</ng-container> | ||
|
||
|
||
<ng-container matColumnDef="projectName"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.projectName' | translate }}</mat-header-cell> | ||
<mat-cell *matCellDef="let bill">{{ bill.projectName }}</mat-cell> | ||
<ng-container matColumnDef="value"> | ||
<mat-header-cell *matHeaderCellDef></mat-header-cell> | ||
<mat-cell *matCellDef="let row">{{ row.value }}</mat-cell> | ||
</ng-container> | ||
|
||
<ng-container matColumnDef="downloadButton"> | ||
<mat-header-cell *matHeaderCellDef>{{ 'monthly-report.bills.billAsFile' | translate }}</mat-header-cell> | ||
<mat-cell *matCellDef="let bill"> | ||
<ng-container *ngIf="bill.attachmentBase64String"> | ||
<mat-icon class="downloadBtn" (click)="downloadPDF(bill)">get_app</mat-icon> | ||
</ng-container> | ||
<ng-container *ngIf="!bill.attachmentBase64String"> | ||
<app-state-indicator size="small"></app-state-indicator> | ||
</ng-container> | ||
</mat-cell> | ||
</ng-container> | ||
|
||
<mat-header-row *matHeaderRowDef="displayedColumns"></mat-header-row> | ||
<mat-row *matRowDef="let row; columns: displayedColumns;"></mat-row> | ||
</mat-table> | ||
</ng-template> | ||
</div> | ||
</ng-container> | ||
|
||
</ng-template> | ||
<div *ngIf="billInfo?.employeeHasCreditCard" class="credit-card-warning"> | ||
<app-credit-card-warning></app-credit-card-warning> | ||
</div> | ||
</mat-card-content> | ||
</mat-card> | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
8 changes: 8 additions & 0 deletions
8
...eport/feature-monthly-report/bills/credit-card-warning/credit-card-warning.component.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
<div class="credit-card-container"> | ||
<div class="icon-container"> | ||
<app-state-indicator size="small"></app-state-indicator> | ||
</div> | ||
<div class="text-container"> | ||
<p>{{'monthly-report.bills.hasCreditCard' | translate}}</p> | ||
</div> | ||
</div> |
24 changes: 24 additions & 0 deletions
24
...eport/feature-monthly-report/bills/credit-card-warning/credit-card-warning.component.scss
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
@import 'styles/colors'; | ||
|
||
.credit-card-container { | ||
background-color: $mega-warning-orange-transparent; | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
padding: 8px; | ||
border-radius: 4px; | ||
max-height: 50px; | ||
} | ||
|
||
.icon-container { | ||
margin-right: 12px; | ||
} | ||
|
||
.credit-card-container .icon-container app-state-indicator::ng-deep mat-icon { | ||
color: $mega-warning-orange; | ||
} | ||
|
||
.text-container { | ||
color: $mega-warning-orange; | ||
text-align: center; | ||
} |
21 changes: 21 additions & 0 deletions
21
...rt/feature-monthly-report/bills/credit-card-warning/credit-card-warning.component.spec.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import { ComponentFixture, TestBed } from '@angular/core/testing'; | ||
|
||
import { CreditCardWarningComponent } from './credit-card-warning.component'; | ||
|
||
describe('CreditCardWarningComponent', () => { | ||
let component: CreditCardWarningComponent; | ||
let fixture: ComponentFixture<CreditCardWarningComponent>; | ||
|
||
beforeEach(() => { | ||
TestBed.configureTestingModule({ | ||
declarations: [CreditCardWarningComponent] | ||
}); | ||
fixture = TestBed.createComponent(CreditCardWarningComponent); | ||
component = fixture.componentInstance; | ||
fixture.detectChanges(); | ||
}); | ||
|
||
it('should create', () => { | ||
expect(component).toBeTruthy(); | ||
}); | ||
}); |
19 changes: 19 additions & 0 deletions
19
...-report/feature-monthly-report/bills/credit-card-warning/credit-card-warning.component.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import {Component} from '@angular/core'; | ||
import {StateIndicatorComponent} from "@mega/shared/ui-common"; | ||
import {TranslateModule} from "@ngx-translate/core"; | ||
|
||
@Component({ | ||
selector: 'app-credit-card-warning', | ||
templateUrl: './credit-card-warning.component.html', | ||
styleUrls: ['./credit-card-warning.component.scss'], | ||
imports: [ | ||
StateIndicatorComponent, | ||
TranslateModule | ||
], | ||
standalone: true | ||
}) | ||
export class CreditCardWarningComponent { | ||
|
||
constructor() { } | ||
|
||
} |
Oops, something went wrong.