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:40] 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 script will step through the shifts attached to the timesheet. If a shift type is of shift N it will be posted to the Night pay band. \\ \\ 
-If not it will be divided into days (i.e. two slices if it spans midnight, one if not), and the parts on Saturday or Sunday will go to the Weekend pay band. \\ \\ 
-Anything left will go to the Basic pay band. \\ \\ 
-See example below, note the use of - as indents to make it easier to see the lines by each command. 
- 
-foreach shift 
--if shift N 
---add Night 
--foreach dayslice 
---if day Sunday 
----add Weekend 
---if day Saturday 
----add Weekend 
---add Basic 
--post 
- 
-The totals in each band will be posted as timesheet lines for every shift (i.e. one or more lines per shift). 
- 
-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, 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). 
- 
-Full stops . greater than > signs or hyphens – can be used instead of spaces to improve readability. 
-Remember, the name of the payband must be described exactly as it is spelled, inc upper case characters. 
  
 The Commands are listed below, followed by Examples. The Commands are listed below, followed by Examples.
Line 69: 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 76: 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). 
 \\ \\ \\ \\
  • sa_ratescriptlanguage.1681224001.txt.gz
  • Last modified: 2023/04/11 14:40
  • by Scott McMullen