Hello! I have this system like an inventory list. If I pick product, select quantity and input the cash amount, I finish inputting my details. but I want to either save or delete the transaction (using TinyDB). Then this saved transactions will appear on the list view on the other screen called Inventory. How can I do it?
A transaction must be unique, even when other transactions are identical. So when you save a transaction, you must apply something like a record number, which could be a date and time instance - this would be your TinyDB tag too. You should also store a transaction date for later search purposes.
The issue you have in saving your transactions is their complexity, being a mixture of lists of lists and individual text items and, I think, the length of the lists of lists per transaction is a variable. If that can be simplified, you might be able to save some of your hair from going grey.
I would store the list on a per item basis. This would also help to report progress to the User inputting the transaction, for example the User inputs or selects an item and quantity, adds that to the current transaction and the App reports the item price, total price for the quantity of the item and total price thus far of all items added to the transaction. Store the transaction when it is completed.
Add Items To Items_List
Item1
Price
Quantity
Total Price
Item2
Price
Quantity
Total Price ....etc
Since we don't know how many Items_Lists there are, make a List of Transaction date and time, total price, cash and change first, then add that to the Transaction_List, followed by the Items_Lists (loop through), and save to TinyDB.
Hello Sandra
We would definitely need to see your project (.aia) to understand what happens or doesn't happen. That will no doubt be time consuming and all the Power Users are busy, so you won't get an immediate response.