booking_rates

16607 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
booking_id int4 10 null
booking_item int4 10 null
booking_items.item_id fk_booking_rates_booking_items C
charge_date date 13 null

Posting night of this rate row (one row per stay night) = transactions.post_date. NOT a service/schedule date — for the “charge for day X” concept see transactions.charge_date.

room_rate t_money 15,2 0
extrabed_rate t_money 15,2 0
child_rate t_money 15,2 0
infant_rate t_money 15,2 0
comp bool 1 false
comp_abf bool 1 false
comp_lunch bool 1 √ false
comp_dinner bool 1 √ false
promotion_id int4 10 √ null
promotion.id fk_booking_rates_promotion_id N
start_date date 13 √ null
end_date date 13 √ null
abf_rate t_money 15,2 √ null
lunch_rate t_money 15,2 √ null
dinner_rate t_money 15,2 √ null
room t_money 15,2 √ null

DEAD COLUMN – declared but never written by any code path (verified: 0 non-zero rows on sample and aonestar). Use sp_booking_rates_breakdown(…).room for the GROSS room-only amount and .room_net for the amount net of itemizers. Same applies to service, tax, extrabed, extrabed_svc, extrabed_tax, abf, lunch, dinner and discount on this table.

service t_money 15,2 √ null

DEAD COLUMN – never written. See the comment on booking_rates.room.

tax t_money 15,2 √ null

DEAD COLUMN – never written. See the comment on booking_rates.room.

extrabed t_money 15,2 √ null
extrabed_svc t_money 15,2 √ null
extrabed_tax t_money 15,2 √ null
abf t_money 15,2 √ null
lunch t_money 15,2 √ null
dinner t_money 15,2 √ null
discount t_money 15,2 √ null
room_charge_dept int4 10 √ null
rateplan_id int4 10 √ null
rate_plan.id fk_booking_rates_rateplan_id R
mealtype_id int4 10 √ null
meal_type.id fk_booking_rates_mealtype_id R

Indexes

Constraint Name Type Sort Column(s)
pk_booking_rates Primary key Asc/Asc booking_item + charge_date
idx_booking_rates_booking_id Performance Asc booking_id
idx_booking_rates_booking_item Performance Asc booking_item
idx_booking_rates_mealtype_id Performance Asc mealtype_id
idx_booking_rates_promotion_id Performance Asc promotion_id
idx_booking_rates_rateplan_id Performance Asc rateplan_id

Relationships