Saturday, July 20, 2019

The Existing System For Payslip Generation

The Existing System For Payslip Generation The purpose of the proposed project is to automate the Payslip generation process which replaces the traditional system of Payslip generation that used to print the employee salary details onto a paper. This project includes a single user who is authorized to initiate the application. The privileges are given only to the individual in a department who is responsible for generating the PaySlips for the employees. The application takes in the Excel Spreadsheet as input and generates an encrypted PDF PaySlip for each employee. This PDF PaySlip is mailed to the respective employee by using their mail-id which is provided in the Excel sheet. 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 salary data of each employee. The salary data is converted into a password-protected PDF document as per a pre-defined template. These salary statements (in PDF) are emailed to respective users. The email process is logged. 1.2 Existing System: The 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 then 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 used in distributing the payslips 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 placed in the envelope.this has to be distributed to all the employees near the desk has to take an acknowledgement that the employee has received by signing on paper. If the employee is not at the desk or out of station 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 accessible is also another aspect of it. 1.3 Proposed System: The proposed System for generating the PaySlips is a Web based Automated System for generation and distribution of PaySlips. Proposed System is efficient enough as it includes Less 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 accessible 2.1 Functional Requirements Modules: Authentication/Authorization Upload File Excel Parser PDF Generation Email Module Description: Authentication/Authorization Module: This 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 password. This needs database connectivity that stores all the details of the users who can use the application with their password. This module is implemented using Struts. As this partitions the presentation and implementation the login UI is built using Java server 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 forwards to another UI. Upload File: This 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 file a servlet gets invoked handling the process that directs an action. Excel Parser: This 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 Office 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 Word and MS PowerPoint files using Java. POI is your Java Excel solution (for Excel 97-2007). However, we have a complete API for porting other 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 Generation: This module creates a PDF file per employee based on pre-defined template and a randomly generated Password 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 Stylesheet 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 Consortium (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 Module: This 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 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 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 Accessibility This application is easily accessible by the user who is authorized to use the system for generating PaySlips every month. Performance This system can generate PaySlips for any number of employees considering the same speed. Reliability This system is consistent and performs required functions under stated conditions. Security Unauthorized 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. Usability This system enhances usability by incorporating well structured user interfaces, end-user interactions, informative error messages etc. 2.3 System Requirement Specification: Software Requirements: Language: Java/J2EE Operating system: Win 2000/XP or higher Web Server: Apache Tomcat Server Excel Parsers: POI(Poor Obfuscation Implementation) PDF Generator Tools: XSL-FO(Extensible Style sheet Language-Formatting Object) Back End: MySQL Database Hardware Requirements: Processor: P4 or higher RAM: 1 GB or higher Hard disk: 10 GB 3.1 Technical Architecture A 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. Browser Web Container (Tomcat) MySQL PaySlip Generation System The web container in detail handles the following operations as depicted in the following diagram As 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 String. 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 public IP or giving some domain name to the application. 3.2 Software Architecture Software architecture alludes to the overall structure of the software and the ways in which the structure provides conceptual integrity for a system. In the simplest form software architecture is the hierarchical structure of program 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 Objectives: Design 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 will be easier to implement, distribute and maintain. 4.2 UML Diagrams 4.2.1 Usecase Diagram: 4.2.2 Class Diagram: 4.2.3 Sequence Diagram: 4.2.4 Collaboration Diagram: 4.2.5 Activity Diagram: 4.3 Data Flow Diagrams: Level 1 4.4 Database Design: 4.4.1 E-R Diagrams 4.4.2 Database Tables: Database Tables: 5.1 Pseudo Code Login Module Login form: public class LoginForm extends ActionForm { /**Declare two string variables that holds the username and password values entered in the form Define getter and setter methods **/ } Login Action: public class LoginAction extends Action { Public ActionForward execute(ActionMapping mapping, ActionForm actionForm, HttpServletRequest request, HttpServletResponse response) throws Exception { /**Create an object to the login form Retrieve the username and password entered in the form and save in some variables Create an object for the implementation and call the function validate() with the retrieved username and password as arguments Savetoken() Depending on its return value forward the action to success page or failure page**/ } Login Interface: public interface LoginDAO { /**Declare th method validate(string , string)**/ } Interface Implementation: public class LoginDAOimpl extends BaseDAO implements LoginDAO { Constructor() { } Validate () { /**Declare two string variables that holds the values of the username and password from he database Get the connection to the database using the predefined method in java Retrieve the username and password from the database using a SQL query(select) Compare both username, password from form and database Return a Boolean value according to the comparision**/ } } Login.jsp: CTE Pay Slip Generation System Employee Login function validateLogin(){ if(document.loginForm.username.value!=""&& document.loginForm.password.value!="") { return true; } else { alert("Please Enter UserName and Password."); return false;} } Login UserName : Password : Copyright  © 2009 Cambridge Technology Enterprises. All rights reserved. Upload File Module: Upload form: public class UploadForm extends ActionForm { /**Define a variable file of type file Also define the getter and setter methods **/ } Upload Action: public class StrutsUploadAction extends Action { public ActionForward execute ( ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response) throws Exception { /** If the token is valid then Create an object for upload form to retrieve parameters like contentType, fileName, fileSize. Create an object to interface to all the method parseExcel(file) Return success Else Return failure **/ Upload.jsp CTE Pay Slip Generation System Employee Login function isFileName() { var fileName = document.forms[0].theFile.value; // uploadform is the form name if (fileName =="") { alert("Please select a file"); return false; } Else { if(fileName.substr((fileName.length)-3,fileName.length) == "xls") { document.forms[0].action = "FileUpload.do"; document.forms[0].method = "post"; document.forms[0].submit(); return true;} Else { alert("Please Upload an Excel file"); return false; }}} File Upload value= > Select File Copyright  © 2009 Cambridge Technology Enterprises. All rights reserved. window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"de6e6cfad9","applicationID":"221047987","transactionName":"bl0HMhMFDEYCWhJeWlcXMBQISwdGEFgfRBpYShEPAggHGxNRFg==","queueTime":0,"applicationTime":1,"atts":"QhoERFsfH0g=","errorBeacon":"bam.nr-data.net","agent":""} Upload interface: public interface PaySlipDAO { declare a method parseExcel() } /**Upload interface implementation(Excel Working and PDF Generation Modules **/ ) public class PaySlipDAOImpl extends BaseDAO implements PaySlipDAO { Constructor() { } public String parseExcel(String fileName) throws Exception { Define a String array 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 HSSFworkbook get the sheet count get the sheet with count zero iterate the rows if the sheet has rows then iterate the cells from that retrieve the 4th,2nd and 21st cell values. 4-mployeeid 2-month 21-Email id For every cell value append the opening tag using the string array**/ /**According to the cell value get the value Like Numeric Formula String After adding the value append the closing tag Like wise iterate till all the cells are completed At the end append the closing root tag With this we are ready with our xml string. Using 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 Module: public int genPDF( HSSFCell empid, HSSFCell mailid, HSSFCell monthyear, String xmlStr ) /**Set the path of the base directory to the current directory Define a file in which we save the xslt file that is used in designing the payslip Also define a PDF file with parameters like where to save(current directory),with what name(employee-id) and with what extension(.pdf) Create new instances for fop factory and fo user agent Get the random generated password which is of six characters length Now define two random numbers and retrieve th characters at that ndex in the employee id Append these two characters to the random generated password Encrypt the pdf using method PDFEncryptionParams() and set the Boolean parameters like allow print, allowCopyContent, allowEditContent, allowEditAnnotations and also the keys to encrypt configure foUserAgent as desired. Setup output. Construct fop with desired output format Setup XSLT Setup input for XSLT transformation Resulting SAX events (the generated FO) must be piped through to FOP Start XSLT transformation and FOP processing**/ /**Call the sendmail method by creating its object Save the returnvalue in a variable If 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 this After mail is sent save that in the log using the user defined method insertIntoEmailLog (mailid, monthYear,status)**/ } private void insertIntoEmailLog(HSSFCell mailid, String monthYear, int status) { /**Get the data base connection Insert 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 symbols Return a string of length n characters**/ } MailService Module: public class MailService { MailService (); { } /**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 etc Define a new mail session Declare a new MIMEmessage() for this mail session set the source to PDF bytes send that message as mail to the tomailid**/ } } Failure.jsp CTE Pay Slip Generation System Employee Login response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server response.setHeader(Cache-Control,no-store); //HTTP 1.1 %> Invalid username or password Please Try Again Copyright  © 2009 Cambridge Technology Enterprises. All rights reserved. Uploadsuccess.jsp CTE Pay Slip Generation System Employee Login response.setHeader(Cache-Control,no-cache); //HTTP 1.1 response.setHeader(Pragma,no-cache); //HTTP 1.0 response.setDateHeader (Expires, 0); //prevents caching at the proxy server response.setHeader(Cache-Control,no-store); //HTTP 1.1 %> File Successfully Uploaded EMail 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()); %> EMail failed to:

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.