previous

User Definable Functions (UDFs)

The following user defined functions are available.

Generates Functions

Packages Functions

Generates Functions

Luxury Tax on Published Rate

Description

This function calculates a tax generate based on a user-specified rate code (e.g., published rate)  that may be different than the rate code explicitly assigned to the reservation (charged rate).

Note: The Luxury Tax on Published Rate calculates the tax based on the rate detail amount (for the published-rate RATE_CODE) for each date of the reservation and the number of adults and children attached to the reservation each day of the stay.

Function

LuxuryTax_on_published_rate (RESV_NAME_ID, 'RATE_CODE', percent)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

'RATE_CODE'

Rate code on which tax is to be based.

percent

Tax percent.

Example

To calculate a 5.25% tax based on the published rack rate (RACK) rather than on the guest's charged rate:

LuxuryTax_on_published_rate (RESV_NAME_ID, 'RACK', 5.25)

Generate Based on Adults

Description

This function accepts a number (e.g., a package price or allowance) and multiplies it against the number of adults associated with the reservation.

Function

generate_on_adults (RESV_NAME_ID,number)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

number

A number (e.g., a package price or allowance)

Example

Assume that a meal allowance on a transaction code is based on the number of adults on the reservation. If the meal allowance is 140 per adult, use this function as follows to determine the allowance:

generate_on_adults (RESV_NAME_ID,140)

GEN Tax UDF

Description

This function calculates an accommodation tax that depends on the net room rate per adult as described below.

Default "threshold" net room rate values and the resulting per-adult tax amounts are hard coded into the function; however, the function (gen_tax_udf.fun) may be edited to change these values.

Function

udf_city_tax(RESV_NAME_ID, BASE)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

BASE

Net room rate per adult (excluding tax, service charges, package elements).

Example 1

Two guests are sharing a room, each with a (split) rate of 8000 (total 16,000). Zero tax is applicable since the rate per person (16,000/2) is less than 10,000. If the sharing guest has a zero rate (the primary guest has a 16,000 rate and the sharer has a 0 rate), the rate per adult is still less than 10,000 (16,000/2) and the tax is 0.

Example 2

If the net room rate is 12,500 for each of 2 sharing guests (the per-adult rate is between 10,000 and 15,000), a tax of 100 would be posted to each guest. If the sharing guest has a zero rate (the primary guest has a 25,000 rate and the sharer has a 0 rate), the rate per adult is 12,500 (25,000/2) the tax is 200.

Calculate Tax (General Excise Tax) on Rate Code if Package is Included

Description

This function calculates a tax on the full amount of a rate code if (and only if) a reservation has a package attached either to the rate code or directly on the reservation. The function will check if a package exists on the reservation, and if so, calculate the specified percentage over the full amount. This function should be configured as a generate on the lodging transaction code.

Function

gen_tax_udf_full(RESV_NAME_ID,BASE,get_tax)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

BASE

Rate amount (excluding other taxes and service charges). Rate amount includes packages.

get_tax

Tax to be applied to full amount of the rate code

Example 1

All generates are configured as Tax Exclusive.

Rate for Rate Code TEST for 1 person is 500.00 (which includes a package for Breakfast for 20.00). Sales tax is 7.25% and TAT (Transient Accommodation Tax) is 7.25% on Room only. GET (General Excise Tax) is 4.166%.

The Sales tax, TAT and GET are configured using generates on their transaction codes.

GET generate employs gen_tax_udf_full function to calculate 4.166% over 500.

gen_tax_udf_full(resv_name_id,base,4.166)

Create a reservation with the rate and check it in. Post room and tax. The postings are as follows:

VIENNA TAX UDF Function (generic functionality)

Description

A function for taxes has been created for all properties located in Vienna (or other locations, as appropriate) to ensure the correct calculation of the city tax. The VIENNATAX function takes the number of adults on a reservation and multiplies it by the amount of the packages. This amount is then subtracted from the share amount and the new amount is multiplied by a factor that corresponds to the tax percentage; the default factor is .021655 which corresponds to a 15% tax. The formula used is (SHARE_AMOUNT - ( ADULTS * (sum of all the inclusive package prices)) ) * 0.021655).

