mirror of
https://dev.azure.com/hugendubel/ISA/_git/ISA-Frontend
synced 2025-12-28 22:42:11 +01:00
Merged PR 1865: feat(oms-data-access, oms-return-review, oms-return-summary): fix return receipt mapping and ensure process completion
feat(oms-data-access, oms-return-review, oms-return-summary): fix return receipt mapping and ensure process completion Corrects the mapping of return receipts in the return process flow to ensure that the correct receipt IDs are used when printing and finalizing returns. Updates the `finishProcess` method to associate return receipts with the correct entities and ensures the store is updated after process completion. This resolves issues where printed receipts or review steps could reference incorrect or missing data. Ref: #5120
This commit is contained in:
committed by
Lorenz Hilpert
parent
159afa9356
commit
636e405927
@@ -182,8 +182,8 @@ export const ReturnProcessStore = signalStore(
|
||||
store.storeState();
|
||||
},
|
||||
finishProcess: (returnReceipts: { [id: number]: Receipt }) => {
|
||||
const entities = store.entities().map((entity) => {
|
||||
const receipt = returnReceipts[entity.receiptId];
|
||||
const entities = store.entities().map((entity, i) => {
|
||||
const receipt = returnReceipts[i];
|
||||
if (receipt) {
|
||||
return { ...entity, returnReceipt: receipt };
|
||||
}
|
||||
|
||||
@@ -22,8 +22,8 @@ export class ReturnReviewComponent {
|
||||
if (processId) {
|
||||
const receiptIds = this.#returnProcessStore
|
||||
.entities()
|
||||
.filter((p) => p.processId === processId && p.receiptId)
|
||||
.map((p) => p.receiptId);
|
||||
.filter((p) => p.processId === processId && p.returnReceipt?.id)
|
||||
.map((p) => p.returnReceipt!.id);
|
||||
|
||||
await this.#printReceiptsService.printReturnReceipts({
|
||||
returnReceiptIds: receiptIds,
|
||||
|
||||
@@ -113,6 +113,7 @@ export class ReturnSummaryComponent {
|
||||
}));
|
||||
this.returnItemsAndPrintReciptStatus.set('success');
|
||||
|
||||
this.#returnProcessStore.finishProcess(returnReceipts);
|
||||
await this.#router.navigate(['../', 'review'], {
|
||||
relativeTo: this.#activatedRoute,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user