Table openpetra_trunk.public.a_ar_invoice
the invoice (which is also an offer at a certain stage)

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.a_ledger_number_i a_ar_invoice_detail_fk1 R
a_ar_invoice_discount.a_ledger_number_i a_ar_invoice_discount_fk1 R
ph_booking.a_ledger_number_for_invoice_i ph_booking_fk2 R
a_tax_table.a_ledger_number_i a_ar_invoice_fk2 R
This is used as a key field in most of the accounting system files
a_key_i int4 10
a_ar_invoice_detail.a_invoice_key_i a_ar_invoice_detail_fk1 R
a_ar_invoice_discount.a_invoice_key_i a_ar_invoice_discount_fk1 R
ph_booking.a_ar_invoice_key_i ph_booking_fk2 R
Key to uniquely identify invoice
a_status_c varchar 32 an invoice can have these states: OFFER, CHARGED, PARTIALLYPAID, PAID
p_partner_key_n numeric 10  √  null
p_partner.p_partner_key_n a_ar_invoice_fk1 R
This is the partner who has to pay the bill; can be null for cash payments; could also be another field
a_date_effective_d date 13  √  null this is the date when the invoice was charged
a_offer_i int4 10  √  null refers to the offer that was created for this invoice; it is basically an archived copy of the invoice, and the invoice might actually be different from the offer (e.g. hospitality: different number of people, etc.); table ph_booking always refers to the invoice, and the invoice refers to the offer; there is no requirement for an offer to exist, it can be null
a_taxing_c varchar 20 'DEFAULT'::character varying this defines whether no tax is applied to this invoice (NONE), or if a SPECIAL tax is applied, or if the DEFAULT tax defined for each article; this should work around issues of selling to businesses or customers abroad
a_special_tax_type_code_c varchar 16  √  null
a_tax_table.a_tax_type_code_c a_ar_invoice_fk2 R
if a_taxing_c has the value SPECIAL, then this tax applies (defined by tax type code, tax rate code, and date valid from
a_special_tax_rate_code_c varchar 16  √  null
a_tax_table.a_tax_rate_code_c a_ar_invoice_fk2 R
this describes whether it is e.g. the standard, reduced or zero rate of VAT
a_special_tax_valid_from_d date 13  √  null
a_tax_table.a_tax_valid_from_d a_ar_invoice_fk2 R
this describes when this particular percentage rate has become valid by law
a_total_amount_n numeric 24,10  √  null The total amount of money that this invoice is worth; this includes all discounts, even the early payment discount; if the early payment discount does not apply anymore at the time of payment, this total amount needs to be updated
a_currency_code_c varchar 16
a_currency.a_currency_code_c a_ar_invoice_fk3 R
the currency of the total amount
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_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_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_key_i Primary key Asc/Asc a_ar_invoice_pk
p_partner_key_n Performance Asc inx_a_ar_invoice_fk1_key1
a_ledger_number_i + a_special_tax_type_code_c + a_special_tax_rate_code_c + a_special_tax_valid_from_d Performance Asc/Asc/Asc/Asc inx_a_ar_invoice_fk2_key2
a_currency_code_c Performance Asc inx_a_ar_invoice_fk3_key3
s_created_by_c Performance Asc inx_a_ar_invoice_fkcr_key4
s_modified_by_c Performance Asc inx_a_ar_invoice_fkmd_key5
a_ledger_number_i + a_key_i Must be unique Asc/Asc inx_a_ar_invoice_pk0

Close relationships  within of separation: