RESERVATION

Table that stores reservation information for group sales.

Primary Key

Primary Key Field Type
ID uniqueidentifier

Fields

Field Field Type Null Notes Description
NAME nvarchar(100) Default = '' The name given to the reservation.
ARRIVALDATE date The date that the entire group will be visiting.
ARRIVALTIME UDT_HOURMINUTE Default = '' The arrival time of the entire group on the reservation.
NUMBEROFBUSES smallint Default = ((0)) The number of buses that will be arriving.
ARRIVALNOTES nvarchar(255) Default = '' Notes specific to the group's arrival.
DRIVERNAME nvarchar(100) Default = '' Name of a bus driver who may be contacted.
DRIVERPHONENUMBER nvarchar(100) Default = '' Phone number of the driver who may be contacted.
DATEADDED datetime Default = getdate() Indicates the date this record was added.
DATECHANGED datetime Default = getdate() Indicates the date this record was last changed.
TS timestamp Timestamp.
TSLONG bigint (Computed) yes CONVERT(bigint, TS) Numeric representation of the timestamp.
DEPOSITREQUIRED bit Default = 0 Indicates whether a deposit is required on the reservation.
DEPOSITAMOUNT money Default = 0 Indicates the amount due for the deposit.
DEPOSITDUEDATE date yes If a deposit is required, the date it is due by.
FINALDUEDATE date The date the final payment for a reservation is due.
FINALCOUNTREQUIRED bit Default = 0 Indicates whether a final count of visitors is required on a reservation
FINALCOUNTDUEDATE date yes The date the final count of visitors for a reservation is due.
FINALCOUNTRECEIVED bit Default = 0 Indicates whether a final count of visitors has been received for a reservation
CONTRACTREQUIRED bit Default = 0 Indicates whether a contract is required on a reservation
CONTRACTDUEDATE date yes The date the contract for a reservation is due.
CONTRACTRECEIVED bit Default = 0 Indicates whether a contract has been received.
CONTRACTSENT bit Default = 0 Indicates whether a contract has been sent.
FINALCOUNTRECEIVEDDATE date yes The date in which the final count was received.
PRICINGCODE tinyint Default = 0 The pricing structure to use for the reservation.
PRICING nvarchar(10) (Computed) yes CASE [PRICINGCODE] WHEN 0 THEN N'Per ticket' WHEN 1 THEN N'Flat rate' END Provides a translation for the 'PRICINGCODE' field.
ORDERBALANCESENT bit Default = 0 Indicates whether the order invoice has been sent.
SECURITYDEPOSITREQUIRED bit Default = 0 Indicates whether a security deposit is required on the reservation.
SECURITYDEPOSITAMOUNT money Default = 0 Indicates the amount due for the security deposit.
SECURITYDEPOSITDUEDATE date yes If a security deposit is required, the date it is due by.
SECURITYDEPOSITSTATUSCODE tinyint Default = 0 The status of security deposit.
SECURITYDEPOSITSTATUS nvarchar(18) (Computed) yes CASE [SECURITYDEPOSITSTATUSCODE] WHEN 0 THEN N'Not paid' WHEN 1 THEN N'Paid' WHEN 2 THEN N'Refunded' WHEN 3 THEN N'Withheld' WHEN 4 THEN N'Partially refunded' END Provides a translation for the 'SECURITYDEPOSITSTATUSCODE' field.
STARTDATETIME datetime (Computed) yes dbo.UFN_RESERVATION_STARTDATETIME(ID)
ENDDATETIME datetime (Computed) yes dbo.UFN_RESERVATION_ENDDATETIME(ID)

Foreign Keys

Foreign Key Field Type Null Notes Description
ID uniqueidentifier SALESORDER.ID Primary Key.
ARRIVALAREACODEID uniqueidentifier yes ARRIVALAREACODE.ID The location where the buses will arrive.
ADDEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
CHANGEDBYID uniqueidentifier CHANGEAGENT.ID FK to CHANGEAGENT.
SECURITYDEPOSITWITHHOLDREASONCODEID uniqueidentifier yes RESERVATIONSECURITYDEPOSITWITHHOLDREASONCODE.ID The reason why withhold or partially refund the security deposit.

Indexes

Index Name Fields Unique Primary Clustered
IX_RESERVATION_ARRIVALDATE ARRIVALDATE
IX_RESERVATION_DATEADDED DATEADDED yes
IX_RESERVATION_DATECHANGED DATECHANGED
PK_RESERVATION ID yes yes

Triggers

Trigger Name Description
TR_RESERVATION_AUDIT_UPDATE
TR_RESERVATION_AUDIT_DELETE

Referenced by

Referenced by Field
ITINERARY RESERVATIONID
RESERVATIONATTACHMENT RESERVATIONID
RESERVATIONMEDIALINK RESERVATIONID
RESERVATIONNOTE RESERVATIONID
RESERVATIONRATESCALE ID
RESERVATIONSECURITYDEPOSITPAYMENT RESERVATIONID
RESERVATIONSTATUSHISTORY RESERVATIONID