% ' MyPAYE ' Module: SelectTransferCredit.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 - 2021 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 24 September 2021 '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Description - This module ' ' Amendment Log '------------------------------------------------------------------------------------------ ' Date | Name | Vers. | Description '------------------------------------------------------------------------------------------ ' 17/07/07 | TJS | 1.2.03 | Page added ' 18/11/10 | TJS | 1.5.00 | Modified to use both root and agency CSS files when used to ' | eliminate duplicated settings in agency CSS files ' 22/12/10 | TJS | 1.5.01a | Modified to cater for Login_Disabled in Multi_Company_Logins ' 08/08/12 | TJS | 2.0.05 | Google Analytics added ' 01/06/14 | DC | 4.0.00 | Modified for new styling and operation without framesets ' 07/06/14 | TJS | 4.0.00 | Corrected centering of tables ' 05/10/14 | TJS | 4.0.04 | Modified for Encrypted Employer ID check ' 30/10/14 | TJS | 4.0.05 | Modified display of Alert Messages to cater for RemoveHTML changes ' 26/11/15 | TJS | 5.0.00 | Modified to cater for separate User_Permissions table ' 20/10/19 | TJS | 5.7.00 | Modified to use GetMainMenuParam to save having to read lots of parameters for each page build ' 30/05/20 | TJS | 5.8.00 | Modified for new styling - added centered class on body and modified to replace stylesheet.css, mainmenu.css and buttons-css.asp with BodyAndMenu-css.asp ' 25/09/20 | TJS | 5.9.00 | Modified to prevent double clicking on change employer listbox ' 24/09/21 | TJS | 5.9.12 | Modified to replace alert and confirm dialogues to cater for browser blocks on cross site dialogs and to use ASPDOTNET/ViewAccountHistory.aspx page ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' PageID = 22486 SessionID = request.querystring("ID") SessionVarsID = RemoveHTML(request.querystring("SV")) SourceFrame = RemoveHTML(request.querystring("S")) DestFrame = RemoveHTML(request.querystring("D")) EmployerID = CheckURLDBIDField(RemoveHTML(request.querystring("ER")), "EmployerID") %> <%GetSessionVarsIDRecord(SessionVarsID)%> <%Function CheckValidationFailure(FieldName) if instr(1, FailureFields, ":" & FieldName & ":") = 0 then ' no failure - set control to normal CheckValidationFailure = "" ' TJS 01/06/14 else ' validation failed - set control to red outline CheckValidationFailure = "-error" ' TJS 01/06/14 end if end Function FailureFields = RemoveHTML(request.querystring("FFld")) FailureMessage = RemoveHTML(request.querystring("FMsg")) AlertMessage = RemoveHTML(request.querystring("AlMsg")) TransferToEmployerID = CheckURLDBIDField(RemoveHTML(request.querystring("TrnsER")), "TransferToEmployerID") EmplMntsToTransfer = ValidateIntegerValue(RemoveHTML(Trim(request.querystring("EMTransfer"))), "EMTransfer") sql = "SELECT " & UserTableMenuPermissionFields & ", Sort_Employer_List FROM " & DBSchema & "Users INNER JOIN " & DBSchema ' TJS 26/11/15 sql = sql & "User_Permissions ON Users.User_ID = User_Permissions.User_ID AND (Employee_Employer_ID = '' OR Employee_Employer_ID = '" ' TJS 26/11/15 sql = sql & EncodeEmployerID(UserPermissionsTable, EmployerID) & "') WHERE Users.User_ID = " & GetSessionVar("UserID") ' TJS 26/11/15 sql = sql & " AND User_Permissions.Deleted = 0 ORDER BY Employee_Employer_ID DESC" ' TJS 26/11/15 set rsUser = OpenRecordset(objConn, sql) sql = "SELECT " & EmployerTableMenuOptionFields & ", Billing_Method, Empl_Mnths_Credit FROM " & DBSchema & "Employers WHERE Employer_ID = " & EmployerID set rsEmployer = OpenRecordset(objConn, sql) ReadMainMenuParams SessionVarsID, cBool(rsUser("User_Admin")), (cBool(rsUser("Run_Payroll")) or cBool(rsUser("Payroll_EOY")) or cBool(rsUser("CIS_Returns"))), _ cBool(rsUser("Run_Payroll")), rsUser("Support_User_ID") ' TJS 20/10/19 if "" & EmplMntsToTransfer = "" then EmplMntsToTransfer = rsEmployer("Empl_Mnths_Credit") end if sql = "SELECT Multi_Company_Logins.Employer_ID, Employers.Employer_Name FROM " & DBSchema & "Multi_Company_Logins, " sql = sql & DBSchema & "Employers WHERE Multi_Company_Logins.Employer_ID = Employers.Employer_ID AND User_ID = '" sql = sql & EncodeUserID(MultiCompLoginTable, GetSessionVar("UserID")) & "' AND Multi_Company_Logins.Deleted = 0 AND " sql = sql & "Multi_Company_Logins.Login_Disabled = 0 AND Multi_Company_Logins.Employer_ID <> " & EmployerID ' TJS 22/12/10 if cBool(rsUser("Sort_Employer_List")) then sql = sql & " ORDER BY Employer_Name" end if set rsTransferTo = OpenRecordset(objConn, sql) response.Expires = -1500 response.Expiresabsolute = Now() - 2 response.AddHeader "pragma", "no-cache" response.AddHeader "cache-control", "no-store" response.CacheControl = "no-cache" %>
Transfer Credit to another Employer
<%if GetSessionVar("MultiEmplerLogin") and cBool(rsUser("Employer_Admin")) and rsEmployer("Empl_Mnths_Credit") > 0 and _ rsEmployer("Billing_Method") <> "F" and rsEmployer("Billing_Method") <> "A" then%>Transfer /Secure/ASPDOTNET/ViewAccountHistory.aspx?ID=<%=SetPageSessionID(84214, DestFrame)%>&SV=<%=SessionVarsID%>&S=<%=DestFrame%>&D=<%=MainFrame%>&ER=<%=EmployerID%>','PayrollHome','', true);">Cancel <%else%>
You cannot transfer credits.
<%end if%>")
sTemp = replace(sTemp, "\r\n", "
")
sTemp = replace(sTemp, "&", "&")
iMsgLine = 1
iPosn = instr(sTemp, "
") do while iPosn > 0 iMsgLine = iMsgLine + 2 iPosn = instr(iPosn + 1, sTemp, "
")
loop
iPosn = instr(sTemp, "
")
do while iPosn > 0
iMsgLine = iMsgLine + 1
iPosn = instr(iPosn + 1, sTemp, "
")
loop
' end of code added TJS 24/09/21%>
<%end if%>
<%rsUser.close
rsTransferTo.close
rsEmployer.close
set rsUser = nothing
set rsTransferTo = nothing
set rsEmployer = nothing
SaveSessionVarsRecord SessionVarsID ' TJS 19/06/07
ReleaseASPEncrypt ' TJS 05/10/14
objConn.close
set objConn = nothing
%>