Table: dbo.AR_Payment_Application
Each row in this table represents a payment being applied to a receivable. A payment is either a credit memo (an AR_Transaction of type Credit Memo) or an AR payment (an AR_Payment of any type). A receivable is a regular invoice or a finance charge invoice (an AR_Transaction of type Invoice or Finance Charge). The receivable and payment must belong to the same customer. A given receivable can have multiple payments applied to it until its open balance is zero. A given payment can be applied until its unused amount is zero.
Columns
NameTypeConstraintsDescription
gl_transaction_KEYint (4)NOT NULLThis foreign key is the primary key for the table. The associated GL transaction row contains the GL period and journal that the distribution affects.
receivable__gl_transaction_KEYint (4)NOT NULLThis required foreign key identifies the receivable being paid by the payment. A receivable is a regular invoice or a finance charge invoice (an AR_Transaction of type Invoice or Finance Charge).
payment__gl_transaction_KEYint (4)NOT NULLThis required foreign key identifies the payment paying the receivable. A payment is either a credit memo (an AR_Transaction of type Credit Memo) or an AR payment (an AR_Payment of any type).
application_datesmalldatetime (4)NOT NULLThis is the date that the payment was applied to the receivable. This is only a date; the time portion is always set to midnight.
was_applied_at_payment_creationbit (1)NOT NULLThis boolean is set true if the payment application was made at the time the payment was created. This information is needed to properly determine the amount that hits the unearned revenue account. Monies applied when the payment is created should never count as unearned revenue.
Primary key
NameColumnsDescription
PK_AR_Payment_Application$gl_transaction_KEYgl_transaction_KEY
Foreign keys
NameColumnsReferenced tableDescription
FK_AR_Payment_Application__AR_Transaction__receivable__gl_transaction_KEYreceivable__gl_transaction_KEYAR_Transaction (gl_transaction_KEY)
FK_AR_Payment_Application__GL_Transaction__gl_transaction_KEYgl_transaction_KEYGL_Transaction (gl_transaction_KEY)
FK_AR_Payment_Application__GL_Transaction__payment__gl_transaction_KEYpayment__gl_transaction_KEYGL_Transaction (gl_transaction_KEY)
Incoming foreign keys
NameColumnsReferencing tableDescription
FK_AR_Payment_Application_Distribution__AR_Payment_Application__payment_application__gl_transaction_KEYpayment_application__gl_transaction_KEYAR_Payment_Application_Distribution

Schema diagram