Pre-Calculation Rules

Pre calculation rules execute before each employee calculation and prior to the calculation context being built. If a rule is matched then the appropriate action is taken automatically.


Rule Description Explanation
LeaverEndInstructionsRule Leaver > End Pay Instructions Rule automatically ends all acitve pay instructions (excluding NI) the day after the leaving date set for the employee.
NiDateOfBirthChangeRetrospectiveCRule NI > Date of birth changed > Retrospective Change to C Rule detects a date of birth change that would have caused the employee to be put on NI letter C (retirement) either too early or too late. Creates a retrospective NI adjustment record to correct any under or over payment.
NiDefermentStatusChangeRule NI > Deferment Status Change Rule automatically creates an NI adjustment for the tax year where the employee moves on or off a deferred NI letter code [L, K, J, Z].
NiEndContractedOutTransferRule NI > End of Contracted Out > Transfer NI Letter Rule transfers employees from the obsolete contracted out NI letters codes to their non-contracted out equivalent. This rule is obsolete from tax year 2017/18 onwards.
NiMissingPayInstructionRule NI > Create Missing NI pay instruction Rule creates an NI pay instruction where one is not previously provided. The NI letter code is determined automatically based on the employee circumstances - see [insert link]
NiSetExpectedLetterRule NI > Set Expected NI Letter Rule automatically determines and overrides the employee NI letter code based on the employee circumstances - see [insert link]
P45StudentLoanInstructionRule P45 > Apply P45 student loan instruction Rule creates a student loan pay instruction based on the P45 information provided.
P45TaxInstructionRule P45 > Apply P45 tax instruction Rule creates a tax pay instruction based on the P45 information provided.
P45YtdTaxRule P45 > Apply P45 YTD tax Rule creates a YTD tax pay instruction based on the P45 information provided.
PaymentAfterLeavingRule Payment After Leaving Rule detects where "payment after leaving" rules are applicable and automatically creates new tax and NI pay instructions.
TaxCodeRegionChangeRule Tax > Regional Tax Code Change Rule detects and applies tax code update where employee's region changes. For example from England to Scotland or vice-versa.
TaxCodeUpliftRule New Tax Year > Uplift Tax Code Rule detects and uplifts employee tax codes at the start of the new tax year by the HMRC mandated increments.
TaxMissingPayInstructionRule Tax > Emergency Tax pay instruction Rule creates a tax pay instruction where one is not previously provided using the current emergency tax code.
YtdInstructionRule YTD > Apply Instructions Rule creates child pay lines based on the in scope YTD pay instructions.

Disabling pre-calcuation rules

Warning

Rules can be disabled individually as in some use cases there may be legitimate reasons, but doing so may make calculations non-compliant. Please ensure you understand the consequence of disabling any rules before doing so.

Rules can be disabled on either the Employer or the Employee using the RuleExclusions property. Settings on the Employer will cascade to the decendent Employees unless explicity overriden on the Employee.

The RuleExclusions propery takes a pipe (|) separated list of rule names to exclude; the default value is None.

Patching the Employer

You can disable individual or multiple rules on the Employer using a PATCH request.

curl -X PATCH
   https://api.test.payrun.io/Employer/ER001
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '<?xml version="1.0"?>
<Employer xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-30</EffectiveDate>
    <RuleExclusions>NIMissingPayInstructionRule|NISetExpectedLetterRule</RuleExclusions>
</Employer>'
curl -X PATCH
   https://api.test.payrun.io/Employer/ER001
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '{
  "Employer": {
    "EffectiveDate": "2017-04-30",
    "RuleExclusions": "NIMissingPayInstructionRule|NISetExpectedLetterRule"
  }
}'

Patching the Employee

You can disable individual or multiple rules on the Employee using a PATCH request.

curl -X PATCH
   https://api.test.payrun.io/Employer/ER001/Employee/EE001
   -H 'Content-type: application/xml'
   -H 'Accept: application/xml'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '<?xml version="1.0"?>
<Employee xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
    <EffectiveDate>2017-04-30</EffectiveDate>
    <RuleExclusions>NIMissingPayInstructionRule|NISetExpectedLetterRule</RuleExclusions>
</Employee>'
curl -X PATCH
   https://api.test.payrun.io/Employer/ER001/Employee/EE001
   -H 'Content-type: application/json'
   -H 'Accept: application/json'
   -H 'Api-Version: default'
   -H 'Authorization: {OAuthHeader}'
   -H 'Cache-Control: no-cache'
-d '{
  "Employee": {
    "EffectiveDate": "2017-04-30",
	"RuleExclusions": "NIMissingPayInstructionRule|NISetExpectedLetterRule"
  }
}'