Bleep bleep


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


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.


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


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.


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?


The last transaction is two chocolates.


OK, thanks~~:slight_smile:


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