Project Report NIIT Hanoi CTT Page 1 International IT Institutes PROJECT REPORT Project Title: Payroll System Student Name: Pham Hong Ha Group 3: Pham Hong Ha Tran Thanh Tung Nguyen Van Vinh Group Project Number: 3 Project Number: Case Study 3 Quarter: 5 Coordinator: M.Sc Nguyen Truong Giang May, 2008
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Project Report
NIIT Hanoi CTT Page 1
International IT Institutes
PROJECTREPORT
Project Title: Payroll System
Student Name: Pham Hong HaGroup 3: Pham Hong Ha
Tran Thanh Tung Nguyen Van Vinh
Group Project Number: 3Project Number: Case Study 3Quarter: 5Coordinator: M.Sc Nguyen Truong Giang
May, 2008
Project Report
Table of Contents
Part 1 – Introduction Payroll System
I – What is a Deezy Corp.?
II – What is activities list for Payroll System ?
III – Architecture Diagram for Shell Script
Part 2 – Code for the Shell Script in the Payroll System
Part 3 – Project File Details
NIIT Hanoi CTT Page 2
Project Report
Payroll System
Batch Code: Start date: May 1, 2008End date: May 22, 2008Name of the Coordinator: M.Sc Nguyen Truong GiangName of Developer: Pham Hong HaDate of Submission: May 23,2008
NIIT Hanoi CTT Page 3
Project Report
NIIT
Certificate
This is to certify that this report titled Payroll System embodies the original work done by Pham Hong Ha in partial fulfillment of their course requirement at NIIT.
Coordinator:M.Sc Nguyen Truong Giang
NIIT Hanoi CTT Page 4
Project Report
Acknowledgement
NIIT Hanoi CTT Page 5
Project Report
Introduction
Deezy Corp. is a company associated with auction business for the last ten years. The company is known for providing transparent and secure auctions. Deezy Corp. has its offices in different cities of the US of America. The number of branch offices and employees is constantly increasing with the growing volume of its customer base. In the existing system, Deezy Corp. has different departments, Stores, Accounts, and Maintenance.
NIIT Hanoi CTT Page 6
Project Report
Activities List
The following tasks have been performed to meet the specifications of the project scenario:
1) Create a script file as mainmenu.sh. This file contains the code to display the main menu
2) Create a script file as file_manager.sh. This file contains the code to change information and delete an employee from employee_master file.
3) Create a script file as file_search.sh. This file contains the code to search employees have joined the company in the current year, their date of retirement in the current year and department-wise total number of employees needs to be identified.
4) Create a script file as print_payslips.sh. This file contains the code to generate pay-slips for each employee in the format.
5) Create a script file as print_da.sh. This file contains the code to generate deduction and allowance details report for all grades.
NIIT Hanoi CTT Page 7
Project Report
Architecture DiagramMAINMENU.SH
file_search.sh
mainmenu.sh
print_pay-slips.sh
NIIT Hanoi CTT Page 8
file_manager.sh
print_da.sh
Project Report
Architecture Diagramfile_manager.sh
add_new_employee
file_manager.sh
update_information_employee
delete_an_employee
NIIT Hanoi CTT Page 9
Project Report
Architecture Diagramfile_search.sh
NIIT Hanoi CTT Page 10
file_search.sh
search_join_current_year
search_retirement_current_year
search_same_department
Project Report
Architecture Diagramprint_payslips.sh
employee_ID
print_payslips.sh
department
basic_salary
E_name
grade
gross_salary
ManagerAcounts Department
NIIT Hanoi CTT Page 11
Project Report
Architecture Diagramprint_da.sh
NIIT Hanoi CTT Page 12
print_da.sh
print_deduction
print_allowance
print_grade
Project Report
Code for the mainmenu.sh file
#!/bin/bashget_return(){echo -e "Press return \c"read xreturn 0}get_confirm(){echo -e "Are you sure? \c"while truedoread xcase "$x" iny | yes | Y | Yes | YES )return 0;;n | no | N | No | NO )echoecho "Cancelled"return 1;;*) echo "Please enter yes or no" ;;esacdone}mainmenu(){OPT=0while [ "$OPT" != "5" ]doclearechoechoechoecho -e "\033[30;1m MAIN MENU \033[0m"echoecho " 1. Manager Employee Informations"echo " 2. Search Employee Informations"echo " 3. Generate pay-slips for Employees"echo " 4. Generate Deduction and Allowance Informations"echo " 5. Quit"echo echo -n " Please enter choice then press return: "read OPTcase $OPT in"1") . file_manager.sh ;;"2") . file_search.sh ;;"3") . Print_payslip.sh ;;"4") . print_da.sh ;;
file_search(){clearOPT=0while [ "$OPT" != "4" ]doclearechoechoechoecho -e "\033[30;1m Search Employee Informations\033[0m"echoecho " 1. Search Employees joined the company in the current year "echo " 2. Search Employees have their date of retirement in the current year"echo " 3. Search Employees in same Depatment"echo " 4. Back"echo echo -n " Please enter choice then you need search: "read OPTcase $OPT in"1") search_join;;"2") retirement_em;;"3") department_em;;"4") return;;*) echo -e "\n\t\t\t\tInvailid Input" echo -e "\n\t\t\t\tPress <Enter> key to continue...\c" read;; esacdoneecho "Option chosed: [$OPT]"return $OPT}search_join(){clearyear_cur=$(date "+%Y")grep "$year_cur" Employee_Master > temp_file.txtread bien < temp_file.txtif [ -z "$bien" ]; thenecho -e "Khong co nhan vien vao cong ty trong nam nay"elsenum_join=$(wc -l temp_file.txt)echo -e "So nhan vien gia nhap cong ty trong nam nay: $num_join"echo -e ""echo -e "Danh sach nhan vien:"cat temp_file.txtfiecho -e ""
NIIT Hanoi CTT Page 19
Project Report
get_return}department_em(){clearechoecho -e " Enter Department"read departgrep "$depart" Employee_Master > temp_file.txtread bien1 < temp_file.txtif [ -z "$bien1" ]; thenecho -e "Phong ban go khong co trong cong ty"get_returnelsenum_join=$(wc -l temp_file.txt)echo -e "Tong so nhan vien trong phong $depart la: $num_join"echo ""echo -e " Danh sach nhan vien trong phong $depart gom:"cat temp_file.txtbien1=""get_returnfi}
file_search
NIIT Hanoi CTT Page 20
Project Report
Code for the print_paysips.sh file
Print_payslip(){echo -e "Enter a ID of Employee to generate Pay-slip"read Strif [ "$Str" = "" ]; thenreturn 0figrep "^$Str" Employee_Master > temp_file.txtIFS=":"read E_id F_Name L_Name depart DoB DoJ grade Ba_Sa Gr_Sa < temp_file.txtIFS=":"if [ -z "$E_id" ]; thenecho -e "Sorry! Employee has ID is $Str nothing found"return 0fiecho ""echo " Deezy Corp, Pay-Slip"echo ""echo "Employee ID: $E_id F_Name: $F_Name L_Name: $L_Name"echo "Department: $depart Grade: $grade"echo "Basic Salary: $Ba_Sa Gross Salary: $Gr_Sa"echo ""echo " Manager"echo " Accounts Department"echo""get_return}Print_payslip
NIIT Hanoi CTT Page 21
Project Report
Code for the print_da.sh file
print_da(){echo -e "Enter a Grade to Generate details report for Dedution and Allowance"read Strif [ "$Str" = "" ]; thenreturn 0figrep "^$Str" Grade.txt > temp_file.txtIFS=":"read grade deduc allow < temp_file.txtIFS=":"if [ -z "$grade" ]; thenecho -e "Sorry! Grade is $Str nothing found"return 0fiecho ""echo " Deduction and Allowance of $grade"echo ""echo " Grade Deduction Allowance"echo " $grade $deduc $allow"echo ""get_return}print_da
NIIT Hanoi CTT Page 22
Project Report
Execute the Application
To execute the Payroll System shell script application:
1. Create a directory, ps, under your home directory and copy all the Payroll System realated shell script to the ps directory.
2. Issue the following command to change the permission of the shell script such that the current user has execute permission on them:$ chmod 744 ~/ps/*.sh
3. Add the PATH, $HOME/PS to the environment variable, PATH, of the current user in the file, .bash_profile, as shown in the flowing code: PATH=$PATH:$HOME/bin:$HOME/PSExport $PATH
4. Save file, .bash_profile and logout
NIIT Hanoi CTT Page 23
Project Report
SYSTEM CONFIGURATION
Hardware: PC compatible with a Intel Pentium- III processor, 256-MB RAM, and 10GB of hard disk.
Software:Server: Customize Personal Desktop type of installation of Fedora Core 2 operating system with send mail server and print server configuredClient: Customize Personal Desktop type of installation of Fedora Core 2 operating system with pine and compress utilities installed.
NIIT Hanoi CTT Page 24
Project Report
PROJECT FILE DETAILS
S.NO File Name Description1 mainmenu.sh Contains the code to
display the main menu.2 file_manager.sh Contains the code to
change information and delete an employee from employee_master file.
3 file_search.sh Contains the code to search employees have joined the company in the current year, their date of retirement in the current year and department-wise total number of employees needs to be identified.
4 print_payslips.sh Contains the code to generate pay-slips for each employee in the format.
5 print_da.sh Contains the code to generate deduction and allowance details report for all grades.