mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-15 19:55:27 +00:00
Send label printing information to the server
This commit is contained in:
2
lib/l10n
2
lib/l10n
Submodule lib/l10n updated: 8717eeeb0d...42662619b3
@ -205,9 +205,27 @@ class _StockItemDisplayState extends RefreshableState<StockDetailWidget> {
|
|||||||
"",
|
"",
|
||||||
fields,
|
fields,
|
||||||
icon: FontAwesomeIcons.print,
|
icon: FontAwesomeIcons.print,
|
||||||
onSuccess: (data) async {
|
onSuccess: (Map<String, dynamic> data) async {
|
||||||
print("Printing...");
|
int labelId = (data["label"] ?? -1) as int;
|
||||||
print(data.toString());
|
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,
|
||||||
|
);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user