mirror of
https://github.com/inventree/inventree-app.git
synced 2025-06-16 12:15:31 +00:00
[refactor] Scan improvements (#577)
* Handle error on unexpected barcode response * Add ManufacturerPart detail view * Support barcode scanning for manufacturer part * Refactoring for null checks * Ignore selected errors in sentry * Fix API implementation for ManufacturerPart * Update release notes * More error handling * Decode quantity betterer * Refactoring * Add option to confirm checkin details * Improve response handlign * Cleanup * Remove unused imports * Fix async function * Fix for assigning custom barcode * Handle barcode scan result for company * Fix * Adjust scan priority * Refactoring MODEL_TYPE - Use instead of duplicated const strings * @override fix
This commit is contained in:
@ -33,7 +33,7 @@ class BarcodeScanStockLocationHandler extends BarcodeHandler {
|
||||
|
||||
// We expect that the barcode points to a 'stocklocation'
|
||||
if (data.containsKey("stocklocation")) {
|
||||
int _loc = (data["stocklocation"]["pk"] ?? -1) as int;
|
||||
int _loc = (data["stocklocation"]?["pk"] ?? -1) as int;
|
||||
|
||||
// A valid stock location!
|
||||
if (_loc > 0) {
|
||||
@ -83,7 +83,7 @@ class BarcodeScanStockItemHandler extends BarcodeHandler {
|
||||
Future<void> onBarcodeMatched(Map<String, dynamic> data) async {
|
||||
// We expect that the barcode points to a 'stockitem'
|
||||
if (data.containsKey("stockitem")) {
|
||||
int _item = (data["stockitem"]["pk"] ?? -1) as int;
|
||||
int _item = (data["stockitem"]?["pk"] ?? -1) as int;
|
||||
|
||||
// A valid stock location!
|
||||
if (_item > 0) {
|
||||
|
Reference in New Issue
Block a user