I am currently trying to design a membership type database design that can keep track of monthly payments. I have a couple tables one for keeping track of MEMBERS another to keep track of PLANTYPES(ex. individualmembership plus cost $25.00) or employeemembership plus cost $15.00) which includes a Cost field.
I also have a DUES table where I am trying to keep track of Membership Fees depending on the plan type that is assigned to each member. So the question I have is, so far I have the following fields
DUAAMT, PAID(YES OR NO), DESC(COMMENTS),MEMID(LINKED FIELD TO MEMBERS TABLE),
PID(LINKED FIELD TO THE PLANTYPES TABLE)
I am having trouble figuring out the proper way to keep track of how much the member owes for that month, also what if they paid extra how would I keep track of that?
My idea was to have a Credit a field where any extra money paid would sit in this field and once the month is due I would check if the member had any existing credit first if not they would owe the full amount due that month.
The dues are monthly?
You need to define a Transaction table.
The Dues table would define the dues amount and things like the amount and due date.
Every day (or week or month), you run a process that appends a transaction to the Transaction table. This adjusts the balance by the dues amount.
When the member pays his dues, an opposite transaction is applied to the Transaction table, and the balance goes to 0. If the member overpays, the overpayment simply results in a positive balance.
You can create views that show member balances, members with due payments, and overdue members just by getting the latest transaction for each member and filtering by balance and by date.
You have 1 dues per member per plan.
You have 1 transaction for every time a member is charged or makes a payment, so typically 2 transactions per month.
So you would have:
Dues: MemberID, PlanID, DueDate
Transaction: MemberID, TransactionID, Amount, Date, Type (Dues, Payment, Purchase), RunningBalance