Changes

Jump to navigation Jump to search

Template Variables

7,902 bytes added, 11:08, 15 August 2022
[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
[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
[APISOURCETEXT] - human readable name of the channel
[BOOKINGIP] - ip address of booker's computer [APIMESSAGE] - api message sent by originating channel [BOOKINGDATE] - booking datein guests language
[BOOKINGTIMEDATE] - booking date and timein guests language
[BOOKINGDATEYYYY-MM-DD] - booking date in YYYY-MM-DD format
[BOOKINGIP] - ip address of booker's computer [APIMESSAGE] - api message sent by originating channelsee date and time variables below for custom time formats.
=== Content from "Charges and Payments" tab (also see "Invoice/Invoicee/Room") ===
[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.
==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:{%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 in a custom format string.
[CURRENTTIME] - current time 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 any valid PHP strftime in a custom format string.
[DAYSTOCHECKIN] - number of days until check-in
[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 in a custom format string.
[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 in a custom format string.
[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 in a custom format string.
[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 in a custom format string.
[MODIFYDATE:{%A, %e %B, %Y}] - last booking modification date/time, the display can be any valid PHP strftime format string.
[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 in a custom format string. 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 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 %j Day of the year, 3 digits with leading zeros 001 to 366 %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) %U Week number of the given year, starting with the first Sunday as the first week 13 (for the 13th full week of the year) %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) %W A numeric representation of the week of the year, starting with the first Monday as the first week 46 (for the 46th week of the year beginning with a Monday) %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) %C Two digit representation of the century (year divided by 100, truncated to an integer) 19 for the 20th Century %g Two digit representation of the year going by ISO-8601:1988 standards (see %V) Example: 09 for the week of January 6, 2009 %G The full four-digit version of %g Example: 2008 for the week of January 3, 2009 %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 %k Hour in 24-hour format, with a space preceding single digits 0 through 23 %I Two digit representation of the hour in 12-hour format 01 through 12 %l (lower-case 'L') Hour in 12-hour format, with a space preceding single digits 1 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 "%I:%M:%S %p" Example: 09:34:17 PM for 21:34:17 %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 %T Same as "%H:%M:%S" Example: 21:34:17 for 09:34:17 PM %X Preferred time representation based on locale, without the date Example: 03:59:16 or 15:59:16 %z The time zone offset. Example: -0500 for US Eastern Time %Z The time zone abbreviation. Example: EST for Eastern Time %c Preferred date and time stamp based on locale Example: Tue Feb 5 00:45:10 2009 for February 5, 2009 at 12:45:10 AM %D Same as "%m/%d/%y" Example: 02/05/09 for February 5, 2009 %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 %x Preferred date representation based on locale, without the time Example: 02/05/09 for February 5, 2009 %n A newline character ("\n") %t A Tab character ("\t") %% A literal percentage character ("%")
== Booking Group variables ==
[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.
[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.
=== Invoice Values ===
==== Custom Invoice Values====
You have the option to create a custom invoice variable to display a value from an invoice. Available content [INVOICEVAL with a selection of the following variables arespecifies the calculation:
CHA - charges
DP4 - 4 decimal places
DES - used as "DESsome description " - gives the sum of values with 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
[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 ==
[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)
 
 
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 "
[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 ===
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]
 
<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 can also be used if you expect : or | characters within your data.
 
 
IF's are processed in the following order.
[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>:
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</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
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. == Write out the number in Words. ==
[INWORDS] - writes out a number in words. This works in English only.
Expamles:
[INWORDS] 10 will write out then"ten"
[INWORDS] [INVOICEPAYMENTSNUM] will write out the invoice sum of all payments
2,819

edits

Navigation menu