diff --git a/lib/api.dart b/lib/api.dart index e6d86e44..4cfc5978 100644 --- a/lib/api.dart +++ b/lib/api.dart @@ -619,7 +619,6 @@ class InvenTreeAPI { String _authorizationHeader(String username, String password) { if (_token.isNotEmpty) { - print("Using TOKEN: ${_token}"); return "Token $_token"; } else { return "Basic " + base64Encode(utf8.encode('${username}:${password}')); diff --git a/lib/inventree/stock.dart b/lib/inventree/stock.dart index 1f3e7e09..a54c6ec0 100644 --- a/lib/inventree/stock.dart +++ b/lib/inventree/stock.dart @@ -433,6 +433,8 @@ class InvenTreeStockItem extends InvenTreeModel { return false; } + print("Adjust stock: ${endpoint}"); + var response = await api.post( endpoint, body: { @@ -441,9 +443,12 @@ class InvenTreeStockItem extends InvenTreeModel { "quantity": "${q}", }, "notes": notes ?? '', - } + }, + expectedStatusCode: 200 ); + print("Adjustment completed!"); + if (response == null) { return false; } diff --git a/lib/widget/stock_detail.dart b/lib/widget/stock_detail.dart index 5075d435..1b009641 100644 --- a/lib/widget/stock_detail.dart +++ b/lib/widget/stock_detail.dart @@ -529,6 +529,7 @@ class _StockItemDisplayState extends RefreshableState { title: Text(I18N.of(context).countStock), leading: FaIcon(FontAwesomeIcons.checkCircle), onTap: _countStockDialog, + trailing: Text(item.quantityString), ) );