diff --git a/src/app/features/invoice/invoice-page/invoice-page.component.html b/src/app/features/invoice/invoice-page/invoice-page.component.html index 82dac47..804ecaa 100644 --- a/src/app/features/invoice/invoice-page/invoice-page.component.html +++ b/src/app/features/invoice/invoice-page/invoice-page.component.html @@ -13,12 +13,10 @@

{{ title }}

Unprocessed
- -
- + +
+
@@ -27,24 +25,20 @@

{{ title }}

Processed
- -
- + +
+
-
  • +
  • Deleted
    - +
    diff --git a/src/app/features/invoice/invoice-page/invoice-page.component.ts b/src/app/features/invoice/invoice-page/invoice-page.component.ts index c777c68..df6da3d 100644 --- a/src/app/features/invoice/invoice-page/invoice-page.component.ts +++ b/src/app/features/invoice/invoice-page/invoice-page.component.ts @@ -2,6 +2,8 @@ import { Component, HostListener, OnInit } from '@angular/core'; import { ActivatedRoute } from '@angular/router'; import { Title } from '@angular/platform-browser'; import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; +import { User } from '@core/models/user'; +import { PersonalInfoService } from '@core/service/personal.info.service'; @Component({ selector: 'app-invoice-page', @@ -11,17 +13,26 @@ import { NgbModal } from '@ng-bootstrap/ng-bootstrap'; export class InvoicePageComponent implements OnInit { activeId: string; fullScreen: boolean; - + user: User; + get hasRoleAdmin(): boolean { + return this.user.authorities.includes('ADMIN'); + } @HostListener('document:keydown.escape', ['$event']) onKeydownHandler(event: KeyboardEvent) { if (!this.modalService.hasOpenModals()) { this.fullScreen = false; } } - constructor(public route: ActivatedRoute, private modalService: NgbModal, private titleService: Title) {} + constructor( + public route: ActivatedRoute, + private modalService: NgbModal, + private titleService: Title, + private personalInfoService: PersonalInfoService, + ) { } ngOnInit(): void { this.titleService.setTitle('Invoices'); this.activeId = this.route.snapshot.params.name || 'unprocessed'; + this.personalInfoService.me().subscribe((u) => (this.user = u)); } } diff --git a/src/app/features/invoice/invoice-table-result/invoice-table-result.component.html b/src/app/features/invoice/invoice-table-result/invoice-table-result.component.html index 4788a5f..8bb9b42 100644 --- a/src/app/features/invoice/invoice-table-result/invoice-table-result.component.html +++ b/src/app/features/invoice/invoice-table-result/invoice-table-result.component.html @@ -5,7 +5,7 @@

    Dossier: {{ activeDossier?.name }}

    -
    +
    @@ -93,7 +93,7 @@ {{ invoice.newInvoiceNumber || invoice.invoiceNumber }} - Imported on {{ invoice.importedDate | date : 'dd/MM/yyyy HH:mm' }} + Imported on {{ invoice.importedDate | date: 'dd/MM/yyyy HH:mm' }}
    - {{ invoice.dateCreation | date : 'dd/MM/yyyy' }} + {{ invoice.dateCreation | date: 'dd/MM/yyyy' }} {{ invoice.billTo.clientName }} - {{ invoice.dateOfInvoice | date : 'dd/MM/yyyy' }} - {{ invoice.dueDate | date : 'dd/MM/yyyy' }} - {{ invoice.subTotal | currency : '€' }} - {{ invoice.taxes | currency : '€' }} - {{ invoice.total | currency : '€' }} + {{ invoice.dateOfInvoice | date: 'dd/MM/yyyy' }} + {{ invoice.dueDate | date: 'dd/MM/yyyy' }} + {{ invoice.subTotal | currency: '€' }} + {{ invoice.taxes | currency: '€' }} + {{ invoice.total | currency: '€' }}
    - - - - - -