Compare commits

...

6 Commits

Author SHA1 Message Date
Nino
b2340a0e20 #4688 Change PickUpShelf Navigation based on Area In or Out 2024-03-06 12:02:07 +01:00
Nino Righi
a3330263f8 Merged PR 1758: #4689 Pickup Shelf Out Update Quantity After FETCHED_PARTIAL in Result List
#4689 Pickup Shelf Out Update Quantity After FETCHED_PARTIAL in Result List
2024-03-04 16:45:50 +00:00
Nino Righi
89092a5f6e Merged PR 1757: #4690 PickupShelfOut Details Display FETCHED_PARTIAL Action Correctly
#4690 PickupShelfOut Details Display FETCHED_PARTIAL Action Correctly
2024-03-04 15:54:43 +00:00
Nino
42fa108bb6 Pickup Shelf Out Details with Supplier Id Filter 2024-03-01 10:43:32 +01:00
Nino
2692588357 Changed Checkout Summary Navigation To Pickup Shelf Out Filter to supplier id 16 2024-02-29 12:47:45 +01:00
Nino Righi
ec26b5f4c0 Merged PR 1756: #4684 Routing to Pickup Shelf Out Update
#4684 Routing to Pickup Shelf Out Update
2024-02-28 11:28:26 +00:00
9 changed files with 83 additions and 42 deletions

View File

@@ -35,7 +35,7 @@ export class PickupShelfOutService extends PickupShelfIOService {
);
}
const { orderdate } = args.filter?.getQueryToken()?.filter ?? {};
const { orderdate, supplier_id } = args.filter?.getQueryToken()?.filter ?? {};
return this._abholfachService.AbholfachWarenausgabe({
input: {
@@ -45,6 +45,7 @@ export class PickupShelfOutService extends PickupShelfIOService {
archive: String(true),
all_branches: String(true),
orderdate,
supplier_id,
},
});
}

View File

