How Invoices Relate to Payments
Invoices have Invoice Detail records representing each line item that makes up the Invoice Total. Payments have Payment Detail records representing the line items paid for, which make up the Total Payment. The Invoice Detail and Payment Detail records are linked when a payment is made that pays for that line item of the invoice.
For example, someone registers online for both the Women's Conference ($100 Total, $25 Deposit) and Mother's Day Out ($35 Total, $5 Deposit). The $30 payment she makes at the time of registration covers the deposit for each event. Two weeks later, she receives an email reminding her to pay the outstanding balance. She makes a $105 payment from My Purchase History page to cover the remaining balance for each event.
The created records and their connections would look something like the following: