registration_rates

26867 rows


Columns

Column Type Size Nulls Auto Default Children Parents Comments
register_id int4 10 null
registration.id fk_registration_rates_register_id 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.

comp bool 1 false
promotion_id int4 10 √ null
promotion.id fk_registration_rates_promotion_id N
room_rate t_money 15,2 0
child_rate t_money 15,2 0
infant_rate t_money 15,2 0
extrabed_rate t_money 15,2 0
abf_rate t_money 15,2 0
lunch_rate t_money 15,2 0
dinner_rate t_money 15,2 0
room t_money 15,2 0

DEAD COLUMN – declared DEFAULT 0 NOT NULL but never written by any code path (verified: 0 non-zero rows on sample and aonestar). Do not read it and do not start writing it: the room-only amount depends on the meal plan and rate inclusions, which live outside this table (registration.adult/child/mealtype_id/rateplan_id), so a row-level trigger could not keep it fresh and rate rows are written in bulk. Use sp_rate_schedule_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 0

DEAD COLUMN – never written. See the comment on registration_rates.room. For the service-charge slice use sp_rate_schedule_breakdown(…).room_service.

tax t_money 15,2 0

DEAD COLUMN – never written. See the comment on registration_rates.room. For the tax slice use sp_rate_schedule_breakdown(…).room_tax.

extrabed t_money 15,2 0
extrabed_svc t_money 15,2 0
extrabed_tax t_money 15,2 0
abf t_money 15,2 0
lunch t_money 15,2 0
dinner t_money 15,2 0
discount t_money 15,2 0
room_charge_dept int4 10 √ null
department.id fk_registration_rates_room_charge_dept N

Guard column only: set by rpc.reservation_namelist_create/clear and read by fn_get_room_charge_dept to tell whether the room charge was already posted. It is mostly NULL (0/26,867 rows on aonestar). It is NOT the department that posting uses – sp_auto_post / sp_auto_post_folio resolve that as COALESCE(rate_plan.room_charge_dept, fn_sys_param(‘AUTO_POST’,‘ROOM’)), which is also what sp_rate_schedule_breakdown reports as room_net_dept.

posted bool 1 false
tran_id int4 10 √ null
transactions.id fk_registration_rates_tran_id N
comp_abf bool 1 false
rateplan_id int4 10 √ null
rate_plan.id fk_registration_rates_rateplan_id R
mealtype_id int4 10 √ null
meal_type.id fk_registration_rates_mealtype_id R
inclusive_posted bool 1 false
abf_posted bool 1 false
lunch_posted bool 1 false
dinner_posted bool 1 false

Indexes

Constraint Name Type Sort Column(s)
pk_registration_rates Primary key Asc/Asc register_id + charge_date
idx_registration_rates_mealtype_id Performance Asc mealtype_id
idx_registration_rates_promotion_id Performance Asc promotion_id
idx_registration_rates_rateplan_id Performance Asc rateplan_id
idx_registration_rates_register_id Performance Asc register_id
idx_registration_rates_room_charge_dept Performance Asc room_charge_dept
idx_registration_rates_tran_id Performance Asc tran_id

Relationships