Merged PR 1270: #2790 Benachrichtigungskanäle bei Weiter zum Warenkorb nicht überschreiben

#2790 Benachrichtigungskanäle bei Weiter zum Warenkorb nicht überschreiben, wenn der Kunde bereits ausgewhält ist

Related work items: #2790
This commit is contained in:
Andreas Schickinger
2022-06-09 08:34:04 +00:00
committed by Lorenz Hilpert
parent 6cffa53ea9
commit 055339956a

View File

@@ -320,6 +320,8 @@ export class CustomerDetailsComponent implements OnInit {
name: isB2b ? (customer.organisation?.name ? customer.organisation?.name : customer.lastName) : customer.lastName,
});
const currentBuyer = await this.checkoutService.getBuyer({ processId: this.application.activatedProcessId }).pipe(first()).toPromise();
// Set Buyer For Process
this.checkoutService.setBuyer({
processId: this.application.activatedProcessId,
@@ -331,10 +333,12 @@ export class CustomerDetailsComponent implements OnInit {
customerFeatures: this.getCusomterFeatures(customer),
});
this.checkoutService.setNotificationChannels({
processId: this.application.activatedProcessId,
notificationChannels: customer.notificationChannels === (3 as NotificationChannel) ? 1 : customer.notificationChannels,
});
if (currentBuyer?.buyerNumber !== customer.customerNumber) {
this.checkoutService.setNotificationChannels({
processId: this.application.activatedProcessId,
notificationChannels: customer.notificationChannels === (3 as NotificationChannel) ? 1 : customer.notificationChannels,
});
}
// Set Invoice Address If Selected
const payer = await this.getSelectedPayerAddress();