%
' MyPAYE
' Module: EmployeeDetailsJS.asp
'
' This software is the copyright of Mr T J Sheppard and may not be copied, duplicated or
' modified other than as permitted in the licence agreement.
'
' © 2012 - 2025 Mr T J Sheppard
' Lyndale House
' Church Street
' Bradwell
' Hope Valley
' S33 9HJ
'
' Tel 0845 643 5191
' Email Support@MyPAYE.co.uk
'
' MyPAYE is a Registered Trademark of MyPAYE Ltd
'-------------------------------------------------------------------
'
' Updated 08 January 2025
''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
'
' Description - This module contains javascript functions for EmployeeDetails.asp
'
' Amendment Log
'------------------------------------------------------------------------------------------
' Date | Name | Vers. | Description
'------------------------------------------------------------------------------------------
' 18/04/05 | TJS | 1.0 | Original
' 12/05/05 | TJS | 1.0.01 | Added checkkeypress event handler which will be used
' | to ensure Update/Cancel button change occurs on first
' | character changed rather than when the onchange event
' | fires on loss of focus
' | Changed tabs and Update/Close buttons from graphics to text panels
' 13/05/05 | TJS | 1.0.02 | Added call to datachanged() when sortcode() allows to field to be updated
' | and changed datachanged() to check Update button class instead
' | of text of Close button to determine if buttons already
' | set for update
' 16/05/05 | TJS | 1.0.04 | Modified to cater for different CSS files depending on the
' | Agency ID setting for the Employer via session variable PathModifier
' 19/05/05 | TJS | 1.0.05 | Replaced RunPayroll image button with table panel
' 27/05/05 | TJS | 1.0.09 | Modified to prevent user clicking more than one button
' | at a time to prevent security violation errors
' 17/06/05 | TJS | 1.0.11 | Modified for Firefox compatibility
' 17/08/05 | TJS | 1.0.13 | Modified to correctly display Student Loan Date validation failures
' 08/10/05 | TJS | 1.0.15 | Moved javascript functions from EmployeeDetails.asp
' 09/11/05 | TJS | 1.0.18 | Fixed error following move of deceasedclick() function from
' | EmployeeDetails.asp - added SMPPreventsP45 and SAPPreventsP45
' | parameters to function
' 16/01/06 | TJS | 1.0.20 | Moved function checkdirector() back to EmployeeDetails.asp so
' | that function could be altered if director had been a director
' | Modified to cater for frame changes for compatibility with EnterHoursFrames.asp
' 03/03/06 | TJS | 1.0.22 | Corrected validation of Pension Type, SCON and NIC Letter as SCON
' | only required on Money Purchase schemes not Salary Related
' | Also added function studP38clicked() and changed Inland Revenue to HMRC
' 23/03/06 | TJS | 1.0.23 | Modified p45reqdclick to support Force P45 This Period
' 22/08/06 | TJS | 1.0.33 | Tidied text on warning messages re NIC Letters and Pension Schemes
' | and added undoclick, undoradio and undoselect functions to provide
' | a means of locking check boxes, radio boxes and list boxes
' 02/09/06 | TJS | 1.0.34 | Modified value of studentloandisplay for consistency
' 28/10/06 | TJS | 1.1.00 | Modified to cater for NICSelected, deceasedclick and studP38clicked
' | being used by NewEmployeeWizard.asp and corrected error in
' | datachangedpaymethod() which prevented changes being detected and added prompt
' | when BACS Pay Method selected and no BACS Format selected in Employer Options
' 09/11/06 | TJS | 1.0.02 | Modified updatesubmit() to add alert message re deletion of P45 record if
' | leaving date deleted after P45 created. Also modified SexSelected and
' | MaritalStatusSelected to set the update button depending on an input parameter
' 10/12/06 | TJS | 1.1.04 | Added Widowed option to MaritalStatus
' 14/12/06 | TJS | 1.1.04a | Modified displayp45 to enable scrollbars on P45 window
' 14/02/07 | TJS | 1.1.06 | Modified disablebuttons to cater for additional HR and P11D functions
' 19/06/07 | TJS | 1.2.00 | Modified to replace session variables with Session_Vars table
' 28/06/07 | TJS | 1.2.01 | Corrected use of single and double quotes in restorepayrollprep
' | when including pathmodifier variable
' 21/09/07 | TJS | 1.2.05 | Modified disablebuttons to cater for Notes tab
' 21/11/07 | TJS | 1.2.07 | Modified to use SystemName and ContactUs in Session Vars
' 07/10/09 | TJS | 1.3.06b | Inhibited session secirity check as it prevents operation on Accountants Circle payroll
' 24/02/11 | TJS | 1.5.03 | Modified to cater for Tax Credits being replaced with Holidays
' | and to clear the Force P45 this period checkbox if the P45 REquired box is cleared
' 30/06/11 | TJS | 1.7.00 | Modified to use JS_Keys in session_vars table instead of session("GetEEDJS")
' 10/07/11 | TJS | 1.7.01 | Replaced JS_Keys with individual fields to stop occasional field overflow errors
' 09/01/13 | TJS | 3.0.00 | Modified for RTI, TUPE and for business transfer to MyPAYE Ltd
' 26/07/13 | TJS | 3.0.08 | Added SetButtons parameter to EmplSecSet to prevent error in New Employee Wizard
' 01/06/14 | TJS | 4.0.00 | Modified for new styling and operation without framesets
' 24/06/14 | DC | 4.0.00a| Not able to update bank details - temp fix CHECK WITH TIM.
' 19/08/14 | TJS | 4.0.02 | Modified to use fieldset rather than nested tables for iPad compatibility
' 14/10/14 | TJS | 4.0.05 | Modified to cater for employee Payment after Leaving and Always Exclude needing to refresh list after saving
' 30/10/14 | TJS | 4.0.05a | Added clarification popup to EmplSecSet when seconded employee status is selected as per HMRC request
' 05/01/15 | TJS | 4.0.09 | Modified for Student Loan Plan Type and 2015/16 NI SCON Validation changes
' 28/04/15 | TJS | 4.0.14 | Modified to cater for password protection of PDF payslips
' 02/08/15 | TJS | 4.0.21 | Modified to cater for send password button not always being loaded
' 26/11/15 | TJS | 5.0.00 | Modified checkkeypress function to cater for Ctrl C, Ctrl V, Ctrl X
' 18/12/15 | TJS | 5.0.02 | Modified for HMRC Appendix 5: Net of foreign tax credit relief
' 11/02/16 | DC/TJS | 5.0.03 | Modified to cater for NIC letter 'H' now being used for Apprectices under 25 fro TY 2016 and later
' 23/11/16 | TJS | 5.0.16 | Corrected p45reqdclick to correctly process SMP/SAP message display and to handle
' | potential cancellation of Auto Enrolment contributions if employee leaves before Pay Date
' 10/03/17 | DC | 5.0.18 | Correct syntx errors in p45reqdclick().
' 24/03/17 | TJS | 5.0.19 | Modified p45reqdclick() to cater for setting Pay Leaver SMP/SAP flag
' 12/05/17 | TJS | 5.1.02 | Modified to always display Email address field
' 12/07/18 | DC | 5.3.03 | Function displaybank() should not have been mixed case.
' 03/09/18 | TJS | 5.4.00 | Corrected spelling error in p45reqdclick() and enhanced message to include parental pay end date
' 30/09/19 | TJS | 5.5.05 | added missing postgradloandisplay function
' 04/04/19 | TJS | 5.5.06 | Modified p45reqdclick to copy Leaving Date to Director End date for Directors paid periodically to trigger the final annual NIC calculation.
' 29/08/19 | TJS | 5.6.00a | Modified to cater for SendLinkEmail button
' 30/05/20 | TJS | 5.8.00 | Modified to cater for new styling
' 16/10/20 | TJS | 5.9.01 | Modified to cater for Student Loan and Post Graduate current year refunds
' 07/08/21 | TJS | 5.9.11 | Modified to replace alert and confirm dialogues to cater for browser blocks on cross site dialogs
' 18/09/21 | TJS | 5.9.12 | Modified to use window.parent.DisplayAlertMsg
' 06/03/22 | TJS | 5.9.17 | Modified to cater for Veteran First Civilian Employment date
' 08/01/25 | TJS | 5.10.1 | Modified to cater for Employee Workplace Postcode
'''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''
Response.Clear
Response.ContentType = "text/javascript"
%>
<%' start of code added TJS 30/06/11
SessionVarsID = request.querystring("SV")
if "" & SessionVarsID <> "" then
' check session var ID only contains numbers and/or letters
for iLoop = 1 to len(SessionVarsID)
iChar = Asc(mid(SessionVarsID, iLoop, 1))
if (iChar < Asc("0") or iChar > Asc("9")) and (iChar < Asc("A") or iChar > Asc("Z")) and (iChar < Asc("a") or iChar > Asc("z")) then
response.end
end if
next
sql = "SELECT GetEEDJS FROM " & DBSchema & "Session_Vars WHERE Session_Var_ID = '" & left(SessionVarsID, 15) & "'" ' TJS 10/07/11
set rsCheckJSKey = OpenRecordset(objConn, sql)
if rsCheckJSKey.EOF then
' response.end
elseif "" & rsCheckJSKey("GetEEDJS") <> "Yes" then ' TJS 10/07/11
' response.end
end if
else
' response.end
end if
' end of code added TJS 30/06/11
%>
function NICSelected(NICCatLetterCtrl, SetButtons){
econ=document.getElementById("ECONHeld");
if ((NICCatLetterCtrl.value == "D") || (NICCatLetterCtrl.value == "E") || ((NICCatLetterCtrl.value == "L") && (PayrollTaxYear < 2022)) || ((NICCatLetterCtrl.value == "F") && (PayrollTaxYear < 2022)) ||
(NICCatLetterCtrl.value == "G") || ((NICCatLetterCtrl.value == "S") && (PayrollTaxYear < 2022)) || (NICCatLetterCtrl.value == "N") || (NICCatLetterCtrl.value == "O") ||
(NICCatLetterCtrl.value == "K") || ((NICCatLetterCtrl.value == "V") && (PayrollTaxYear < 2021)) || ((NICCatLetterCtrl.value == "I") && (PayrollTaxYear < 2022)) || ((NICCatLetterCtrl.value == "H") && (PayrollTaxYear < 2016))) // TJS 05/01/15 DC/TJS 11/02/16 TJS 06/03/22 TJS 08/01/25
{
if (econ.value == 'No')
{
window.parent.DisplayAlertMsg('NIC Contracting-Out Number', 'You cannot enter an NIC Letter of ' + NICCatLetterCtrl.value + ' without first entering your
Employer NIC Contracting-Out Number on your Employer Details page', 130, 600); // TJS 07/08/21 TJS 18/09/21
NICCatLetterCtrl.value = "";
}
}
scon=document.getElementById("SCONHeld");
pst=document.getElementById("PSchemeType");
if (((NICCatLetterCtrl.value == "F") && (PayrollTaxYear < 2022)) || (NICCatLetterCtrl.value == "G") || ((NICCatLetterCtrl.value == "S") && (PayrollTaxYear < 2022)) ||
((NICCatLetterCtrl.value == "K") && (PayrollTaxYear < 2015))) // TJS 05/01/15 DC 03/02/15 TJS 08/01/25
{
if ((scon.value == 'No') || (pst.value != 'M'))
{
window.parent.DisplayAlertMsg('Invalid Pension Scheme type', 'You cannot enter an NIC Letter of ' + NICCatLetterCtrl.value + ' when the Pension Scheme for this Payroll
is not an HMRC approved Money Purchase pension scheme', 130, 600); // TJS 07/08/21 TJS 18/09/21
NICCatLetterCtrl.value = "";
}
}
if ((NICCatLetterCtrl.value == "D") || (NICCatLetterCtrl.value == "E") || ((NICCatLetterCtrl.value == "L") && (PayrollTaxYear < 2022)) || (NICCatLetterCtrl.value == "N") ||
(NICCatLetterCtrl.value == "O") || ((NICCatLetterCtrl.value == "K") && (PayrollTaxYear < 2015)) || ((NICCatLetterCtrl.value == "V") && (PayrollTaxYear < 2021)) ||
((NICCatLetterCtrl.value == "I") && (PayrollTaxYear < 2022))) // TJS 05/01/15 TJS 06/03/22 TJS 08/01/25
{
if ((scon.value == 'No') || (pst.value != 'S')) // TJS 05/01/15
{
window.parent.DisplayAlertMsg('Invalid Pension Scheme type', 'You cannot enter an NIC Letter of ' + NICCatLetterCtrl.value + ' when the Pension Scheme for this Payroll
is not an HMRC approved Salary Related pension scheme
with a Scheme Contracted Out Number.', 140, 600); // TJS 07/08/21 TJS 18/09/21
NICCatLetterCtrl.value = "";
}
}
z=document.getElementById("DeferCertHeld");
DeferCertHeld = z.value;
z=document.getElementById("AgeCertHeld");
AgeCertHeld = z.value;
z=document.getElementById("MarinerConf");
MarinerConf = z.value;
z=document.getElementById("NilEarningsConf");
NilEarningsConf = z.value;
z=document.getElementById("ReducedRate");
ReducedRate = z.value;
if ((NICCatLetterCtrl.value == "J") || (NICCatLetterCtrl.value == "Q") || ((NICCatLetterCtrl.value == "L") && (PayrollTaxYear < 2022)) ||
((NICCatLetterCtrl.value == "S")) || ((NICCatLetterCtrl.value == "V") && (PayrollTaxYear < 2021))) // TJS 06/03/22 TJS 08/01/25
{
if (DeferCertHeld != "Yes")
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'NIC Letter';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Do you hold a valid certificate of deferment (Form CA2700) for this Employee ?';
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
NICSelected(NICCatLetterCtrl, SetButtons);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
NICSelected(NICCatLetterCtrl, SetButtons);
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
DeferCertHeld = "Yes";
}
else
{
DeferCertHeld = "No";
NICCatLetterCtrl.value = "";
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
CheckMarriedWoman();
if ((NICCatLetterCtrl.value == "C") || (NICCatLetterCtrl.value == "W"))
{
if (AgeCertHeld != "Yes")
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Employee Pension age';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Do you hold a proof of pension age for this Employee ?';
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
NICSelected(NICCatLetterCtrl, SetButtons);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
NICSelected(NICCatLetterCtrl, SetButtons);
};
ayn.style.height = '130px';
ayn.style.width = '420px';
ayn.style.left = '390px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
AgeCertHeld = "Yes";
}
else
{
AgeCertHeld = "No";
NICCatLetterCtrl.value = "";
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
if ((NICCatLetterCtrl.value == "R") || ((NICCatLetterCtrl.value == "T") && (PayrollTaxYear < 2022)) || (NICCatLetterCtrl.value == "Q") || (NICCatLetterCtrl.value == "N") ||
(NICCatLetterCtrl.value == "O") || ((NICCatLetterCtrl.value == "H") && (PayrollTaxYear < 2016)) || (NICCatLetterCtrl.value == "K") ||
((NICCatLetterCtrl.value == "V") && (PayrollTaxYear < 2021)) || (NICCatLetterCtrl.value == "W")) // TJS 11/02/16 TJS 06/03/22 TJS 08/01/25
{
if (MarinerConf != "Yes")
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Is Employee a Mariner ?';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Is this Employee a Mariner as defined by the DWP ?';
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
NICSelected(NICCatLetterCtrl, SetButtons);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
NICSelected(NICCatLetterCtrl, SetButtons);
};
ayn.style.height = '130px';
ayn.style.width = '420px';
ayn.style.left = '390px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
MarinerConf = "Yes";
}
else
{
MarinerConf = "No";
NICCatLetterCtrl.value = "";
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
if (NICCatLetterCtrl.value == "X")
{
if (NilEarningsConf != "Yes")
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Employee Earnings';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Please confirm that this Employee will have NIL Earnings ?';
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
NICSelected(NICCatLetterCtrl, SetButtons);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
NICSelected(NICCatLetterCtrl, SetButtons);
};
ayn.style.height = '130px';
ayn.style.width = '420px';
ayn.style.left = '390px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
NilEarningsConf = "Yes";
}
else
{
NilEarningsConf = "No";
NICCatLetterCtrl.value = "";
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
// start of code added TJS 06/03/22
vr = document.getElementById("VeteranRow");
if ((NICCatLetterCtrl.value == "V") && (PayrollTaxYear >= 2021))
{
vr.className = 'rowdisplayed';
}
else
{
vr.className = 'rowcollapsed';
}
// end of code added TJS 06/03/22
// start of code added TJS 08/01/25
wppcr = document.getElementById("WrkPlPCdeRow");
if (((NICCatLetterCtrl.value == "F") || (NICCatLetterCtrl.value == "I") || (NICCatLetterCtrl.value == "L") ||(NICCatLetterCtrl.value == "S")) && (PayrollTaxYear >= 2025))
{
wppcr.className = 'rowdisplayed';
}
else
{
wppcr.className = 'rowcollapsed';
}
// end of code added TJS 08/01/25
z=document.getElementById("DeferCertHeld");
z.value = DeferCertHeld;
z=document.getElementById("AgeCertHeld");
z.value = AgeCertHeld;
z=document.getElementById("MarinerConf");
z.value = MarinerConf;
z=document.getElementById("NilEarningsConf");
z.value = NilEarningsConf;
z=document.getElementById("ReducedRate");
z.value = ReducedRate;
if (SetButtons)
{
datachanged();
}
}
function SexSelected(SetButtons){
CheckMarriedWoman();
if (SetButtons)
{
datachanged();
}
}
function MaritalStatusSelected(SetButtons){
CheckMarriedWoman();
if (SetButtons)
{
datachanged();
}
}
function CheckMarriedWoman(){
z=document.getElementById("ReducedRate");
ReducedRate = z.value;
SexF=document.getElementById("SexF");
MaritalStatus=document.getElementById("MaritalStatus"); // DC 01/06/14
NICLetter=document.getElementById("NICLetter");
if ((NICLetter.value == "B") || (NICLetter.value == "E") || (NICLetter.value == "G") || (NICLetter.value == "T") || (NICLetter.value == "O") || ((NICLetter.value == "K") && (PayrollTaxYear < 2015))) // TJS 05/01/14
{
if ((SexF.checked == true) && ((MaritalStatus.value == "M") || (MaritalStatus.value == "S") || (MaritalStatus.value == "W"))) // DC 01/06/14
{
if (ReducedRate != "Yes")
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Reduced Rate Certificate';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Do you hold a valid Reduced Rate Certificate for this Employee ?';
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
CheckMarriedWoman();
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
CheckMarriedWoman();
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
ReducedRate = "Yes";
}
else
{
ReducedRate = "No";
NICLetter.value = "";
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
else
{
window.parent.DisplayAlertMsg('Invalid NIC Category', 'NIC Category ' + NICLetter.value + ' is only valid for Married Women or Widows', 120, 600); // TJS 07/08/21 TJS 18/09/21
ReducedRate = "No";
NICLetter.value = "";
}
}
else
{
ReducedRate = "No";
}
z=document.getElementById("ReducedRate");
z.value = ReducedRate;
}
function datachanged(){
cls = document.getElementById('Close');
ane = document.getElementById('ANE');
if (((ane.value == 'Edit') || (ane.value == 'Add')) && (cls.className != 'cancel_button_disabled')) // TJS 01/06/14
{
upd = document.getElementById('Update');
spwd = document.getElementById('SendPassword'); // TJS 28/04/15
sle = document.getElementById('SendLinkEmail'); // TJS 29/08/19
if ((cls.innerHTML == 'Close') || (upd.className == 'continue_button_disabled')) // TJS 01/06/14
{
cls.innerHTML = 'Cancel'; // TJS 01/06/14
upd.className = 'continue_button'; // TJS 01/06/14
if (spwd) // TJS 02/08/15
{
spwd.className = 'continue_button_disabled'; // TJS 28/04/15
}
if (sle) // TJS 29/08/19
{
sle.className = 'continue_button_disabled'; // TJS 29/08/19
}
}
}
}
function datachangedpaymethod(SystemName){
cls=document.getElementById('Close');
ane=document.getElementById('ANE');
if (((ane.value == 'Edit') || (ane.value == 'Add')) && (cls.className != 'cancel_button_disabled'))
{
a=document.getElementById('PayMethod');
if (a.value == 'B')
{
if (!BACSEnabled)
{
window.parent.DisplayAlertMsg('BACS Format', 'You must select a BACS Format in your Employer Options
if you want ' + SystemName + ' to create a BACS Payment File/Report', 130, 6000); // TJS 07/08/21 TJS 18/09/21
}
displaybank();
}
datachanged();
}
}
function studentloandisplay(){
stld = document.getElementById("STLoanDetail"); // TJS 30/05/20
stcd = document.getElementById("STLChkDiv"); // TJS 30/05/20
slpd = document.getElementById("STLPlanDiv"); // TJS 30/05/20
stl = document.getElementById('SLoanCheck');
if(stl.checked)
{
stld.className = 'divdisplayed'; // TJS 30/05/20
if (PayrollTaxYear >= 2015) // TJS 05/01/15
{
slpd.className = 'divdisplayed'; // TJS 05/01/15 TJS 30/05/20
stcd.style.height = '60px'; // TJS 30/05/20
}
else
{
slpd.className = 'divcollapsed'; // TJS 05/01/15 TJS 30/05/20
stcd.style.height = '40px'; // TJS 30/05/20
}
}
else
{
stld.className = 'divcollapsed'; // TJS 30/05/20
slpd.className = 'divcollapsed'; // TJS 05/01/15 TJS 30/05/20
stcd.style.height = '20px'; // TJS 30/05/20
}
datachanged();
}
// start of code added TJS 16/10/20
function SLoanRfnd(ctrl){
if (ctrl.checked)
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Refund Student Loan Deductions';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Setting this checkbox will cause all Student Loan Deductions made
in the current Tax Year to be refunded on the next payroll run.
You should only set this checkbox if you have received a Notice
from HMRC instructing you to make such a refund.
Click Yes if you have received such a Notice, otherwise click No.'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
SLoanRfnd(ctrl);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
SLoanRfnd(ctrl);
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
datachanged();
}
else
{
ctrl.checked = false;
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
else
{
datachanged();
}
}
// end of code added TJS 16/10/20
// start of code added TJS 30/03/19
function postgradloandisplay(){
pgld = document.getElementById("PGLoanDetail"); // TJS 30/05/20
pgcd = document.getElementById("PGLChkDiv"); // TJS 30/05/20
pgl = document.getElementById('PGLoanCheck');
if(pgl.checked)
{
pgld.className = 'divdisplayed'; // TJS 30/05/20
pgcd.style.height = '40px'; // TJS 30/05/20
}
else
{
pgld.className = 'divcollapsed'; // TJS 30/05/20
pgcd.style.height = '20px'; // TJS 30/05/20
}
datachanged();
}
// end of code added TJS 30/03/19
// start of code added TJS 16/10/20
function PGLoanRfnd(ctrl){
if (ctrl.checked)
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Refund Postgraduate Loan Deductions';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Setting this checkbox will cause all Postgraduate Loan Deductions
made in the current Tax Year to be refunded on the next payroll run.
You should only set this checkbox if you have received a Notice
from HMRC instructing you to make such a refund.
Click Yes if you have received such a Notice, otherwise click No.'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
PGLoanRfnd(ctrl);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
PGLoanRfnd(ctrl);
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
datachanged();
}
else
{
ctrl.checked = false;
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
else
{
datachanged();
}
}
// end of code added TJS 16/10/20
function displaybank(){ // DC 12/07/18
a=document.getElementById('BankPanel');
b=document.getElementById('PayrollPanel');
upd=document.getElementById("Update"); // TJS 01/06/14
cls=document.getElementById('Close'); // TJS 01/06/14
a.className = 'FormPanelDisplayed';
b.className = 'FormPanelNotVisible'; // TJS 19/09/14
// upd.className = 'continue_button_disabled'; // TJS 01/06/14
// cls.className = 'cancel_button_disabled'; // TJS 01/06/14 DC 24/06/14
}
function CloseBank(){
a=document.getElementById('BankPanel');
b=document.getElementById('PayrollPanel');
upd=document.getElementById("Update"); // TJS 01/06/14
cls=document.getElementById('Close'); // TJS 01/06/14
a.className = 'FormPanelNotVisible'; // TJS 19/09/14
b.className = 'FormPanelDisplayed';
if (cls.innerHTML == 'Close') // TJS 01/06/14
{
cls.className = 'cancel_button'; // TJS 01/06/14
}
else
{
upd.className = 'continue_button'; // TJS 01/06/14
cls.className = 'cancel_button'; // TJS 01/06/14
}
}
function DisplayTUPE(){
a=document.getElementById('EmployPanel');
b=document.getElementById('TUPEPanel');
b.className = 'FormPanelDisplayed';
a.className = 'FormPanelNotVisible'; // TJS 19/09/14
}
function CloseTUPE(){
a=document.getElementById('EmployPanel');
b=document.getElementById('TUPEPanel');
b.className = 'FormPanelNotVisible'; // TJS 19/09/14
a.className = 'FormPanelDisplayed';
}
function TUPEDateEnable(){
et=document.getElementById('EnableTUPE');
tds = document.getElementById("TUPEDateSurround");
if (et.checked)
{
tds.className = 'rowdisplayed';
}
else
{
tds.className = 'rowcollapsed';
}
datachanged();
}
function sortcode(e)
{
var key;
var keychar;
var reg;
if(window.event)
{
// for IE, e.keyCode or window.event.keyCode can be used
key = e.keyCode;
}
else
{
if (e.which)
{
// netscape
key = e.which;
}
else
{
// no event, so pass through
return true;
}
}
keychar = String.fromCharCode(key);
reg = /\d/;
return reg.test(keychar);
}
function updatesubmit(){
upd=document.getElementById("Update");
if (upd.className != 'continue_button_disabled') // TJS 01/06/14
{
<%' start of changes TJS 03/11/06%>
delp45=document.getElementById("DelP45");
delp45.value = 'No';
if (P45Created)
{
ld=document.getElementById("LeavingDate");
if (ld.value == '')
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Delete P45';
// end of code added TJS 07/08/21
ynt.innerHTML = 'As you have deleted the Leaving Date for this Employee,
the P45 Form which already been created will be deleted.
Please destroy all printed copies of the P45.
Alternatively click Cancel to abort saving this record.'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Delete P46';
anb.innerHTML = 'Cancel';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'D';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
updatesubmit();
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'C';
updatesubmit();
};
ayn.style.height = '200px';
ayn.style.width = '480px';
ayn.style.left = '360px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
return false;
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
return false;
}
else
{
delp45 = document.getElementById("DelP45");
delp45.value = 'Yes';
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
<%' end of changes TJS 03/11/06%>
disablebuttons();
document.empform.submit();
}
return false;
}
function emailpayslip(notwindowload){
em = document.getElementById("EmailPayslip");
el = document.getElementById("EmailLbl"); // TJS 12/05/17
if (em.checked)
{
el.innerHTML = 'Email Address *'; // TJS 12/05/17
}
else
{
el.innerHTML = 'Email Address'; // TJS 12/05/17
}
if (notwindowload)
{
datachanged();
}
}
// start of code added TJS 09/05/13
function inforeigncountry(notwindowload){
pl=document.getElementById("PostcodeLabel");
ifc=document.getElementById("InForeignCountry");
fcs=document.getElementById("ForeignCountrySurround");
if (ifc.checked)
{
pl.innerHTML='';
if (fcs)
{
fcs.className='rowdisplayed';
}
}
else
{
pl.innerHTML=' *';
if (fcs)
{
fcs.className='rowcollapsed';
}
}
if (notwindowload)
{
datachanged();
}
}
// end of code added TJS 09/05/13
function setemployeeadded(){
parent.Employees.document.getElementById('employeeadded').value = 'yes';
}
// start of code added TJS 14/10/14
function setrefinclexcl(){
parent.Employees.document.getElementById('refreshinclexcl').value = 'yes';
}
// end of code added TJS 14/10/14
function checkkeypress(evt){
var e =(window.event) ? window.event : evt;
if (((((e.keyCode >= 48) && (e.keyCode <= 111) && (e.keyCode != 91) && (e.keyCode != 93)) || (e.keyCode == 8) || (e.keyCode == 32)
|| (e.keyCode == 46) || ((e.keyCode >= 186) && (e.keyCode <= 192)) || ((e.keyCode >= 219) && (e.keyCode <= 223))) && (!e.ctrlKey))
|| ((e.ctrlKey) && ((e.keyCode == 86) ||(e.keyCode == 88)))) // TJS 26/11/15
{
datachanged();
}
}
function disablebuttons(){
parent.DisableEmployeeMenuButtons();
btn=document.getElementById('Update');
btn.className='continue_button_disabled';
btn=document.getElementById('Close');
btn.className='cancel_button_disabled';
}
function p45reqdclick(SmpNoP45, SapNoP45, AEZeroCont){ // TJS 23/11/16
P45R = document.getElementById('P45Reqd');
fp45d = document.getElementById('ForceP45Surround');
ldl = document.getElementById('LeaveDateLbl'); // TJS 30/05/20
if (P45R.checked)
{
fp45d.className = 'rowdisplayed';
ldl.innerHTML = 'Leaving Date *'; // TJS 30/05/20
ld = document.getElementById('LeavingDate');
if (ld.value != '')
{
// start of code changed from asp to javascript TJS 23/11/16
if ((SmpNoP45 == 'Yes') || (SapNoP45 == 'Yes'))
{
msgText = 'This Employee is entitled to '
if (SmpNoP45 == 'Yes')
{
msgText = msgText + 'Statutory Maternity Pay (SMP)'
}
else
{
msgText = msgText + 'Statutory Adoption Pay (SAP)'
}
msgText = msgText + ' which must be
paid even if '
sex = document.getElementById('SexM')
if (sex.checked)
{
msgText = msgText + 'he'
}
else
{
msgText = msgText + 'she'
}
msgText = msgText + ' leaves your employment, unless ' // DC 10/03/17
if (sex.checked)
{
msgText = msgText + 'he'
}
else
{
msgText = msgText + 'she'
}
msgText = msgText + ' starts
work with another employer or dies.
You cannot therefore generate a P45 for this Employee at this time' // DC 10/03/17
// start of code added TJS 24/03/17
msgText = msgText + '
unless you either pay ';
if (sex.checked)
{
msgText = msgText + ' him the remaining ' // TJS 03/09/18
}
else
{
msgText = msgText + ' her the remaining ' // TJS 03/09/18
}
if (SmpNoP45 == 'Yes')
{
msgText = msgText + 'Statutory Maternity Pay (SMP)'
}
else
{
msgText = msgText + 'Statutory Adoption Pay (SAP)'
}
// start of code added TJS 03/09/18
if (PPEndDate == '')
{
msgText = msgText + ',
';
}
else
{
msgText = msgText + '
to ' + PPEndDate + ', ';
}
// end of code added TJS 03/09/18
msgText = msgText + 'or make one of the other changes below.';
// end of code added TJS 24/03/17
msgText = msgText + '
If the Employee has advised you that ' // DC 10/03/17
if (sex.checked)
{
msgText = msgText + 'he'
}
else
{
msgText = msgText + 'she'
}
msgText = msgText + ' has started work with another
employer, you should click Cancel, then set the Parental Pay Status on the
Parental Pay page ' // DC 10/03/17
msgText = msgText + 'for this Employee to "H - Started work for another Employer"
and enter the date ' // DC 10/03/17
if (sex.checked)
{
msgText = msgText + 'he'
}
else
{
msgText = msgText + 'she'
}
msgText = msgText + ' started work for the new Employer.
If the Employee has died, check the Deceased box and enter the date ' // DC 10/03/17 if (sex.checked) { msgText = msgText + 'he' } else { msgText = msgText + 'she' } msgText = msgText + ' died.' // DC 10/03/17 // end of code changed from asp to javascript TJS 23/11/16 // start of code added TJS 24/03/17 msgText = msgText + '
If you want to pay the remaining ';
if (SmpNoP45 == 'Yes')
{
msgText = msgText + 'Statutory Maternity Pay (SMP)'
}
else
{
msgText = msgText + 'Statutory Adoption Pay (SAP)'
}
// start of code added TJS 03/09/18
if (PPEndDate != '')
{
msgText = msgText + ' to ' + PPEndDate;
}
// end of code added TJS 03/09/18
msgText = msgText + '
in the current pay period, then click Pay Leaver SMP.';
plpp = document.getElementById('PayLeaverParPay');
// end of code added TJS 24/03/17
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
if (SmpNoP45 == 'Yes')
{
ynh.innerHTML = 'Statutory Maternity Pay (SMP)';
}
else
{
ynh.innerHTML = 'Statutory Adoption Pay (SAP)';
}
// end of code added TJS 07/08/21
ynt.innerHTML = msgText; // TJS 07/08/21
// start of code added TJS 07/08/21
if (SmpNoP45 == 'Yes')
{
ayb.innerHTML = 'Pay Leaver SMP';
}
else
{
ayb.innerHTML = 'Pay Leaver SAP';
}
anb.innerHTML = 'Cancel';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
p45reqdclick(SmpNoP45, SapNoP45, AEZeroCont);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
p45reqdclick(SmpNoP45, SapNoP45, AEZeroCont);
};
ayn.style.height = '390px';
ayn.style.width = '540px';
ayn.style.left = '310px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value != 'Y') // TJS 07/08/21
{
P45R.checked = false;
plpp.value = 'No'; // TJS 24/03/17
}
else
{
plpp.value = 'Yes'; // TJS 24/03/17
datachanged(); // TJS 24/03/17
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
else
{
// start of code added TJS 23/11/16
if (AEZeroCont == 'Yes')
{
zaec = document.getElementById('ZeroAEContrib');
zaec.value = 'No';
if (CompareDates(ld.value, NextPayDate, true, false, false))
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Leaver Pension Contributions';
// end of code added TJS 07/08/21
ynt.innerHTML = 'The Leaving Date for this Employee is prior to the expected next Pay Date for this Payroll.
Click Yes if you want to make pension contributions for this pay period,
or No to set the pension contributions to zero.'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
p45reqdclick(SmpNoP45, SapNoP45, AEZeroCont);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
p45reqdclick(SmpNoP45, SapNoP45, AEZeroCont);
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'N') // TJS 07/08/21
{
zaec.value = 'Yes';
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
}
// end of code added TJS 23/11/16
datachanged();
}
}
else
{
window.parent.DisplayAlertMsg('Leaving Date blank', 'You must enter a Leaving Date before requesting the generation of a P45.', 120, 600); // TJS 07/08/21 TJS 18/09/21
P45R.checked = false;
}
// start of code added TJS 04/04/19
et = document.getElementById('EmployeeType');
et = document.getElementById('EmployeeType');
ded = document.getElementById('DirEndDate');
if ((et.value == 'P') && (ded.value == ''))
{
window.parent.DisplayAlertMsg('Director Paid Periodically', 'This Employee is currently a Director - Paid Periodically.
Their Leaving Date wil be copied to the Director Stop Date and the
Employee Type updated to trigger the final annual Director NIC calculation.', 150, 600); // TJS 07/08/21 TJS 18/09/21
ded.value = ld.value;
et.value = 'p';
datachanged();
}
// end of code added TJS 04/04/19
}
else
{
fp45d.className = 'rowcollapsed';
ftp = document.getElementById('ForceThisPeriod'); // TJS 05/01/11
ftp.checked = false; // TJS 05/01/11
ldl.innerHTML = 'Leaving Date'; // TJS 30/05/20
datachanged();
}
}
function deceasedclick(SmpNoP45, SapNoP45, SetButtons){
died = document.getElementById('Deceased');
ddr = document.getElementById('DeceasedDateRow'); // TJS 30/05/20
dds = document.getElementById('DeceasedDateSpan'); // TJS 30/05/20
if (died.checked)
{
if (ddr) // TJS 30/05/20
{
ddr.className = 'rowdisplayed';
}
if (dds) // TJS 30/05/20
{
dds.className = 'spaninlineblock'; // TJS 30/05/20
}
ld = document.getElementById('LeavingDate');
if (ld.value != '')
{
if ((SmpNoP45 == 'Yes') || (SapNoP45 == 'Yes'))
{
msgText = 'This Employee was entitled to '
if (SmpNoP45 == 'Yes')
{
msgText = msgText + 'Statutory Maternity Pay (SMP)'
}
else
{
msgText = msgText + 'Statutory Adoption Pay (SAP)'
}
msgText = msgText + '
which must be paid up to and including the week '
sex = document.getElementById('SexM')
if (sex.checked)
{
msgText = msgText + 'he'
}
else
{
msgText = msgText + 'she'
}
msgText = msgText + ' died.
Please enter the date the Employee died as this
'
msgText = msgText + 'will normally be different from the Leaving Date.'
window.parent.DisplayAlertMsg('Leaver Parental Pay', msgText, 160, 600); // TJS 07/08/21 TJS 18/09/21
}
else
{
dtedied=document.getElementById('DateDeceased');
dtedied.value = ld.value;
datachanged();
}
}
}
else
{
if (ddr) // TJS 30/05/20
{
dd.className = 'rowcollapsed';
}
if (dds) // TJS 30/05/20
{
dds.className = 'spancollapsed'; // TJS 30/05/20
}
}
if (SetButtons)
{
datachanged();
}
}
function checkbank(){
a=document.getElementById('BankName')
if (a.className=='inputerror'){
displaybank();
return;
}
a=document.getElementById('BankBranchName')
if (a.className=='inputerror'){
displaybank();
return;
}
a=document.getElementById('BankSortCode')
if (a.className=='inputerror'){
displaybank();
return;
}
a=document.getElementById('BankAccount')
if (a.className=='inputerror'){
displaybank();
return;
}
a=document.getElementById('BankAccountName')
if (a.className=='inputerror'){
displaybank();
return;
}
a=document.getElementById('BACSReference')
if (a.className=='inputerror'){
displaybank();
return;
}
}
function studP38clicked(SetButtons){
stp38=document.getElementById('StudentP38S');
txcde=document.getElementById('TaxCode');
if (stp38.checked)
{
txcde.value = 'NT'
txcde.readOnly = true;
}
else
{
txcde.value = ''
txcde.readOnly = false;
}
if (SetButtons)
{
datachanged();
}
}
// start of code added TJS 09/01/13
function EmplSecSet(SetButtons){ // TJS 26/07/13
empsec=document.getElementById('EmployeeSecondment');
roweeaczn=document.getElementById('EEACitizenSurround');
if ((empsec.value == '') || (empsec.value == 'R'))
{
roweeaczn.className = 'rowcollapsed'
}
else
{
roweeaczn.className = 'rowdisplayed'
// start of code added TJS 30/10/14
if ((empsec.value == 'M') || (empsec.value == 'L')) // TJS 07/08/21
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'Employee Secondment Status';
// end of code added TJS 07/08/21
ynt.innerHTML = 'This option should only be selected if this employee is employed
by an overseas employer, who has sent this individual to work for you
Click Yes if this is the case, otherwise click Cancel'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'Cancel';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
EmplSecSet(SetButtons);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
EmplSecSet(SetButtons);
};
ayn.style.height = '170px';
ayn.style.width = '480px';
ayn.style.left = '360px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'N') // TJS 07/08/21
{
empsec.value = '';
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
// end of code added TJS 30/10/14
}
if (SetButtons) // TJS 26/07/13
{
datachanged();
}
}
// end of code added TJS 09/01/13
// start of code added TJS 18/12/15
function App5Enabled(ctrl){
if (ctrl.checked)
{
// start of code added TJS 07/08/21
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
cd = window.parent.document.getElementById('ConfirmDiv');
ynr = window.parent.document.getElementById('YesNoRes');
if (dm.style.display != 'block')
{
ynh = window.parent.document.getElementById('YesNoHeader');
ynt = window.parent.document.getElementById('YesNoText');
ayb = window.parent.document.getElementById('YesBtn');
anb = window.parent.document.getElementById('NoBtn');
ynh.innerHTML = 'NIC Letter';
// end of code added TJS 07/08/21
ynt.innerHTML = 'Do you hold written approval from HMRC to operate Appendix 5:
Net of foreign tax credit relief for this Employee ?'; // TJS 07/08/21
// start of code added TJS 07/08/21
ayb.innerHTML = 'Yes';
anb.innerHTML = 'No';
ayb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
ynr.value = 'Y';
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
App5Enabled(ctrl);
};
anb.onclick = function(e) { ynr = window.parent.document.getElementById('YesNoRes');
dm = window.parent.document.getElementById('DialogMask');
ayn = window.parent.document.getElementById('AskYesNoDiv');
ynr.value = 'N';
App5Enabled(ctrl);
};
ayn.style.height = '130px';
ayn.style.width = '520px';
ayn.style.left = '340px';
dm.style.display = 'block';
cd.style.display = 'none';
ayn.style.display = 'block';
}
else
{
// end of code added TJS 07/08/21
if (ynr.value == 'Y') // TJS 07/08/21
{
datachanged();
}
else
{
ctrl.checked = false;
}
dm.style.display = 'none'; // TJS 07/08/21
ayn.style.display = 'none'; // TJS 07/08/21
}
}
else
{
datachanged();
}
}
// end of code added TJS 18/12/15
// start of code added TJS 30/05/20
function NICHolChng(ctrl){
nhf = document.getElementById('NICHolFrom')
if (ctrl.checked)
{
nhf.style.visibility = "visible";
nhf.style.display = "inline-block";
}
else
{
nhf.style.visibility = "hidden";
nhf.style.display = "none";
}
datachanged();
}
// start of code added TJS 30/05/20
// start of code added TJS 23/11/16
function CompareDates(Date1, Date2, LT, EQ, GT){
d1c=Date1.split('/');
d2c=Date2.split('/');
// check both fields have 3 sections separated by /
if ((d1c.length != 3) || (d2c.length != 3))
{
return
}
// compare year first
if ('' + Date1 != '')
{
if (d1c[2].length < 3)
{
if (d1c[2] < 50)
{
// force arithmetic addition by usung subtract
d1c[2] = 2001 + (d1c[2] - 1);
}
else
{
// force arithmetic addition by usung subtract
d1c[2] = 1901 + (d1c[2] - 1);
}
}
}
if (d1c[2] - d2c[2] > 0)
{
// Date 1 Greater Than Date 2
if (GT)
{
return true;
}
else
{
return false;
}
}
else
{
if (d1c[2] - d2c[2] < 0)
{
// Date 1 Less Than Date 2
if (LT)
{
return true;
}
else
{
return false;
}
}
else
{
// years are the same, check month
if (d1c[1] - d2c[1] > 0)
{
// Date 1 Greater Than Date 2
if (GT)
{
return true;
}
else
{
return false;
}
}
else
{
if (d1c[1] - d2c[1] < 0)
{
// Date 1 Less Than Date 2
if (LT)
{
return true;
}
else
{
return false;
}
}
else
{
// months are the same, check day
if (d1c[0] - d2c[0] > 0)
{
// Date 1 Greater Than Date 2
if (GT)
{
return true;
}
else
{
return false;
}
}
else
{
if (d1c[0] - d2c[0] < 0)
{
// Date 1 Less Than Date 2
if (LT)
{
return true;
}
else
{
return false;
}
}
else
{
// Date 1 Equal Date 2
if (EQ)
{
return true;
}
else
{
return false;
}
}
}
}
}
}
}
}
// end of code added TJS 23/11/16
function undoclick(ctrl){
if (ctrl.checked)
{
ctrl.checked = false;
}
else
{
ctrl.checked = true;
}
}
function undoselect(ctrl, origvalue){
ctrl.value = origvalue
}
function undoradio(checkedctrlid, clickedctrl){
ctrl=document.getElementById(checkedctrlid);
// IE gets a control reference if there
if (ctrl)
{
ctrl.checked = true;
if (ctrl.id != checkedctrlid)
{
ctrl.checked = false;
}
}
else
{
clickedctrl.checked = false
}
}
<%
sql = "UPDATE " & DBSchema & "Session_Vars SET GetEEDJS = Null WHERE Session_Var_ID = '" & left(SessionVarsID, 15) & "'" ' TJS 10/07/11
ExecuteSQL objConn, sql ' TJS 30/06/11
rsCheckJSKey.close ' TJS 30/06/11
set rsCheckJSKey = nothing ' TJS 30/06/11
%>