**What**
- Remove all allocations to line items once an order edit is confirmed
**Why**
- Since all line items of an order are discarded once an order edit is confirmed it will orphan the reservations causing inconsistencies with the stock
**What**
- If cart completion fails after creating reservations, remove those reservations
**Why**
- To avoid hanging reservations if something fails at a later point
* ensure that all levels are listed
* add changeset
* remove count from config
* update changeset version bump
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* Fix effect check in inventory table and overflow UI
* Create ten-berries-rest.md
* Fix edit stock&inventory modal to use the right form
* Fix faulty merge conflict resolution
* Fix inventory item creation
* Add redirect to locations tab if no locations, toast
* Revert redirect and toast, add message in table
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* validate that an inventory level exists as well
* improve create-fulfillment handling in admin
* pass along location id rather than inventory level id
* add changeset
* remove dependency
* feat(oas:cli): output better error when no command is provided
* chore(changeset): patch
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
**What**
- fix `difference_due` in the OE modal to show the correct difference a user has to pay
- fix Timeline crashing due to returned line item being `undefined `(deleted after OE confirmation)
**Why**
We were taking into account `refunded_amount` when calculating "Difference Due" and used the following formula:
`orderEdit.total - paidTotal + refundedTotal`.
The issue here is that `orderEdit.total` is "overpriced" for the amount of items that are returned/refunded already (i.e. we are charging the user again for the returned items).
The straightforward solution would be to subtract `refunded_total` from the `orderEdit.total` to get the total cost of items the user is actually getting after the edit.
`difference_due = (orderEdit.total - refundedTotal) - (paidTotal - refundedTotal ) = orderEdit.total - paidTotal`
But if we have partially refunded returns, we would have the same problem of returned items priced into the total.
In that case, general solution should be something like:
`diff_due_display = orderEdit_total_of_items_user_is_getting - paid_total + refunded_total`
Would like to hear what you guys think!
---
FIXES CORE-1246
**What**
1. Enable the "create location" button in "create stock location" when a field has changed
2. Remove the "successful delete" toast when cancelling stock location creation
3. Properly update available and reserved when editing stock levels for variant
4. invalidate inventoryItemList queryKeys when changing location levels
**Why**
- we had the same bug with form validation when creating location levels as we had when editing them (1)
- when updating location levels, listing inventory items wouldn't show the newly added location levels (4)
- fixing ui bugs (2, 4)
**What**
- Add warning to request-return modal if no inventory level exists for the combination of items that is being requested
- Block receive return at location with the same condition
**What**
The error handling was applied on the emit, which always succeed. On the other hand, the `on` which calls the handler, was not handling any errors and therefore crashed the server