Method to get the barcode
private ItemBarCode getBarcodeString(ItemId _itemId, InventDimId _inventDimId)
{
ItemBarCode barCodeString;
BarcodeSetupId barcodeSetupId = InventParameters::find().BarcodeSetupIdPick;
;
barCodeString = InventItemBarcode::findByProductDimensions(_itemId,
InventDim::find(_inventDimId),
false,false,barcodeSetupId,false).itemBarCode;
return barCodeString;
}
Method to get the encoded barcode string
private BarCodeString getEncodedBarCodeString(ItemId _itemId, InventDimId _inventDimId)
{
BarCodeString EncodedBarCodeString;
BarcodeSetupId barcodeSetupId = InventParameters::find().BarcodeSetupIdPick;
BarcodeSetup barcodeSetup = BarcodeSetup::find(barcodeSetupId);
Barcode barcode = barcodeSetup.barcode();
ItemBarCode itemBarCode;
;
itemBarCode = this.getBarcodeString(_itemId, _inventDimId);
if (barcodeSetup.validateBarcode(itemBarCode))
{
barcode.string(true, itemBarCode);
barcode.encode();
}
else
{
throw(error(strfmt("@SYS41409", barcode.barcodeType(), itemBarCode)));
}
EncodedBarCodeString = barcode.barcodeStr();
return EncodedBarCodeString;
}
private ItemBarCode getBarcodeString(ItemId _itemId, InventDimId _inventDimId)
{
ItemBarCode barCodeString;
BarcodeSetupId barcodeSetupId = InventParameters::find().BarcodeSetupIdPick;
;
barCodeString = InventItemBarcode::findByProductDimensions(_itemId,
InventDim::find(_inventDimId),
false,false,barcodeSetupId,false).itemBarCode;
return barCodeString;
}
Method to get the encoded barcode string
private BarCodeString getEncodedBarCodeString(ItemId _itemId, InventDimId _inventDimId)
{
BarCodeString EncodedBarCodeString;
BarcodeSetupId barcodeSetupId = InventParameters::find().BarcodeSetupIdPick;
BarcodeSetup barcodeSetup = BarcodeSetup::find(barcodeSetupId);
Barcode barcode = barcodeSetup.barcode();
ItemBarCode itemBarCode;
;
itemBarCode = this.getBarcodeString(_itemId, _inventDimId);
if (barcodeSetup.validateBarcode(itemBarCode))
{
barcode.string(true, itemBarCode);
barcode.encode();
}
else
{
throw(error(strfmt("@SYS41409", barcode.barcodeType(), itemBarCode)));
}
EncodedBarCodeString = barcode.barcodeStr();
return EncodedBarCodeString;
}
No comments:
Post a Comment