2
0
mirror of https://github.com/inventree/inventree-app.git synced 2025-06-12 10:15:32 +00:00

Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint (#421)

* Add POReceiveBarcodeHandler to support barcode/po-receive/ endpoint

* Remove german translation

* Add api version checks

* Add getOverlayText method to barcode handler

* Bump required API version to 139

* Update barcode.dart

The "quantity" field is not an integer, and can cause the app to crash if not handled correctly

---------

Co-authored-by: Oliver <oliver.henry.walters@gmail.com>
This commit is contained in:
Bobbe
2023-10-19 14:28:32 +02:00
committed by GitHub
parent c76309341b
commit 67fd6a564a
7 changed files with 185 additions and 2 deletions

View File

@ -58,8 +58,9 @@ class BarcodeHandler {
*
* Returns true only if the barcode scanner should remain open
*/
Future<void> processBarcode(String barcode, {String url = "barcode/"}) async {
Future<void> processBarcode(String barcode,
{String url = "barcode/",
Map<String, dynamic> extra_data = const {}}) async {
debug("Scanned barcode data: '${barcode}'");
barcode = barcode.trim();
@ -82,6 +83,7 @@ class BarcodeHandler {
url,
body: {
"barcode": barcode,
...extra_data,
},
expectedStatusCode: null, // Do not show an error on "unexpected code"
);