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 06:45] – Added formatting / rephrased some parts ddam | document [2020/03/14 22:53] (current) – ddam | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | Use the [[http:// | + | Document |
+ | Thanks to the use of variables, repetitions and conditions, documents are a powerful | ||
- | 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. | + | |
+ | ===== Document modification page ===== | ||
- | === RTF Documents === | + | As administrator, |
- | To easily | + | |
- | Microsoft Word or LibreOffice/ | + | ==== Document formats ==== |
- | 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. | + | |
+ | 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 | ||
=== Variables (all document formats) === | === Variables (all document formats) === | ||
- | Inside documents, you can use predefined variables that, if left | + | Inside documents, you can use predefined variables that will take the corresponding value when the record is generated by Hoteldruid. Combined with repetitions, variables allow to iterate through lists of reservations, |
- | empty, will be replaced by spaces to be filled | + | |
+ | == Inline document editing == | ||
+ | For simple documents created for internal use (mainly text format documents), you may choose to edit your document directly on the Document modification page (instead of using an external editor/word processor); in that case, you can use the '' | ||
+ | |||
+ | == 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 60: | 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 73: | 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 79: | 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). | (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 " | + | You can use the '' |
- | ---- | + | on the Document modification page to easily add repetitions inside your documents.\\ |
+ | == 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.1523601940.txt.gz · Last modified: 2018/04/13 06:45 by ddam