Table: dbo.Customer
A client specific table that stores the setup information defining a customer.
Columns
Name | Type | Constraints | Description
customer_KEY | int (4) | NOT NULL | Primary key for this table.
client_KEY | int (4) | NOT NULL | Foreign key. A Reference to the client that has this customer.
customer_id | nvarchar (22) | NOT NULL | The user defined unique identifier of the customer.
customer_name | nvarchar (100) | NOT NULL | The name of the customer.
is_prospect | bit (1) | NOT NULL | Indicates whether or not the customer is an actual customer or if the customer is a potential customer.
contact_KEY | int (4) | NOT NULL | Foreign key. The primary contact record for this customer.
ein_ssn | nvarchar (22) | NOT NULL | This field will hold the Fed Tax ID if the customer is a non-individual or it will hold the taxpayer SSN if the customer is an individual.
tax_exempt_number | nvarchar (32) | NOT NULL | The customer tax exempt number.
date_inactive | smalldatetime (4) |  | The date when the customer is made inactive. If null, the customer will be active.
inactive_reason | nvarchar (2000) | NOT NULL | The reason explaining why the Customer has been marked as inactive.
ar__gl_account_KEY | int (4) |  | Foreign key. Links the customer to one of the client`s accounts receivable GL Accounts. If null, the client has no receivable account for the customer.
payment_term_KEY | int (4) |  | Foreign key. Links the customer to the related Payment term. If null, the client has no payment term for the customer.
finance_charge_definition_KEY | int (4) |  | Foreign key. Links the customer to one of the related client`s finance charge definitions. The finance charge definition calculates the fees on a customer`s overdue balance. If null, the customer will not have finance charges.
purchase_order_number | nvarchar (32) | NOT NULL | Used as a default purchase order number for entering an AR transaction. Must not begin with a decimal or zero.
shipping__ar_item_KEY | int (4) |  | Foreign key. Links the customer to one of the related client`s accounts receivable shipping items. The shipping item contains the shipping charge information for the customer`s purchase. If null, the customer will not have shipping charges.
sales_tax__ar_item_KEY | int (4) |  | Foreign key. Links the customer to one of the related client`s accounts receivable sales tax items. The sales tax item contains the sales tax charge information for the customer`s purchase. If null, the customer will not have sales tax charges.
customer_message | nvarchar (2000) | NOT NULL | The customer message. Used as a default for entering an AR transaction.
credit_limit_amount | decimal (9, 2) |  | The maximum credit amount assigned to a customer. If null, there is no credit_limit_amount for the customer and the customer will not be able to receive a prompt indicating when the credit limit is reached.
enable_credit_limit_prompt | bit (1) | NOT NULL | Determines whether or not to prompt the user when the customer credit_limit_amount is reached.
enable_credit_hold | bit (1) | NOT NULL | Indicates whether or not there is a credit hold placed on the customer.
credit_hold_explanation | nvarchar (60) | NOT NULL | Explains why a customer has a credit hold.
customer_notes | nvarchar (480) | NOT NULL | Stores any notes the client has on the customer.
customer_id_sortable | nvarchar (96) | NOT NULL | A representation of the customer_id column that sorts in natural order. A trigger keeps this field synchronized with the content of customer_id.

Primary key
Name | Columns | Description
PK_Customer | customer_KEY |
Unique constraints
Name | Columns | Description
UK_Customer$client_KEY$customer_id | client_KEY, customer_id |
UK_Customer$contact_KEY | contact_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_Customer__AR_Item__sales_tax__ar_item_KEY | sales_tax__ar_item_KEY | AR_Item (ar_item_KEY) |
FK_Customer__AR_Item__shipping__ar_item_KEY | shipping__ar_item_KEY | AR_Item (ar_item_KEY) |
FK_Customer__Client__client_KEY | client_KEY | Client (client_KEY) |
FK_Customer__Contact__contact_KEY | contact_KEY | Contact (contact_KEY) |
FK_Customer__Finance_Charge_Definition__finance_charge_definition_KEY | finance_charge_definition_KEY | Finance_Charge_Definition (finance_charge_definition_KEY) |
FK_Customer__GL_Account__ar__gl_account_KEY | ar__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_Customer__Payment_Term__payment_term_KEY | payment_term_KEY | Payment_Term (payment_term_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_AR_Transaction_Template_N_Customer__Customer__customer_KEY | customer_KEY | AR_Transaction_Template_N_Customer |
FK_Spreadsheet_Import_Customer__Customer__customer_KEY | customer_KEY | Spreadsheet_Import_Customer |
FK_AR_Transaction__Customer__customer_KEY | customer_KEY | AR_Transaction |
FK_Print_Customer_Statement_Selection__Customer__customer_KEY | customer_KEY | Print_Customer_Statement_Selection |
FK_Apply_Customer_Payment_Transaction__Customer__customer_KEY | customer_KEY | Apply_Customer_Payment_Transaction |
FK_Custom_Value_Customer__Customer__customer_KEY | customer_KEY | Custom_Value_Customer |
FK_AR_Payment__Customer__customer_KEY | customer_KEY | AR_Payment |
FK_Manage_Customer_Payment__Customer__customer_KEY | customer_KEY | Manage_Customer_Payment |
FK_Customer_Historical_AR_Transaction__Customer__customer_KEY | customer_KEY | Customer_Historical_AR_Transaction |