@@ -296,18 +296,8 @@ export class CheckoutSummaryComponent implements OnInit, OnDestroy {
if (takeNowOrders.length != 1) return;
try {
for (const takeNowOrder of takeNowOrders) {
for (const orderItem of takeNowOrder.items.filter((item) => item.features?.orderType === 'Rücklage')) {
await this.omsService
.changeOrderStatus(takeNowOrder.id, orderItem.id, orderItem.subsetItems[0]?.id, {
processingStatus: 128,
})
.toPromise();
}
}
await this.router.navigate(this._shelfOutNavigationService.listRoute({ processId: Date.now() }).path, {
queryParams: { main_qs: takeNowOrders[0].orderNumber },
queryParams: { main_qs: takeNowOrders[0].orderNumber, filter_supplier_id: '16' },
});
} catch (e) {
console.error(e);

View File

@@ -5,14 +5,13 @@ import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
import { Breadcrumb, BreadcrumbService } from '@core/breadcrumb';
import { take } from 'rxjs/operators';
import { NavigationRoute } from '@shared/services';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString, ListResponseArgsOfDBHOrderItemListItemDTO } from '@swagger/oms';
import { isEmpty } from 'lodash';
import { Observable } from 'rxjs';
import { RunCheckTrigger } from './trigger';
import { OrderItemsContext } from '@domain/oms';
import { ActionHandlerService } from './services/action-handler.service';
import { Config } from '@core/config';
import { debounce } from '@utils/common';
export type GetNameForBreadcrumbData = {
processId: number;
@@ -117,31 +116,8 @@ export abstract class PickupShelfBaseComponent implements OnInit {
return queryParams;
}
regsiterFetchListResponseHandler() {
this.listStore.fetchListResponse$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(async ({ processId, queryParams, response }) => {
/**
* Wenn die Suche erfolgreich war, wird der Benutzer auf die Liste oder Detailseite des gefundenen Artikels weitergeleitet.
*/
const filterQueryParams = this.listStore.filter.getQueryParams();
// Only Update QueryParams if the user is already on the details, edit or history page
// const view: string = this.activatedRoute.snapshot.data.view;
// if (['filter', 'details', 'edit', 'history'].includes(view)) {
// await this.router.navigate([], { queryParams: { ...queryParams, ...filterQueryParams }, skipLocationChange: true });
// return;
// }
if (response.hits === 1) {
const detailsPath = await this.getPathForDetail(response.result[0]).pipe(take(1)).toPromise();
await this.router.navigate(detailsPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...detailsPath.queryParams } });
} else if (response.hits > 1) {
const listPath = await this.getPathFoListBreadcrumb({ processId, queryParams });
await this.router.navigate(listPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...listPath.queryParams } });
} else {
await this.router.navigate([], { queryParams: { ...queryParams, ...filterQueryParams } });
}
});
}
// Fix Ticket #4688 Navigation behaves different based on section PickUpShelfOut and PickUpShelfIn
abstract regsiterFetchListResponseHandler(): void | Promise<void>;
/**
* Sucht die Breadcrumb anhand des Tags.

View File

@@ -125,6 +125,7 @@ export abstract class PickupShelfDetailsBaseComponent {
processingStatus: updatedItem.processingStatus,
compartmentCode: updatedItem.compartmentCode,
compartmentInfo: updatedItem.compartmentInfo,
quantity: updatedItem.quantity,
},
});
});

View File

@@ -16,6 +16,7 @@ import { map, take } from 'rxjs/operators';
import { ApplicationService } from '@core/application';
import { FilterAutocompleteProvider } from '@shared/components/filter';
import { PickUpShelfInAutocompleteProvider } from './providers/pickup-shelf-in-autocomplete.provider';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@Component({
selector: 'page-pickup-shelf-in',
@@ -205,4 +206,23 @@ export class PickupShelfInComponent extends PickupShelfBaseComponent {
async getNameForHistoryBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
return 'Historie';
}
async regsiterFetchListResponseHandler() {
this.listStore.fetchListResponse$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(async ({ processId, queryParams, response }) => {
/**
* Wenn die Suche erfolgreich war, wird der Benutzer auf die Liste oder Detailseite des gefundenen Artikels weitergeleitet.
*/
const filterQueryParams = this.listStore.filter.getQueryParams();
if (response.hits === 1) {
const detailsPath = await this.getPathForDetail(response.result[0]).pipe(take(1)).toPromise();
await this.router.navigate(detailsPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...detailsPath.queryParams } });
} else if (response.hits > 1) {
const listPath = await this.getPathFoListBreadcrumb({ processId, queryParams });
await this.router.navigate(listPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...listPath.queryParams } });
} else {
await this.router.navigate([], { queryParams: { ...queryParams, ...filterQueryParams } });
}
});
}
}

View File

@@ -84,7 +84,7 @@ export class PickupShelfOutDetailsComponent extends PickupShelfDetailsBaseCompon
addToPreviousCompartmentAction$ = this.store.addToPreviousCompartmentAction$;
mainActions$ = this.store.mainActions$;
mainActions$ = this.store.mainShelfOutActions$;
trackByFnGroupDBHOrderItemListItemDTO = (index: number, group: { type: string; items: DBHOrderItemListItemDTO[] }) => group.type;

View File

