Documents in HotelDruid


Documents Description

 Hoteldruid allows to print user inserted documents. These documens can represent rental contracts, payment recepies, forms for public authorities, reports for the hotel staff or any other document to be printed with data from hoteldruid. In fact you can insert in documents some predefined variables that contain the reservation and client data.
 The variables are recognized by being enclosed in square brackets. Their complete list is available when modifying a document from "configure and customize" and contains, besides the predefined ones, also the ones added by the user. The user can add custom variables that change their value accordingly to the value of other variables. You can create for example a variable called [room] that takes the value "one room" if the selected rate corresponds to a bouble, "two rooms" if the rate corresponds to a triple.

 The documents can have four different formats. The first format is HTML and allows you to view the document directly inside the browser. The second is RTF and has the advantage, compared to HTML, to allow defining pages margins when printing as the RTF files are opened by word processors like Word and OpenOffice. The third format is plain text, useful if you have to save a file preformatted in xml or similar.
 The last available format is the email one, that allows you to send email messages directly from within hoteldruid. For this to be possible the server on which hoteldruid runs must be properly configured to allow sending emails. The default text of the message will be the one of the document, but it will be possible to edit it before sending. The default recipient will be the client's email address, when available. It is also possible to save a file to be attached to the email, this being useful for sending maps or images.

 The documents in HTML or RTF format can also be saved as a file on the server where hoteldruid runs. The second part of the filenames will be constituted by the year and a progressive number compared with the last file present in the directory where the documents are saved. This progressive number will be available, as a variable, also inside the document, this way series of invoices can be registered.

 The document can be viewed either with one reservation or more reservations at once. For example from the page with all the reservations you can select, also on a time basis, the reservations of which you want to view the documents and then choose the document to be viewed. In this case, if the text of the document doesn't have limits for the sections that must be repeated, the document will be repeated entirely for each reservation, and if the document has email format it will be possible to send as many different emails as the number of the reservations. Instead if the text contains repetition limits, only the delimited sections will be repeated, and with email format it will be possible to send one email with all the available client's addresses as recipients. In the parts of the document that are not repeated it is possible to insert some variables with values that contain the sum of the values of all the reservations.

 Another way to have repetitions inside the document is creating a loop with the values of a document variable contained in an array. For example you can assign by default to the array the values of dates found between the selected ones, creating a loop that repeats itself for each date.

 You can also create parts of a document to be repeated inside each reservation, so that lists with available variables can be generated. For example all the variables that finish with "_guest" can be used to create the list with guests data.