Table openpetra_trunk.public.a_ar_invoice_detail
an invoice consists of one or more details

Generated by
SchemaSpy
Legend: SourceForge.net
Primary key columns
Columns with indexes
Implied relationships
Excluded column relationships
< n > number of related tables
 
Column Type Size Nulls Auto Default Children Parents Comments
a_ledger_number_i int4 10 0
a_ar_invoice_detail_discount.a_ledger_number_i a_ar_invoice_detail_discount_fk1 R
a_ar_invoice.a_ledger_number_i a_ar_invoice_detail_fk1 R
a_tax_table.a_ledger_number_i a_ar_invoice_detail_fk2 R
This is used as a key field in most of the accounting system files
a_invoice_key_i int4 10
a_ar_invoice_detail_discount.a_invoice_key_i a_ar_invoice_detail_discount_fk1 R
a_ar_invoice.a_key_i a_ar_invoice_detail_fk1 R
this invoice detail belongs to the invoice with this key
a_detail_number_i int4 10
a_ar_invoice_detail_discount.a_detail_number_i a_ar_invoice_detail_discount_fk1 R
A unique number for this detail for its invoice.
a_ar_article_code_c varchar 100
a_ar_article.a_ar_article_code_c a_ar_invoice_detail_fk4 R
a_ar_article_price.a_ar_article_code_c a_ar_invoice_detail_fk5 R
code that uniquely identifies the item; can also be a code of a group of equally priced items
a_ar_reference_c varchar 100  √  null Reference for this invoice detail; for a non specific article that could give more details (e.g. which book of type small book)
a_ar_number_of_item_i int4 10 defines the number of the article items that is bought
a_ar_article_price_d date 13
a_ar_article_price.a_ar_date_valid_from_d a_ar_invoice_detail_fk5 R
Reference to the price that should be used for this article in this invoice, by date; without discounts, just for single item
a_calculated_amount_n numeric 24,10  √  null The total amount of money that this invoice detail is worth; includes the discounts
a_currency_code_c varchar 16
a_currency.a_currency_code_c a_ar_invoice_detail_fk3 R
the currency of the total amount
a_tax_type_code_c varchar 16
a_tax_table.a_tax_type_code_c a_ar_invoice_detail_fk2 R
The tax type is always the same, e.g. VAT
a_tax_rate_code_c varchar 16
a_tax_table.a_tax_rate_code_c a_ar_invoice_detail_fk2 R
this describes whether it is e.g. the standard, reduced or zero rate of VAT
a_tax_valid_from_d date 13
a_tax_table.a_tax_valid_from_d a_ar_invoice_detail_fk2 R
we need to be able to pick a rate that was valid in the past or will be valid in the future
s_date_created_d date 13  √  ('now'::text)::date
s_created_by_c varchar 20  √  null
s_user.s_user_id_c a_ar_invoice_detail_fkcr R
s_date_modified_d date 13  √  null
s_modified_by_c varchar 20  √  null
s_user.s_user_id_c a_ar_invoice_detail_fkmd R
s_modification_id_c varchar 150  √  null

Table contained 0 rows at Do Nov 10 18:00 MEZ 2011

Indexes:
Column(s) Type Sort Constraint Name
a_ledger_number_i + a_invoice_key_i + a_detail_number_i Primary key Asc/Asc/Asc a_ar_invoice_detail_pk
a_ledger_number_i + a_invoice_key_i Performance Asc/Asc inx_a_ar_invoice_detail_fk1_key1
a_ledger_number_i + a_tax_type_code_c + a_tax_rate_code_c + a_tax_valid_from_d Performance Asc/Asc/Asc/Asc inx_a_ar_invoice_detail_fk2_key2
a_currency_code_c Performance Asc inx_a_ar_invoice_detail_fk3_key3
a_ar_article_code_c Performance Asc inx_a_ar_invoice_detail_fk4_key4
a_ar_article_code_c + a_ar_article_price_d Performance Asc/Asc inx_a_ar_invoice_detail_fk5_key5
s_created_by_c Performance Asc inx_a_ar_invoice_detail_fkcr_key6
s_modified_by_c Performance Asc inx_a_ar_invoice_detail_fkmd_key7
a_ledger_number_i + a_invoice_key_i + a_detail_number_i Must be unique Asc/Asc/Asc inx_a_ar_invoice_detail_pk0

Close relationships  within of separation: