Table a_ar_invoice_detail |
Description: an invoice consists of one or more details |
PRIMARY KEY | ||
a_ledger_number_i
integer default: 0 NOT NULL | This is used as a key field in most of the accounting system files | a_ar_invoice, a_tax_table |
a_invoice_key_i
integer NOT NULL | this invoice detail belongs to the invoice with this key | a_ar_invoice |
a_detail_number_i
integer NOT NULL | A unique number for this detail for its invoice. | |
a_ar_article_code_c
varchar (100) NOT NULL | code that uniquely identifies the item; can also be a code of a group of equally priced items | a_ar_article, a_ar_article_price |
a_ar_reference_c
varchar (100) | 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
integer NOT NULL | defines the number of the article items that is bought | |
a_ar_article_price_d
date NOT NULL | Reference to the price that should be used for this article in this invoice, by date; without discounts, just for single item | a_ar_article_price |
a_calculated_amount_n
numeric (24, 10) | The total amount of money that this invoice detail is worth; includes the discounts | |
a_currency_code_c
varchar (16) NOT NULL | the currency of the total amount | a_currency |
a_tax_type_code_c
varchar (16) NOT NULL | The tax type is always the same, e.g. VAT | a_tax_table |
a_tax_rate_code_c
varchar (16) NOT NULL | this describes whether it is e.g. the standard, reduced or zero rate of VAT | a_tax_table |
a_tax_valid_from_d
date NOT NULL | we need to be able to pick a rate that was valid in the past or will be valid in the future | a_tax_table |
s_date_created_d
date default: CURRENT_DATE | The date the record was created. | |
s_created_by_c
varchar (20) | User ID of who created this record. | s_user |
s_date_modified_d
date | The date the record was modified. | |
s_modified_by_c
varchar (20) | User ID of who last modified this record. | s_user |
s_modification_id_t
timestamp default: CURRENT_TIMESTAMP | This identifies the current version of the record. | |
FOREIGN KEY a_ar_invoice_detail_fk1: a_ledger_number_i;a_invoice_key_i => a_ar_invoice a_ar_invoice_detail_fk2: a_ledger_number_i;a_tax_type_code_c;a_tax_rate_code_c;a_tax_valid_from_d => a_tax_table a_ar_invoice_detail_fk3: a_currency_code_c => a_currency a_ar_invoice_detail_fk4: a_ar_article_code_c => a_ar_article a_ar_invoice_detail_fk5: a_ar_article_code_c;a_ar_article_price_d => a_ar_article_price a_ar_invoice_detail_fkcr: s_created_by_c => s_user a_ar_invoice_detail_fkmd: s_modified_by_c => s_user | ||
REFERENCED BY a_ar_invoice_detail_discount | ||