Merged PR 1644: #4364 Check if Order is Kulturpass Order if no customer is available

#4364 Check if Order is Kulturpass Order if no customer is available
This commit is contained in:
Nino Righi
2023-10-17 13:46:23 +00:00
committed by Lorenz Hilpert
parent 1d25fec9ff
commit 4fd10bc8a4

View File

@@ -469,9 +469,11 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
}
const customer = res.result[0];
const isKulturpass = this.order?.features?.orderSource === 'KulturPass';
// check if the customer is the same as the order's buyer
if (customer.customerNumber !== this.order.buyer.buyerNumber) {
// also check if the order is a KulturPass order, then there may be no customer
if (!isKulturpass && customer?.customerNumber !== this.order.buyer.buyerNumber) {
this._modal.error('Fehler beim Laden des Kunden', new Error('Der Kunde ist nicht der Bestellung zugeordnet.'));
return;
}