sa_ratescriptlanguage

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
sa_ratescriptlanguage [2023/04/11 14:01] Scott McMullensa_ratescriptlanguage [2023/04/19 14:22] (current) – [Indenting] Scott McMullen
Line 2: Line 2:
 ==== Introduction ==== ==== Introduction ====
 Temp Rate Scripts provide the mechanism for converting shifts into timesheet lines when the timesheet is completed. The script must be attached to the Rate Scheme which is being applied.\\ \\  Temp Rate Scripts provide the mechanism for converting shifts into timesheet lines when the timesheet is completed. The script must be attached to the Rate Scheme which is being applied.\\ \\ 
 +
 The Commands are listed below, followed by Examples. The Commands are listed below, followed by Examples.
 <note warning>Scripts are case sensitive.</note> <note warning>Scripts are case sensitive.</note>
 ==== Rate Script Commands ==== ==== Rate Script Commands ====
 |comment or rem| the remainder of the line is a comment and is ignored - when using //comment// you must preserve the current indent level| |comment or rem| the remainder of the line is a comment and is ignored - when using //comment// you must preserve the current indent level|
-|foreach shift|  | Start the script with this each time |+|foreach shift| Start the script with this each time |
 |foreach dayslice|must be nested within foreach shift.| |foreach dayslice|must be nested within foreach shift.|
 |foreach timeslice paybandname | must be nested within foreach dayslice. In a rate scheme a pay band may have a start and end time - e.g. an Unsocial pay band may specify 1800 to 0600 as the Unsocial period which attracts a higher rate. Foreach timeslice uses the named pay band to further divide a dayslice into timeslices - those which do and do not fall within the specified time range. Use If intimeslice to determine whether the current slice is in the time range. Break treatment: Any break period is deducted from the longest slice; if slices are of equal length, then the break is deducted from the slice with the highest charge. | |foreach timeslice paybandname | must be nested within foreach dayslice. In a rate scheme a pay band may have a start and end time - e.g. an Unsocial pay band may specify 1800 to 0600 as the Unsocial period which attracts a higher rate. Foreach timeslice uses the named pay band to further divide a dayslice into timeslices - those which do and do not fall within the specified time range. Use If intimeslice to determine whether the current slice is in the time range. Break treatment: Any break period is deducted from the longest slice; if slices are of equal length, then the break is deducted from the slice with the highest charge. |
Line 42: Line 43:
 |addupto time paybandname | an alternative method of time-slicing. E.g. addupto 06:00 Early. Must be used inside a foreach dayslice but NOT inside a foreach timeslice. May have a series of adduptos with increasing times to slice up the day. Each one reduces the residual amounts in the block to prevent double posting. As with timeslice, breaks are deducted from the largest slice.| |addupto time paybandname | an alternative method of time-slicing. E.g. addupto 06:00 Early. Must be used inside a foreach dayslice but NOT inside a foreach timeslice. May have a series of adduptos with increasing times to slice up the day. Each one reduces the residual amounts in the block to prevent double posting. As with timeslice, breaks are deducted from the largest slice.|
 |showrate paybandname | the payband is added to the timesheet but with zero hours, as a place-holder for edits at completion time.| |showrate paybandname | the payband is added to the timesheet but with zero hours, as a place-holder for edits at completion time.|
 +
 +
 +
  
  
Line 49: Line 53:
 \\ \\
 ==== Indenting ==== ==== Indenting ====
 +
 +Nesting the Commands
 +
 +We start off with
 +<sxh>
 +foreach shift
 +-foreach dayslice
 +--foreach timeslice
 +--foreach timeslicedefault  (same as foreach timeslice)
 +</sxh>
 +Within each band we add the required details for days and times. You don’t need to use all, but it needs to be in that order. \\ \\
 +
 +
 The number of leading spaces indenting each command is used to determine which commands are affected by //foreach// and //if// commands. E.g. if the leading space is removed from the final //post// command in the second example above, it will be outside the //foreach// shift loop, and the effect will be to post summary pay band totals for the timesheet as a whole (i.e. not more than one timesheet line per pay band).  The number of leading spaces indenting each command is used to determine which commands are affected by //foreach// and //if// commands. E.g. if the leading space is removed from the final //post// command in the second example above, it will be outside the //foreach// shift loop, and the effect will be to post summary pay band totals for the timesheet as a whole (i.e. not more than one timesheet line per pay band). 
 \\ \\ \\ \\
Line 113: Line 130:
 ---add Basic  ---add Basic 
 -post -post
 +</sxh>
 +
 +With Specified Dates and Thresholdsplit.
 +
 +<sxh>
 +foreach shift
 +-foreach dayslice
 +--if day 25
 +---add Basic Plus
 +--if day 30/05
 +---add Basic Plus
 +--if day 99
 +---add Basic Plus
 +--if day 01/06/2021
 +---add Basic Plus
 +--add Basic
 +thresholdsplit 37.5 Basic|Overtime
 +post
 +</sxh>
 +
 +
 +Using addlumpsum, charge and payonly.
 +
 +<sxh>
 +foreach shift
 +-addlumpsum 1 Mileage
 +-and
 +-add CHARGEONLY Bonus
 +-and
 +-add PAYONLY Commission
 +-and
 +-if day weekend
 +--add Basic
 +-if day weekday
 +--add Basic
 +post
 </sxh> </sxh>
  
  • sa_ratescriptlanguage.1681221712.txt.gz
  • Last modified: 2023/04/11 14:01
  • by Scott McMullen