Year 2008 doesn't work in version 0.6.1

Discuss here how to configure hoteldruid and better use its features.

Moderator: marco

Post Reply
Herringbone
Posts: 4
Joined: Mon Mar 10, 2008 12:41 pm

Year 2008 doesn't work in version 0.6.1

Post by Herringbone »

My employer uses PHP-Residence 0.6.1. We have a problem
with it. (It might be the same as the problem described
in the post "Creating new year bug in 0.7.1", at
http://www.digitaldruid.net/php-residen ... .php?t=411 .)

The problem is as follows. If, from the page headed "Main menu of year
2008", I click the button which reads "View and Modify the Reservations"
(after making sure to specify March as the month and 2008 as the year),
I get a page for September 2008, which lists all the apartments (but
no reservations).

If I click the "March" link in the menubar, I get a
page with the same content. The URL when I do this is
/bookingmanager/tabella.php?id_sessione=&anno=2008&mese=3 (I've
left out the domain, to preserve privacy). If I edit the URL to be
/bookingmanager/tabella.php?id_sessione=&anno=2007&mese=15, I get a page
which shows all the apartments, with reservations for some of them.

My manager is normally the one who uses PHP-Residence. Apparently the
problem has existed since the start of the year, and he has been working
around it by editing the URL as I've just described.

I upgraded PHP-Residence to version 1.0.1, but the problem was still
there. (I therefore restored everything from backup, so we're now
running version 0.6.1 again.)

Last year, I wrote a program to query our PHP-Residence database, so I
have a little understanding of the database schema. The contents of
the periodi2008 table seem odd to me. I ran this SQL query from the
MySQL client:

select min(idperiodi), max(idperiodi), count(*), min(datainizio),
min(datafine), max(datainizio), max(datafine) from periodi2008

The output was:

min(idperiodi): 1
max(idperiodi): 365
count(*): 365
min(datainizio): 2008-09-01
min(datafine): 2008-09-02
max(datainizio): 2009-08-31
max(datafine): 2009-09-01

I'm going to mention 2 other things that may be irrelevant, but which
may tell you what's going wrong.

Firstly, for comparison, here is the result of running the above query
on the periodi2007 table:

min(idperiodi): 1
max(idperiodi): 762
count(*): 762
min(datainizio): 2007-01-01
min(datafine): 2007-01-02
max(datainizio): 2009-01-31
max(datafine): 2009-02-01

Secondly, every rate (tariffa1, tariffa2, etc) in every row in the
periodi2008 table is NULL.

And now (at last) my question: is there any way to change the database so
that the software will work properly? I am entirely comfortable working
with SQL and PHP, so if the solution involves writing code, I can do that.

If you like, I can give you access to our installation of PHP-Residence
(i.e. I can let you use it), and I can also send you a copy of our
database.
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

The bug for 0.7.1 is only present in that version, but there may be other bugs in older versions so I recommend you to upgrade anyway.
It seems that the 2008 year was created with Septembet as starting month. There is no way to add months before the starting date once the year is created, so the only solution should be deleting 2008 and creating it again. You will loose all reservations of this year and will have to insert them again, only the data regarding the clients will be kept.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
Herringbone
Posts: 4
Joined: Mon Mar 10, 2008 12:41 pm

Post by Herringbone »

Sorry for the delay in replying.

I deleted 2008, and PHP-Residence correctly recreated it, and transferred
all the reservations into it. So the problem seems to be solved.
Post Reply