mirror of
https://github.com/HendrikRauh/inventree-app.git
synced 2026-01-14 12:06: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
|
|
@ -6,6 +6,7 @@ import "package:inventree/widget/po_line_list.dart";
|
|||
|
||||
import "package:inventree/api.dart";
|
||||
import "package:inventree/app_colors.dart";
|
||||
import "package:inventree/barcode/barcode.dart";
|
||||
import "package:inventree/helpers.dart";
|
||||
import "package:inventree/l10.dart";
|
||||
|
||||
|
|
@ -132,6 +133,29 @@ class _PurchaseOrderDetailState extends RefreshableState<PurchaseOrderDetailWidg
|
|||
);
|
||||
}
|
||||
|
||||
@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(purchaseOrder: order),
|
||||
);
|
||||
},
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return actions;
|
||||
}
|
||||
|
||||
|
||||
@override
|
||||
Future<void> request(BuildContext context) async {
|
||||
await order.reload();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue