Table a_ar_discount
Description:
defines a discount that depends on other conditions or can just be assigned to an invoice or article
PRIMARY KEY
a_ar_discount_code_c
varchar (100) NOT NULL
code that identifies the discount
a_ar_date_valid_from_d
date NOT NULL
date from which this discount is valid

a_ar_adhoc_l
boolean default: '1'
this discount has only be created on the fly and should not be reusable elsewhere
a_active_l
boolean default: '1'
flag that prevents this discount from being used, to avoid too long lists in comboboxes etc
a_ar_discount_percentage_n
numeric (5, 2) default: 0
discount percentage; can be negative for expensive rooms etc
a_ar_discount_absolute_n
numeric (24, 10)
the absolute discount that is substracted from the article price; can be negative as well
a_ar_absolute_amount_n
numeric (24, 10)
the absolute amount that is charged if this discount applies; e.g. 3 books for 5 Pound
a_currency_code_c
varchar (16) NOT NULL
the currency in which the absolute discount or amount is given a_currency
a_ar_number_of_items_i
integer
this discount applies for this number of items that are bought at the same time
a_ar_minimum_number_of_items_i
integer
this discount applies for all of the items if at least this number of items is bought at the same time
a_ar_number_of_nights_i
integer
this discount applies for this number of nights that the individual or group stays; this is needed because 100 people staying for one night do cost more than 50 people staying for 2 nights
a_ar_minimum_number_of_nights_i
integer
this discount applies for all of the nights if the individual or group stays at least for the given amount of nights; this is needed because 100 people staying for one night do cost more than 50 people staying for 2 nights
a_ar_whole_room_l
boolean
this discount applies when a whole room is booked rather than just a bed
a_ar_children_l
boolean
this discount applies for a children (e.g. meals)
a_ar_early_booking_days_i
integer
this discount applies when the booking has been done so many days before the stay (using ph_booking.ph_confirmed_d and ph_in_d)
a_ar_early_payment_days_i
integer
this discount applies when the payment has been received within the given number of days after the invoice has been charged
a_ar_article_code_c
varchar (100)
this discount applies if the article code matches a_ar_article
p_partner_type_code_c
varchar (20)
this discounts applies to partners of this type p_type
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_discount_fkcr: s_created_by_c => s_user
a_ar_discount_fkmd: s_modified_by_c => s_user
ar_discount_fk1: a_currency_code_c => a_currency
ar_discount_fk2: p_partner_type_code_c => p_type
ar_discount_fk3: a_ar_article_code_c => a_ar_article


REFERENCED BY
a_ar_discount_per_category, a_ar_default_discount, a_ar_invoice_discount,
a_ar_invoice_detail_discount