Weight counter for POS

Hello, we do a doorcheck, with a totalquantity counter displayed on the status.htm and the receipt.

However, for weighed items, it doesn't show a piece count, it shows a total unit count.

For instance: 5.2 lb of bratwurst and 1 can of sauerkraut = 6.2 pieces NOT 2 pieces

I need to apply something like this to the status.htm to properly calculate

For Each Transaction.Entry If Entry.Itemtype=6 Then weighteval = Entry.Quantity - 1 weightpool = weightpool + weighteval End If

Then weightpool can be subtracted from the totalquantity.

Can someone advise me to properly construct a for evaluation within status.htm

Thanks!

Kevin

Reply to
Fisher
Loading thread data ...

For some reason, once I use one weight item (Item Type 6), it loses track of things... I've tried it at various points of the IF loops for status.htm

Any thoughts?

Dim TimerID

' ------------------------------------ ' displayVariables ' ------------------------------------

Function displayVariables On Error Resume Next

Dim QSRules Dim Entry Dim TransasctionItem Dim txtItemLookupCode Dim txtDescription Dim txtPrice Dim txtQuantity Dim txtExtended Dim PictureFileName Dim PictureFileName2 Dim txtPictureextension Dim weightcount

Dim RS Dim SQL Dim Conn

Set QSRules = qsBridge.RequestQSRules()

txtDescription = " " txtQuantity = " " txtPrice = " " txtExtended = " " txtPicture = "" txtPicture2 = "" txtPictureextension = ".jpg" SQL = ""

Set RS = Nothing

Set Entry = Nothing Set TransactionItem = Nothing PictureFileName = "transparent.gif" PictureFileName2 = "transparent.gif"

If Not QSRules Is Nothing Then

' This line is valid after version 1.07 Set Entry QSRules.Transaction.Entries(QSRules.Transaction.CurrentEntryKey)

If Entry Is Nothing then Set Entry QSRules.Transaction.Entries(QSRules.Transaction.Entries.Count) End If '************************************************** 'PROBLEM CODE' If Entry.Item.Itemtype = 6 Then weightcount = weightcount + 1 'weightcount = Entry.Item.Weight - (Entry.Item.Weight - 1) End If '*************************************************** If Not Entry Is Nothing Then txtDescription = Entry.Description txtQuantity = Entry.Quantity txtPrice = FormatCurrency(Entry.Price) txtExtended = FormatCurrency(Entry.ExtendedPrice)

SQL = "SELECT PictureName FROM Item WHERE ItemLookupCode = '"

  • Entry.Item.ItemLookupcode + "'" Set Rs = QSRules.OpenRecordSet((SQL),(-1)) If Not Rs.EOF Then PictureFileName = Rs("PictureName") if (len(PictureFileName) < 1) then PictureFileName "transparent.gif" Else PictureFileName = "transparent.gif" End If End If End If

PictureFileName2 = Entry.Item.ItemLookupcode & txtPictureextension

Picture.src = "C:\Program Files\Microsoft Retail Management System\Store Operations\Pictures\" & PictureFileName Picture2.src = "C:\Program Files\Microsoft Retail Management System\Store Operations\Pictures\" & PictureFileName2

'txtTotalQuantityPurchased.innerText QSRules.Transaction.TotalQuantityPurchased + QSRules.Transaction.TotalQuantityOnOrder txtTotalQuantityPurchased.innerText QSRules.Transaction.TotalQuantityPurchased + QSRules.Transaction.TotalQuantityOnOrder - QSRules.Transaction.TotalWeightPurchased + weightcount End Function

Function doStartup

' use a timer to run displayVariables() periodically every second TimerID = window.setInterval("displayVariables()", 100)

End Function

Reply to
Fisher

Having done that, my counter continuously increments when an ItemType 6 (weighed) item is present. So my weight item line item causes the timer interval to re-read and re-evaluate the statement ad infinitum.

If I quickly scan and set the update timer to 1000, I can prevent the counter from incrementing. But, I know the cashiers won't always be as vigilant. Is there a pause or break function for the counter to leave a window of opportunity for the scale to be queried?

Thanks for the prompt response, hopefully I can iron this out! Kevin

Reply to
Fisher

Everytime your function runs, you are re-declaring the weightcount variable. Declare the variable outside of the function (where TimerID is)

Reply to
Glenn Adams [MVP - Retail Mgmt]

Admittedly, I'm not as familiar with VBScript as I'd like to be. I think a sub call would work theoretically. Since this info is tied to displayVariables in the Status.htm, I would like to call the sub from there and also reset the checkcount variable or make it dynamic to account for multiple items that are weighed. Thanks for your help so far:

Sub weightcheck()

do while checkcount < 1 'checkcount allows the procedure to be called once 'I need to reset the counter after the item has been entered

If Entry.Item.Itemtype=6 Then weightcount = weightcount + 1 End If

'Item Type 6 = weighed item 'weightcount is factored into overall quantity of items scanned checkcount=checkcount+1 loop End Sub

Reply to
Fisher

BeanSmart website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.