Table: dbo.AR_Item
This table stores setup information for AR items.
Columns
Name | Type | Constraints | Description
ar_item_KEY | int (4) | NOT NULL | Primary key for this table.
client_KEY | int (4) | NOT NULL | key to the client.
ar_item_id | nvarchar (22) | NOT NULL | The id for the ar_item.
description | nvarchar (2000) | NOT NULL | The description for the ar_item.
ar_item_type_KEY | int (4) | NOT NULL | The ar_item type.
inactive_date | smalldatetime (4) |  | If set this is the date the ar_item becomes inactive.
sales_price | decimal (9, 4) | NOT NULL | The sales price of the ar_item.
sales__gl_account_KEY | int (4) |  | The sales gl account.
purchase_cost | decimal (9, 4) | NOT NULL | The purchase cost of the ar_item.
cost__gl_account_KEY | int (4) |  | The purchase cost of sales gl account.
inventory__gl_account_KEY | int (4) |  | The inventory gl account.
ar_item_tax_status_KEY | int (4) | NOT NULL | The tax status.
taxing_authority_KEY | int (4) |  | Key to the taxing authority table which stores the sales tax description we are interested in.
tax__gl_account_KEY | int (4) |  | The tax gl account.
additional_charge_percentage | decimal (5, 4) | NOT NULL | The percentage of additional charge.
additional_charge_amount | decimal (9, 4) | NOT NULL | the amount of additional charge.
additional_charge__gl_account_KEY | int (4) |  | The additional charge gl account.
eligible_for_discount | bit (1) | NOT NULL | The eligibility for discount on the item.
discount__gl_account_KEY | int (4) |  | Used by the filter system which expects separate fields for each gl account. Not splitting these out would result in getting both kinds of accounts when only one kind was desired.
other_charge__gl_account_KEY | int (4) |  | Used by the filter system which expects separate fields for each gl account. Not splitting these out would result in getting both kinds of accounts when only one kind was desired.
active_status_KEY | int (4) | NOT NULL | New column to fetch the status based on the inactive date. Note: not a true FK since 'Active_Status' doesn't exist. Allowed values are 1 (active) and 2 (inactive).
ar_item_id_sortable | varchar (48) | NOT NULL | The sortable id for the ar_item.
additional_charge__payment_term_discount_method_KEY | tinyint (1) | NOT NULL | The selected method determines if this ar_item uses a percentage or an amount.

Primary key
Name | Columns | Description
PK_AR_Item | ar_item_KEY |
Unique constraints
Name | Columns | Description
UK_AR_Item$ar_item_id$client_KEY | ar_item_id, client_KEY |

Foreign keys
Name | Columns | Referenced table | Description
FK_AR_Item__Payment_Term_Discount_Method__additional_charge__payment_term_discount_method_KEY | additional_charge__payment_term_discount_method_KEY | Payment_Term_Discount_Method (payment_term_discount_method_KEY) |
FK_AR_Item__AR_Item_Tax_Status__ar_item_tax_status_KEY | ar_item_tax_status_KEY | AR_Item_Tax_Status (ar_item_tax_status_KEY) |
FK_AR_Item__AR_Item_Type__ar_item_type_KEY | ar_item_type_KEY | AR_Item_Type (ar_item_type_KEY) |
FK_AR_Item__Client__client_KEY | client_KEY | Client (client_KEY) |
FK_AR_Item__GL_Account__additional_charge__gl_account_KEY | additional_charge__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__cost__gl_account_KEY | cost__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__discount__gl_account_KEY | discount__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__inventory__gl_account_KEY | inventory__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__other_charge__gl_account_KEY | other_charge__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__sales__gl_account_KEY | sales__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__GL_Account__tax__gl_account_KEY | tax__gl_account_KEY | GL_Account (gl_account_KEY) |
FK_AR_Item__Taxing_Authority__taxing_authority_KEY | taxing_authority_KEY | Taxing_Authority (taxing_authority_KEY) |

Incoming foreign keys
Name | Columns | Referencing table | Description
FK_AR_Item_Group__AR_Item__group__ar_item_KEY | group__ar_item_KEY | AR_Item_Group |
FK_AR_Item_Group__AR_Item__member__ar_item_KEY | member__ar_item_KEY | AR_Item_Group |
FK_AR_Transaction_Template_Item__AR_Item__ar_item_KEY | ar_item_KEY | AR_Transaction_Template_Item |
FK_Spreadsheet_Import_AR_Item__AR_Item__ar_item_KEY | ar_item_KEY | Spreadsheet_Import_AR_Item |
FK_Customer__AR_Item__sales_tax__ar_item_KEY | sales_tax__ar_item_KEY | Customer |
FK_Customer__AR_Item__shipping__ar_item_KEY | shipping__ar_item_KEY | Customer |
FK_AR_Transaction_Item_N_AR_Item__AR_Item__ar_item_KEY | ar_item_KEY | AR_Transaction_Item_N_AR_Item |