User Tools

Site Tools


document

This is an old revision of the document!


Use the Documents page to create or modify document templates (simply called “documents” hereafter), that hoteldruid will use to generate all kinds of records you might need (reports, invoices, contracts, etc.). You can add as many documents as you need. Documents can be created in HTML, RTF, e-mail and text format. Thanks to the use of variables, repetitions and conditions, documents are a powerfull tool that can save a lot of time once properly set up.

Here's an example of an invoice using HTML

From “configure and customize”, clicking on their number, you can edit the texts of documents to be printed, saved or emailed. The texts must be inserted in HTML or RTF format, or in simple text to send emails. You'll find some examples of alredy usable documents after intalling hoteldruid.

RTF Documents

To easily insert an RTF document you can write the text in your preferred program (like Microsoft Word or LibreOffice/OpenOffice Writer), and save it in RTF format, using all needed variables inside the document. If you want to make sure formatting is kept, please use the provided RTF file as a starting point (some advanced formating might get lost when starting from scratch). Once created, saved and closed, you can reopen the file with a text editor (like Notepad on Windows, or Leafpad on Linux), then copy all the raw text (RTF code) and paste it inside a document from hoteldruid.

Variables (all document formats)

Inside documents, you can use predefined variables that, if left empty, will be replaced by spaces to be filled up by hand. Use the Variables drop-down menu, on the document modification page, to easily add some variable: first choose a variable, then place the cursor where you want the variable inside the document, then click on the Add button. Some available variables that can be inserted are (the complete list is in the drop-down menu of the document modification page):

Client's data:

[surname]		surname
[name]			name
[birthdate]		birthday
[Mr]			'' (if male) or 's' (if female)
[nation]		origin nation
[city]			residence city
[street]		street
[street2]		the same as $street but if it's not 
			defined it inserts the word street 
			before the spaces
[street_number]		street number
[postal_code]		postal code
[telephone]		telephone number
[telephone2]		second telephone
[telephone3]		third telephone
[fax]			fax number

Reservation's data:

[people_num]		number of people
[extra_beds_num]	number of extra beds from the costs
[people_num_tot]	number of people + extra beds
[price_tot]		complete price
[deposit]		deposit
[deposit_rest]		complete price - deposit
[starting_date]		starting date
[ending_date]		departure date
[rate_name]		rate name
[rate_price]		price without extra costs and discount
[discount]		discount
[comment]		comment
[apartment]		apartment number
[apartment_list]	list of apartments that can be assigned 
			separated by commas
[paid]			what has been paid until now
[all_extra_costs]	list with all the extra costs and their
			respective values
[sel_extra_cost_name]	name of the extra cost selected before 
			viewing the document
[sel_extra_cost_value]	value of the extra cost selected before
			viewing the document
[today]			today date
[price_tot_p],		as the previous ones without final _p  
[deposit_p],[paid_p],	but formatted with points or commas  
[deposit_rest_p],	between thousands and decimals
[rate_price_p],
[discount_p],
[all_extra_costs_p],
[sel_extra_cost_value_p]
[repetition_error]	when not empty the current reservation 
			is not added to the document
[email_already_sent]	1 if an email with the same subject has 
			already been sent to client, otherwise 0
[error_message]		when not empty its contents are shown 
			instead of the document

Repetitions

The document parts that are enclosed in [r][/r] tags will be repeated for each reservation (if these tags are not present the whole document will be repeated). Inside these parts other lists can be inserted with tags [r2][/r2] (for guests) or [r3][/r3] (for extra costs). When creating a list with guest data (which is done with a [r2] repetition), you need to use the variables that end with the “_guest” suffix.


Rules to consider when editing a document:

  • when you have a repetition of reservations ([r][/r]) inside a repetition of dates ([r4 array=“dates_array”][/r4]), then only reservations that are present in current date will be repeated.
  • you can compare dates with format YYYY-MM-DD in “if” conditions, then the date format is changed when they are displayed or assigned to other variables
document.1523601940.txt.gz · Last modified: 2018/04/13 06:45 by ddam