Hi @timl,
Staff currently have to scan their ID badge to display their current balance and be provided the option to create a new IOU. The ID badge info is formatted like this:
###,FirstName LastName,Department
I am using this unique identifier to lookup/filter staff. I have Scan1 = IOUID. All staff have a starting balance that needs to be taken into account. So I have tested by setting up Table 1 as you showed, but added a column for their current balance. I have a second table as you have laid out. Upon pressing the checkout and confirm button, I have a Patch that looks up the users name based on scan1 and updates the current balance with the new iou they entered. This works fine.
Patch(StaffNames, First(Filter(StaffNames, StaffID1 = Scan1)), {GrandTotal: Sum(currentBalance, enterTotal)})
I have a Collect that adds the individual iou records to the table.
Collect(IOUTable, {IOUID: Scan1, Amount: "$" & enterTotal.Text, IOUDate: dateNow.Text})
This seems to work so far, but I would like to configure it so the table and Powerapp inputs are number/currency fields. When I change these I start to get errors and things stop working. Not sure how to configure those correctly.
Also, I understand that a payment by the employee would be registered as a negative value. However, staff are intended to use this app at certain locations to 'self' checkout. What is stopping them from just inputting the negative amount and basically stealing whatever items they choose? Currently we have this issue with people not actually recording their ious but I feel like this is worse.
Is there any way to force a positive value, and then I could create an IOU management app for those in charge of the IOU list, to be able to revise the records when the staff member pays their IOU?