...
A BillingAccount simply allows for more organization of Invoices and
Payments related to things like the following (which is not an exhaustive
list by any means):
- keep track of "credit" available to a customer for purchase on
account - keep track of Payments in advance
- keep track of a sub-set of Payments and Invoices for a specific
client, ie allow them to have multiple billings accounts - allow multiple authorized parties to bill against the same account
which one party is responsible for paying
Perhaps the best way to see how these might work is just to look at the
data structure, and to do so with no assumptions but rather focusing on
finding questions instead of answers, and then once those questions are
laid out (perhaps on paper if need be) then find the answers to the
bigger picture.
...
A field on a BillingAccount entity records the value of Line of Credit issued to a Party billingAccount. If a Payment is received before Invoice or is a Customer Deposit, such payment can be applied to a BillingAccount.When a Payment is applied to a BillingAccount there should be a record in PaymentApplication, but if the PaymentApplication record(s) doesn't have the invoiceId field populated it should not be considered applied to an Invoice and therefore "consumed".