/// <summary> /// Returns all RFID's that have not been used as ScanInfo[]. /// </summary> /// <returns></returns> public IScanInfo[] GetUnProcessedRFIDs() { try { //Get all the RFIDs currently in the PosisRfidTable that have not been used string sqlQry = " SELECT R.RFID, ISNULL(S.ITEMID, '') AS ITEMID " + " FROM POSISRFIDTABLE R " + " LEFT JOIN INVENTSERIAL S ON S.RFIDTAGID = R.RFID " + " WHERE TRANSACTIONID IS NULL "; DataTable RFIDtable = new DBUtil(Application.Settings.Database.Connection).GetTable(sqlQry); //Create the array of RfidInformation IScanInfo[] scanInfo = new IScanInfo[RFIDtable.Rows.Count]; int i = 0; foreach (DataRow row in RFIDtable.Rows) { scanInfo[i] = this.Application.BusinessLogic.Utility.CreateScanInfo(); scanInfo[i].ScanDataLabel = row["ITEMID"].ToString(); scanInfo[i].RFIDTag = row["RFID"].ToString(); scanInfo[i++].EntryType = BarcodeEntryType.MultiScanned; } return(scanInfo); } catch (Exception x) { LSRetailPosis.ApplicationExceptionHandler.HandleException("RFID.ProcessRFID", x); throw; } }
private void scanner_ScannerMessageEvent(IScanInfo scanInfo) { if (ScannerMessageEvent != null) { ScannerMessageEvent(scanInfo); } }
/// <summary> /// Returns barcode information as BarcodeInfo type. /// </summary> /// <param name="barcodeEntrytype"></param> /// <param name="barcode"></param> /// <returns></returns> public IBarcodeInfo ProcessBarcode(BarcodeEntryType barcodeEntrytype, string barcode) { IScanInfo scanInfo = this.Utility.CreateScanInfo(); scanInfo.ScanDataLabel = barcode; scanInfo.EntryType = barcodeEntrytype; return(ProcessBarcode(scanInfo)); }
private bool GetItemInfo(string barcode, bool skipDimensionDialog) { if (string.IsNullOrEmpty(barcode)) { return(false); } this.saleLineItem = (SaleLineItem)PurchaseOrderReceiving.InternalApplication.BusinessLogic.Utility.CreateSaleLineItem( ApplicationSettings.Terminal.StoreCurrency, PurchaseOrderReceiving.InternalApplication.Services.Rounding, posTransaction); IScanInfo scanInfo = PurchaseOrderReceiving.InternalApplication.BusinessLogic.Utility.CreateScanInfo(); scanInfo.ScanDataLabel = barcode; scanInfo.EntryType = BarcodeEntryType.ManuallyEntered; IBarcodeInfo barcodeInfo = PurchaseOrderReceiving.InternalApplication.Services.Barcode.ProcessBarcode(scanInfo); if ((barcodeInfo.InternalType == BarcodeInternalType.Item) && (barcodeInfo.ItemId != null)) { // The entry was a barcode which was found and now we have the item id... this.saleLineItem.ItemId = barcodeInfo.ItemId; this.saleLineItem.BarcodeId = barcodeInfo.BarcodeId; this.saleLineItem.SalesOrderUnitOfMeasure = barcodeInfo.UnitId; this.saleLineItem.EntryType = barcodeInfo.EntryType; this.saleLineItem.Dimension.ColorId = barcodeInfo.InventColorId; this.saleLineItem.Dimension.SizeId = barcodeInfo.InventSizeId; this.saleLineItem.Dimension.StyleId = barcodeInfo.InventStyleId; this.saleLineItem.Dimension.VariantId = barcodeInfo.VariantId; } else { // It could be an ItemId this.saleLineItem.ItemId = barcodeInfo.BarcodeId; this.saleLineItem.EntryType = barcodeInfo.EntryType; } // fetch all the addtional item properties PurchaseOrderReceiving.InternalApplication.Services.Item.ProcessItem(saleLineItem, true); if (saleLineItem.Found == false) { POSFormsManager.ShowPOSMessageDialog(2611); // Item not found. return(false); } else if ((saleLineItem.Dimension != null) && (saleLineItem.Dimension.EnterDimensions || !string.IsNullOrEmpty(saleLineItem.Dimension.VariantId)) && !skipDimensionDialog) { if (!barcodeInfo.Found) { return(OpenItemDimensionsDialog(barcodeInfo)); } } return(true); }
private void ProcessScannedItem(IScanInfo scanInfo) { if (scanInfo.ScanData.Length > 0) { padGiftCardNumber.EnteredValue = scanInfo.ScanData; padGiftCardNumber.Refresh(); PreExecute(); } }
private IClipImageSource CreateClipImage(DataRow clipImageRow, IScanInfo scanInfo) { ClipImage clipImage = new ClipImage(clipImageRow["ImageId"].ToString(), (ScanInfo)scanInfo) { Index = (int)(long)clipImageRow["Index"], ActiveArea = (ReferenceAreaEnum)clipImageRow["ActiveArea"], ImageType = clipImageRow["ImageType"].ToString(), IsCine = (bool)clipImageRow["IsCine"], MultiDisplayFormat = (MultiDisplayFormatEnum)clipImageRow["MultiDisplayFormat"], ImageSize = (long)clipImageRow["ImageSize"], TimeStamp = (DateTime)clipImageRow["TimeStamp"] }; return(clipImage); }
public void posScanner_DataEvent(int Status) { NetTracer.Information("Peripheral [Scanner] - data event status: {0}", Status); if (ScannerMessageEvent != null) { IScanInfo scanInfo = Peripherals.InternalApplication.BusinessLogic.Utility.CreateScanInfo(); scanInfo.ScanDataLabel = oposScanner.ScanDataLabel; scanInfo.ScanData = oposScanner.ScanData; scanInfo.ScanDataType = oposScanner.ScanDataType; scanInfo.EntryType = BarcodeEntryType.SingleScanned; ScannerMessageEvent(scanInfo); } }
private void OnBarcode_DataReceived(IScanInfo scanInfo) { ExtendedLogOnInfo extendedLogOnInfo = new ExtendedLogOnInfo() { LogOnType = ExtendedLogOnType.Barcode, LogOnKey = scanInfo.ScanData, Message = ApplicationLocalizer.Language.Translate(99408), // Bar code accepted. PasswordRequired = Functions.StaffBarcodeLogOnRequiresPassword }; FireDataReceived(extendedLogOnInfo); // Barcode scanner is auto-disabled, we need to enable again after event. barcodeReader.ReEnableForScan(); }
/// <summary> /// Occures when opos scanner is used. /// </summary> /// <param name="scannedMessage"></param> private void ProcessScannedItem(IScanInfo scanInfo) { clearItemInfo(); if (useScanner) { Dialog.InternalApplication.Services.Peripherals.Scanner.DisableForScan(); } numPad1.EnteredValue = scanInfo.ScanDataLabel; checkItemPrice(numPad1.EnteredValue); if (useScanner) { Dialog.InternalApplication.Services.Peripherals.Scanner.ReEnableForScan(); } }
void OnBarcodeScan(IScanInfo scanInfo) { InventoryLookup(scanInfo.ScanDataLabel); }
private bool GetItemInfo(string barcode) { System.Diagnostics.Debug.Assert(barcode != null, "barcode should not be null"); if (string.IsNullOrEmpty(barcode)) { return(false); } saleLineItem = (SaleLineItem)Dialog.InternalApplication.BusinessLogic.Utility.CreateSaleLineItem( ApplicationSettings.Terminal.StoreCurrency, Dialog.InternalApplication.Services.Rounding, posTransaction); IScanInfo scanInfo = Dialog.InternalApplication.BusinessLogic.Utility.CreateScanInfo(); scanInfo.ScanDataLabel = barcode; scanInfo.EntryType = BarcodeEntryType.ManuallyEntered; IBarcodeInfo barcodeInfo = Dialog.InternalApplication.BusinessLogic.Utility.CreateBarcodeInfo(); barcodeInfo = Dialog.InternalApplication.Services.Barcode.ProcessBarcode(scanInfo); if ((barcodeInfo.InternalType == BarcodeInternalType.Item) && (barcodeInfo.ItemId != null)) { // The entry was a barcode which was found and now we have the item id... saleLineItem.ItemId = barcodeInfo.ItemId; saleLineItem.BarcodeId = barcodeInfo.BarcodeId; saleLineItem.SalesOrderUnitOfMeasure = barcodeInfo.UnitId; if (barcodeInfo.BarcodeQuantity > 0) { saleLineItem.Quantity = barcodeInfo.BarcodeQuantity; } if (barcodeInfo.BarcodePrice > 0) { saleLineItem.Price = barcodeInfo.BarcodePrice; } saleLineItem.EntryType = barcodeInfo.EntryType; saleLineItem.Dimension.ColorId = barcodeInfo.InventColorId; saleLineItem.Dimension.SizeId = barcodeInfo.InventSizeId; saleLineItem.Dimension.StyleId = barcodeInfo.InventStyleId; saleLineItem.Dimension.ConfigId = barcodeInfo.ConfigId; saleLineItem.Dimension.VariantId = barcodeInfo.VariantId; } else { // It could be an ItemId saleLineItem.ItemId = barcodeInfo.BarcodeId; saleLineItem.EntryType = barcodeInfo.EntryType; } Dialog.InternalApplication.Services.Item.ProcessItem(saleLineItem, true); if (saleLineItem.Found == false) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSMessageDialog(2611); // Item not found. return(false); } //Color,Size,Style,config if (saleLineItem.Dimension.VariantId == null) { saleLineItem.Dimension.VariantId = string.Empty; } if (saleLineItem.Dimension.EnterDimensions) { LSRetailPosis.POSProcesses.SetDimensions dimensions = new LSRetailPosis.POSProcesses.SetDimensions(); dimensions.OperationID = PosisOperations.SetDimensions; dimensions.POSTransaction = (PosTransaction)posTransaction; dimensions.SaleLineItem = saleLineItem; dimensions.RunOperation(); } if (!saleLineItem.SalesOrderUnitOfMeasure.Equals(saleLineItem.InventOrderUnitOfMeasure, StringComparison.OrdinalIgnoreCase)) { UnitOfMeasureData uomData = new UnitOfMeasureData( ApplicationSettings.Database.LocalConnection, ApplicationSettings.Database.DATAAREAID, ApplicationSettings.Terminal.StorePrimaryId, Dialog.InternalApplication); saleLineItem.UnitQtyConversion = uomData.GetUOMFactor(saleLineItem.InventOrderUnitOfMeasure, saleLineItem.SalesOrderUnitOfMeasure, saleLineItem); } return(true); }
void Scanner_ScannerMessageEvent(IScanInfo scanInfo) { InventoryLookup(scanInfo.ScanDataLabel); }
public IBarcodeInfo ProcessBarcode(ISaleLineItem iSaleLineItem, IScanInfo scanInfo, IBarcodeInfo barcodeInfo, string barcode) { if (iSaleLineItem == null) { throw new ArgumentNullException("iSaleLineItem"); } // Caller can provide either barCode, scanIno or barCodeInfo object to process. if (barcodeInfo == null) { if (scanInfo == null) { if (string.IsNullOrWhiteSpace(barcode)) { throw new ArgumentNullException("barcode"); } scanInfo = this.Utility.CreateScanInfo(); scanInfo.ScanDataLabel = barcode; } barcodeInfo = ProcessBarcode(scanInfo); } SaleLineItem saleLineItem = (SaleLineItem)iSaleLineItem; // The barcodeInfo has already been populated by the ProcessInput operation, which triggered the ItemSale operation if ((barcodeInfo.InternalType == BarcodeInternalType.Item) && (barcodeInfo.ItemId != null)) { // The entry was a barcode which was found and now we have the item id... saleLineItem.ItemId = barcodeInfo.ItemId; saleLineItem.BarcodeId = barcodeInfo.BarcodeId; saleLineItem.SalesOrderUnitOfMeasure = barcodeInfo.UnitId; // Note that the following values will be set later (by Item): // saleLineItem.SalesOrderUnitOfMeasureName // saleLineItem.UnitQuantityFactor if (barcodeInfo.BarcodeQuantity > 0) { saleLineItem.Quantity = barcodeInfo.BarcodeQuantity; } saleLineItem.EntryType = barcodeInfo.EntryType; saleLineItem.Dimension.ColorId = barcodeInfo.InventColorId; saleLineItem.Dimension.SizeId = barcodeInfo.InventSizeId; saleLineItem.Dimension.StyleId = barcodeInfo.InventStyleId; saleLineItem.Dimension.ConfigId = barcodeInfo.ConfigId; } else { // It could be an ItemId saleLineItem.ItemId = barcodeInfo.BarcodeId; saleLineItem.EntryType = barcodeInfo.EntryType; } saleLineItem.Dimension.VariantId = barcodeInfo.VariantId; if (barcodeInfo.QtySold > 0) { saleLineItem.UnitQuantity = barcodeInfo.QtySold; } if (barcodeInfo.BarcodePrice > 0) { // If the item normally has a price, try to back-compute quantity based on the BarcodePrice. decimal defaultPrice = this.Application.Services.Price.GetItemPrice(saleLineItem.ItemId, saleLineItem.SalesOrderUnitOfMeasure); decimal price = barcodeInfo.BarcodePrice; // Determine if the barcoded price represents an extended price for a quantity > 1, // if so, get the default unit price, and back-calculate quantity. if ((defaultPrice != barcodeInfo.BarcodePrice) && (defaultPrice != decimal.Zero)) { decimal quantity = Convert.ToDecimal(this.Application.Services.Rounding.RoundQuantity(barcodeInfo.BarcodePrice / defaultPrice, barcodeInfo.UnitId)); saleLineItem.Quantity = quantity; price = defaultPrice; } saleLineItem.Price = price; saleLineItem.PriceInBarcode = true; } return(barcodeInfo); }
public IBarcodeInfo ProcessBarcode(IScanInfo scanInfo) { IBarcodeInfo barcodeInfo = this.Utility.CreateBarcodeInfo(); try { // The barcodeInfo is null and we need to populate it. The operation was triggered by i.e. a button or ItemSearch string barcodeid = scanInfo.ScanDataLabel; barcodeInfo.BarcodeId = barcodeid; barcodeInfo.ItemBarcode = barcodeid; barcodeInfo.EntryType = scanInfo.EntryType; barcodeInfo.TimeStarted = DateTime.Now; //If entered barcode contains "," or "." then it should be processed as an empty barcode if (barcodeid.Contains(",") || barcodeid.Contains(".")) { barcodeid = string.Empty; } if (string.IsNullOrEmpty(barcodeid)) { barcodeInfo.Found = false; } else { try { // If the input string that we are trying to identify contains any other caracters than numeric characters.... if (VerifyCheckDigit(barcodeInfo) == true) { barcodeInfo.CheckDigitValidated = true; } else { barcodeInfo.CheckDigitValidated = false; } } /// <exception cref="System.Exception">Thrown when the input string is not a barcode.</exception> catch (Exception) { } //Check if barcode is found as it was entered into the system. Find(barcodeInfo); //If not found, check if it is a maskable barcode. if (barcodeInfo.Found == false) { BarcodeMask barcodeMask = new BarcodeMask(Application.Settings.Database.Connection, Application.Settings.Database.DataAreaID); barcodeMask.Find(barcodeid); if (barcodeMask.Found == true) { barcodeInfo.MaskId = barcodeMask.MaskId; barcodeInfo.Prefix = barcodeMask.Prefix; barcodeInfo.InternalType = barcodeMask.InternalType; barcodeInfo.Symbology = barcodeMask.Symbology; barcodeInfo.BarcodePrice = 0; barcodeInfo.BarcodeQuantity = 0; barcodeInfo.DataEntry = string.Empty; barcodeInfo.EmployeeId = string.Empty; barcodeInfo.CouponId = string.Empty; barcodeInfo.EANLicenseId = string.Empty; barcodeInfo.CustomerId = string.Empty; barcodeInfo.DiscountCode = string.Empty; switch (barcodeMask.InternalType) { case BarcodeInternalType.Item: case BarcodeInternalType.Customer: case BarcodeInternalType.DataEntry: case BarcodeInternalType.Employee: case BarcodeInternalType.Salesperson: case BarcodeInternalType.Pharmacy: case BarcodeInternalType.DiscountCode: case BarcodeInternalType.GiftCard: case BarcodeInternalType.LoyaltyCard: ProcessMaskSegments(barcodeInfo); break; case BarcodeInternalType.Coupon: break; default: NetTracer.Warning("ProcessBarcode: Unsupported bardcode type {0}", barcodeMask.InternalType); break; } } } else { barcodeInfo.InternalType = BarcodeInternalType.Item; } } return(barcodeInfo); } finally { barcodeInfo.TimeFinished = DateTime.Now; barcodeInfo.TimeElapsed = barcodeInfo.TimeFinished - barcodeInfo.TimeStarted; } }
private void checkItemPrice(string barcode) { System.Diagnostics.Debug.Assert(barcode != null, "barcode should not be null."); if (string.IsNullOrEmpty(barcode)) { return; } SaleLineItem saleLineItem = (SaleLineItem)Dialog.InternalApplication.BusinessLogic.Utility.CreateSaleLineItem( ApplicationSettings.Terminal.StoreCurrency, Dialog.InternalApplication.Services.Rounding, posTransaction); IScanInfo scaninfo = Dialog.InternalApplication.BusinessLogic.Utility.CreateScanInfo(); scaninfo.ScanDataLabel = barcode; IBarcodeInfo barcodeInfo = Dialog.InternalApplication.Services.Barcode.ProcessBarcode(scaninfo); if ((barcodeInfo.InternalType == BarcodeInternalType.Item) && (barcodeInfo.ItemId != null)) { // The entry was a barcode which was found and now we have the item id... saleLineItem.ItemId = barcodeInfo.ItemId; saleLineItem.BarcodeId = barcodeInfo.BarcodeId; saleLineItem.SalesOrderUnitOfMeasure = barcodeInfo.UnitId; if (barcodeInfo.BarcodeQuantity > 0) { saleLineItem.Quantity = barcodeInfo.BarcodeQuantity; } else { saleLineItem.Quantity = 1; } if (barcodeInfo.BarcodePrice > 0) { saleLineItem.Price = barcodeInfo.BarcodePrice; } saleLineItem.EntryType = barcodeInfo.EntryType; //saleLineItem.DimensionGroupId = barcodeInfo.DimensionGroupId; saleLineItem.Dimension.ColorId = barcodeInfo.InventColorId; saleLineItem.Dimension.SizeId = barcodeInfo.InventSizeId; saleLineItem.Dimension.StyleId = barcodeInfo.InventStyleId; saleLineItem.Dimension.VariantId = barcodeInfo.VariantId; } else { saleLineItem.ItemId = barcodeInfo.BarcodeId; saleLineItem.EntryType = barcodeInfo.EntryType; saleLineItem.Quantity = 1; } Dialog.InternalApplication.Services.Item.ProcessItem(saleLineItem, true); if (!saleLineItem.Found) { LSRetailPosis.POSProcesses.POSFormsManager.ShowPOSMessageDialog(3341); } else { //Color,Size,Style,Config if (saleLineItem.Dimension.EnterDimensions) { if (!SetItemDimensions(saleLineItem)) { return; } } // Create a deep copy of the transaction to get the correct price calculation. RetailTransaction tempTransaction = (RetailTransaction)this.posTransaction.CloneTransaction(); tempTransaction.Add(saleLineItem); // Get the item info... // Get the price, tax and discount info Dialog.InternalApplication.BusinessLogic.ItemSystem.CalculatePriceTaxDiscount(tempTransaction); saleLineItem = tempTransaction.GetItem(saleLineItem.LineId); saleLineItem.CalculateLine(); // Find the last ItemSale entry.. LinkedListNode <SaleLineItem> lastItem = tempTransaction.SaleItems.Last; ISaleLineItem lineItem = lastItem.Value; this.ItemId = lineItem.ItemId; this.ItemDescription = lineItem.Description; this.Price = lineItem.NetAmount; this.CustomerId = tempTransaction.Customer.CustomerId; this.CustomerName = tempTransaction.Customer.Name; loadItemInfo(); this.barcode = numPad1.EnteredValue; } numPad1.ClearValue(); }