Table: invoice

Columns
  Column Name Data Type Default
Value
References
Table
Foreign Key
Name
1. PK invoice_key decimal(15)      
2.   invoice_number varchar(50)      
3.   invoice_date datetime      
4.   project_key decimal(15)   project fk_invoice1
5.   customer_key decimal(15)   customer fk_invoice9
6.   billed_organization_key decimal(15)   customer fk_invoice10
7.   billed_account_key decimal(15)   account fk_invoice11
8.   created_by decimal(15)   person fk_invoice2
9.   created_date datetime      
10.   completed_by decimal(15)   person fk_invoice3
11.   completed_date datetime      
12.   extracted_by decimal(15)      
13.   extracted_date datetime      
14.   amount decimal(18,2)      
15.   discount_amount decimal(18,2)      
16.   billing_through datetime      
17.   payment_term_key decimal(15)   payment_term fk_invoice4
18.   due_date datetime      
19.   discount_date datetime      
20.   contract_number varchar(25)      
21.   order_number varchar(25)      
22.   funded_value decimal(15,2)      
23.   company_logo decimal(15)   image_setup fk_invoice6
24.   memo varchar(2000)      
25.   description varchar(2000)      
26.   show_proj_code char(1) ('N')    
27.   show_proj_title char(1) ('N')    
28.   show_proj_funded_value char(1) ('N')    
29.   show_company_logo char(1) ('N')    
30.   show_contract_number char(1) ('N')    
31.   show_order_number char(1) ('N')    
32.   invoice_format_key decimal(15)   invoice_format fk_invoice5
33.   voided_invoice_key decimal(15)   invoice fk_invoice7
34.   voiding_invoice_key decimal(15)   invoice fk_invoice8
35.   bill_to_street1 varchar(255)      
36.   bill_to_street2 varchar(255)      
37.   bill_to_street3 varchar(2000)      
38.   bill_to_city varchar(60)      
39.   bill_to_state_province varchar(60)      
40.   bill_to_postal_code varchar(16)      
41.   bill_to_country varchar(60)      
42.   ship_to_street1 varchar(255)      
43.   ship_to_street2 varchar(255)      
44.   ship_to_street3 varchar(2000)      
45.   ship_to_city varchar(60)      
46.   ship_to_state_province varchar(60)      
47.   ship_to_postal_code varchar(16)      
48.   ship_to_country varchar(60)      
49.   remit_to_street1 varchar(255)      
50.   remit_to_street2 varchar(255)      
51.   remit_to_street3 varchar(2000)      
52.   remit_to_city varchar(60)      
53.   remit_to_state_province varchar(60)      
54.   remit_to_postal_code varchar(16)      
55.   remit_to_country varchar(60)      
56.   bill_to_first_name varchar(50)      
57.   bill_to_last_name varchar(50)      
58.   bill_to_middle_initial char(1)      
59.   bill_to_suffix varchar(10)      
60.   ship_to_first_name varchar(50)      
61.   ship_to_last_name varchar(50)      
62.   ship_to_middle_initial char(1)      
63.   ship_to_suffix varchar(10)      
64.   remit_to_first_name varchar(50)      
65.   remit_to_last_name varchar(50)      
66.   remit_to_middle_initial char(1)      
67.   remit_to_suffix varchar(10)      
68.   invoice_option char(1) ('S')    
69.   show_proj_org_code char(1) ('N')    
70.   post_date datetime      
71.   emailed_by decimal(15)      
72.   emailed_timestamp datetime      
73.   printed_by decimal(15)      
74.   printed_timestamp datetime      
Foreign Keys
Column References Foreign Key Name
Table Column
billed_account_key account account_key fk_invoice11
customer_key customer customer_key fk_invoice9
billed_organization_key customer customer_key fk_invoice10
company_logo image_setup image_setup_key fk_invoice6
voided_invoice_key invoice invoice_key fk_invoice7
voiding_invoice_key invoice invoice_key fk_invoice8
invoice_format_key invoice_format invoice_format_key fk_invoice5
payment_term_key payment_term payment_term_key fk_invoice4
created_by person person_key fk_invoice2
completed_by person person_key fk_invoice3
project_key project project_key fk_invoice1
Referenced from
Table Column Foreign Key Name
cost_plus_post_detail invoice_key fk_cost_plus_post_detail8
customer_payment_included_inv invoice_key fk_cust_payment_included_inv2
expense_data_allocation invoice_key fk_expense_data_allocation8
fee_cap_adjustment invoice_key fk_fee_cap_adjustment4
fin_document_detail_expense invoice_key fk_fin_doc_detail_expense4
fixed_price invoice_key fk_fixed_price3
funding_cap_adjustment invoice_key fk_funding_cap_adjustment4
invcd_cost_plus_post_detail invoice_key fk_invcd_cpp_detail1
invcd_document_expense invoice_key fk_invcd_document_expense1
invcd_expense invoice_key fk_invcd_expense1
invcd_fee_cap_adjustment invoice_key fk_invcd_fee_cap_adjustment1
invcd_fixed_price invoice_key fk_invcd_fixed_price1
invcd_funding_cap_adjustment invoice_key fk_invcd_funding_cap_adj1
invcd_prebilled_labor invoice_key fk_invcd_prebilled_labor1
invcd_project invoice_key fk_invcd_project1
invcd_time invoice_key fk_invcd_time1
invoice voided_invoice_key fk_invoice7
invoice voiding_invoice_key fk_invoice8
invoice_addl_fmt invoice_key fk_invoice_addl_fmt1
journal_cost_plus_detail invoice_key fk_journal_cost_plus_detail5
journal_document_expense invoice_key fk_journal_document_expense5
journal_expense invoice_key fk_journal_expense5
journal_fee_cap_adjustment invoice_key fk_journal_fee_cap_adjust5
journal_fixed_price invoice_key fk_journal_fixed_price5
journal_funding_cap_adjustment invoice_key fk_journal_funding_cap_adj5
journal_prebilled_labor invoice_key fk_journal_prebilled_labor5
journal_time invoice_key fk_journal_time5
onetime_charge invoice_key fk_onetime_charge3
person_time_data invoice_key fk_person_time_data12
prebilled_labor invoice_key fk_prebilled_labor3
Check Constraints
Name Definition
cc_inv_bill_to_empty ([bill_to_street1] IS NOT NULL OR [bill_to_street2] IS NOT NULL OR [bill_to_street3] IS NOT NULL OR [bill_to_city] IS NOT NULL OR [bill_to_state_province] IS NOT NULL OR [bill_to_postal_code] IS NOT NULL OR [bill_to_country] IS NOT NULL)
cc_inv_billing_through ([billing_through]>='1900-01-01' AND [billing_through]<='2099-12-31')
cc_inv_due_date ([due_date]>='1900-01-01' AND [due_date]<='2099-12-31')
cc_inv_emailed_timestamp ([emailed_timestamp]>='1900-01-01' AND [emailed_timestamp]<='2099-12-31')
cc_inv_invoice_date ([invoice_date]>='1900-01-01' AND [invoice_date]<='2099-12-31')
cc_inv_invoice_option ([invoice_option]='C' OR [invoice_option]='L' OR [invoice_option]='S')
cc_inv_printed_timestamp ([printed_timestamp]>='1900-01-01' AND [printed_timestamp]<='2099-12-31')
cc_inv_remit_to_empty ([remit_to_street1] IS NOT NULL OR [remit_to_street2] IS NOT NULL OR [remit_to_street3] IS NOT NULL OR [remit_to_city] IS NOT NULL OR [remit_to_state_province] IS NOT NULL OR [remit_to_postal_code] IS NOT NULL OR [remit_to_country] IS NOT NULL)
cc_inv_show_company_logo ([show_company_logo]='N' OR [show_company_logo]='Y')
cc_inv_show_contract_number ([show_contract_number]='N' OR [show_contract_number]='Y')
cc_inv_show_order_number ([show_order_number]='N' OR [show_order_number]='Y')
cc_inv_show_proj_code ([show_proj_code]='N' OR [show_proj_code]='Y')
cc_inv_show_proj_funded_value ([show_proj_funded_value]='N' OR [show_proj_funded_value]='Y')
cc_inv_show_proj_org_code ([show_proj_org_code]='N' OR [show_proj_org_code]='Y')
cc_inv_show_proj_title ([show_proj_title]='N' OR [show_proj_title]='Y')
cc_inv_void (NOT ([voiding_invoice_key] IS NOT NULL AND [voided_invoice_key] IS NOT NULL))
Indices
Index Name Unique Column Name Asc Or Desc
pk_invoice true invoice_key Asc
idx_invoice2 true invoice_number Asc
idx_invoice1 false project_key Asc
idx_invoice3 false voided_invoice_key Asc
idx_invoice4 false voiding_invoice_key Asc
idx_invoice5 false billed_organization_key Asc
idx_invoice6 false billed_account_key Asc
idx_invoice7 false customer_key Asc
Dependent Views
View Name
customer_invoice_activity
journal_view