Merged PR 475: #1410 Belegnummer Link deaktiviert

#1410 Belegnummer Link deaktiviert, Fallback auf Organisation Name, wenn kein Customer Name vorhanden
This commit is contained in:
Andreas Schickinger
2021-02-08 14:46:18 +00:00
committed by Lorenz Hilpert
4 changed files with 11 additions and 24 deletions

View File

@@ -7,7 +7,7 @@
<div class="order">
<div class="order-container">
<div class="label">Belegnummer</div>
<div class="data order-number" (click)="goToDetails()" [ngClass]="{ download: isDownload }">#{{ orderNumber }}</div>
<div class="data order-number" [ngClass]="{ download: isDownload }">#{{ orderNumber }}</div>
</div>
<div class="order-container">
<div class="label">Bestelldatum</div>

View File

@@ -60,8 +60,6 @@
position: absolute;
width: 300px;
left: 140px;
color: #1f466c;
cursor: pointer;
}
div.download {

View File

@@ -1,8 +1,4 @@
import { Component, OnInit, Input, Output, EventEmitter, ChangeDetectionStrategy } from '@angular/core';
import { Store } from '@ngxs/store';
import { ChangeCurrentRoute } from 'apps/sales/src/app/core/store/actions/process.actions';
import { AddBreadcrumb } from 'apps/sales/src/app/core/store/actions/breadcrumb.actions';
import { Router } from '@angular/router';
@Component({
selector: 'app-confirmation-overview',
@@ -26,26 +22,11 @@ export class ConfirmationOverviewComponent implements OnInit {
@Input() orderBranchAddress: string;
@Output() printOrder: EventEmitter<number> = new EventEmitter();
constructor(private store: Store, private router: Router) {}
constructor() {}
ngOnInit() {}
print() {
this.printOrder.emit(this.orderId);
}
goToDetails() {
const route = `/customer/${this.customerId}/order/${this.orderId}`;
this.store.dispatch(new ChangeCurrentRoute(route));
this.store.dispatch(
new AddBreadcrumb(
{
name: 'Bestelldetails',
path: route,
},
'checkout'
)
);
this.router.navigate([route]);
}
}

View File

@@ -154,7 +154,15 @@ export class CartConfirmationComponent implements OnInit, OnDestroy {
private processCustomerAddress(customer: User) {
this.customerId = customer.id;
this.customerName = `${customer.first_name} ${customer.last_name}`;
if (customer.first_name != null && customer.last_name != null) {
this.customerName = `${customer.first_name} ${customer.last_name}`;
} else if (customer.organisation?.name != null) {
this.customerName = customer.organisation?.name;
} else {
this.customerName = '';
}
this.email = customer.email;
let delAddress = '';