...
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 therein 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".