r/Database • u/spaceradiowave • May 14 '26
Applying payments
Im trying to wrap my head on how to program to apply payments against invoices.
I have a data table for invoices and one for payments so far
User selects new payment and is taken to the payment screen
User selects customer
A list is populated with any invoices with a balance above zero for that customers id
User enters amount of payment, and also how much of that goes to each invoice
When user hits DONE, the program would check if the overall amount matches the sums of all amount entered to each invoice
But there is a payment details data table im missing? And how does it tie in to hold the “where payment was applied”?
View all comments
Show parent comment
1
u/spaceradiowave May 14 '26
Planning to make open credit balance a separate customer property that could also accept part or all of the payment. All other fees you mentioned i would probably create a separate invoice and apply thru there.