Merged PR 920: #2304 Customer Order Details Display Dummy Orders

#2304 Customer Order Details Display Dummy Orders
This commit is contained in:
Nino Righi
2021-10-20 14:32:15 +00:00
committed by Lorenz Hilpert
parent 5793094187
commit 445ba6ba20
3 changed files with 22 additions and 4 deletions

View File

@@ -46,7 +46,9 @@
<div class="orders">
<ng-container *ngFor="let orderItem of order.items; let i = index">
<ng-container
*ngIf="i === 0 || order.items[i - 1].data.features.orderType !== orderItem.data.features.orderType"
*ngIf="
i === 0 || order.items[i - 1].data.features.orderType !== orderItem.data.features.orderType || !hasDummyItems(orderItem.data)
"
[ngSwitch]="orderItem.data.features.orderType"
>
<div *ngSwitchCase="'Rücklage'" class="order-category">
@@ -54,8 +56,15 @@
<h2>Rücklage</h2>
</div>
<div *ngSwitchCase="'Abholung'" class="order-category">
<ui-icon class="icon" icon="box_out" size="18px"></ui-icon>
<h2>Abholung</h2>
<ng-container *ngIf="hasDummyItems(orderItem.data); else abholung">
<div class="order-category-dummy">
<h2>manuelle Anlage / Dummy Bestellung</h2>
</div>
</ng-container>
<ng-template #abholung>
<ui-icon class="icon" icon="box_out" size="18px"></ui-icon>
<h2>Abholung</h2>
</ng-template>
</div>
<div #download *ngSwitchCase="'Download'" class="order-category">
<ui-icon class="icon" icon="download" size="18px"></ui-icon>

View File

@@ -10,6 +10,10 @@
@apply flex flex-col bg-white mx-10 mt-5 mb-5;
}
.order-category-dummy {
@apply flex flex-row items-center mt-5 ml-0;
}
.order-category {
@apply flex flex-row items-center mt-5;

View File

@@ -3,7 +3,7 @@ import { ActivatedRoute } from '@angular/router';
import { ApplicationService } from '@core/application';
import { BreadcrumbService } from '@core/breadcrumb';
import { DomainOmsService } from '@domain/oms';
import { OrderDTO } from '@swagger/oms';
import { EntityDTOContainerOfOrderItemDTO, OrderDTO, OrderItemDTO } from '@swagger/oms';
import { combineLatest, Observable } from 'rxjs';
import { map, shareReplay } from 'rxjs/operators';
@@ -17,6 +17,7 @@ export class CustomerOrderDetailsComponent implements OnInit {
customerId: number;
orderId: number;
order$: Observable<OrderDTO>;
manuallyOrDummyOrderItems$: Observable<EntityDTOContainerOfOrderItemDTO[]>;
branchName$: Observable<string>;
constructor(
@@ -47,4 +48,8 @@ export class CustomerOrderDetailsComponent implements OnInit {
params: {},
});
}
hasDummyItems(orderItem: OrderItemDTO): boolean {
return !!orderItem?.subsetItems?.find((subsetItem) => subsetItem?.data?.supplyChannel === 'MANUALLY');
}
}