You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Describe the bug
In version 2.0.5, the addFulfillmentToOrder() function called from AdminUI can create a fulfillment with a quantity exceeding the initial order line quantity. This creates a fulfillmentLine in the database with an incorrect quantity (OrderLineInput.quantity > orderLine.quantity). This operation should throw an error, but it doesn't.
To Reproduce
Steps to reproduce the behavior:
Carry out the following operations: addItemToOrder(), SetOrderShippingMethod(), transitionOrderToState(), addPaymentToOrder().
Go to the newly placed order in the AdminUI. If necessary, 'Settle payment', then click on 'Fulfill order'.
Input a quantity that is larger than the unfulfilled quantity. For instance, if the order line quantity is 2, input 3 in the fulfillment quantity. Fill 'Method' and 'Tracking code' with any string.
Execute 'Create Fulfillment'. It will run successfully.
Back in the order details page, the newly created fulfillment displays 3 units, despite the original order line quantity being 2. The 'Quantity' column for the order line will display 'No items fulfilled'.
Expected behavior
When a fulfillment is attempted with a quantity exceeding the original order line quantity, the system should throw an error.
Analysis
The OrderService.requestedFulfillmentQuantityExceedsLineQuantity() function seems to return false when it queries for linesToBeFulfilled and no matching records are found (e.g., for new order lines without preceding fulfillment lines). One potential fix could be to compare the requested fulfillment quantity with the original order line quantity in cases where no matching records are found in linesToBeFulfilled.
The text was updated successfully, but these errors were encountered:
Describe the bug
In version 2.0.5, the
addFulfillmentToOrder()
function called from AdminUI can create a fulfillment with a quantity exceeding the initial order line quantity. This creates afulfillmentLine
in the database with an incorrect quantity (OrderLineInput.quantity > orderLine.quantity
). This operation should throw an error, but it doesn't.To Reproduce
Steps to reproduce the behavior:
addItemToOrder()
,SetOrderShippingMethod()
,transitionOrderToState()
,addPaymentToOrder()
.Expected behavior
When a fulfillment is attempted with a quantity exceeding the original order line quantity, the system should throw an error.
Analysis
The
OrderService.requestedFulfillmentQuantityExceedsLineQuantity()
function seems to return false when it queries forlinesToBeFulfilled
and no matching records are found (e.g., for new order lines without preceding fulfillment lines). One potential fix could be to compare the requested fulfillment quantity with the original order line quantity in cases where no matching records are found inlinesToBeFulfilled
.The text was updated successfully, but these errors were encountered: