Merged PR 1321: #3270 Listenbestellung B2B Preis wird richtig übernommen

#3270 Listenbestellung B2B Preis wird richtig übernommen

Related work items: #3270
This commit is contained in:
Andreas Schickinger
2022-07-13 14:59:36 +00:00
committed by Nino Righi
parent 07498db711
commit 62b8e387ca

View File

@@ -169,6 +169,7 @@ export class PurchasingOptionsListModalComponent implements OnInit {
const deliveryDigAvailabilities = await this._store.deliveryDigAvailabilities$.pipe(first()).toPromise();
const selectedTakeAwayBranch = await this._store.selectedTakeAwayBranch$.pipe(first()).toPromise();
const selectedPickUpBranch = await this._store.selectedPickUpBranch$.pipe(first()).toPromise();
let option = this._store.selectedFilterOption;
for (const item of items) {
let availability;
@@ -190,11 +191,12 @@ export class PurchasingOptionsListModalComponent implements OnInit {
availability = deliveryDigAvailabilities[item.product.catalogProductNumber];
} else if (deliveryB2bAvailabilities[item.product.catalogProductNumber]) {
availability = deliveryB2bAvailabilities[item.product.catalogProductNumber];
option = 'b2b-delivery';
}
break;
}
const price = this._availability.getPriceForAvailability(this._store.selectedFilterOption, item.availability, availability);
const price = this._availability.getPriceForAvailability(option, item.availability, availability);
// Negative Preise und nicht vorhandene Availability ignorieren
if (price?.value?.value < 0 || !availability) {