Skip to content
This repository was archived by the owner on Nov 19, 2024. It is now read-only.

update inventory-cli-reference.md incorrect info #8023

Merged
merged 11 commits into from
Oct 16, 2020
21 changes: 18 additions & 3 deletions src/guides/v2.3/inventory/inventory-cli-reference.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ Command options:

- `-c`, `--complete-orders` - Returns inconsistencies for completed orders. Incorrect reservations may still be on hold for completed orders.
- `-i`, `--incomplete-orders` - Returns inconsistencies for incomplete orders (partially shipped, unshipped). Incorrect reservations may hold too much or not enough salable quantity for the orders.
- `-b`, `--bunchsize` - Defines how many orders to load at once.
- `-r`, `--raw` - Raw output.

Responses using `-r` return in `<ORDER_INCREMENT_ID>:<SKU>:<QUANTITY>:<STOCK-ID>` format:
Expand Down Expand Up @@ -109,30 +110,44 @@ Following reservations were created:
- Product bike-123 was compensated by +2.000000 for stock 1
```

You can run both commands by piping `list-inconsistencies` and `create-compensations` to detect inconsistencies and immediately create compensations. Use the `-r` command option to generate and submit the raw data to `create-compensations`.
### Detect inconsistencies and create compensations

You can detect inconsistences and immediately create compensations by using a pipe to run both the `list-inconsistencies` and `create-compensations`. Use the `-r` command option to generate and submit the raw data to `create-compensations`.

```bash
bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations
```

Example response:

```terminal
```bash
bin/magento inventory:reservation:list-inconsistencies -r | bin/magento inventory:reservation:create-compensations
```

```terminal
Following reservations were created:
- Product bike-123 was compensated by +2.000000 for stock 1
- Product bikehat-456 was compensated by +1.000000 for stock 1
```

After updates complete, run the list command to verify:

```terminal
```bash
bin/magento inventory:reservation:list-inconsistencies -r

No order inconsistencies were found.
```

You can also pipe the commands to detect inconsistencies and create compensations for only incomplete (`-i`) or complete (`-c`) orders.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The line "No order inconsistencies were found." above is output. Separate the output from the input, as you did for the previous example.


```bash
bin/magento inventory:reservation:list-inconsistencies -r -i | bin/magento inventory:reservation:create-compensations
```

```bash
bin/magento inventory:reservation:list-inconsistencies -r -c | bin/magento inventory:reservation:create-compensations
```

## Import geocodes

{{site.data.var.im}} provides the [Distance Priority](https://docs.magento.com/m2/ce/user_guide/catalog/inventory-configure-distance-priority.html) algorithm, which helps determine the best option for shipping a full or partial order. The algorithm uses GPS information or geocodes to calculate the distance between the source (a warehouse or other physical location) of each item in an order and the shipping address. Based on those results, the algorithm recommends which source should be used to ship out each item in the order.
Expand Down