Merged PR 959: #2336 WK DIG Versand Grouping fix

#2336 WK DIG Versand Grouping fix

Related work items: #2336
This commit is contained in:
Andreas Schickinger
2021-11-11 15:48:12 +00:00
committed by Nino Righi
parent cbfa2fc98c
commit 60f1a89984

View File

@@ -49,12 +49,15 @@ export class CheckoutReviewComponent implements OnInit {
takeUntil(this._orderCompleted),
map((items) =>
items.reduce((grouped, item) => {
// let index = grouped.findIndex((g) => g?.orderType === item?.features?.orderType && g.destination?.id === item?.destination?.id);
let index = grouped.findIndex(
(g) => g?.orderType === 'Dummy' || item?.features?.orderType === 'DIG-Versand' || g?.orderType === item?.features?.orderType
let index = grouped.findIndex((g) =>
item?.availability?.supplyChannel === 'MANUALLY'
? g?.orderType === 'Dummy'
: item?.features?.orderType === 'DIG-Versand'
? g?.orderType === 'Versand'
: g?.orderType === item?.features?.orderType
);
let group = index !== -1 ? grouped[index] : undefined;
let group = index !== -1 ? grouped[index] : undefined;
if (!group) {
group = {
orderType: