Automatic Assignment Description
That php-residence
can automatically assign reservations means that you can insert a
reservation giving to it a list of apartments, rather than a fixed one,
and then php-residence will assign it to an apartment of the list
considering the characteristics of the apartments and maximizing the
availability.
The characteristics of the apartments that are considered are
the maximum number of people it can host and the priority, values that
are inserted at the creation of the database and can be modified from
the table with all the apartments. The maximum number of people is
considered in that it can't be lower than number of people of the
reservation. You can still insert a reservation with more people than
the maximum of the apartment in which you insert it by using an extra
cost that is considered as the number of extra beds. The priority is
considered in that the apartments with the lower one are assigned
first. Finally, if more reservations are inserted contemporarely, it
is possible to insert them in apartments close to each other.
To maximize availability php-residence will move reservations
between their assigned apartments if it is needed to free an apartment
in a requested period. Let's assume for example that we have this
situation in a residence with 4 apartments:
| 01 --- 02 |
02 --- 03 |
03 --- 04 |
04 --- 05 |
05 --- 06 |
06 --- 07 |
07 --- 08 |
08 --- 09 |
09 --- 10 |
10 --- 11 |
11 --- 12 |
12 --- 13 |
|
| 1 | 10 |
12 |
||||||||||
| 2 | 11 |
1 | 2 | 4 |
13 | |||||||
| 3 | 8 |
7 |
5 |
|||||||||
| 4 | 9 |
3 | 6 | |||||||||
where for simplicity there are only reservations that can be assigned
to all 4 apartments, in green, and reservations that are assigned to
only 1 fixed apartment, in red. If we now insert a new reservation,
number 14, in the period from day 8 to 10, php-residence will move
reservations 10, 1, 2 and 7 to free an apartment and this will be the
new situation:
| 01 --- 02 |
02 --- 03 |
03 --- 04 |
04 --- 05 |
05 --- 06 |
06 --- 07 |
07 --- 08 |
08 --- 09 |
09 --- 10 |
10 --- 11 |
11 --- 12 |
12 --- 13 |
|
| 1 | 1 | 12 | ||||||||||
| 2 | 11 | 7 | 4 |
13 | ||||||||
| 3 | 8 |
2 | 14 | 5 |
||||||||
| 4 | 10 | 9 |
3 | 6 | ||||||||
If you tried to insert reservation 14 in an apartment different from
number 3 php-residence would have told you that it was not possible to
insert the reservation in the requested apartments. Naturally
reservations that are already begun won't be moved from the apartment
where they are, unless you move them manually one by one. So in the
previous example if today was day 2 you woldn't have been able to
insert reservation 14 unless you moved before reservation 10 to
apartment 4.
At the moment of inserting the reservation you can choose the
list of apartments directly, specifying the numbers or the
characteristics (house, floor, number of people), or by choosing the
rate with assignment rule 2. This rule assigns to each rate a list of
apartments that are automatically selected when the rate is choosen and
no list is directly given. With assignment rule 2 you can for example
associate the rate "double room" to all apartments that can host 2
people.
Assignment rule 1 instead can be used to reserve some periods
of an apartment to agencies. This way php-residence will try not to use
this periods until it's necessary, and then will alert you before
inserting a reservation in one of them.