2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-17 04:35:26 +00:00

Scan items into location from location context

This commit is contained in:
Oliver Walters
2021-02-17 08:57:08 +11:00
parent b7e9c06dfa
commit 24b7cfaede
4 changed files with 159 additions and 102 deletions

View File

@ -486,7 +486,7 @@ class InvenTreeStockItem extends InvenTreeModel {
return result;
}
Future<http.Response> transferStock(int location, {double quantity, String notes}) async {
Future<bool> transferStock(int location, {double quantity, String notes}) async {
if (quantity == null) {} else
if ((quantity < 0) || (quantity > this.quantity)) {
quantity = this.quantity;
@ -504,7 +504,9 @@ class InvenTreeStockItem extends InvenTreeModel {
data["item"]["quantity"] = "${quantity}";
}
return api.post("/stock/transfer/", body: data);
final response = await api.post("/stock/transfer/", body: data);
return (response.statusCode == 200);
}
}