<% ' MyPAYE ' Module: GenericAEExportFormat.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 09 April 2021 ' '''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' ' ' Description - This module enables a user defined Generic AE export file format. ' ' Amendment Log '------------------------------------------------------------------------------------------ ' Date | Name | Vers. | Description '------------------------------------------------------------------------------------------ ' 21/03/16 | DC | 5.0.05 | Page added ' 17/06/15 | DC | 5.0.08 | Added Gross earnings ' 08/12/15 | DC | 5.0.17 | Added Taxable earnings ' 21/02/17 | DC | 5.0.17a| Added Non-Banded pens earnings, and added code to clear ' | | | text when checkbox cleared. ' | | | Fixed non-working LogOut. ' 10/10/17 | TJS | 5.1.10 | Corrected conflict where PSID param was used for both PaySlipID and PenSchID on new employee wizard ' 20/10/19 | TJS | 5.7.00 | Modified to use GetMainMenuParam to save having to read lots of parameters for each page build ' 25/02/20 | TJS | 5.7.04 | Modified to cater for Partner only reports on Multi Employer Overview ' 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 ' 09/04/21 | TJS | 5.9.09 | Modified to use ASPDOTNET/LogOut.aspx and ASPDOTNET/AgencyCancel.aspx pages ''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''''' PageID = 43183 NoBack = True if Request.ServerVariables("request_method") = "GET" then 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") AddNewEdit = RemoveHTML(request.querystring("ANE")) CancelPage = RemoveHTML(request.querystring("CPge")) else SessionID = request.form("ID") SessionVarsID = RemoveHTML(request.form("SV")) SourceFrame = RemoveHTML(request.form("S")) DestFrame = RemoveHTML(request.form("D")) EmployerID = CheckURLDBIDField(RemoveHTML(request.form("ER")), "EmployerID") AddNewEdit = RemoveHTML(request.form("ANE")) CancelPage = RemoveHTML(request.form("CPge")) end if %> <%GetSessionVarsIDRecord(SessionVarsID)%> <% if Request.ServerVariables("request_method") = "GET" then FailureFields = RemoveHTML(request.querystring("FFld")) FailureMessage = RemoveHTML(request.querystring("FMsg")) AlertMessage = RemoveHTML(request.querystring("AlMsg")) else FailureFields = RemoveHTML(request.form("FFld")) FailureMessage = RemoveHTML(request.form("FMsg")) AlertMessage = RemoveHTML(request.form("AlMsg")) end if Function CheckValidationFailure(FieldName) if instr(1, FailureFields, ":" & FieldName & ":") = 0 then ' no failure - set control to normal CheckValidationFailure = "" else ' validation failed - set control to red outline CheckValidationFailure = "-error" end if end Function ' get details for user who is logged in sql = "SELECT Employer_ID, " & UserTableMenuPermissionFields & " FROM " & DBSchema & "Users INNER JOIN " & DBSchema & "User_Permissions " sql = sql & "ON Users.User_ID = User_Permissions.User_ID AND (Employee_Employer_ID = '' OR Employee_Employer_ID = '" sql = sql & EncodeEmployerID(UserPermissionsTable, EmployerID) & "') WHERE Users.User_ID = " & GetSessionVar("UserID") sql = sql & " AND User_Permissions.Deleted = 0 ORDER BY Employee_Employer_ID DESC" set rsUser = OpenRecordset(objConn, sql) sql = "SELECT " & EmployerTableMenuOptionFields & " 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 AddNewEdit <> "Edit" then ReadOnly=" readonly" AllowChanges = false else ReadOnly="" AllowChanges = true end if response.Expires = -1500 response.Expiresabsolute = Now() - 2 response.AddHeader "pragma", "no-cache" response.AddHeader "cache-control", "no-store" response.CacheControl = "no-cache" %> Generic AE Export File Format <%if CheckBrowserVersion("MSIE", 8, true, false, false) then ' [if LT IE 8]%> <%end if if CheckBrowserVersion("MSIE", 7, true, true, false) then ' [if lte IE 7]%> <%end if if "" & GetSessionVar("PathModifier") <> "" then%> Partner-CSS.asp" /> <%end if%> <%MenuShowHome = true MenuShowEmployer = true MenuShowFindEmployee = true MenuShowUsers = true MenuShowCreate = true MenuShowCreatePayroll = true MenuShowCreateEmployer = true MenuShowCreateUser = true MenuShowHMRC = true MenuShowReports = true MenuPartnerReportsOnly = false ' TJS 25/02/20 MenuShowPayrollData = true MenuShowTools = true MenuShowSupport = true MenuSelected = "" MenuEmployerExists = true MenuShowAccount = true%> <%dim arBaseNames(32) ' DC 17/06/16 DC 08/12/16 21/02/17 arBaseNames(1) = "Title" arBaseNames(2) = "Employee First Name" arBaseNames(3) = "Employee Surname" arBaseNames(4) = "Date Of Birth" arBaseNames(5) = "National Insurance Number" arBaseNames(6) = "Gender" arBaseNames(7) = "Payroll Ref" arBaseNames(8) = "Address 1" arBaseNames(9) = "Address 2" arBaseNames(10) = "Town/City" arBaseNames(11) = "County" arBaseNames(12) = "Post Code" arBaseNames(13) = "Country" arBaseNames(14) = "E-mail Address" arBaseNames(15) = "Employee Start Date" arBaseNames(16) = "Leaving Date" arBaseNames(17) = "Pay Period" arBaseNames(18) = "Pay Frequency" arBaseNames(19) = "Enrolment Date" arBaseNames(20) = "Postponement Date" arBaseNames(21) = "Opt Out Date" arBaseNames(22) = "AE Status" arBaseNames(23) = "Pensionable Earnings" arBaseNames(24) = "Employee Cont £" arBaseNames(25) = "Employee Cont %" arBaseNames(26) = "Employer Cont £" arBaseNames(27) = "Employer Cont %" arBaseNames(28) = "AVC Cont £" arBaseNames(29) = "AVC Cont %" arBaseNames(30) = "Gross Earnings" ' DC 17/05/16 arBaseNames(31) = "Taxable Earnings" ' DC 08/12/16 arBaseNames(32) = "NonBanded Pensionable Earnings" ' DC 21/02/17 sql = "SELECT Source_Col_ID, Custom_Name, Sort_Order FROM " & DBSchema & "Gen_AE_File_Format WHERE Employer_ID = " & EmployerID sql = sql & " AND Source_Col_ID > 0 AND Deleted = 0 ORDER BY Source_Col_ID" set rsFileFmt = OpenRecordset(objConn, sql) sql = "SELECT Source_Col_ID, Custom_Name, Sort_Order FROM " & DBSchema & "Gen_AE_File_Format WHERE Employer_ID = " & EmployerID sql = sql & " AND Source_Col_ID < 0 AND Deleted = 0 ORDER BY Source_Col_ID" set rsFillerFields = OpenRecordset(objConn, sql) %>
/Secure/UpdateGenAEFileFormat.asp"> <%if "" & FailureMessage <> "" then%>

<%=FailureMessage%>

<%end if%>
<%For iLoop = 1 to UBound(arBaseNames)%> <%if "" & FailureFields = "" then ' Build list from dataset do while not rsFileFmt.EOF if cInt(rsFileFmt("Source_Col_ID")) = iLoop then CustName = rsFileFmt("Custom_Name") iSort = cInt(rsFileFmt("Sort_Order")) bChecked = True exit do else CustName = "" iSort = 0 bChecked = False end if rsFileFmt.movenext Loop if not rsFileFmt.BOF then rsFileFmt.movefirst end if else ' Build list from form CustName = RemoveHTML(request.form("CuNme" & iLoop)) iSort = cInt(RemoveHTML(request.form("Srt" & iLoop))) if RemoveHTML(request.form("Incl" & iLoop)) = "ON" then bChecked = True else bChecked = False end if end if%> <%next%>

Names and column positions for Generic Auto Enrolment Export File.

 
Generic Name Include Custom Name Col. Posn.
<%=arBaseNames(iLoop)%> value="ON" onclick="SetText(<%=iLoop%>, '<%=arBaseNames(iLoop)%>')"> <%if AllowChanges then%><%else%>-readonly<%end if%>" maxlength="48" value="<%=CustName%>" <%=ReadOnly%><%if AllowChanges then%> onkeydown="checkkeypress(event)"<%end if%>>

Update Close

<%if "" & AlertMessage <> ""then%> <%end if%> <% ReleaseASPEncrypt rsFileFmt.close rsUser.close rsEmployer.close set rsFileFmt = nothing set rsUser = nothing set rsEmployer = nothing SaveSessionVarsRecord SessionVarsID objConn.close set objConn = nothing %>