**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
What:
- Parent was being updated incorrectly because of a weird typeorm issue, making the rank pick up the wrong entity's rank. This PR fixes that issue by passing in an ID and letting the service take care of fetching the parent.
RESOLVES CORE-1274
Encoded the `location_id` into the query params and ensured it gets parsed on mount, into defaults. This allows safer refreshes of the locations table or accurate deep-links to be shared.
Resolves CORE-1252
I believe that changing the requiredness of the `address_1` and `country_code` fields when any part of the address was filled was not being registered correctly with the form state representation of those fields. ~~Have added an effect that unregisters the fields when the requiredness state changes and allows them to be re-registered with the correct `required` value when the next re-render happens due to that state having changed.~~
Have updated the submit button to be available even if form is invalid.
Resolves CORE-1266