document
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
document [2018/04/13 07:47] – ddam | document [2020/03/14 22:53] (current) – ddam | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Document templates | + | Document templates are used by Hoteldruid |
+ | Thanks to the use of variables, repetitions and conditions, documents are a powerful | ||
- | === The Documents section | + | ====== |
- | Click on " | + | |
- | You'll find more examples of alredy usable documents after a fresh intall of hoteldruid. | + | |
+ | It's important to understand the logic of how documents function, which can be a little offsetting at first. There is two sides to documents: the first side is the visual part of the document, i.e. which data to display where inside the generated record. This happens on the main document modification page. The second side is the creation of the content itself, where you can use variables and rules that set those variables, as the record is being generated. This happens on the " | ||
- | === RTF Documents === | + | ===== Document modification page ===== |
- | To easily create an RTF document, you can write the text in your preferred word processing | + | |
+ | As administrator, | ||
+ | |||
+ | ==== Document formats ==== | ||
+ | |||
+ | 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). | ||
+ | You'll find more examples of already usable documents after a fresh install of Hoteldruid, or by restoring them from the Documents | ||
+ | |||
+ | |||
+ | === RTF/HTML documents | ||
+ | To easily create an RTF or HTML document, you can write the text in your preferred word processing | ||
=== Variables (all document formats) === | === Variables (all document formats) === | ||
- | Inside documents, you can use predefined variables that will take the corresponding value when the document | + | Inside documents, you can use predefined variables that will take the corresponding value when the record |
- | If you choose to edit your document directly on the document | + | |
+ | == Inline document editing == | ||
+ | For simple documents created for internal use (mainly text format documents), | ||
+ | |||
+ | == Available built-in variables == | ||
Some available variables that can be inserted are (the complete list is in the | Some available variables that can be inserted are (the complete list is in the | ||
- | drop-down menu of the document | + | drop-down menu of the Document |
Client' | Client' | ||
Line 54: | 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 67: | 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 73: | 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 === | ||
+ | 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 | The document parts that are enclosed in [r][/r] tags will be | ||
- | repeated for each reservation | + | repeated for each reservation. Inside these parts, other lists |
- | whole document will be repeated). Inside these parts, other lists | + | |
can be inserted with tags [r2][/r2] (for guests) or [r3][/ | can be inserted with tags [r2][/r2] (for guests) or [r3][/ | ||
- | (for extra costs). When creating a list with guest data (which is done with a [r2] repetition), | + | (for extra costs). |
- | You can use the '' | + | You can use the '' |
- | on the document | + | on the Document |
- | ---- | + | |
+ | == Caveats when using repetitions == | ||
- | Rules to consider | + | __Use specific variables inside repetitions__ |
+ | *r2 repetitions: | ||
+ | *r6 repetitions: | ||
+ | __Special cases__ | ||
+ | *r4 repetitions: when you have a repetition of reservations ([r][/r]) inside a repetition of dates ([r4 array=" | ||
+ | *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:** when deleting | ||
+ | |||
+ | Arrays are variables | ||
+ | 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.1523605672.txt.gz · Last modified: 2018/04/13 07:47 by ddam