Color coding special reservation types

Top  Previous  Next

DISCLAIMER: This article involves Advanced Customizations, which can be technically challenging to get working and is not part of standard support.  This is programming and must be done precisely or the results can be unpredictable.  This information is provided as a service for those who have the technical skills to work through it -- we cannot help you solve any issues with getting it working.  For more information about Advanced Customizations, see the full documentation:

https://campgroundmaster.com/help/overview32.html

 

 

Update:  As of version 8, there is a much simpler way to do this for most cases -- see the new article here:

https://campgroundmaster.com/help/color-codingreservationtypes.html

 

 

Original article:

 

If you add special Reservation Types for weekly, seasonal or other special reservations (e.g. through the Pick Lists), then you may want to show them in different colors on the Rack.  The normal Color Key only understands the standard "Base" reservation types, and can't be added to directly.  However with the Color Schemes added in version 4.0, you can create your own color scheme for your new reservation types.

 

What you need to do is create a color scheme that has rules for each condition you want to check for (e.g. pending, checked in paid or not paid, etc.), for each new reservation type.  We can use that color scheme to "override" the normal color scheme for reservations -- it will check your rules first, and if none of those conditions are met then it will use the standard color definitions (so you don't have to re-define all of the standard ones yourself).  Of course you do need to be careful with your conditions so that it doesn't end up using one of your new colors when it shouldn't.

 

Here is an example of handling a new reservation type called "Weekly" (which of course would have to be added through Maintenance / Pick Lists / Reservation Types).  The Base type for Weekly is assumed to be "Normal".  Obviously this example can be altered for any reservation type by simply changing the text and/or numeric values in the rule expressions below.

 

1. Go to Maintenance / Advanced Customizations / Color Schemes.

 

2. Click "Add scheme definition", and give it a name like "Reservations override".  Note that only one Color Scheme can be used to override the normal reservations colors, so if you have multiple types, etc. then the rules for all of them need to be defined in this one scheme.

 

3. Make sure the Default scheme is "Reservations" (this is what it uses after checking all of your rules).

 

4. Click "Add Color Rule", and give it a name.  This is what will show in the Color Key for this color.  Lets make this one "Reservation, Pending, Weekly, Paid" so it follows the format of the default color key labels.

 

5. Define the text and background colors using the "Change Text Color" and "Change Background Color" buttons.

 

6. Now you need to define the rule using an Expression, which must have a boolean result for the reservation we're checking.  If it's True, then this color will be used.  If it's False, then it will continue and check the next rule, and so forth.  

 

This also means that the order of the rules may also be important in some cases (e.g. the highest priority conditions should be above the lower priority conditions in the rules list), but in this case it's not a factor since each case is very specific.  Speed can also be affected by the order, e.g. the sooner it finds a match the quicker it finishes, but again it shouldn't matter for this simple case especially if Weekly is rare compared to Normal or other reservation types.

 

Now you could do all of the appropriate tests against the reservation to see if it's pending and see if it's paid in full as of the given date, etc. -- but there's a shortcut you can use.  The function ColorStatusResv() will do the normal checks and return a code for which standard color key item it would normally use.  All you need to do is see if this would be the color for a "Normal" type pending/paid reservation and then see if it's actually a Weekly reservation instead of Normal.  By checking the Fixed List Values for  "Site Status (color default)" you can find that the code for the "Resv, Pending, Paid" status is 35.  

 

Note: If your reservation type has a different Base Type, e.g. Monthly instead of Normal, then of course this value would need to be changed accordingly.

 

So the expression for this condition would be:

 

ColorStatusResv(Resv(),ThisDate(),ThisPeriod()) = 35 AND Resv:Resv_Type = "Weekly"

 

7. Save that rule.  

 

8. Now we need to continue adding other rules to cover any other conditions like the normal color key does (if you skip some, then the reservation might not match any of your rules and thus be shown in the default "Normal" color).

 

You can save some time by selecting the last rule added above and "Copy Rule(s)", then edit the copied rule.  Just change the name, colors, and the expression.  Each expression should be the same as shown above except for the numeric code returned by ColorStatusResv().  The rest of the colors needed for a "Normal" based reservation type are shown below:

 

 Reservation, Pending (not paid) : 28

 Reservation, Pending, Don't Move : 30

 Reservation, Pending, Don't Move, Paid : 37

 Reservation, Confirmed : 25

 Reservation, Confirmed, Don't Move : 51

 Reservation, Guaranteed : 24

 Reservation, Guaranteed, Don't Move : 50

 Reservation, Checked In, Not Paid : 13

 Reservation, Checked In, Paid : 14

 

Note that these numbers are only correct for Reservation Types with a "Normal" base type, and we don't test for Checked Out, Canceled, etc. since those colors are the same for all reservation types anyway.  

 

If your new Reservation Type has a base type of Monthly, then these are the values you should use (note that "Don't Move" is not a different color for Monthlies):

 

 Reservation, Monthly, Pending (not paid) : 33

 Reservation, Monthly, Pending, Paid : 40

 Reservation, Monthly, Confirmed : 41

 Reservation, Monthly, Guaranteed : 42

 Reservation, Monthly, Checked In, Not Paid : 22

 Reservation, Monthly, Checked In, Paid : 23

 

There are some other special situations like Owner reservations (which don't have status so there's only paid/not paid status conditions to test), so be sure to check the "Site Status" fixed list values for all conditions you may need to test for the appropriate Base Type of your new reservation type.  To get the Site Status values -- from Edit Color Scheme Rule click on Insert Expression Element..., select the element type "Fixed List Values", then the fixed list name "Site Status (color default)".  Select the status needed in the right-hand column, and the numeric value for that status will be shown at the bottom.

 

 

9. Now once the scheme has all the rules and you Save it, there's one more thing you need to do -- make this scheme the default for reservations.  Go to Maintenance / Advanced Customizations / Select Global Color Schemes, and select the scheme you just created in the drop-down list after "Override reservation names with color scheme:".

 

Now your new colors should be used on the Rack and other tab views, wherever a reservation name is normally colored.  The Color Key will also show your new definitions along with the default ones, in case the operators need a reference.

 

 


Page URL https://CampgroundMaster.com/news/colorcodingspecialreservati.html

Campground Master Home