@@ -7,7 +7,7 @@ import { PickupShelfIOService, PickupShelfOutService } from '@domain/pickup-shel
import { GetNameForBreadcrumbData, GetPathForBreadcrumbData, PickupShelfBaseComponent } from '../pickup-shelf-base.component';
import { NavigationRoute, PickUpShelfOutNavigationService } from '@shared/services';
import { AsyncPipe } from '@angular/common';
import { DBHOrderItemListItemDTO } from '@swagger/oms';
import { DBHOrderItemListItemDTO, ListResponseArgsOfDBHOrderItemListItemDTO } from '@swagger/oms';
import { Observable, of } from 'rxjs';
import { take } from 'rxjs/operators';
import { provideActionHandlers } from '@core/command';
@@ -15,6 +15,7 @@ import { ActionHandlerServices } from '@domain/oms';
import { ActionHandlerService } from '../services/action-handler.service';
import { FilterAutocompleteProvider } from '@shared/components/filter';
import { PickUpShelfOutAutocompleteProvider } from './providers/pickup-shelf-out-autocomplete.provider';
import { takeUntilDestroyed } from '@angular/core/rxjs-interop';
@Component({
selector: 'page-pickup-shelf-out',
@@ -203,4 +204,30 @@ export class PickupShelfOutComponent extends PickupShelfBaseComponent {
async getNameForHistoryBreadcrumb(data: GetNameForBreadcrumbData): Promise<string> {
return 'Historie';
}
async regsiterFetchListResponseHandler() {
this.listStore.fetchListResponse$.pipe(takeUntilDestroyed(this.destroyRef)).subscribe(async ({ processId, queryParams, response }) => {
/**
* Wenn die Suche erfolgreich war, wird der Benutzer auf die Liste oder Detailseite des gefundenen Artikels weitergeleitet.
*/
const filterQueryParams = this.listStore.filter.getQueryParams();
if (response.hits === 1 || this._hasSameOrderNumber(response)) {
const detailsPath = await this.getPathForDetail(response.result[0]).pipe(take(1)).toPromise();
await this.router.navigate(detailsPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...detailsPath.queryParams } });
} else if (response.hits > 1) {
const listPath = await this.getPathFoListBreadcrumb({ processId, queryParams });
await this.router.navigate(listPath.path, { queryParams: { ...queryParams, ...filterQueryParams, ...listPath.queryParams } });
} else {
await this.router.navigate([], { queryParams: { ...queryParams, ...filterQueryParams } });
}
});
}
// Fix Ticket #4684 Navigate on Details if items contain same OrderNumber
private _hasSameOrderNumber(response: ListResponseArgsOfDBHOrderItemListItemDTO) {
if (response.hits === 0) return false;
const orderNumbers = new Set(response.result.map((item) => item.orderNumber));
return orderNumbers.size === 1;
}
}

View File

@@ -1,5 +1,5 @@
import { PickupShelfDetailsState } from './pickup-shelf-details.state';
import { DBHOrderItemListItemDTO } from '@swagger/oms';
import { DBHOrderItemListItemDTO, KeyValueDTOOfStringAndString } from '@swagger/oms';
export const selectOrder = (s: PickupShelfDetailsState) => s.order;
@@ -245,6 +245,26 @@ export const selectMainActions = (s: PickupShelfDetailsState) => {
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true));
};
export const selectShelfOutMainActions = (s: PickupShelfDetailsState) => {
const items = selectOrderItems(s);
const fetchPartial = selectFetchPartial(s);
// Ticket #4690 Consider every Item for selecting the main actions in Details View - Only for PickUpShelfOut
const actions: KeyValueDTOOfStringAndString[] = [];
for (const item of items) {
const actionsFromItem = item?.actions
?.filter((action) => typeof action?.enabled !== 'boolean')
?.filter((action) => (fetchPartial ? !action.command.includes('FETCHED_PARTIAL') : true));
for (const action of actionsFromItem) {
if (!actions.find((a) => a.command === action.command)) {
actions.push(action);
}
}
}
return actions;
};
export const selectCustomerNumber = (s: PickupShelfDetailsState) => {
const order = selectOrder(s);
return order?.buyer?.buyerNumber;

View File

@@ -212,6 +212,12 @@ export class PickupShelfDetailsStore extends ComponentStore<PickupShelfDetailsSt
return this.get(Selectors.selectMainActions);
}
mainShelfOutActions$ = this.select(Selectors.selectShelfOutMainActions);
get mainShelfOutActions() {
return this.get(Selectors.selectShelfOutMainActions);
}
customerNumber$ = this.select(Selectors.selectCustomerNumber);
get customerNumber() {