Table contacts

Table contacts holds information regarding all customer, vendor, employee, and branch accounts. It is tightly coupled with table address_book. Table contacts holds the specific information whereas the addresses are stored in table address_book.

This table is updated through the maintain customer (or vendor, employee, branch) or added through the order process through the add/update checkbox.

Table Type: InnoDB

Field Type Default Description
id auto_increment N/A PRIMARY KEY - unique id assigned to each account entry
type char c INDEX - Defines the type of entry. Handy to know when building reports to specify as a hidden criteria  to filter out unwanted accounts. Defined types are:
c - Customer
v - Vendor
e - Employee
b - Branch
short_name varchar(20) NOT NULL INDEX - This field holds a short reference name (called Customer ID, Vendor ID, etc.) used to help organize the accounts. Acts as a unique identifer in a more user readable fashion than the id field.
inactive enum (0,1) 0 Flag to mark and account as inactive. Can be used to prevent orders to a account.
contact_first varchar (32) NULL Used for employee type accounts to hold the employee first name.
contact_middle varchar (32) NULL Used for employee type accounts to hold the employee middle name or initial
contact_lastvarchar (32)NULLUsed for employee type accounts to hold the employee last name
store_idvarchar (15)NOT NULL 
gl_type_accountvarchar (15)NOT NULLHolds the general ledger account to use as the default in the order screen. When set, this account will appear in the line item account position.
gov_id_numbervarchar (16)NOT NULLHolds the employee id number, tax resale number of the account
dept_rep_idvarchar (16)NOT NULLHolds the department rep id assigned to this account. When entered, the rep name will be inserted into the  sales rep entry field of the order screen.
account_numbervarchar (16)NOT NULLHolds an assigned customer or vendor account number. Useful on sales orders and purchase orders to identify your companies account number with your customer or supplier.
special_termsvarchar(32)0PhreeBooks allows individual payment terms by account. A value of 0 indicates that the default terms should be used. The value is encoded and can be changed in the Maintain Customer/Vendor screen.
first_datedate0000-00-00Set the first time the account is created. Useful to know how long the account has been active.
last_updatedateNULLIndicates the last time the account was updated. Useful to know when the last time the account was accessed.
last_date_1dateNULL
last_date_2dateNULL