Template Variables: Difference between revisions

Jump to navigation Jump to search
Lesley (talk | contribs)
Lesley (talk | contribs)
 
(84 intermediate revisions by 6 users not shown)
Line 4: Line 4:
  On this page you find a list of template variables and information on how they are used.  
  On this page you find a list of template variables and information on how they are used.  


These variables (short codes) will be replaced by the relevant information from each booking. They can be used in every text settings that allows their use . Copy them exactly as shown, including the square brackets and upper case.
These variables (short codes) will be replaced by the relevant information from each booking. They can be used in every text settings that allows their use. Copy them exactly as shown, including the square brackets and upper case.


The date variables can have an optional offset value of a number of days added after a colon, for example '''[FIRSTNIGHT:-3 days]'''
The date variables can have an optional offset value of a number of days added after a colon, for example '''[FIRSTNIGHT:-3 days]'''
Line 148: Line 148:
[ROOMID] - room id number
[ROOMID] - room id number


[ROOMNAME] - room names of all booked rooms (not for cancelled bookings use ROOMNAMEINC if used for cacelled bookings)
[ROOMNAME] - room names of all booked rooms (not for cancelled bookings use ROOMNAMEINC if used for cancelled bookings)


[ROOMNAMEBR] - room names with line break
[ROOMNAMEBR] - room names with line break
Line 214: Line 214:
[ROOMTEMPLATE8BR] - ROOM  Template 8  with linkbreak
[ROOMTEMPLATE8BR] - ROOM  Template 8  with linkbreak


[ROOMMETAAUXTEXT] - room meta text setting for first booked room
[ROOMMETAAUXTEXT] - room auxiliary text setting for first booked room {{#fas:cog}} (SETTINGS) PROPERTIES > ROOMS > SETUP > DISPLAY


[ROOMMETAAUXTEXTS] - room meta text setting for all booked rooms
[ROOMMETAAUXTEXTS] - room auxiliary text setting for all booked rooms  


[ROOMMETAAUXTEXTSINC] - room auxiliary text setting for all booked rooms
[ROOMMETAAUXTEXTSINC] - room auxiliary text setting for all booked rooms, incl. cancelled bookings


[INTERNALROOMNAME] - internal room name as used in the control panel, this is not the translated room name shown on the booking page
[INTERNALROOMNAME] - internal room name as used in the control panel, this is not the translated room name shown on the booking page


[OFFERID]  - ID of the boked offer
[OFFERID]  - ID of the booked offer


[OFFERNAME] - booked offer name for all booked rooms
[OFFERNAME] - booked offer name for all booked rooms
Line 246: Line 246:
[OFFERSUMMARYINC] - summary offers including cancelled bookings
[OFFERSUMMARYINC] - summary offers including cancelled bookings


[UNITID] - ID of the unit (number)
[UNITID1] - ID of the unit (number) for this booking number (coming soon)


[UNITNAME] - unit names of all the assigned room types in the booking group (cancelled bookings are not shown)
[UNITNAME] - unit names of all the assigned room types in the booking group (cancelled bookings are not shown)
Line 267: Line 267:


[LEAVINGDAYAVAIL] - returns yes or no, can be used to trigger an Auto Action
[LEAVINGDAYAVAIL] - returns yes or no, can be used to trigger an Auto Action
[NUMROOMSAVAIL] - returns the number of available rooms (-1 if overbooked), can be used to trigger an Auto Action


[ROOMRACKRATENUM] - Rack Rate from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMRACKRATENUM] - Rack Rate from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
Line 272: Line 274:
[ROOMCLEANINGFEENUM]  - Cleaning fee from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMCLEANINGFEENUM]  - Cleaning fee from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT


[ROOMSECURITYDEPOSITNUM]  - Securty deposit from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMSECURITYDEPOSITNUM]  - Security deposit from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT


