reservation system for hotel

Hi, I'm trying to make an app for a small hotel where I could load
rooms into a database then assign a different nightly rate to them for
each day in a calendar year. Each room would be loaded individually
into the DB and and have it's own rate, you would then be able to
search for a room by entering a date rang, the app would display all
available rooms and the total nightly rate
I'm not sure what the best practice to set this up would be. Does
anyone know of an example app I could look at?

Thanks for your help - Greg.

Simple.

Two tables.

Rooms :
Has info like double bed, fridge, size and such.

costs : <---- might need a better name
room_id
day
price

Then you would say something like room has many costs
And then I would just use julian dates and you can easily ask each
room for dates in a given range.

Trausti

You should also track inventory of rooms and handle a range of dates
(periods).

Other than that I like it :stuck_out_tongue:

You just gave me an excellent idea. Thank you.

I'm implementing a web-based ticketing system for boat passage. Yes,
there are many boats to keep track of, each with varying types and
availability of accommodations and regularly scheduled trips.

Thanks for your help! So I'm trying to put this together, when I
create a new unit in the units table I also want the unit_id field
that is entered by the user to enter into the unit_id column of the
rates table as well. I know this stuff is simple, I'm still learning,
I've trolled through these forums but can't seem to find an answer.
Any help is greatly appreciated.

This is what I have to enter into the unit_id column in the unit
table:

<% form_for(@unit) do |f| %>
  <p>
    <b>Unit</b><br />
    <%= f.text_field :unit_id %>
  </p>

Thanks!

Hi Greg and everybody,

Have you figured out a way to implement advanced rate changes? To
clarify what this is, let me give you an example.

Assume today is the first of January.
Hotel management decides that effective February 1, all room rates
will increase.
You still can't change the values in the rates table, obviously. But
if somebody books in advance for February 2, the system should use the
new rates (which would have been effective already by then.)

I've been thinking about this for a few days now and i still haven't
come up with a good solution. I could create a RateChange model with
the effectivity date and the new rate, and then a room will have many
rate_changes. I don't know yet. I'm really stumped.

Your question isn't really a Rails question, but a good way to do this would be to have a bookings model and an inventory model.

The rooms are 'inventory'. Their selling price is in the inventory model. Dynamic changes can take place to the inventory while retaining previously booked room rates. .

The pricing model is linked to the inventory by date, or season, etc. Rake tasks nightly could update the inventory based on objects in the pricing model.

When a booking occurs you create a booking to lock-in the rate, and eventually that booking turns into an invoice when the customer checks in.

You're going to have to allow for the employee to make changes to the booking rate (with manager approval, of course) in the event the customer comes in and changes their room after a pricing event has taken place. etc.

-john

Your question isn't really a Rails question, but a good way to do this
would be to have a bookings model and an inventory model.

The rooms are 'inventory'. Their selling price is in the inventory
model. Dynamic changes can take place to the inventory while retaining
previously booked room rates. .

The pricing model is linked to the inventory by date, or season, etc.
Rake tasks nightly could update the inventory based on objects in the
pricing model.

When a booking occurs you create a booking to lock-in the rate, and
eventually that booking turns into an invoice when the customer checks
in.

You're going to have to allow for the employee to make changes to the
booking rate (with manager approval, of course) in the event the
customer comes in and changes their room after a pricing event has
taken place. etc.

-john

Thanks for the insight John. I think i glossed over my problem in my
post. My system isn't a hotel reservation system but a ticketing
system for a shipping line. I got the reservation part down (by
treating cots as inventory - which is exactly ChilliCoder's
suggestion), but the client would like advanced rate changes to be
setup to allow for bookings made in advance.

The models i'm using are Voyage, Vessel, Route, Rate,
AccommodationType, Reservation, etc. Voyage belongs to Route, Route
belongs to Vessel, Vessel has many AccommodationTypes, Route has many
Rates, Rate belongs to AccommodationType. I decided to put an
effectivity date in the Rate model and do some checking to determine
which rate is effective based on the Voyage's departure date. So far
so good.

I would put both start date and end date. That could simplify the
calculations a little.

Milan Dobrota
http://www.milandobrota.com

Greg…

Take a look at OpenCampground.com for a gpl licensed app that is
similar in requirements. It is for campground space reservations but
the general requirements are similar.

Norm