How to find out how many days an apartment was booked?

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

Moderator: marco

Post Reply
tazilein
Posts: 19
Joined: Fri May 18, 2007 1:30 pm

How to find out how many days an apartment was booked?

Post by tazilein »

Hi,

I have 8 unique apartments that I manage with php-residence

For calculation issues I would need to know how many nights each apartment was booked.

as there is no function in php_residence for that I will need a sql-query for that. Unfortunately I am a noob on that. Could anyone help me with that query?
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

You create an ad hoc document with custom document variables. If you have the variables nights_apartment1 and add_nights_apartment1 you can add the conditions:

-set add_nights_apartment1 = 0
-if [apartment] = 1 then set add_nights_apartment1 = [periods_num]
-add add_nights_apartment1 to nights_apartment1

If put a [r] [/r] (to repeat all selected reservations) inside the document then after it you'll be able to see the number of nights in apartment 1 in nights_apartment1.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
tazilein
Posts: 19
Joined: Fri May 18, 2007 1:30 pm

Post by tazilein »

Hi Marco,

Thank you for your reply.

I tried the code you wrote, but it seems I made smethg wrong.

When I edit f.ex. document18 and insert your code (and add the [r] before the if ) I get a lot f text like this:

set add_nights_apartment1 = 0 -if Magdalenenstrasse Nr. 25 = 1 then set add_nights_apartment1 = 6 -add add_nights_apartment1 to nights_apartment1 -if Praterstrasse Nr 78/15 = 1 then set add_nights_apartment1 = 4 -add add_nights_apartment1 to nights_apartment1

So all reservations are checked, but there is no addition made (at least I cannot find it). I also tried instead of "1" the name of one of the apartments, but the text is the same.

I think that I miss smthg - could you help me marco?
marco
Posts: 1332
Joined: Tue Jul 05, 2005 6:00 pm
Location: Roma, Italia

Post by marco »

Hello,
you don't have to paste that code in the document, you have to create it with the custom variables: "main menu" --> "configure and customize" --> "custom variables" in the documents section. There you first create the 2 new custom variables "nights_apartment1" and "add_nights_apartment1" and then add those options from the conditions at the bottom of the page.

Marco
Problems installing, configuring, upgrading?
Try the easiest way to use HotelDruid:
https://www.digitaldruid.net/hosted/index.php
Post Reply