* remove reservations from draft order creation and show correct inventory
* add changeset
* add integration tests
* adjust inventory on payment if no inventory service is installed
* fix fulfillment for order lines without inventory items
* fix summary card on order for variants without inventory items
* add changeset
* minor fixes
* remove variants without inventory items from allocate modal
* naming
* Update .changeset/kind-rings-wave.md
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* remove line item indicator
* cleanup
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>
* 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
**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
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
Previously, if an order had two fulfilments that fully satisfied the order, then only one was shipped, the status would change to `partially_shipped` and show the "Create Fulfillment" button again, which would open a buggy modal with no items to fulfil. Added another check that looks at the items in the order and compares `quantity` and `fulfilled_quantity`, so that we can hide the button based on this as well, rather than just the order's `fulfillment_status`, which can be misleading.
Also added a status icon to the Fulfillment card's title bar for the `partially_shipped` status, as this area was blank before in that state.
Resolves CORE-1262
**What**
- Fix stock locations quantities being shown as `undefined` and `NaN`
- Throw if updates to location levels are made with negative quantities through the api
- Show "allocated" in order summary for partially fulfilled orders
Fixes CORE-1268, CORE-1267, CORE-1265
* init deploy command
* add include flag
* add 'shortcut' flag
* add dev command, fix var replacement, change default behaviour
* cleanup params of build command
* fix defaults when using the plugin to serve admin
* add changeset
* fix globals
* update README
* throw error on no build found
---------
Co-authored-by: Oliver Windall Juhl <59018053+olivermrbl@users.noreply.github.com>