mirror of
https://github.com/inventree/inventree-app.git
synced 2025-05-16 05:53:10 +00:00
Fixes for stock adjustment
This commit is contained in:
parent
b8c535560d
commit
27a6025c32
@ -619,7 +619,6 @@ class InvenTreeAPI {
|
|||||||
|
|
||||||
String _authorizationHeader(String username, String password) {
|
String _authorizationHeader(String username, String password) {
|
||||||
if (_token.isNotEmpty) {
|
if (_token.isNotEmpty) {
|
||||||
print("Using TOKEN: ${_token}");
|
|
||||||
return "Token $_token";
|
return "Token $_token";
|
||||||
} else {
|
} else {
|
||||||
return "Basic " + base64Encode(utf8.encode('${username}:${password}'));
|
return "Basic " + base64Encode(utf8.encode('${username}:${password}'));
|
||||||
|
@ -433,6 +433,8 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
print("Adjust stock: ${endpoint}");
|
||||||
|
|
||||||
var response = await api.post(
|
var response = await api.post(
|
||||||
endpoint,
|
endpoint,
|
||||||
body: {
|
body: {
|
||||||
@ -441,9 +443,12 @@ class InvenTreeStockItem extends InvenTreeModel {
|
|||||||
"quantity": "${q}",
|
"quantity": "${q}",
|
||||||
},
|
},
|
||||||
"notes": notes ?? '',
|
"notes": notes ?? '',
|
||||||
}
|
},
|
||||||
|
expectedStatusCode: 200
|
||||||
);
|
);
|
||||||
|
|
||||||
|
print("Adjustment completed!");
|
||||||
|
|
||||||
if (response == null) {
|
if (response == null) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
@ -529,6 +529,7 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
title: Text(I18N.of(context).countStock),
|
title: Text(I18N.of(context).countStock),
|
||||||
leading: FaIcon(FontAwesomeIcons.checkCircle),
|
leading: FaIcon(FontAwesomeIcons.checkCircle),
|
||||||
onTap: _countStockDialog,
|
onTap: _countStockDialog,
|
||||||
|
trailing: Text(item.quantityString),
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user