Note: When the Reservations>Room Type To Charge application parameter is set to Y, the Vienna Tax function takes into account the changed room type shown in the RTC field on the reservation.

Function

VIENNATAX(RESV_NAME_ID,OPERATION_NAME,POSTED_AMOUNT,calculation_rule_amount)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function. The default is null.

OPERATION_NAME

Posting routine (e.g., End of Day processing)

POSTED_AMOUNT

Posted amount on which the tax is to be calculated.

calculation_rule_amount

The multiplication factor as determined by the taxing entity. The default is 0.021655 (which corresponds to 15%). Other commonly used factors are 0.022517 (10.5%); 0.022126 (12.5%); 0.024823 (0%).

Example

When configuring a room charge transaction code, the function would be added via the UDF Function for the generate attached to the room transaction code as:
VIENNATAX(RESV_NAME_ID,OPERATION_NAME,POSTED_AMOUNT,0.021655)


If, as in this case, the default calculation_rule_amount is being used, you might also specify:
VIENNATAX(RESV_NAME_ID,OPERATION_NAME,POSTED_AMOUNT)


Create a tax transaction code (i.e., 555)

Created a new room charge transaction code (i.e., 666)

Select the room charge transaction code (666) and select the Generates button.

Select the appropriate tax transaction code, (i.e., 555), and via the UDF Function radio button, add the UDF function as VIENNATAX(RESV_NAME_ID,OPERATION_NAME,POSTED_AMOUNT,0.021655)

Create a rate code of VIENNA (tax inclusive), using the room charge transaction code of 666, with a price 300.00.

Following are a few examples of the tax calculation for different scenarios, based on the configuration described above:

Scenario #1

Walk in reservation with 2 adults, rate code = VIENNA. Add same day package element (i.e., AB = 10.00 per person) to the reservation. Generate an Advanced Bill.

Postings are as follows:

20.00 (package element)

