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 On Fri, Nov 13, 2009 at 6:28 AM, Greg <gholland85-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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. > > > >
Trausti Thor Johannsson wrote:> 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.Julian dates? Isn''t that a bit of a low-level implementation detail? Personally, I''d try to do this using native Ruby and DB date types.> > > TraustiBest, -- Marnen Laibow-Koser http://www.marnen.org marnen-sbuyVjPbboAdnm+yROfE0A@public.gmane.org -- Posted via http://www.ruby-forum.com/.
You should also track inventory of rooms and handle a range of dates (periods). Other than that I like it :P On Nov 13, 10:15 am, Trausti Thor Johannsson <traust...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > On Fri, Nov 13, 2009 at 6:28 AM, Greg <ghollan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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. > >
On Nov 14, 2:45 am, ChilliCoder <chilli.co...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> You should also track inventory of rooms and handle a range of dates > (periods). > > Other than that I like it :P >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! On Nov 13 2009, 8:15 am, Trausti Thor Johannsson <traust...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> 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 > > On Fri, Nov 13, 2009 at 6:28 AM, Greg <ghollan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> > On Fri, Nov 13, 2009 at 6:28 AM, Greg <ghollan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > > > > Hi, I''m trying to make an app for a smallhotelwhere 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.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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
On Feb 1, 2010, at 7:57 PM, adrianb wrote:>>> On Fri, Nov 13, 2009 at 6:28 AM, Greg <ghollan...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> >>>> Hi, I''m trying to make an app for a smallhotelwhere 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. > > > 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.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 --- John Adams (@netik) Retina Communications jna-v/oBC7Wj0TusTnJN9+BGXg@public.gmane.org http://www.retina.net/tech this email is: [ ] bloggable [ x ] ask first [ ] confidential -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
> 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. -- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
I would put both start date and end date. That could simplify the calculations a little. Milan Dobrota http://www.milandobrota.com On Feb 2, 10:12 am, adrianb <adrian.b...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> > 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.-- You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type"> <title></title> </head> <body bgcolor="#ffffff" text="#000000"> Greg..<br> 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.<br> <br> Norm<br> </body> </html> <p></p> -- <br /> You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.<br /> To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br /> To unsubscribe from this group, send email to rubyonrails-talk+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/Ez6ZCGd0@public.gmane.org<br /> For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.<br />