Skip to content

Commit

Permalink
fix(core): Fix incorrect allocation logic in default fulfillment process
Browse files Browse the repository at this point in the history
Fixes #2306
  • Loading branch information
michaelbromley committed Jul 27, 2023
1 parent 23af791 commit f6881bf
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,10 @@ export const defaultFulfillmentProcess: FulfillmentProcess<FulfillmentState> = {
},
async onTransitionEnd(fromState, toState, { ctx, fulfillment, orders }) {
if (toState === 'Cancelled') {
const orderLineInput = fulfillment.lines.map(l => ({ orderLineId: l.id, quantity: l.quantity }));
const orderLineInput = fulfillment.lines.map(l => ({
orderLineId: l.orderLineId,
quantity: l.quantity,
}));
await stockMovementService.createCancellationsForOrderLines(ctx, orderLineInput);
// const lines = await groupOrderItemsIntoLines(ctx, orderLineInput);
await stockMovementService.createAllocationsForOrderLines(ctx, orderLineInput);
Expand Down

0 comments on commit f6881bf

Please sign in to comment.