AnsweredAssumed Answered

How to apply a second TO in a parallel manner

Question asked by GaoshengHuang on May 17, 2015
Latest reply on May 28, 2015 by philmodjunk


How to apply a second TO in a parallel manner


Dear all,

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!