document
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
document [2018/04/12 22:13] – ddam | document [2020/03/14 22:53] (current) – ddam | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | In this page you can Change create or change the number | + | Document templates are used by Hoteldruid to generate all kinds of records |
+ | Thanks to the use of variables, repetitions | ||
- | Here's an [[example]] of an invoice using HTML | + | ====== Editing documents ====== |
- | From " | + | It's important to understand |
- | can edit the texts of documents | + | |
- | The texts must be inserted in HTML or RTF format, or in simple | + | |
- | text to send emails. You'll find some examples | + | |
- | documents after intalling hoteldruid. To easily insert an RTF | + | |
- | document | + | |
- | Microsoft Word or OpenOffice Writer), and save it in RTF format, using all needed variables | + | |
- | text editor (like Notepad | + | |
- | In the documents you can use predefined variables that, if left | + | ===== Document modification page ===== |
- | empty, will be replaced by spaces to be filled | + | |
- | document | + | As administrator, |
- | repeated | + | |
- | whole document will be repeated). Inside these parts other lists | + | ==== Document formats ==== |
- | can be inserted with tags [r2][/ | + | |
- | (for extra costs). For example for the list with guests data the | + | Documents can be created in HTML, RTF, e-mail and text format. Here's an [[example]] of an invoice using HTML. Please note that the officially supported format is HTML (for support provided when subscribed to the hosted version). |
- | variables end all with the " | + | You'll find more examples of already usable documents after a fresh install of Hoteldruid, or by restoring them from the Documents backup page. |
- | variables that can be inserted are (the complete list is in the | + | |
- | page where you modify the document): | + | |
+ | === RTF/HTML documents === | ||
+ | To easily create an RTF or HTML document, you can write the text in your preferred word processing program (like Microsoft Word or LibreOffice/ | ||
+ | |||
+ | |||
+ | === Variables (all document formats) === | ||
+ | Inside documents, | ||
+ | |||
+ | == Inline | ||
+ | For simple documents created | ||
+ | |||
+ | == Available built-in variables == | ||
+ | Some available variables that can be inserted are (the complete list is in the | ||
+ | drop-down menu of the Document modification | ||
Client' | Client' | ||
Line 61: | Line 68: | ||
respective values | respective values | ||
[sel_extra_cost_name] name of the extra cost selected before | [sel_extra_cost_name] name of the extra cost selected before | ||
- | viewing the document | + | viewing the record |
[sel_extra_cost_value] value of the extra cost selected before | [sel_extra_cost_value] value of the extra cost selected before | ||
- | viewing the document | + | viewing the record |
[today] today date | [today] today date | ||
[price_tot_p], | [price_tot_p], | ||
Line 74: | Line 81: | ||
< | < | ||
- | is not added to the document | + | is not added to the record |
[email_already_sent] 1 if an email with the same subject has | [email_already_sent] 1 if an email with the same subject has | ||
already been sent to client, otherwise 0 | already been sent to client, otherwise 0 | ||
Line 80: | Line 87: | ||
instead of the document</ | instead of the document</ | ||
- | ---- | + | == Custom variables == |
+ | You may create and use custom variables as you see fit. Please refer to the " | ||
+ | === Repetitions === | ||
+ | Repetitions allow to iterate through lists: by enclosing variables | ||
+ | inside repetition tags, Hoteldruid will automatically replace the | ||
+ | variable names with the corresponding data, and loop through all | ||
+ | elements of the list. Example: < | ||
+ | will display surnames for all reservations from the current view (e.g. " | ||
+ | The document parts that are enclosed in [r][/r] tags will be | ||
+ | repeated for each reservation. Inside these parts, other lists | ||
+ | can be inserted with tags [r2][/r2] (for guests) or [r3][/ | ||
+ | (for extra costs). | ||
+ | You can use the '' | ||
+ | on the Document modification page to easily add repetitions inside your documents.\\ | ||
- | Rules to consider | + | == Caveats |
- | | + | __Use specific variables inside repetitions__ |
+ | | ||
+ | *r6 repetitions: | ||
+ | __Special cases__ | ||
+ | *r4 repetitions: | ||
+ | *The tags for reservations repetition ([r][/r]) are forbidden in multilingual mode (i.e. the whole document is repeated for each reservation).\\ | ||
+ | |||
+ | ===== " | ||
+ | On the lowest part of the Document modification page, you will find a button called " | ||
+ | |||
+ | === Custom variables and arrays === | ||
+ | You can create whichever variable you want, valid for just this document, or usable in all.\\ | ||
+ | **WARNING: | ||
+ | |||
+ | Arrays are variables of variables. They are key/value pairs: at each key (or index, or position) inside the array, is stored a value. | ||
+ | You can create arrays of any existing variable (custom or built-in). They can be useful when working with periods (e.g. arrays of days (r4)), or when you don't know exactly how many variables your document will need. | ||
+ | For instance, let's assume you want to count your guests by nationality: | ||
+ | |||
+ | ==== (Rule) conditions ==== | ||
+ | Rule conditions are at the heart of documents. By configuring them, ordering them, and nesting them (i.e. deciding inside which kind of repetition they should be used), you can set all your custom variables to the values you need, and then have those values appear inside the record. | ||
+ | |||
+ | **Caveat:** When nesting a repetition inside another one, e.g. an extra-costs repetition inside a reservation repetition, like: < | ||
+ | |||
+ | ------ | ||
+ | |||
+ | TBC | ||
* you can compare dates with format YYYY-MM-DD in " | * you can compare dates with format YYYY-MM-DD in " | ||
+ |
document.txt · Last modified: 2020/03/14 22:53 by ddam