applyPayments
On the current record (capID) this function takes any unapplied payments and distributes them to any invoiced fee items.
Version
2.0
Parameters
None
Notes
The function loops through all fee items and applies the payments until all funds are applied, or no more unpaid fee items remain.