How to apply a second TO in a parallel manner
I am working on a database that captures transaction appointments for a family business. I have a Voucher table, which records discounted vouchers prepaid by some willing customers, on top of a Staff(who services customers) table, Customer table, Appointments table. So for each visit, the amount applied (VAmountApplied) is put into the Appointment table, and then added to the TotalAmountedUsed and meantime deducted from balance in Voucher table.
This seems to be working until I come across another situation: a customer may bring their family or friends and want to apply his/her voucher. I tried creating a second TO of Voucher and related it to Appointments or Customers, but neither could get the balance correct.
Did I do something wrong with the calculation? OR is there a better arrangement?
I would appreciate your suggestions!