Bleep bleep


#1

It seems the method voidLastTransaction() deletes all the 4 chocolates. Could anybody explain why? Thanks.


#2

Because the four chocolates are scanned in a single transaction. It is the transaction that is voided, not the individual items. That is why we re-scan the new amount of three.


#3

I understand, thanks. Can we figure out a way to just delete one item?


#4

How about n items? That would be more practical, perhaps? It adds a new problem based upon the assumption that n items exist in the register. Voiding a transaction does not assume any items, just a transaction. There is a big difference, and different logging in play.


#5

Does lastTransactionAmount mean the last transaction we scanned which means we can't use the voidLastTransaction method to delete 'eggs' 'milk' or 'magazine'?
Since four chocolates are considered one transaction, I wonder what is the standard for one transaction, since we scan one item by one item. What if we scan an egg and a chocolate and an egg and two chocolates? What is the transaction for this sequence?


#6

The last transaction is two chocolates.


#7

OK, thanks~~:slight_smile:


#8

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.