280.00 for room (which is the 300.00 minus the package (net = 273.9366, tax = 6.0634)

Scenario #2

Check-in guest. No package on reservation.

Postings are as follows:

300.00 for room (which is the 300.00 rate less the package (net = 293.5035, tax = 6.4965)

Scenario #3

Change rate code to be tax exclusive. Check guest in and generate an Advanced Bill.

Add same day package element (i.e., AB = 10.00 per person) to the reservation.

Postings are as follows:

Allowance created of 20.00

280.00 for room (which is the 300.00 rate less the package (net = 273.9366, tax = 6.0634)

UDF GST TAX Function

Description

The GST tax is not applicable on the room rate for residential rooms. This function excludes the tax from reservations that are not GST eligible, including in those cases where the room charge is routed from a non GST-eligible room to another room that may be GST-eligible.

Note: The room numbers that are not GST-eligible must be hardcoded into the function.

Function

udf_gst_tax_func_28(OPERATION_NAME,BASE,RESV_NAME_ID)

Parameters

Parameter

Description

BASE

Net room charge.

OPERATION_NAME

Posting routine (e.g., End of Day processing, posting).

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

Example

Assume that rooms 1003, 1004, and 1005 are not GST eligible and have been hardcoded into the function. Transaction code 1026 is the Lodging transaction code which has the GST generate attached.

1. Create a reservation for room 1003 and check the reservation in.

2. Create another reservation for a room not equal to 1003, 1004 or 1005 and check it in (e.g., room 1006).

3. Cashiering > Billing > Room 1003 > Select > Post > Trn. Code=1026, Amount=100.00. OK. No tax should post as Room 1003 is not GST eligible.

4. Now create a room routing instruction to 1006 for transaction code 1026

5. From room 1003 now post a charge to transaction code 1026. The message to route the charge to 1006 will appear. Answer Yes.

6. Now open the reservation for room 1006 and the posting for 1026 should show without tax

7. Cashiering > Billing > Room 1006. Post an amount to transaction code 1026. The Tax should post.

horizontal rule

Package Functions

Added Adult Charge for Prevailing Rates

Description

This function provides a way to add a charge for extra persons when prevailing rates functionality is being used. This function is attached to a package element that is, in turn, attached to the prevailing-rate rate code. The package header must have Add Rate Combined Line selected. When associated with the prevailing rate code's rate header, the rate query DORA screen properly reflects the rate detail amount plus the additional overage for the number of adults above the base number defined in the package's formula definition.

Function

added_adult_charge (in_resv_name_id, XXX, YYY)

Parameters

Parameter

Description

in_resv_name_id

System-assigned reservation ID. Provided by the function. The default is null.

XXX

Base number of adults.

YYY

Amount to be charged for each adult over the number specified by XXX.

Example

If the package formula entered is:

added_adult_charge (in_resv_name_id,2,30)

any adult over 2 adults will add $30 to the rate query amount.

Float Person Charge Flat

Description

This function provides for package allowance with a Flat Amount calculation rule and a Floating Allowance per Stay posting rhythm if the number of persons is greater than 0. If the number of persons is 0, no package allowance is posted.

Function

float_flat_allowance_person (RESV_NAME_ID, in_price, in_allowance)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

in_price

The package price.

in_allowance

The allowance amount. If the allowance value is not entered, or if the allowance value entered is less than the price, the allowance is set equal to the price.

Example

If the package formula entered is:

float_flat_allowance_person (RESV_NAME_ID, 10, 20)

and the reservation has 1 adult, the package has a 20 allowance. If the reservation has 0 adults and 0 children, no allowance is posted.

Note: When this UDF is entered in the Formula field on the Package Code screen, the Allowance check box is automatically selected and the Posting Rhythm is automatically set to Floating Allowance Per Stay. For proper functionality of this feature, the Calculation Rule is automatically set to Per Person even though the amount posted will be a flat amount.

PERC City Tax

Description

This function calculates a generate amount on a room charge that has an inclusive tax component, when the inclusive component is not to be considered in the generate calculation. This function might be used, for example, where a room service tax must be calculated for a room charge that has an inclusive tax.

Function

perc_city_tax('RESV_NAME_ID',tax,inclusive_tax)

Parameters

Parameter

Description

RESV_NAME_ID

System-assigned reservation ID. Provided by the function.

tax

Tax to be applied to room charge after removing inclusive tax.

inclusive_tax

Inclusive tax included in room charge.

Example

Assume you have Room Charge transaction code 0010 which has an inclusive generate of 10% (transaction code 0195). You wish to calculate a 5% Room Service Tax (transaction code 0199) as an exclusive generate on 0010.

1. Create package RMSERVICE with transaction code 0195. Specify UDF formula:

perc_city_tax('RESV_NAME_ID',5,10)

and Add Rate Separate Line selected.

2. Create rate code ABCD with transaction code 0010 (Inclusive Tax check box selected).

3. Add package RMSERVICE to rate code ABCD. The wrapper transaction code (to which room and tax is posted) is 8002. The Rate Detail amount = $100.

The following postings are displayed on the folio:

Room Charge - Transaction code 8002    $100
Room Service Tax - Transaction code 0199    $4.55

Database details would reveal the following values underlying these postings:

Trn. Code

Amount

0010

90.91

0195

9.09

0199

4.55

Note: When a rate code includes a package that uses the Perc City Tax formula, the Rate Info screen accessed via the Rate Query (F5) screen or from the Reservation screen will reflect the Perc City Tax calculation.

The perc_city_tax_hamburg(resv_name_id) UDF is used in the package configuration to calculate the city tax based on the defined purpose of the stay. To indicate which Purpose of Stay values qualify for city tax, the description of the purpose should include ‘*’ in the beginning of the description. The UDF room rate ranges per person and the qualified city tax amounts are defined as follows and cannot be modified:

RT Extra Adult Charge

Description

This function calculates the package inclusive rate for a number of adults greater than a base number, per stated room types. Any price information provided in the Package Details is overridden by this function.

Function

rt_extra_adult (in_resv_name_id, X, Y, 'rmtype_1,rmtype_2,...rmtype_n')

Parameters

Parameter

Description

in_resv_name_id

System-assigned reservation ID. Provided by the function. The default is null.

X

Base number of adults.

Y

Amount to be added for each adult over the base number specified by X.

rmtype_1...rmtype_n

Room types to which this calculation applies. Comma separated list.

Example

Rate code LEISURE, which includes a package, is priced at $150. If the package formula entered is:

rt_extra_adult (in_resv_name_id, 7, 15, 'DLX,STD')

any adult over 7 adults will add $15 to the rate query amount for the LEISURE rate on room types DLX and STD. For 8 adults, the rate would be priced at $165 rather than $150.

RT Extra Adult Plus Bucket 1

Description

This function calculates the package inclusive rate for a total number of adults plus children in child bucket 1 that is greater than a base number, per stated room types. Any price information provided in the Package Details is overridden by this function. This function will automatically refresh the total rate value shown in the Reservation screen Total field when the number of adults and/or children in child bucket 1 is changed.

Function

rt_extra_adult_n_bucket1 (in_resv_name_id, X, Y, 'rmtype_1,rmtype_2,...rmtype_n')

Parameters

Parameter

Description

in_resv_name_id

System-assigned reservation ID. Provided by the function. The default is null.

X

Base number of adults plus number of children in child bucket 1.

Y

Amount to be added for each person over the base number specified by X.

rmtype_1...rmtype_n

Room types to which this calculation applies. Comma separated list.

Example

Rate code LEISURE, which includes a package, is priced at $150. If the package formula entered is:

rt_extra_adult_n_bucket1(in_resv_name_id, 7, 15, 'DLX,STD')

Any person over 7 adults plus children in child bucket 1 will add $15 to the rate query amount for the LEISURE rate on room types DLX and STD. For 5 adults and 3 children in child bucket 1, the rate would be priced at $165 rather than $150.

RT Extra Adult Plus Bucket 2

Description

This function calculates the package inclusive rate for a total number of adults plus children in child bucket 2 that is greater than a base number, per stated room types. Any price information provided in the Package Details is overridden by this function. This function will automatically refresh the total rate value shown in the Reservation screen Total field when the number of adults and/or children in child bucket 2 is changed.

Function

rt_extra_adult_n_bucket2 (in_resv_name_id, X, Y, 'rmtype_1,rmtype_2,...rmtype_n')

Parameters

Parameter

Description

in_resv_name_id

System-assigned reservation ID. Provided by the function. The default is null.

X

Base number of adults plus number of children in child bucket 2.

Y

Amount to be added for each person over the base number specified by X.

rmtype_1...rmtype_n

Room types to which this calculation applies. Comma separated list.

Example

Rate code LEISURE, which includes a package, is priced at $150. If the package formula entered is:

rt_extra_adult_n_bucket2 (in_resv_name_id, 7, 15, 'DLX,STD')

Any person over 7 adults plus children in child bucket 2 will add $15 to the rate query amount for the LEISURE rate on room types DLX and STD. For 5 adults and 3 children in child bucket 2, the rate would be priced at $165 rather than $150.

Direct Bill Fee

Description

This function adds a flat fee to Billing screen window 1 when posting a package under the following conditions:

Function

direct_bill_fee(resv_name_id,fee_amount)

Parameters

Parameter

Description

in_resv_name_id

System-assigned reservation ID. Provided by the function. The default is null.

fee_amount

Fee to be posted when the direct bill payment method is selected as payment method.

Example

direct_bill_fee(resv_name_id,20)

Posts a fee of 20 to Billing screen window 1 if UDFC08 is set to Y and the payment method for window 1 is direct bill.

Note: If no resv_name_id exists, the function returns 0. Therefore, a rate query without a reservation will not include the Direct Bill Fee amount.
•When creating a reservation the function returns a 0 until the reservation is saved and a resv_name_id becomes available.
•If a package is set up as Add To Rate Combined Line and attached to a rate code or directly to a reservation, the package amount would be 0 and the reservation would therefore not include the Direct Bill Fee.
•After the user saves the reservation he should refresh rates in order for the reservation to show the correct rate.

See Also