Skip to content

Commit

Permalink
bug(Out Stock)
Browse files Browse the repository at this point in the history
- Use of another variable to check if the repository has inventories in
  stock for distribution instead of the vm.selectableInventories variable
  which is used in multiple times

closes #5098
  • Loading branch information
lomamech committed Nov 11, 2020
1 parent dea558c commit a110366
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion client/src/modules/stock/exit/exit.html
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ <h4 translate>STOCK.PRODUCT_NOT_AVAILABLE</h4>
ui-grid-resize-columns>
<bh-grid-loading-indicator
loading-state="StockCtrl.loading"
empty-state="StockCtrl.selectableInventories.length === 0"
empty-state="StockCtrl.emptyStock"
error-state="StockCtrl.hasError"
empty-state-message="STOCK.EMPTY">
</bh-grid-loading-indicator>
Expand Down
3 changes: 3 additions & 0 deletions client/src/modules/stock/exit/exit.js
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,9 @@ function StockExitController(
vm.loading = false;
vm.selectableInventories = inventories.filter(item => item.quantity > 0);

// Here we check directly if a Depot has inventories in stock available
vm.emptyStock = !vm.selectableInventories.length;

// map of inventories by inventory uuid
vm.mapSelectableInventories = new Store({ identifier : 'inventory_uuid', data : vm.selectableInventories });
checkValidity();
Expand Down

0 comments on commit a110366

Please sign in to comment.