mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-31 09:37:15 +01:00
#1526 Setzen der Rechnugsadresse bei Online und B2B Kunden
This commit is contained in:
@@ -335,6 +335,19 @@ export class DomainCheckoutService {
|
||||
shareReplay()
|
||||
);
|
||||
|
||||
const customerTypes$ = this.getCustomerFeatures({ processId }).pipe(
|
||||
first(),
|
||||
map((features) => {
|
||||
const isOnline = !!features?.webshop;
|
||||
const isGuest = !!features?.guest;
|
||||
const isB2B = !!features?.b2b;
|
||||
const hasCustomerCard = !!features?.p4mUser;
|
||||
const isStaff = !!features?.staff;
|
||||
|
||||
return { isOnline: isOnline, isGuest, isB2B, hasCustomerCard, isStaff };
|
||||
})
|
||||
);
|
||||
|
||||
const shippingAddressDestination$ = this.getCheckout({ processId }).pipe(
|
||||
first(),
|
||||
map((checkout) => checkout?.destinations?.find((dest) => dest.data.target === 2 || dest.data.target === 16)),
|
||||
@@ -346,9 +359,9 @@ export class DomainCheckoutService {
|
||||
mergeMap((buyer) => this._setBuyer({ processId, buyer }))
|
||||
);
|
||||
|
||||
const setPayer$ = itemOrderOptions$.pipe(
|
||||
mergeMap((options) => {
|
||||
if (options.hasB2BDelivery || options.hasDelivery || options.hasDigDelivery || options.hasDownload) {
|
||||
const setPayer$ = customerTypes$.pipe(
|
||||
mergeMap(({ isOnline, isB2B }) => {
|
||||
if (isOnline || isB2B) {
|
||||
return this.getPayer({ processId }).pipe(first());
|
||||
}
|
||||
return of(undefined);
|
||||
|
||||
Reference in New Issue
Block a user