| @@ -13,6 +13,7 @@ import {ContactsComponent} from "@app/contacts/contacts.component"; | |||||
| import {ContactsDetailComponent} from "@app/contacts/contacts-detail/contacts-detail.component"; | import {ContactsDetailComponent} from "@app/contacts/contacts-detail/contacts-detail.component"; | ||||
| import {TasksComponent} from "@app/tasks/tasks.component"; | import {TasksComponent} from "@app/tasks/tasks.component"; | ||||
| import {SalesComponent} from "@app/sales/sales.component"; | import {SalesComponent} from "@app/sales/sales.component"; | ||||
| import {SalesDetailComponent} from "@app/sales/sales-detail/sales-detail.component"; | |||||
| const accountModule = () => import('./account/account.module').then(x => x.AccountModule); | const accountModule = () => import('./account/account.module').then(x => x.AccountModule); | ||||
| const usersModule = () => import('./users/users.module').then(x => x.UsersModule); | const usersModule = () => import('./users/users.module').then(x => x.UsersModule); | ||||
| @@ -88,6 +89,7 @@ const routes: Routes = [ | |||||
| canActivate: [AuthGuard], | canActivate: [AuthGuard], | ||||
| children: [ | children: [ | ||||
| {path: '', component: SalesComponent, data: {dataType: 'sales'}}, | {path: '', component: SalesComponent, data: {dataType: 'sales'}}, | ||||
| {path: ':id', component: SalesDetailComponent, data: {dataType: 'sales-detail'}}, | |||||
| ] | ] | ||||
| }, | }, | ||||
| @@ -9,7 +9,6 @@ | |||||
| </a> | </a> | ||||
| </div> | </div> | ||||
| <div class="navbar-nav align-items-center"> | <div class="navbar-nav align-items-center"> | ||||
| <button class="btn btn-primary me-4" (click)="copyTokenToClipboard()">Copy Token</button> | |||||
| <div role="button" class="pe-2 me-4 position-relative" data-bs-toggle="dropdown">Benachrichtigungen | <div role="button" class="pe-2 me-4 position-relative" data-bs-toggle="dropdown">Benachrichtigungen | ||||
| <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger"> | <span class="position-absolute top-0 start-100 translate-middle badge rounded-pill bg-danger"> | ||||
| 99+ | 99+ | ||||
| @@ -21,7 +20,8 @@ | |||||
| <li><a class="dropdown-item" href="#">Peter Matusik: Christian hat einen Kommentar verfasst</a></li> | <li><a class="dropdown-item" href="#">Peter Matusik: Christian hat einen Kommentar verfasst</a></li> | ||||
| </ul> | </ul> | ||||
| </div> | </div> | ||||
| <button class="btn btn-secondary" (click)="logout()">{{ 'basic.logout' | translate }}</button> | |||||
| <button class="btn btn-secondary me-3" (click)="logout()">{{ 'basic.logout' | translate }}</button> | |||||
| <button class="btn btn-primary" (click)="copyTokenToClipboard()">c</button> | |||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| </nav> | </nav> | ||||
| @@ -49,15 +49,6 @@ | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="download"> | |||||
| <th mat-header-cell *matHeaderCellDef> | |||||
| {{ 'overview.download' | translate }} | |||||
| </th> | |||||
| <td mat-cell *matCellDef="let element"><span class="btn btn-primary btn-sm" role="button" | |||||
| (click)="navigateToDocumentFile(element)">Herunterladen</span> | |||||
| </td> | |||||
| </ng-container> | |||||
| <ng-container matColumnDef="createdAt"> | <ng-container matColumnDef="createdAt"> | ||||
| <th mat-header-cell *matHeaderCellDef mat-sort-header | <th mat-header-cell *matHeaderCellDef mat-sort-header | ||||
| sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.uploaded' | translate }}"> | sortActionDescription="{{ 'overview.sort' | translate }}: {{ 'overview.uploaded' | translate }}"> | ||||
| @@ -76,10 +67,18 @@ | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="download"> | |||||
| <th mat-header-cell *matHeaderCellDef></th> | |||||
| <td mat-cell *matCellDef="let element"> | |||||
| <span class="btn btn-primary bi bi-download p-2-4" | |||||
| data-type="user-tool" data-action="edit" (click)="navigateToDocumentFile(element)"></span> | |||||
| </td> | |||||
| </ng-container> | |||||
| <ng-container matColumnDef="edit"> | <ng-container matColumnDef="edit"> | ||||
| <th mat-header-cell *matHeaderCellDef></th> | <th mat-header-cell *matHeaderCellDef></th> | ||||
| <td mat-cell *matCellDef="let element"> | <td mat-cell *matCellDef="let element"> | ||||
| <span class="bi bi-pencil p-2" | |||||
| <span class="btn btn-primary bi bi-pencil p-2-4" | |||||
| data-type="user-tool" data-action="edit" (click)="openModalEditDocument(element)"></span> | data-type="user-tool" data-action="edit" (click)="openModalEditDocument(element)"></span> | ||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -44,7 +44,7 @@ export class DocumentsComponent { | |||||
| private documentService: DocumentService | private documentService: DocumentService | ||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.displayedColumns = ['pos', 'name', 'description', 'download', 'partnerName', 'productName', 'createdAt', 'createdByName', 'edit']; | |||||
| this.displayedColumns = ['pos', 'name', 'description', 'partnerName', 'productName', 'createdAt', 'createdByName', 'download', 'edit']; | |||||
| this.documentsSub = new Subscription(); | this.documentsSub = new Subscription(); | ||||
| this.documents = []; | this.documents = []; | ||||
| @@ -8,14 +8,16 @@ | |||||
| <p><strong>{{ saleSummary.ownerName }}</strong></p> | <p><strong>{{ saleSummary.ownerName }}</strong></p> | ||||
| <div class="sales-summary-bar"> | <div class="sales-summary-bar"> | ||||
| <div> | <div> | ||||
| <span class="sales-summary-turnover" [ngStyle]="{ 'width.%': calculateWidthPercentage(Number(saleSummary.turnover), saleSummaryMaxTurnover)}"> | |||||
| <span class="sales-summary-turnover" | |||||
| [ngStyle]="{ 'width.%': calculateWidthPercentage(Number(saleSummary.turnover), saleSummaryMaxTurnover)}"> | |||||
| {{ 'sales.turnover' | translate }}: <strong>{{ saleSummary.turnover | currency: 'EUR' }}</strong> | {{ 'sales.turnover' | translate }}: <strong>{{ saleSummary.turnover | currency: 'EUR' }}</strong> | ||||
| </span> | </span> | ||||
| </div> | </div> | ||||
| </div> | </div> | ||||
| <div class="sales-summary-bar"> | <div class="sales-summary-bar"> | ||||
| <div> | <div> | ||||
| <span class="sales-summary-profit" [ngStyle]="{ 'width.%': calculateWidthPercentage(Number(saleSummary.profit), saleSummaryMaxTurnover)}"> | |||||
| <span class="sales-summary-profit" | |||||
| [ngStyle]="{ 'width.%': calculateWidthPercentage(Number(saleSummary.profit), saleSummaryMaxTurnover)}"> | |||||
| {{ 'sales.profit' | translate }}: <strong>{{ saleSummary.profit | currency: 'EUR' }}</strong> | {{ 'sales.profit' | translate }}: <strong>{{ saleSummary.profit | currency: 'EUR' }}</strong> | ||||
| </span> | </span> | ||||
| </div> | </div> | ||||
| @@ -41,9 +43,7 @@ | |||||
| {{ 'overview.sale-user' | translate }} | {{ 'overview.sale-user' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell *matCellDef="let element"> | <td mat-cell *matCellDef="let element"> | ||||
| <span role="button" (click)="navigateToSaleDetails(element)"> | |||||
| {{ element.ownerName }} | |||||
| </span> | |||||
| {{ element.ownerName }} | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -53,7 +53,7 @@ | |||||
| {{ 'overview.sale-partner' | translate }} | {{ 'overview.sale-partner' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell *matCellDef="let element"> | <td mat-cell *matCellDef="let element"> | ||||
| {{ element.partnerName }} | |||||
| <a [routerLink]="['/customer', ApiConverter.extractId(element.partner)]">{{ element.partnerName }}</a> | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -63,7 +63,7 @@ | |||||
| {{ 'overview.productname' | translate }} | {{ 'overview.productname' | translate }} | ||||
| </th> | </th> | ||||
| <td mat-cell *matCellDef="let element"> | <td mat-cell *matCellDef="let element"> | ||||
| {{ element.productName }} | |||||
| <a [routerLink]="['/products', ApiConverter.extractId(element.product)]">{{ element.productName }}</a> | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| @@ -97,6 +97,16 @@ | |||||
| </td> | </td> | ||||
| </ng-container> | </ng-container> | ||||
| <ng-container matColumnDef="details"> | |||||
| <th mat-header-cell *matHeaderCellDef> | |||||
| {{ 'overview.details' | translate }} | |||||
| </th> | |||||
| <td mat-cell *matCellDef="let element"> | |||||
| <span class="btn btn-primary bi bi-zoom-in p-2-4" | |||||
| data-type="user-tool" data-action="edit" (click)="navigateToSaleDetails(element)"></span> | |||||
| </td> | |||||
| </ng-container> | |||||
| <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | <tr mat-header-row *matHeaderRowDef="displayedColumns"></tr> | ||||
| <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> | <tr mat-row *matRowDef="let row; columns: displayedColumns;"></tr> | ||||
| </table> | </table> | ||||
| @@ -1,5 +1,6 @@ | |||||
| import {ChangeDetectorRef, Component, LOCALE_ID, OnInit, ViewChild} from '@angular/core'; | import {ChangeDetectorRef, Component, LOCALE_ID, OnInit, ViewChild} from '@angular/core'; | ||||
| import { | import { | ||||
| ContactJsonld, | |||||
| ProductJsonld, | ProductJsonld, | ||||
| SaleJsonld, | SaleJsonld, | ||||
| SaleService, | SaleService, | ||||
| @@ -64,7 +65,7 @@ export class SalesComponent implements OnInit { | |||||
| private router: Router, | private router: Router, | ||||
| ) { | ) { | ||||
| this.sort = new MatSort(); | this.sort = new MatSort(); | ||||
| this.displayedColumns = ['pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date']; | |||||
| this.displayedColumns = ['pos', 'user', 'partner', 'product', 'turnover', 'profit', 'date', 'details']; | |||||
| this.salesSub = new Subscription(); | this.salesSub = new Subscription(); | ||||
| this.sales = []; | this.sales = []; | ||||
| this.salesSummarySub = new Subscription(); | this.salesSummarySub = new Subscription(); | ||||
| @@ -159,8 +160,9 @@ export class SalesComponent implements OnInit { | |||||
| } | } | ||||
| navigateToSaleDetails(element: any) { | navigateToSaleDetails(element: any) { | ||||
| // const product: ProductJsonld = element as ProductJsonld; | |||||
| // this.router.navigate(['/products', ApiConverter.extractId(product.id)]); | |||||
| console.log(element); | |||||
| // const sale: SaleJsonld = element as SaleJsonld; | |||||
| // this.router.navigate(['/sales', ApiConverter.extractId(sale.id)]); | |||||
| } | } | ||||
| openModalNewSale() { | openModalNewSale() { | ||||
| @@ -177,4 +179,5 @@ export class SalesComponent implements OnInit { | |||||
| } | } | ||||
| protected readonly Number = Number; | protected readonly Number = Number; | ||||
| protected readonly ApiConverter = ApiConverter; | |||||
| } | } | ||||
| @@ -75,6 +75,7 @@ | |||||
| "product": "Produkt", | "product": "Produkt", | ||||
| "sale-user": "Verkäufer", | "sale-user": "Verkäufer", | ||||
| "sale-partner": "Kunde", | "sale-partner": "Kunde", | ||||
| "details": "Details", | |||||
| "turnover": "Umsatz", | "turnover": "Umsatz", | ||||
| "profit": "Gewinn", | "profit": "Gewinn", | ||||
| "createdAt": "erstellt am" | "createdAt": "erstellt am" | ||||
| @@ -14,7 +14,7 @@ | |||||
| @include transition(); | @include transition(); | ||||
| &:hover { | &:hover { | ||||
| color: $color-matsen; | |||||
| background: $color-matsen; | |||||
| } | } | ||||
| } | } | ||||