Sunday, June 2, 2019
The Existing System For Payslip Generation
The Existing System For Payslip genesisThe purpose of the proposed project is to automatise the Payslip generation process which replaces the traditional system of Payslip generation that utilize to print the employee requital particular propositions onto a paper.This project includes a single user who is accepted to initiate the application. The privileges are given save to the individual in a department who is responsible for generating the PaySlips for the employees.The application takes in the outperform Spread canvass as comment and generates an encrypted PDF PaySlip for distributively employee. This PDF PaySlip is mailed to the respective employee by using their mail-id which is provided in the Excel cruise.This application generates PaySlips of each employee every month. The PaySlip spreadsheet is uploaded to the system. The application uses an excel parser to read this spreadsheet. The excel parser parses the excel sheet in a row-wise fashion and generates an xml string for each row. This xml string contains the lucre data of each employee. The salary data is converted into a tidings-protected PDF instrument as per a pre-defined template. These salary statements (in PDF) are emailed to respective users. The email process is logged.1.2 Existing SystemThe existing System for PaySlip generation includes manual entry of the pay details of all the employees in an excel sheet and converting them to word document. Each row from the excel sheet is taken and consequently converted into the word document. This word document contains the Pay details of the employee. This document is printed on to a paper and then distributed to all the employees.The Existing System requires manual effort in converting the excel sheet data into the word document. The word document which contains the salary details should be generated for all the employees which in turn delays the whole process of distributing the payslips. As the paper is use in distributing the pa yslips this even includes the wastage of paper. This is till the part of generation of pyslips itself. When talking about distribution each and every paslip has to be signed by the authority, stamped and then folded which is descend in the envelope.this has to be distributed to all the employees near the desk has to take an ack instantlyledgement that the employee has received by signing on paper. If the employee is not at the desk or out of brand then distribution has to be postponed for that employee till he is available. That is he cant check it immediately after its been issued. Making it remotely price of admissionible is also other aspect of it.1.3 Proposed SystemThe proposed System for generating the PaySlips is a Web base Automated System for generation and distribution of PaySlips.Proposed System is efficient enough as it includes less(prenominal) Manual effort. Manual effort is needed in only logging into the application and uploading the appropriate excel sheet into the application. Just a click on the upload button is sufficient, then the application itself will generate the payslips and distribute them to the respective employees mailid. Optimal performance of the application is achieved as delay is reduced in generation of Payslips with the existing system. Paper conservation is achieved, as the PaySlips are sent to the employees through mails, This makes the payslip remotely accessible2.1 Functional RequirementsmodulesAuthentication/AuthorizationUpload appointExcel ParserPDF GenerationEmailModule DescriptionAuthentication/Authorization ModuleThis application is used to generate payslips of the employees for every month. Payslips, that depict all the salary details, is very confidential and hence this work should be carried out by an authorized person. For this purpose the user is presented with a login and is granted access to the application only after supplying a valid username and countersignature. This needs database connectivity tha t stores all the details of the users who can use the application with their word.This module is implemented using Struts. As this partitions the presentment and execution the login UI is built using Java legion pages. When the user submits the user name and password the servlet gets invoked handling the process that connects to the database, verifies and accordingly an action is taken that frontward to another UI.Upload FileThis module uploads the Excel spread sheet into the application in which details of all the employees are present with the present months salary details. The details of the employee includes the name, empid, designation etc .The Excel spread sheet that is needed to be uploaded should be in a specified format i.e., all the details should be in the same chronological order according to the specifications. The uploaded spread sheet will not be saved any where as the data in the Excel sheet is very confidential.This module is implemented using Struts. The File Upload UI is built using Java server pages. When the user uploads an Excel cross- accommodate a servlet gets invoked handling the process that directs an action.Excel ParserThis module takes the uploaded excel sheet as input and parses it in a row wise fashion, organizes the data in xml format For this a special software tool is used In this module we also retrieve the employee-id, mail-id and month for which the payslip is generated.The software tool used for parsing the Excel document is POI. This needs a POI.jar added in the library where some predefined methods are defined. The POI consists of APIs for manipulating various file formats based upon Microsofts OLE 2 Compound Document format, and accountability OpenXML format, using pure Java. In short, you can read and write MS Excel files using Java. In addition, you can read and write MS tidings and MS PowerPoint files using Java. POI is your Java Excel solution (for Excel 97-2007).However, we have a complete API for porting o ther OLE 2 Compound Document formats and welcome others to participate.OLE 2 Compound Document Format based files include most Microsoft Office files such as XLS and DOC as well as MFC serialization API based file formats. Office OpenXML Format based files include the new (2007+) xml based file formats, including Microsoft office files such as XLSX, DOCX and PPTX.PDF GenerationThis module creates a PDF file per employee based on pre-defined template and a hit-or-missly generated cry is used to encrypt the PDF file. This password is used by the employees to retrieve the PaySlips. The template is designed using XSL independently and values are taken from the Excel and filled into PDF using java. The PDF is encrypted using a random generated password and the password is attached to the mail. The encrypted PDF document is mailed to the employee.The software tool used for generating a PDF document is XSL-FO. XSL-FO is a language for formatting XML data . XSL-FO stands for Extensible St ylesheet Language Formatting Objects . XSL-FO is a W3C Recommendation . XSL-FO is now formally named XSL . XSL-FO is an XML-based markup language describing the formatting of XML data for output to screen, paper or other media. Styling is both about transforming and formatting information. When the World Wide Web syndicate (W3C) made their first XSL Working Draft, it contained the language syntax for both transforming and formatting XML documents. Later, the XSL Working Group at W3C split the original draft into separate Recommendations. XSLT, a language for transforming XML documents . XSL or XSL-FO, a language for formatting XML documents. XPath, a language for navigating through elements and attributes in XML documents.This is more advantageous because this seperates the presentation or template of the PDF and the implementation how the data is filled in.Email ModuleThis Module emails the Payslips (Password protected PDF files) to the respective employee by using their mail id. The mailing details are saved in a batch log with the time and date at which the mail is sent to the employee for verification. This module sets the mail attributes like the subject, from_address, to_address and message body. Also a partial(p) random generated password is sent in the mails which need to be personalized by the employee. This module also inserts values into the email log with the details of mailing.The communications protocol used for mailing the PDF document to a particular employee is SMTP. The JavaMail API provides a platform-independent and protocol-independent framework to build mail and messaging applications.This is binded with Simple Mail Transfer Protocol for mailing.2.2 Non-Functional Requirements availabilityThis application is easily accessible by the user who is authorized to use the system for generating PaySlips every month.PerformanceThis system can generate PaySlips for any emergence of employees considering the same speed.ReliabilityThis system is consistent and performs required inclines under stated conditions.SecurityUnauthorized access to the system and its data is not allowed.The person who wants to access the system is authenticated against a username and password. The PaySlip mailed to the employee is also password protected. This ensures unauthorized access of the PaySlip.UsabilityThis system enhances usability by incorporating well expressiond user embrasures, end-user interactions, informative defect messages etc.2.3 System Requirement SpecificationSoftware RequirementsLanguage Java/J2EEOperating system Win 2000/XP or higherWeb Server Apache tomcat ServerExcel Parsers POI(Poor Obfuscation Implementation)PDF Generator Tools XSL-FO(Extensible Style sheet Language-Formatting Object)Back End MySQL DatabaseHardware RequirementsProcessor P4 or higherRAM 1 GB or higherHard disk 10 GB3.1 Technical computer architectureA Technical Architecture breaks down operational (business) processes into functional components and capabilities. It describes the structure and behaviour of the technology infrastructure of an enterprise, solution or system.The following diagram depicts functional components of the application.BrowserWeb Container(Tomcat)MySQLPaySlip Generation SystemThe web container in detail handles the following operations as depicted in the following diagramAs the web container receives the request from the browser it invokes the parser functionality and does the excel parsing row-wise and generates an xml wagon train. The string data is used in generating the PDF. These PDFs which are generated are mailed to the respective employees by the mailer component. The entire email process is logged in a file.Once the application is deployed in the server we can access it locally or from remote using mankind IP or giving some domain name to the application.3.2 Software ArchitectureSoftware architecture alludes to the overall structure of the software and the itinerarys in which the structure pro vides conceptual integrity for a system. In the simplest form software architecture is the hierarchical structure of course of study components (modules), the manner in which these components interact and structure of data that are used by these components. The software architecture of a program or computing system is the structure or structures of the system, which comprise software components, the externally visible properties of those components, and the relationships between them.4.1 Design ObjectivesDesign is the first step in the development phase of a process or system in sufficient details to permit its physical realization.Without design specifications, the design will be unguided.It is difficult to know when the process is complete and to measure the progress.Design is used to plan what information needs to be displayed and entered and how it relates to other information.Design is the only way to translate the requirements into a finished system.A well designed program wi ll be easier to implement, distribute and maintain.4.2 UML draws4.2.1 Usecase Diagram4.2.2 Class Diagram4.2.3 Sequence Diagram4.2.4 Collaboration Diagram4.2.5 Activity Diagram4.3 Data Flow DiagramsLevel 14.4 Database Design4.4.1 E-R Diagrams4.4.2 Database TablesDatabase Tables5.1 Pseudo CodeLogin ModuleLogin formpublic assort LoginForm extends ActionForm/**Declare two string variables that holds the username and password values entered in the formparticularise getter and setter methods **/Login Actionpublic class LoginAction extends ActionPublic ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws ejection/**Create an object to the login formRetrieve the username and password entered in the form and save in some variablesCreate an object for the implementation and call the function validate() with the retrieved username and password as argumentsSavetoken()Depending on its return value forward the act ion to success page or disaster page**/Login Interfacepublic interface LoginDAO/**Declare th method validate(string , string)**/Interface Implementationpublic class LoginDAOimpl extends BaseDAO implements LoginDAOConstructor()Validate ()/**Declare two string variables that holds the values of the username and password from he database overtake the connection to the database using the predefined method in javaRetrieve the username and password from the database using a SQL query(select)Compare both username, password from form and databaseReturn a Boolean value according to the comparision**/Login.jspCTE Pay Slip Generation System Employee Loginfunction validateLogin()if(document.loginForm.username.value=&& document.loginForm.password.value=)return trueelsealert(Please Enter UserName and Password.)return out of true LoginUserName Password secure 2009 Cambridge Technology Enterprises. All rights reserved.Upload File ModuleUpload formpublic class UploadForm extends ActionForm/**De fine a variable file of oddball fileAlso define the getter and setter methods **/Upload Actionpublic class StrutsUploadAction extends Actionpublic ActionForward execute(ActionMapping mapping,ActionForm form,HttpServletRequest request,HttpServletResponse response) throws Exception/** If the token is valid thenCreate an object for upload form to retrieve parameters like contentType, fileName, fileSize.Create an object to interface to all the method parseExcel(file)Return successElseReturn failure **/Upload.jspCTE Pay Slip Generation System Employee Loginfunction isFileName()var fileName = document.forms0.theFile.value // uploadform is the form nameif (fileName ==)alert(Please select a file)return falseElseif(fileName.substr((fileName.length)-3,fileName.length) == xls)document.forms0.action = FileUpload.dodocument.forms0.method = postdocument.forms0.submit()return trueElsealert(Please Upload an Excel file)return falseFile Upload value= Select FileCopyright 2009 Cambridge Technol ogy Enterprises. All rights reserved.window.NREUM(NREUM=)NREUM.info=beaconbam.nr-data.net,licenseKeyde6e6cfad9,applicationID221047987,transactionNamebl0HMhMFDEYCWhJeWlcXMBQISwdGEFgfRBpYShEPAggHGxNRFg==,queueTime0,applicationTime1,attsQhoERFsfH0g=,errorBeaconbam.nr-data.net,agentUpload interfacepublic interface PaySlipDAO declare a method parseExcel()/**Upload interface implementation(Excel Working and PDF Generation Modules **/)public class PaySlipDAOImpl extends BaseDAO implements PaySlipDAOConstructor()public String parseExcel(String fileName) throws ExceptionDefine a String get down str=sno,month,NoofDays,empid,empname,desg,Basic,HRA,That defines the sequence in which Excel file should be in./**Define a string variable that holds the root tag declare an input stream and initialize it to null now define a new input stream and initialize it to file (Excel file)initialize POIFSFileSystem to inputstream define a new HSSFworkbookget the sheet count get the sheet with count zero echo the rows if the sheet has rows theniterate the cells from that retrieve the 4th,2nd and 21st cell values.4-mployeeid 2-month 21-Email idFor every cell value tack the opening tag using the string array**//**According to the cell value get the value give careNumericFormulaStringAfter adding the value append the closing tagLike wise iterate till all the cells are completedAt the end append the closing root tagWith this we are ready with our xml string. exploitation this xml string as the argument make the call to the generatPDF()Return empids of employees for whom the mail is sent and to whom the mail is not sent with a appended in between.**/PDF Generation Modulepublic int genPDF( HSSFCell empid,HSSFCell mailid,HSSFCell monthyear,String xmlStr )/**Set the path of the base directory to the current directoryDefine a file in which we save the xslt file that is used in intent the payslipAlso define a PDF file with parameters like where to save(current directory),with what name(employe e-id) and with what extension(.pdf)Create new instances for fop factory and fo user agentGet the random generated password which is of six characters lengthNow define two random numbers and retrieve th characters at that ndex in the employee idAppend these two characters to the random generated passwordEncrypt the pdf using method PDFEncryptionParams() and set the Boolean parameters like allow print, allowCopyContent, allowEditContent, allowEditAnnotations and also the keys to encryptconfigure foUserAgent as sought after.Setup output.Construct fop with desired output formatSetup XSLTSetup input for XSLT transformationResulting SAX events (the generated FO) must be piped through to FOPStart XSLT transformation and FOP bear upon**//**Call the sendmail method by creating its objectSave the returnvalue in a variableIf that is equal to one then save that email id as sentmailid and append all other of this kind in the Excel sheet to this**//**If thats is equal to zero save that email id as failedmailid and append all others of this kind in the Excel sheet to thisAfter mail is sent save that in the log using the user defined methodinsertIntoEmailLog (mailid, monthYear,status)**/ private void insertIntoEmailLog(HSSFCell mailid, String monthYear, int status)/**Get the data base connectionInsert into table the values of status,month nd the mailed**/public static String getPassword(int n)/**Generate n random characters may it be alphabets(upper and lower),numbers and symbolsReturn a string of length n characters**/MailService Modulepublic class MailServiceMailService ()/**Define the host, transport_protocol, authentication needed, debugging needed etc.**/public int sendMail(String empId,String monthYear,String emailid,byte pdfBytes,String randompwd,int randomposition1,int randomposition2)/**Set the parameters like frommail, tomail, subject, messagetext, content type etcDefine a new mail sessionDeclare a new MIMEmessage() for this mail sessionset the source to PDF bytes send that message as mail to the tomailid**/Failure.jspCTE Pay Slip Generation System Employee Loginresponse.setHeader(Cache-Control,no-cache) //HTTP 1.1response.setHeader(Pragma,no-cache) //HTTP 1.0response.setDateHeader (Expires, 0) //prevents caching at the proxy serverresponse.setHeader(Cache-Control,no-store) //HTTP 1.1%Invalid username or password Please Try Again Copyright 2009 Cambridge Technology Enterprises. All rights reserved.Uploadsuccess.jspCTE Pay Slip Generation System Employee Loginresponse.setHeader(Cache-Control,no-cache) //HTTP 1.1response.setHeader(Pragma,no-cache) //HTTP 1.0response.setDateHeader (Expires, 0) //prevents caching at the proxy serverresponse.setHeader(Cache-Control,no-store) //HTTP 1.1%File successfully UploadedEMail sent to String maildata = (String)request.getAttribute(emailEmpId)int splitCount= maildata.indexOf()String sentEmailIds=maildata.substring(0,splitCount)String failedEmailIds=maildata.substring(splitCount+1,maildata.length())%EMai l failed to
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.