Table: dbo.AR_Transaction
This table stores Invoices, Credit Memos, and Finance Charges for the Accounts Receivable service. Invoices and Finance Charges are transactions customers have to pay while Credit Memos are can be used to reduce open balance.
Columns
Name | Type | Constraints | Description
gl_transaction_KEY | int (4) | NOT NULL | Primary key for this table. AR Transactions are required to have a GL Transaction row.
customer_KEY | int (4) | NOT NULL | The customer the transaction is for.
ar_transaction_type_KEY | int (4) | NOT NULL | AR Transaction Type including Invoice, Credit Memo and Finance Charge.
transaction_status_KEY | int (4) | NOT NULL | Transaction status. Valid statuses for AR Transactions include Live, Voided, and Pending
transaction_date | smalldatetime (4) | NOT NULL | The date the transaction took place on.
reference_number | nvarchar (32) | NOT NULL | The reference number for the transaction.
payment_discount_amount_original | decimal (9, 2) | NOT NULL | A discount amount for making early payments. This field is for an original amount.
payment_discount_amount_override | decimal (9, 2) |  | An override field for payment discount amount.
payment_term_KEY | int (4) |  | An optional payment term for the transaction.
due_date | smalldatetime (4) |  | The due date for the transaction if applicable.
purchase_order_number | nvarchar (32) | NOT NULL | The purchase order number for the transaction.
gl_account_KEY | int (4) | NOT NULL | The AR Transaction GL Account.
payment_discount_expiration_date | smalldatetime (4) |  | The discount expiration date for the payment discount.
payment_discount__gl_account_KEY | int (4) |  | The gl account for the payment discount amount.
shipping__contact_address_type_KEY | int (4) |  | The type of contact address to use for shipping.
shipping_date | smalldatetime (4) |  | The date the items for the invoice shipped.
shipping_salutation | nvarchar (80) | NOT NULL | The salutation to use for the shipping name.
shipping_name | nvarchar (100) | NOT NULL | The name to use in the shipping address.
printed | bit (1) | NOT NULL | True if this AR_Transaction has ever been printed.
generated_by__transaction_template_KEY | int (4) |  | Specifies that this AR transaction was generated by a specific template. This link is important for template scheduling; we need to keep track of what has already been generated by a template. A null value indicates that it was not generated by a template.
reference_number_sortable | varchar (80) | NOT NULL | A system generated sortable reference number.
purchase_order_number_sortable | varchar (80) | NOT NULL | A system generated sortable purchase order number.
message | nvarchar (2000) | NOT NULL | A transaction message.
payment_discount_amount | decimal (9, 2) | NOT NULL | This payment discount amount field shows the override value if not null otherwise it shows the original amount.
created_date | datetime (8, 3) | NOT NULL | The date on which the AR transaction was created. To maintain consistency with the Payable_Transaction and Bank_Transaction_Event versions of created date, we want to use DATETIME instead of DATE and the local time value needs to be assigned rather than using UTC time.

Primary key
Name | Columns | Description
PK_AR_Transaction$gl_transaction_KEY | gl_transaction_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_AR_Transaction__AR_Transaction_Template__generated_by__transaction_template_KEY | generated_by__transaction_template_KEY | AR_Transaction_Template (transaction_template_KEY) |
FK_AR_Transaction__AR_Transaction_Type__ar_transaction_type_KEY | ar_transaction_type_KEY | AR_Transaction_Type (ar_transaction_type_KEY) |
FK_AR_Transaction__Contact_Address_Type__shipping__contact_address_type_KEY | shipping__contact_address_type_KEY | Contact_Address_Type (contact_address_type_KEY) |
FK_AR_Transaction__Customer__customer_KEY | customer_KEY | Customer (customer_KEY) |
FK_AR_Transaction__GL_Account__gl_account_KEY | gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Transaction__GL_Account__payment_discount__gl_account_KEY | payment_discount__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Transaction__GL_Transaction__gl_transaction_KEY | gl_transaction_KEY | GL_Transaction (gl_transaction_KEY) |
FK_AR_Transaction__Payment_Term__payment_term_KEY | payment_term_KEY | Payment_Term (payment_term_KEY) |
FK_AR_Transaction__Transaction_Status__transaction_status_KEY | transaction_status_KEY | Transaction_Status (transaction_status_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_Customer_Historical_AR_Transaction__AR_Transaction__gl_transaction_KEY | gl_transaction_KEY | Customer_Historical_AR_Transaction |
FK_AR_Transaction_Item__AR_Transaction__gl_transaction_KEY | gl_transaction_KEY | AR_Transaction_Item |
FK_AR_Transaction_Item__AR_Transaction__assessed_invoice__gl_transaction_KEY | assessed_invoice__gl_transaction_KEY | AR_Transaction_Item |
FK_Print_AR_Transaction_Selection__AR_Transaction__gl_transaction_KEY | gl_transaction_KEY | Print_AR_Transaction_Selection |
FK_AR_Payment_Application__AR_Transaction__receivable__gl_transaction_KEY | receivable__gl_transaction_KEY | AR_Payment_Application |