mirror of
https://github.com/inventree/inventree-app.git
synced 2025-04-30 22:46:49 +00:00
Send label printing information to the server
This commit is contained in:
parent
34fd68229d
commit
f2f652bfdc
2
lib/l10n
2
lib/l10n
@ -1 +1 @@
|
||||
Subproject commit 8717eeeb0d2ac2d406aec95cd9d0fcdf8609eb23
|
||||
Subproject commit 42662619b3d094e9bd41d3f715cac2beff7cf6f6
|
@ -205,9 +205,27 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
||||
"",
|
||||
fields,
|
||||
icon: FontAwesomeIcons.print,
|
||||
onSuccess: (data) async {
|
||||
print("Printing...");
|
||||
print(data.toString());
|
||||
onSuccess: (Map<String, dynamic> data) async {
|
||||
int labelId = (data["label"] ?? -1) as int;
|
||||
String pluginKey = (data["plugin"] ?? "") as String;
|
||||
|
||||
if (labelId != -1 && pluginKey.isNotEmpty) {
|
||||
String url = "/label/stock/${labelId}/print/?item=${item.pk}&plugin=${pluginKey}";
|
||||
|
||||
InvenTreeAPI().get(url).then((APIResponse response) {
|
||||
if (response.isValid() && response.statusCode == 200) {
|
||||
showSnackIcon(
|
||||
L10().printLabelSuccess,
|
||||
success: true
|
||||
);
|
||||
} else {
|
||||
showSnackIcon(
|
||||
L10().printLabelFailure,
|
||||
success: false,
|
||||
);
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user