At our store, we have run into some problems when people return an item in exchange for another item. When the transaction is recalled for return, the salesrepID from the original transaction appears on the returned items, which is what we want. However, the new items added to the transaction have the sales rep ID of the current POS session. In our particular circumstance we want the sales rep ID for the exchanged items to match the sales rep ID for the original transaction. We do not want to different rep IDs on the transaction.
I tried to solve this with a customization, here is a the piece of code that was supposed to make this happen:
With posSession.Transaction itemCount = .Entries.Count If .RecallType = RecallTransactionForReturn Then For x = 1 To .Entries.Count If .Entries(x).Quantity < 0 Then MyRep = .Entries(x).SalesRep End If Next x .LoadSalesRep (MyRep) End If End WIth
the code when triggered is supposed to check and see if the transaction is a return. if it is, then it loops through each entry on the transaction, looking for a quantity less then zero. If it finds one, it sets the value of the variable 'MyRep' equal to the salesrepID on that entry. Then I am trying to use LoadSalesRep to set the sales rep ID for the entire transaction equal to 'MyRep'.
this code is not working, because .Entries(x).SalesRep is not returning the salesrep for the entry (???) I'm not sure why. If I insert a msgbox into the code to see what it returns for this value during the loop, all it returns is a zero instead of a rep ID. i know there is a rep ID assigned to the recalled items, I can see it on screen.
can anyone see what is wrong with the above code, and why it wouldn't work correctly using .Entries(x).SalesRep?
thank you, kevin