[ROOMTAXPERCENTNUM]  - Tax percentate from from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
[ROOMTAXPERCENTNUM]  - Tax percentate from from {{#fas:cog}} (SETTINGS) CHANNEL MANAGER > PROPERTY CONTENT > ROOM CONTENT
Line 325: Line 327:
[RANDOM8] - a 8 digit random number seeded from the booking number
[RANDOM8] - a 8 digit random number seeded from the booking number


[VOUCHERPHRASE1] - Voucher Phrase - change the nubmer to the voucher  you want to print out.
[VOUCHERPHRASE1] - Voucher Phrase - change the number to the voucher  you want to print out.


[VOUCHERAMOUNT1]  - Voucher Amount - change the nubmer to the voucher you want to print out.
[VOUCHERAMOUNT1]  - Voucher Amount - change the number to the voucher you want to print out.


=== Content from "Info" tab ===
=== Content from "Info" tab ===
Line 438: Line 440:


[GUESTMOBILENUM] - guests mobile number with all non-numeric characters removed
[GUESTMOBILENUM] - guests mobile number with all non-numeric characters removed
[MOBILELAST1] last digit of the guests mobile number, if mobile is empty the guests phone number will be used.
[MOBILELAST2] last 2 digits of the guests mobile number, if mobile is empty the guests phone number will be used.
[MOBILELAST3] last 3 digits of the guests mobile number, if mobile is empty the guests phone number will be used.
[MOBILELAST4] last 4 digits of the guests mobile number, if mobile is empty the guests phone number will be used.
[MOBILELAST5] last 5 digits of the guests mobile number, if mobile is empty the guests phone number will be used.
[MOBILELAST6] last 6 digits of the guests mobile number, if mobile is empty the guests phone number will be used.


[PHONELAST1]  - last digit of the guests phone number if guest phone is empty it will use the guests mobile number
[PHONELAST1]  - last digit of the guests phone number if guest phone is empty it will use the guests mobile number
Line 556: Line 570:
[APISOURCETEXT] - human readable name of the channel
[APISOURCETEXT] - human readable name of the channel


[BOOKINGDATE] - booking date
[BOOKINGIP] - ip address of booker's computer
 
[APIMESSAGE] - api message sent by originating channel from the Channel Info setting
 
[BOOKINGDATE] - booking date in guests language


[BOOKINGTIMEDATE] - booking date and time
[BOOKINGTIMEDATE] - booking date and time in guests language


[BOOKINGDATEYYYY-MM-DD] - booking date in YYYY-MM-DD format
[BOOKINGDATEYYYY-MM-DD] - booking date in YYYY-MM-DD format


[BOOKINGIP] - ip address of booker's computer
see date and time variables below for custom time formats.
 
[APIMESSAGE] - api message sent by originating channel


=== Content from "Charges and Payments" tab (also see "Invoice/Invoicee/Room") ===
=== Content from "Charges and Payments" tab (also see "Invoice/Invoicee/Room") ===
Line 637: Line 653:
[COMMISSIONNUM] - As per [COMMISSION] but the value is displayed with a decimal point and no thousands separator and no currency symbols (for calculation)
[COMMISSIONNUM] - As per [COMMISSION] but the value is displayed with a decimal point and no thousands separator and no currency symbols (for calculation)


[COMMISSIONGROUP]  - Value of the commission of the complete group booking
[COMMISSIONGROUP]  - Value of the commission of the complete group booking with currency symbol
 
[COMMISSIONGROUPNUM]  - As per [COMMISSIONGROUP] but the value is displayed with a decimal point and no thousands separator and no currency symbols (for calculation)


[GUESTVOUCHER] - voucher code used with booking
[GUESTVOUCHER] - voucher code used with booking
Line 654: Line 672:


=== Content from "Mail & Actions" tab ===
=== Content from "Mail & Actions" tab ===
[GUESTEMAIL] - guest's Email address on the "summary" tab of the booking
[GUESTEMAIL] - guest's Email address on the "Mail & Action" tab of the booking


[GUESTLANGUAGE] - guest language
[GUESTLANGUAGE] - guest language
Line 684: Line 702:


[GUESTSADDRESSSBR1INC] - address of the first guest on the "guests" tab of this booking group incl. cancelled
[GUESTSADDRESSSBR1INC] - address of the first guest on the "guests" tab of this booking group incl. cancelled
[GUESTSAFULLADDRESSSBR1INC] - the first address including city, postcode, sate and country from the guests tab of the booking including cancelled bookings in international  format
[GUESTSAFULLADDRESSSBR1] - the first address including city, postcode, sate and country from the guests tab of the booking in International format
[GUESTSBFULLADDRESSSBR1INC]  - the first address including city, postcode, sate and country from the guests tab of the booking including cancelled bookings in  European format
[GUESTSBFULLADDRESSSBR1]  - the first address including city, postcode, sate and country from the guests tab of the booking in European format


[GUESTSNUMBOOKINGS1] - the total number of bookings made by the first guest, a group booking counts as one booking.
[GUESTSNUMBOOKINGS1] - the total number of bookings made by the first guest, a group booking counts as one booking.
Line 732: Line 758:
[CANCELLEDTIME] - date when the booking was cancelled  
[CANCELLEDTIME] - date when the booking was cancelled  


[CANCELLEDTIME:] - date when the booking was cancelled display can be any valid PHP strftime format string
[CANCELLEDTIME:{%A, %e %B, %Y}] - date when the booking was cancelled


[CANCELURL] - URL to view and cancel bookings  
[CANCELURL] - URL to view and cancel bookings  
Line 740: Line 766:
[CANCELDATEYYYY-MM-DD] - date until when the booking is cancellable displaying a date. If the date is in the past 00-00-0000 will be shown
[CANCELDATEYYYY-MM-DD] - date until when the booking is cancellable displaying a date. If the date is in the past 00-00-0000 will be shown


[DAYSTOCANCEL] - number of days until booking can be cancelled  
[DAYSTOCANCEL] - number of days from today until booking can no longer be cancelled (Not applicable for OTA bookings)


[CANCELUNTIL] - shows the number of days between check-in and the last day which can be cancelled. If guest can always cancel it shows 0, if guest can never cancel it shows 9999
[CANCELUNTIL] - shows the number of days between check-in and the last day the booking can be cancelled. If guest can always cancel it shows 0, if guest can never cancel it shows 999. (Not applicable for OTA bookings)


[GUESTLOGIN] - URL to view bookings
[GUESTLOGIN] - URL to view bookings


[TURNOVERDAYS] - days until next arrival into the same unit
[TURNOVERDAYS] - days until next arrival into the same unit not considering black bookings


[VACANTDAYS]  days from previous checkout to check in of current booking
[TURNOVERDAYSB] - days until next arrival into the same unit considering black bookings
 
[VACANTDAYS]  days from previous checkout to check in of current booking not considering black bookings
 
[VACANTDAYSB]  days from previous checkout to check in of current booking considering black bookings


==Date and Time==
==Date and Time==
Many date template variables support PHP strftime format strings between {} brackets to create custom date formats. Information on PHP strftime strings is available at [http://php.net/manual/en/function.strftime.php http://php.net/manual/en/function.strftime.php]


[CURRENTDATE] - current date
[CURRENTDATE] - current date
Line 760: Line 788:
[CURRENTDATE:{%A, %e %B, %Y}] - current date
[CURRENTDATE:{%A, %e %B, %Y}] - current date


[CURRENTDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[CURRENTDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[CURRENTTIME] - current time and the display can be any valid PHP strftime format string.
[CURRENTTIME] - current time.


[CURRENTTIME:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[CURRENTTIME:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[DAYSTOCHECKIN] -  number of days until check-in
[DAYSTOCHECKIN] -  number of days until check-in
Line 776: Line 804:
[FIRSTNIGHT:{%A, %e %B, %Y}] -  first night booked
[FIRSTNIGHT:{%A, %e %B, %Y}] -  first night booked


[FIRSTNIGHT:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[FIRSTNIGHT:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[LASTNIGHT:{%A, %e %B, %Y}] -  last night booked
[LASTNIGHT:{%A, %e %B, %Y}] -  last night booked


[LASTNIGHT:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[LASTNIGHT:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[LEAVINGDAY:{%A, %e %B, %Y}] -  check-out  
[LEAVINGDAY:{%A, %e %B, %Y}] -  check-out  


[LEAVINGDAY:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[LEAVINGDAY:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[BOOKINGDATE:{%A, %e %B, %Y}] - booking date
[BOOKINGDATE:{%A, %e %B, %Y}] - booking date


[BOOKINGDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.
[BOOKINGDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format.


[MODIFYDATE:{%A, %e %B, %Y}] - last booking modification date/time, the display can be any valid PHP strftime format string.
[MODIFYDATE:{%A, %e %B, %Y}] - last booking modification date/time.


[PAYMENTDATE:{%A, %e %B, %Y}] - most recent payment date
[PAYMENTDATE:{%A, %e %B, %Y}] - most recent payment date


[PAYMENTDATE:+1day{%A, %e %B, %Y}:1:1000] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string. The second parameter specifies the payment to show, 0 or missing means the most recent payment. The third parameter specifies the invoicee.
[PAYMENTDATE:+1day{%A, %e %B, %Y}:1:1000] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be in a custom format. The second parameter specifies the payment to show, 0 or missing means the most recent payment. The third parameter specifies the invoicee.
 
[AUTHORIZEUNTIL] - date until which a card is authorized, this is extracted from the most recent authorize booking info code.
 
[AUTHORIZEUNTIL{%A, %e %B, %Y}] - custom format date until which a card is authorized, this is extracted from the most recent authorize booking info code.
 
[FORMATDATE:[any template variable that creates a date]{%A, %e %B, %Y}] - custom format the date. The date value could be included by inserting a different template variable containing a date.
 


[FORMATDATE:[any template variable that creates a date]{%A, %e %B, %Y}] - format the date in the strftime format. The date value could be included by inserting a different template variable containing a date.
The following codes can be used in any order between the {} brackets to create custom time and date formats.
 
    %a An abbreviated textual representation of the day Sun through Sat 
    %A A full textual representation of the day Sunday through Saturday 
    %d Two-digit day of the month (with leading zeros) 01 to 31 
    %e Day of the month, with a space preceding single digits. 1 to 31 
    %u ISO-8601 numeric representation of the day of the week 1 (for Monday) through 7 (for Sunday) 
    %w Numeric representation of the day of the week 0 (for Sunday) through 6 (for Saturday) 
    %V ISO-8601:1988 week number of the given year, starting with the first week of the year with at least 4 weekdays, with Monday being the start of the week 01 through 53 (where 53 accounts for an overlapping week) 
    %b Abbreviated month name, based on the locale Jan through Dec 
    %B Full month name, based on the locale January through December 
    %h Abbreviated month name, based on the locale (an alias of %b) Jan through Dec 
    %m Two digit representation of the month 01 (for January) through 12 (for December) 
    %y Two digit representation of the year Example: 09 for 2009, 79 for 1979 
    %Y Four digit representation for the year Example: 2038 
    %H Two digit representation of the hour in 24-hour format 00 through 23 
    %I Two digit representation of the hour in 12-hour format 01 through 12 
    %M Two digit representation of the minute 00 through 59 
    %p UPPER-CASE 'AM' or 'PM' based on the given time Example: AM for 00:31, PM for 22:23 
    %P lower-case 'am' or 'pm' based on the given time Example: am for 00:31, pm for 22:23 
    %R Same as "%H:%M" Example: 00:35 for 12:35 AM, 16:44 for 4:44 PM 
    %S Two digit representation of the second 00 through 59 
    %F Same as "%Y-%m-%d" (commonly used in database datestamps) Example: 2009-02-05 for February 5, 2009 
    %s Unix Epoch Time timestamp (same as the time() function) Example: 305815200 for September 10, 1979 08:40:00 AM 
    %% A literal percentage character ("%")


== Booking Group variables ==
== Booking Group variables ==
Line 818: Line 877:
BREF = Booking number
BREF = Booking number


CITY = Booking city
BRL1 = Last digit of booking number


CHAC = Charges with currency symbol
BRL2 = Last 2 digits of booking number


CHAR = Charges
BRL3 = Last 3 digits of booking number
 
BRL4 = Last 4 digits of booking number
 
BRL5 = Last 5 digits of booking number
 
BRL6 = Last 6 digits of booking number
 
CITY = Booking city
 
CHAC = Charges with currency symbol
 
CHAR = Charges


CHIL = Number of children
CHIL = Number of children
Line 879: Line 950:


NOTE = Booking note
NOTE = Booking note
NUMN = Number of nights booked


ONAM = Offer Name  
ONAM = Offer Name  
Line 885: Line 958:


PAIC = Payment amount with currency symbol
PAIC = Payment amount with currency symbol
PADD = Property Address


PAID = Paid amount
PAID = Paid amount
PCIT = Property City


PEOP = Number of guests
PEOP = Number of guests
Line 909: Line 986:


STUS = Status
STUS = Status
TEXT = Prints a plain text table instead of HTML


TOTA = Total price
TOTA = Total price
Line 956: Line 1,035:
[INVOICEDATES] - invoice date invoice number if invoicees are involved
[INVOICEDATES] - invoice date invoice number if invoicees are involved


[INVOICEDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.  
[INVOICEDATE:+1day{%A, %e %B, %Y}] - optional date offset and display format. The offset can be any plus or minus any number of days.  


[INVOICEDATES+1day{%A, %e %B, %Y}] - optional date offset and display format - invoice date invoice number if invoicees are involved, The offset can be any plus or minus any number of days and the display can be any valid PHP strftime format string.  
[INVOICEDATES:+1day{%A, %e %B, %Y}] - optional date offset and display format - invoice date invoice number if invoicees are involved, The offset can be any plus or minus any number of days.  


=== Invoice Values ===
=== Invoice Values ===
Line 964: Line 1,043:


==== Custom Invoice Values====
==== Custom Invoice Values====
You have the option to create a custom invoice variable to display a value from an invoice. Available content variables are:  
You have the option to create a custom invoice variable to display a value from an invoice. [INVOICEVAL with a selection of the following variables specifies the calculation:  


CHA - charges
CHA - charges
Line 982: Line 1,061:
DP4 - 4 decimal places  
DP4 - 4 decimal places  


DESsome description - sum of values with "some description"
DES - used as "DESsome description" - gives the sum of values containing the description "some description"


INV - invoicee, add the invoicee number at the end. Example: INV20 to show invoicee number 20, INV0 will show items not assigned to an invoicee, INV-1 will show all items from the booking regardless of invoicee. You can combine INV[BOOKINGINVOICEEID]] to add the invoicee from the booking  
INV - invoicee, add the invoicee number at the end. Example: INV20 to show invoicee number 20, INV0 will show items not assigned to an invoicee, INV-1 will show all items from the booking regardless of invoicee. You can combine INV[BOOKINGINVOICEEID]] to add the invoicee from the booking  
Line 1,083: Line 1,162:


[INVOICEPENDPAYNEXTDATE]  - date of the next pending payment
[INVOICEPENDPAYNEXTDATE]  - date of the next pending payment
[INVOICEPENDPAYNEXTDATE:]  - date of the next pending payment display can be any valid PHP strftime format string. Information about PHP strftime Strings can be find found here: http://php.net/manual/de/function.strftime.php


[INVOICEPENDPAYNUM] - all (auto and manual) pending payments including failed but the value is displayed with a decimal point and no thousands separator (for calculation).
[INVOICEPENDPAYNUM] - all (auto and manual) pending payments including failed but the value is displayed with a decimal point and no thousands separator (for calculation).
Line 1,382: Line 1,459:


[INVOICE:PRI_QTY_CUA_TOT_VAT_QTY_PAY_GRT_AMO_VAA] will create an invoice table with more information.
[INVOICE:PRI_QTY_CUA_TOT_VAT_QTY_PAY_GRT_AMO_VAA] will create an invoice table with more information.
[INVOICE:SIN TRANSPORT] will create an invoice table with the Invoice item description for any items with the Status = Transport.


== Invoicee Variables ==
== Invoicee Variables ==
Line 1,413: Line 1,492:


[INVOICEECURRENCY] - currency of the invoicee account the invoice is assigned to if it is not the property default or blank
[INVOICEECURRENCY] - currency of the invoicee account the invoice is assigned to if it is not the property default or blank
[INVOICEENOTES] - value of the "Notes" field for the invoicee


[INVOICEETEMPLATE1] - template value 1 of the invoice account the invoice is assigned to or blank
[INVOICEETEMPLATE1] - template value 1 of the invoice account the invoice is assigned to or blank
Line 1,489: Line 1,570:


[REPLACE|searchForThisText|replaceWithThisText|textToSearch] - replace "searchForThisText" with "replaceWithThisText" within the text "textToSearch"
[REPLACE|searchForThisText|replaceWithThisText|textToSearch] - replace "searchForThisText" with "replaceWithThisText" within the text "textToSearch"


[SUBSTR|startCharacterNumber|numberOfCharacters|textToGetSubstringFrom] - get a sub string from "textToGetSubstringFrom" starting at character "startCharacterNumber" (integer, 0 is the first char) with a length of "numberOfCharacters" (integer)
[SUBSTR|startCharacterNumber|numberOfCharacters|textToGetSubstringFrom] - get a sub string from "textToGetSubstringFrom" starting at character "startCharacterNumber" (integer, 0 is the first char) with a length of "numberOfCharacters" (integer)
1. [SUBSTR|0|4|[GUESTPHONENUM]]
This will test for the first 4 characters of the Guest phone number.


[TRIM|  string to trim  ] - remove whitespace from the start and end of "  string to trim  "
[TRIM|  string to trim  ] - remove whitespace from the start and end of "  string to trim  "
Line 1,534: Line 1,622:


[INVOICECHARGESNUM][*]0.2[-][INVOICESECONDITEMNUM][*]0.2[-][COMMISSIONNUM][*]0.2
[INVOICECHARGESNUM][*]0.2[-][INVOICESECONDITEMNUM][*]0.2[-][COMMISSIONNUM][*]0.2
<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span> Property Template 1-8 and Room Template 1-8 can be used to set calculations. If using Room Templates to make a calculation, then use Room Template 8 before Room Template 7.
If you want to see the value 10.
Set Room template 6 = [ROOMTEMPLATE7][+][ROOMTEMPLATE8] and enter 4 in Room template 7 and 6 in Room template 8.
You can set a calculation in Room Templates to show in Property Templates, but not the other way around. So "Property Template1" could pull the calculation of [ROOMTEMPLATE6] and the result = 10.


=== Rounding and controlling decimal places ===
=== Rounding and controlling decimal places ===
Line 1,568: Line 1,664:
If you use the multiplier to convert currencies for channels:  For example hotel id 123456 and a multiplier to convert USD to EUR at todays rate:
If you use the multiplier to convert currencies for channels:  For example hotel id 123456 and a multiplier to convert USD to EUR at todays rate:


123456*[CONVERT:USD-EUR]*
123456*[CONVERT:USD-EUR]* then addition of the * at the end will convert the value back to USD when the booking is imported


or this to convert EUR to USD
or this to convert EUR to USD
Line 1,649: Line 1,745:


You can use IF variables inside other IF variables to create complex logic but the internal IF: must be processed before the external IF
You can use IF variables inside other IF variables to create complex logic but the internal IF: must be processed before the external IF
There are special versions of each IF constructed with ^ and ~ separators like [IF=^this^this^same~different]
There are special versions of each IF constructed with ^ and ~ separators like [IF=^this^this^same~different]
<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span>Only one IF of each type can be used to create complex logic.
The special versions are processed first so should be used as the internal IF so it's result can be processed by the outer if.
The special versions are processed first so should be used as the internal IF so it's result can be processed by the outer if.
The special versions can also be used if you expect : or | characters within your data.
The special versions can also be used if you expect : or | characters within your data.


IF's are processed in the following order.
IF's are processed in the following order.
Line 1,673: Line 1,776:
[IFBETWEEN:
[IFBETWEEN:


=== Examples ===


Template variables can be used inside this template variable as per the examples <span style="color: #019cde">comparison in blue</span>, <span style="color: #75d5ad">positive result in green</span>, <span style="color: #fe746c">negative result in red</span>:
Template variables can be used inside this template variable as per the examples <span style="color: #019cde">comparison in blue</span>, <span style="color: #75d5ad">positive result in green</span>, <span style="color: #fe746c">negative result in red</span>:
Line 1,694: Line 1,799:
6. [<span style="color: #019cde">IFBETWEEN:[NUMADULT]:1:3</span><span style="color: #75d5ad">:yes</span><span style="color: #fe746c">|too low|too high</span>]
6. [<span style="color: #019cde">IFBETWEEN:[NUMADULT]:1:3</span><span style="color: #75d5ad">:yes</span><span style="color: #fe746c">|too low|too high</span>]


7. [<span style="color: #019cde">IFLIKE:[GUESTTITLE]</span><span style="color: #75d5ad">:Mr:Dear|Hi</span>]
7. [<span style="color: #019cde">IFLIKE:[GUESTTITLE]</span><span style="color: #75d5ad">:Mr:Dear</span><span style="color: #fe746c">|Hi</span>]


IFLIKE works like IF= except it is case insensitive and removes any spaces from the start and end of the words
IFLIKE works like IF= except it is case insensitive and removes any spaces from the start and end of the words
Line 1,706: Line 1,811:
If the Booking Info Code CHECKIN has been added to the booking then you will see the value in the text (date/time) otherwise blank.  
If the Booking Info Code CHECKIN has been added to the booking then you will see the value in the text (date/time) otherwise blank.  


Using multiple IF statements to display special messages :-
10. [<span style="color: #019cde">IFIN:DEPOSIT:[BOOKINGINFOCODES]:|[IF=:[GUESTCOUNTRY2]:AU</span><span style="color: #75d5ad">:Credit card details are required </span><span style="color: #fe746c">|A deposit is required]|No deposit is required</span>]
You want  to display a special message to Australians if the booking has a DEPOSIT info item code, if a deposit is required from a non Australia they get "A deposit is required" and if no deposit is required they see "No deposit is required"
11. [<span style="color: #019cde">IF<:[INADVANCE]:|[IFIN:TRANSFER:[BOOKINGINFOCODES]:3</span><span style="color: #75d5ad">:Payment Due Date: ASAP </span><span style="color: #fe746c">|Payment Due Date: [FIRSTNIGHT:- 30days]]|</span>]
You want display a special message to your guests 3 days before checkin with a Booking Info Code = TRANSFER.
12. [<span style="color: #019cde">IF=:[STATUS]:Confirmed:PAID|[IF<^[INADVANCE]^30</span><span style="color: #75d5ad">^Payment Due Date: As soon as possible</span><span style="color: #fe746c">~Payment Due Date: [FIRSTNIGHT:- 30 days]]</span>]
You want to display a special message for your guests for any bookings with Status not = Confirmed, and if the checkin date is more than 30 days in advance, then send the message with "Payment Due Date : "or that the "Payment is due As soon as possible".


13. [<span style="color: #019cde">IFBETWEEN:[TURNOVERDAYS]:0:3:</span><span style="color: #75d5ad">yes|</span><span style="color: #fe746c">no</span>]
You want to test if the days until next arrival into the same unit is between 0 and 3 days. Could be used for offering Late Checkouts or additional days to the guest where there is a gap between bookings.
14. [<span style="color: #019cde">IF>:[VACANTDAYS]:1:</span><span style="color: #75d5ad">yes|</span><span style="color: #fe746c">no</span>]
You want to test if there is 1 day from the previous checkout to check in of current booking. Could be used for offering Early Checkouts or additional days to the guest where there is a gap between bookings.
15. [<span style="color: #019cde">IF=:[LEAVINGDAY:{%a}]:Sun:|[IF>=^[TURNOVERDAYS]^1</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">~no]</span>]
You want to test if the leaving date is a Sunday and it there is a gap for 1 or more days between the current booking and the next booking.
16. [<span style="color: #019cde">IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]
You want to test if the leaving date is a Monday or a Wednesday to send a specific message to the guest, for example a reminder that it is bin collection day.
17. [<span style="color: #019cde">IF=:[LEAVINGDAY:{%u}]:1:yes|[IF=^[LEAVINGDAY:{%u}]^3^yes][IF=^[LEAVINGDAY:{%u}]^6</span><span style="color: #75d5ad">^yes</span><span style="color: #fe746c">]</span>]
You have different cleaning teams for different days of the week, and you want to send a message to the appropriate team if leaving date is a Monday, Wednesday or Saturday.
18. [<span style="color: #019cde">IF<^[AUTHORIZEUNTIL{%Y-%m-%d}]^[CURRENTDATEYYYY-MM-DD]^yes~</span><span style="color: #75d5ad">no</span><span style="color: #fe746c"></span>]
You need to test if the Stripe authorisation has expired before the end of the booking. Then you want to automate the authorisation again . You will require multiple auto actions based on the min/max stay.
== Write out the number in Words. ==


[INWORDS]  - writes out a number in words. This works in English only.  
[INWORDS]  - writes out a number in words. This works in English only.  
Line 1,712: Line 1,855:
Expamles:  
Expamles:  


[INWORDS] 10 will write out then
[INWORDS] 10 will write "ten"


[INWORDS] [INVOICEPAYMENTSNUM] will write out the invoice sum of all payments  
[INWORDS] [INVOICEPAYMENTSNUM] will write out the invoice sum of all payments  


[INWORDS] [INVOICEPAYMENTSNUM] [+] 10 will write out the invoice sum of all payments plus 10
[INWORDS] [INVOICEPAYMENTSNUM] [+] 10 will write out the invoice sum of all payments plus 10
Example: You want  to display a special message to Australians if the booking has a DEPOSIT info item code, if a deposit is required from a non Australia they get "A deposit is required" and if no deposit is required they see "No deposit is required"
[<span style="color: #019cde">IFIN:DEPOSIT:[BOOKINGINFOCODES]:[IF=:[GUESTCOUNTRY2]:AU</span><span style="color: #75d5ad">:Credit card details are required </span><span style="color: #fe746c">|A deposit is required]|No deposit is required</span>]


== Encoding Template Variables ==  
== Encoding Template Variables ==  
Line 1,729: Line 1,868:




Note: Always use the template variables ending with NUM if numbers are involved. The math functions will only work with numbers with a decimal point (not a decimal comma) and no thousands separator and no currency symbol.
<span style="color: #f3e504; font-size: 150%;" >{{#fas:lightbulb}} </span>  Always use the template variables ending with NUM if numbers are involved. The math functions will only work with numbers with a decimal point (not a decimal comma) and no thousands separator and no currency symbol.
 
== Using Template Variables in a HTML editor ==
When using template variables that render tables, such as [INVOICETABLE], do not place them inside <nowiki><p></nowiki> (paragraph) tags. Doing so can lead to formatting issues that affect the table’s appearance.
 
We recommend inserting the template variable as usual, then clicking the </> Code view button in the editor's toolbar. Then in the code view, locate the template variable and move it outside any surrounding <nowiki><p></nowiki> tags.
 
For example, if you have this in the editor:
<code>[INVOICETABLE]</code>
You can click the <code>&lt;/&gt;</code> button to see this:
<code>&lt;p&gt;[INVOICETABLE]&lt;/p&gt;</code>
You can fix the formatting issues by changing it to this:
<code>&lt;p&gt;&lt;/p&gt;[INVOICETABLE]</code>