mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 03:56:24 +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:
parent
c76309341b
commit
67fd6a564a
7 changed files with 185 additions and 2 deletions
|
|
@ -9,6 +9,7 @@ import "package:inventree/widget/purchase_order_detail.dart";
|
|||
import "package:inventree/widget/refreshable_state.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/barcode/barcode.dart";
|
||||
import "package:inventree/inventree/purchase_order.dart";
|
||||
|
||||
/*
|
||||
|
|
@ -79,6 +80,28 @@ class _PurchaseOrderListWidgetState extends RefreshableState<PurchaseOrderListWi
|
|||
);
|
||||
}
|
||||
|
||||
@override
|
||||
List<SpeedDialChild> barcodeButtons(BuildContext context) {
|
||||
List<SpeedDialChild> actions = [];
|
||||
|
||||
if (api.supportsBarcodePOReceiveEndpoint) {
|
||||
actions.add(
|
||||
SpeedDialChild(
|
||||
child: Icon(Icons.barcode_reader),
|
||||
label: L10().scanReceivedParts,
|
||||
onTap:() async {
|
||||
scanBarcode(
|
||||
context,
|
||||
handler: POReceiveBarcodeHandler(),
|
||||
);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
@override
|
||||
Widget getBody(BuildContext context) {
|
||||
return PaginatedPurchaseOrderList(filters);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue