Table openpetra_trunk.public.a_ap_document
This is either an invoice or a credit note in the Accounts Payable system.

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
a_ap_document_detail.a_ledger_number_i a_ap_document_detail_fk2 R
a_ap_document_payment.a_ledger_number_i a_ap_document_payment_fk2 R
a_crdt_note_invoice_link.a_ledger_number_i a_crdt_note_invoice_link_fk2 R
a_ep_document_payment.a_ledger_number_i a_ep_document_payment_fk2 R
a_ledger.a_ledger_number_i a_ap_document_fk1 R
a_account.a_ledger_number_i a_ap_document_fk3 R
Reference to the ledger for this invoice.
a_ap_number_i int4 10
a_ap_document_detail.a_ap_number_i a_ap_document_detail_fk2 R
a_ap_document_payment.a_ap_number_i a_ap_document_payment_fk2 R
a_crdt_note_invoice_link.a_credit_note_number_i a_crdt_note_invoice_link_fk1 R
a_crdt_note_invoice_link.a_invoice_number_i a_crdt_note_invoice_link_fk2 R
a_ep_document_payment.a_ap_number_i a_ep_document_payment_fk2 R
A unique key (together with the ledger number) to identify this document.
p_partner_key_n numeric 10
a_ap_supplier.p_partner_key_n a_ap_document_fk2 R
Reference to the supplier that sent this invoice.
a_credit_note_flag_l bool 1 false A flag to indicate if this document is an invoice or a credit note.
a_document_code_c varchar 30  √  null The code given on the document itself (be it invoice or credit note). This will have to be unique for each supplier.
a_reference_c varchar 100  √  null Some kind of other reference needed.
a_date_issued_d date 13 ('now'::text)::date The date when this document was issued.
a_date_entered_d date 13 ('now'::text)::date The date when this document was entered into the system.
a_credit_terms_i int4 10  √  0 Credit terms allowed for this invoice.
a_total_amount_n numeric 24,10 0 The total amount of money that this document is worth.
a_exchange_rate_to_base_n numeric 24,10  √  null The exchange rate to the base currency at the time that the document was issued.
a_discount_percentage_n numeric 24,10  √  null The percentage discount you get for early payment of this document in the case that it is an invoice.
a_discount_days_i int4 10  √  null The number of days that the discount is valid for (0 for none).
a_ap_account_c varchar 16  √  null
a_account.a_account_code_c a_ap_document_fk3 R
Reference to the AP Account to debit/credit when posting/paying the document.
a_last_detail_number_i int4 10 0 The number of the last item for this document. This is used simply to quickly get the next number if items are added.
a_document_status_c varchar 16  √  null The current status of the invoice. The value can (for now) be one of: OPEN, APPROVED, POSTED, PARTPAID, or PAID.
s_date_created_d date 13  √  ('now'::text)::date
s_created_by_c varchar 20  √  null
s_user.s_user_id_c a_ap_document_fkcr R
s_date_modified_d date 13  √  null
s_modified_by_c varchar 20  √  null
s_user.s_user_id_c a_ap_document_fkmd R
s_modification_id_c varchar 150  √  null

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

Indexes:
Column(s) Type Sort Constraint Name
a_ledger_number_i + a_ap_number_i Primary key Asc/Asc a_ap_document_pk
a_ledger_number_i Performance Asc inx_a_ap_document_fk1_key1
p_partner_key_n Performance Asc inx_a_ap_document_fk2_key2
a_ledger_number_i + a_ap_account_c Performance Asc/Asc inx_a_ap_document_fk3_key3
s_created_by_c Performance Asc inx_a_ap_document_fkcr_key4
s_modified_by_c Performance Asc inx_a_ap_document_fkmd_key5
a_ledger_number_i + a_ap_number_i Must be unique Asc/Asc inx_a_ap_document_pk0

Close relationships  within of separation: