This commit is contained in:
Lorenz Hilpert
2023-07-28 18:06:45 +02:00
2 changed files with 37 additions and 10 deletions

View File

@@ -22,33 +22,38 @@
<div class="flex flex-row items-center bg-[#F5F7FA] min-h-[3.3125rem]">
<div class="flex flex-row items-center justify-center px-5 py-[0.875rem]">
<shared-icon
*ngIf="displayOrder?.features?.orderType !== 'Dummy'"
*ngIf="(displayOrder?.items)[0]?.features?.orderType !== 'Dummy'"
class="mr-2"
[size]="displayOrder?.features?.orderType === 'B2B-Versand' ? 36 : 24"
[size]="(displayOrder?.items)[0]?.features?.orderType === 'B2B-Versand' ? 36 : 24"
[icon]="
displayOrder?.features?.orderType === 'Abholung'
(displayOrder?.items)[0]?.features?.orderType === 'Abholung'
? 'isa-box-out'
: displayOrder?.features?.orderType === 'Versand'
: (displayOrder?.items)[0]?.features?.orderType === 'Versand'
? 'isa-truck'
: displayOrder?.features?.orderType === 'Rücklage'
: (displayOrder?.items)[0]?.features?.orderType === 'Rücklage'
? 'isa-shopping-bag'
: displayOrder?.features?.orderType === 'B2B-Versand'
: (displayOrder?.items)[0]?.features?.orderType === 'B2B-Versand'
? 'isa-b2b-truck'
: displayOrder?.features?.orderType === 'Download'
: (displayOrder?.items)[0]?.features?.orderType === 'Download'
? 'isa-download'
: 'isa-truck'
"
></shared-icon>
<p class="text-p1 font-bold mr-3">{{ displayOrder?.features?.orderType }}</p>
<p class="text-p1 font-bold mr-3">{{ (displayOrder?.items)[0]?.features?.orderType }}</p>
<div
*ngIf="displayOrder?.features?.orderType === 'Abholung' || displayOrder?.features?.orderType === 'Rücklage'; else shippingAddress"
*ngIf="
(displayOrder?.items)[0]?.features?.orderType === 'Abholung' || (displayOrder?.items)[0]?.features?.orderType === 'Rücklage';
else shippingAddress
"
>
{{ displayOrder.targetBranch?.name }}, {{ displayOrder.targetBranch | branchAddress }}
</div>
<ng-template #shippingAddress>
{{ displayOrder.shippingAddress | branchAddress }}
</ng-template>
<div *ngIf="displayOrder?.features?.orderType === 'Download'">| {{ displayOrder.buyer?.communicationDetails?.email }}</div>
<div *ngIf="(displayOrder?.items)[0]?.features?.orderType === 'Download'">
| {{ displayOrder.buyer?.communicationDetails?.email }}
</div>
</div>
</div>

View File

@@ -39,6 +39,28 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
} else {
return filteredOrders;
}
// Ticket #4228 Für die korrekte Gruppierung der Items bei gleichem Bestellziel (Aufsplitten von Abholung und Rücklage)
const ordersWithMultipleFeatures = filteredOrders.filter((order) =>
order.items.find((item) => item.features.orderType !== order.features.orderType)
);
if (!!ordersWithMultipleFeatures && ordersWithMultipleFeatures.length > 0) {
for (let orderWithMultipleFeatures of ordersWithMultipleFeatures) {
const itemsWithOrderFeature = orderWithMultipleFeatures.items.filter(
(item) => item.features.orderType === orderWithMultipleFeatures.features.orderType
);
const itemsWithDifferentOrderFeature = orderWithMultipleFeatures.items.filter(
(item) => item.features.orderType !== orderWithMultipleFeatures.features.orderType
);
filteredOrders = [
...filteredOrders.filter((order) => order.id !== orderWithMultipleFeatures.id),
{ ...orderWithMultipleFeatures, items: itemsWithOrderFeature },
{ ...orderWithMultipleFeatures, items: itemsWithDifferentOrderFeature },
];
}
}
return filteredOrders?.map((order) => {
return {
...order,