Post date: Jul 04, 2011 12:30:39 AM
'Prepays' are advance deposits that a customer might put on an order. Because there is no invoice when the order is first placed, the customer's advance can't be applied against an invoice. So it is held as a credit to the account until an invoice is created. The prepay is entered in the 'Cash entry' function, and the order number is identified on the prepay entry. At some point later, during a batch posting, the system finds an invoice created for that order number, and tries to apply the prepay against that invoice. If the prepay doesn't get linked to an invoice automatically, it can be manually linked by using an 'Apply-to' entry.
Here's a description of the logic used when the posting process links prepays automatically:
Within the batch posting process, after the transactions are created, and all the 'matching lines' are created (these are the 'applying' lines that link the transactions to each other, e.g. the cash receipts linkage to invoices, etc.), the program gets a list of all the customers in the batch. Next, it gets a list of all the 'prepay' transactions with a current amount (i.e., all those that have NOT been linked to invoices) for those customers.
For each of these unlinked prepays, it looks for an open, non-retainage invoice that's eligible to be paid with the prepay. To be 'eligible' for linking, the invoice must be for the same customer, it must have the same order number as the prepay, and it must have a current amount equal to or greater than the prepay. If more than one eligible invoice is found, it chooses the oldest invoice, and links the prepay to that invoice.
In the General Ledger, this linkage generates a credit to the Accounts Receivable Control account (reducing the amount in A/R) and a debit to a 'Prepay Liability' (or 'Customer Deposit') account, reducing the amount in the Prepay Liability account.