mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
#2231 zubuchen aktiv wenn readyforpickup das heutige datum ist
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
import { Component, ChangeDetectionStrategy, Input, EventEmitter, Output, OnInit, OnDestroy } from '@angular/core';
|
||||
import { ComponentStore } from '@ngrx/component-store';
|
||||
import { OrderItemListItemDTO } from '@swagger/oms';
|
||||
import { Group, groupBy } from '@ui/common';
|
||||
import { DateAdapter, Group, groupBy } from '@ui/common';
|
||||
import { read } from 'fs';
|
||||
import { isEqual } from 'lodash';
|
||||
import { Subscription } from 'rxjs';
|
||||
import { map } from 'rxjs/operators';
|
||||
@@ -58,7 +59,7 @@ export class SharedGoodsInOutOrderDetailsCoversComponent extends ComponentStore<
|
||||
|
||||
private subscriptions = new Subscription();
|
||||
|
||||
constructor(private host: SharedGoodsInOutOrderDetailsStore) {
|
||||
constructor(private host: SharedGoodsInOutOrderDetailsStore, private dateAdapter: DateAdapter) {
|
||||
super({
|
||||
orderItems: [],
|
||||
});
|
||||
@@ -71,7 +72,14 @@ export class SharedGoodsInOutOrderDetailsCoversComponent extends ComponentStore<
|
||||
map(
|
||||
(orderItems) =>
|
||||
orderItems
|
||||
?.filter((a) => !!a.readyForPickUp && a.processingStatus === 128)
|
||||
?.filter((a) => a.processingStatus === 128)
|
||||
?.filter((a) => {
|
||||
if (a.readyForPickUp) {
|
||||
const readyForPickUp = new Date(a.readyForPickUp);
|
||||
return this.dateAdapter.compareDate(readyForPickUp, this.dateAdapter.today()) === 0;
|
||||
}
|
||||
return false;
|
||||
})
|
||||
?.sort((a, b) => new Date(b.readyForPickUp).getTime() - new Date(a.readyForPickUp).getTime())
|
||||
?.find((_) => true)?.compartmentCode
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user