Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
International IT Institutes
PROJECT
REPORT
Project Title: Payroll System
May, 2008
Table of Contents
Payroll System
Batch Code:
Start date: May 1, 2008
End date: May 22, 2008
Name of the Coordinator: M.Sc Nguyen Truong Giang
Name of Developer: Pham Hong Ha
Date of Submission: May 23,2008
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
Acknowledgement
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.
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.
Architecture Diagram
MAINMENU.SH
file_manager.sh
file_search.sh
mainmenu.sh
print_pay-slips.sh
print_da.sh
Architecture Diagram
file_manager.sh
add_new_employee
file_manager.sh
update_information_employee
delete_an_employee
Architecture Diagram
file_search.sh
file_search.sh
search_join_current_year
search_retirement_current_year
search_same_department
Architecture Diagram
print_payslips.sh
employee_ID
print_payslips.sh
department
basic_salary
E_name
grade
gross_salary
Manager
Acounts Department
Architecture Diagram
print_da.sh
print_grade
print_da.sh
print_deduction
print_allowance
add_em()
{
# Kiem tra File Employee_Master ton tai chua
sort_id=`sort Employee_Master`
echo "$sort_id" > E_id.txt
set_id=`tail -1 E_id.txt`
echo "$set_id" > E_id.txt
firstline=`cut -d : -f1 E_id.txt`
if [ -z "$firstline" ]
then
e_id="E001"
else
numid=`expr substr $firstline 3 3`
numid=`expr $numid + 1`
if [ $numid -gt 1 -a $numid -le 9 ]
then
e_id="E00${numid}"
elif [ $numid -ge 10 -a $numid -le 99 ]
then
e_id="E0${numid}"
elif [ $numid -ge 100 -a $numid -le 999 ]
then
e_id="E${numid}"
else
echo "Data Invailid Input"
exit
fi
fi
find_em()
{
e_id=""
echo -e "Enter a ID of Employee to search for in the Employee
Informations"
read SearchStr
if [ "$SearchStr" = "" ]; then
return 0
fi
find_em n
fi
if [ -n "$E_id" ]; then
echo -e "You are about to delete $E_id"
get_confirm && {
grep -v "^$E_id" Employee_Master > temp_file.txt
mv temp_file.txt Employee_Master
echo -e "Employee Informations deleted"
E_id=""
}
fi
get_return
return
}
file_manager
file_search()
{
clear
OPT=0
while [ "$OPT" != "4" ]
do
clear
echo
echo
echo
echo -e "\033[30;1m Search Employee
Informations\033[0m"
echo
echo " 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 OPT
case $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;;
esac
done
echo "Option chosed: [$OPT]"
return $OPT
}
search_join()
{
clear
year_cur=$(date "+%Y")
grep "$year_cur" Employee_Master > temp_file.txt
read bien < temp_file.txt
if [ -z "$bien" ]; then
echo -e "Khong co nhan vien vao cong ty trong nam nay"
else
num_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.txt
fi
echo -e ""
get_return
}
department_em()
{
clear
echo
echo -e " Enter Department"
read depart
grep "$depart" Employee_Master > temp_file.txt
read bien1 < temp_file.txt
if [ -z "$bien1" ]; then
echo -e "Phong ban go khong co trong cong ty"
get_return
else
num_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.txt
bien1=""
get_return
fi
}
file_search
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/PS
Export $PATH
4. Save file, .bash_profile and logout
SYSTEM CONFIGURATION
Hardware: PC compatible with a Intel Pentium- III processor, 256-MB RAM, and
10GB of hard disk.
Operating System:
Server: Fedora Core 2 operating system
Client: Fedora Core 2 operating system
Software:
Server: Customize Personal Desktop type of installation of Fedora Core 2 operating
system with send mail server and print server configured
Client: Customize Personal Desktop type of installation of Fedora Core 2 operating
system with pine and compress utilities installed.