Payroll Management System Project
Payroll Management System Project
PROJECT TITLE:
“PAYROLL MANAGEMENT
SYSTEM’’
SUBMITTED BY :
DEEPANSHU DANGI (19661902),
KULDEEP PARMAR (19661910),
NEERAJ PARMAR (19661915),
DEVRAJ DANGI (19661903)
SUBMITTED TO:
Mr. ANIL KANT
(P.G.T. COMPUTER SCIENCE)
1|Page
CERTIFICATE
Anil Kant
PGT Comp Science
Examiner:
Name: _______________
Signature:
2|Page
Acknowledgement:
Apart from the efforts, the success of any project depends largely on the
encouragement and guidelines of many others. We take this opportunity to
express our gratitude to the people who have been instrumental in the successful
completion of this project.
Our sincere thanks to Mr. Anil Kant, PGT C.S. Master In-charge, A
guide, Mentor all the above a friend, who critically reviewed our project and
helped in solving each and every problem, occurred during implementation of the
project
The guidance and support received from all the members who contributed
and who are contributing to this project, was vital for the success of the project.
We are grateful for their constant support and help.
3|Page
INDEX
TABLE OF CONTENTS [ T O C ]
PAGE
SER DESCRIPTION
NO
01 ACKNOWLEDGEMENT 03
03 SOURCE CODE 06
05 ADVANTAGES 13
07 OUTPUT SCREEN 15
08 BIBLIOGRAPHY 16
4|Page
BRIEF OVERVIEW OF
PROJECT..
5|Page
SOURCE CODE:-
# Project for Payroll management system using Python
and MySQL Connectivity
import mysql.connector
import datetime
from tabulate import tabulate
mydb=mysql.connector.connect(host='localhost',
user='root',
passwd='jnvrajgarh@1988',
auth_plugin="mysql_native_password")
mycursor=mydb.cursor()
while True :
print('\n\n\n')
print("*"*95 )
6|Page
print('\t\t\t\t\tMain Menu ' )
print( "*"*95 )
print( '\t\t\t\t1. Adding Employee records')
print( '\t\t\t\t2. For Displaying Record of all the Employees ' )
print( '\t\t\t\t3. For Displaying Record of a particular Employee ' )
print( '\t\t\t\t4. For deleting Records of all the Employees ' )
print( '\t\t\t\t5. For Deleting a Record of a particular Employee' )
print( '\t\t\t\t6. For Modification in a record ' )
print( '\t\t\t\t7. For Displaying payroll' )
print( '\t\t\t\t8. For Displaying Salary Slip of all the Employees ' )
print( '\t\t\t\t9. For Displaying Salary Slip of a particular the Employee ' )
print( '\t\t\t\t10.For Exit ' )
print('enter choice...',end='')
choice=int(input())
if choice==1 :
try :
print("enter employee information......")
mempno=int(input("enter employee no : "))
mname=input("enter employee name : ")
mjob=input("enter employee job :")
mbasic=float(input("enter basic salary : "))
if mjob.upper()=='OFFICER':
mda=mbasic*0.5
mhra=mbasic*0.35
mtax=mbasic*0.2
elif mjob.upper()=='MANAGER':
mda=mbasic*0.45
mhra=mbasic*0.30
mtax=mbasic*0.15
else :
mda=mbasic*0.40
mhra=mbasic*0.25
mtax=mbasic*0.10
mgross=mbasic+mda+mhra
mnet=mgross-mtax
rec=(mempno,mname,mjob,mbasic,mda,mhra,mgross,mtax,mnet)
querry="insert into "+Tablename+" values
(%s,%s,%s,%s,%s,%s,%s,%s,%s)"
mycursor.execute(querry,rec)
7|Page
mydb.commit()
print("record added successfully..........")
except :
print("something went wrong ")
elif choice==2:
try :
querry="select*from "+Tablename
mycursor.execute(querry)
print(tabulate(mycursor,headers=["empno","name","jon","basic
salary","DA","HRA","Gross Salry","Tax","Net salary"],tablefmt='fancy_grid'))
'''myrecords=mycursor.fetchall()
for rec in myrecords :
print(rec)'''
except :
print("something went wrong ")
elif choice==3:
try:
en=input("enter employee no. of the record to be displayed ..: ")
querry="select * from "+Tablename+" where empno ="+ en
mycursor.execute(querry)
myrecord=mycursor.fetchone()
print("\n\nRecord of employee no. : "+en)
print(myrecord)
c=mycursor.rowcount
if ch==-1:
print("nothing to display ")
except :
print("something went wrong ")
elif choice==4:
try:
ch=input("do you want to delete all the records (y/n)")
if ch.upper()=="Y":
mycursor.execute("delete from "+ Tablename)
mydb.commit()
print("all the records are deleted .... ")
except:
print("something went wrong ")
8|Page
elif choice==5:
try :
en+input("enter employee no. of the record to br deleted ...")
querry="delete from "+Tablename+" where empno="+en
mycursor.execute(querry)
mydb.commit()
c=mycursor.rowcount
if c>0:
print("deletion done ")
else :
print("employee no ",en," not found ")
except :
print("something went wrong ")
elif choice==6:
try :
en=input("enter employee no. of the record to be modified ...")
querry="select * from "+Tablename+" where empno="+en
mycursor.execute(querry)
myrecord+mycursor.fetchone()
c=mycursor.rowcount
if c==-1 :
print("empno "+en+" does not exist ")
else :
mname+myrecord[1]
mjob=myrecord[2]
mbasic=myrecord[3]
print("empno :",myreord[0])
print("name :",myreord[1])
print("job :",myreord[2])
print("basic :",myreord[3])
print("DA :",myreord[4])
print("HRA :",myreord[5])
print("gross :",myreord[7])
print("net :",myreord[8])
print("-------------------------")
print("type value to modify below or just press enter for no change ")
x=input("enter name ")
if len(x)>0:
9|Page
mname=x
x=input("enter job ")
if len(x)>0:
mjob=x
x=input('enter Basic Salary ')
if len(x)>0:
mbasic=float(x)
querry+"update "+Tablename+" set name
="+"'"+mname+"'"+','+"job="+"'"+','+"basicsalary="+str(mbasic)+' where
empno='+en
print(querry)
mycursor.execute(querry)
mycursor.commit()
print("record modified ")
except:
print("something went wrong ")
elif choice==7:
try :
querry+"select * from "+Tablename
mycursor.execute(querry)
myrecords=mycursor.fetchall()
print("\n\n\n")
print(95*'-')
print("employee payroll ".centre(90))
print(95*'-')
now=datetime.datetime.now()
print("current Date and Time :",end=" ")
print(now.strftime("%y-%m-%d %H:%M:%S"))
print()
print(95*'-')
print("%-5s %-15s %-10s %-8s %-8s %-8s %-9s %-8s %-9s"\
%("empno","name","job","Basic","DA","HRA","Gross","Tax","Net"))
print(95*'-')
for rec in myrecords :
print('%4d %-15s &-10s %8.2f %8.2f %8.2f %9.2f %8.2f
%9.2f'%rec)#see from yyt
print(95*'-')
except :
print("something went wrong ")
10 | P a g e
elif choice==8:
try :
querry+"select * from "+Tablename
mycursor.execute(querry)
now=datetime.datetime.now()
print("\n\n\n")
print("-"*95)
print("\t\t\t\tSalary Slip ")
print(95*'-')
print("current Date and Time :",end=" " )
print(now.strftime("%Y=%m-%d %H:%M:%S"))
myrecords+mycursor.fetchall()
for rec in myrecords :
print('%4d %-15s &-10s %8.2f %8.2f %8.2f %9.2f %8.2f %9.2f'%rec)
except :
print("something went wrong ")
elif choice==9:
try :
en=input("enter employee number whose pay slip you want retrieve : ")
querry="select * from "+Tablename +" where empno="+en
mycursor.execute(querry )
now=datetime.datetime.now()
print("\n\n\n\t\t\t\tSalary Slip ")
print("current Date and Time :",end=" " )
print(now.strftime("%Y=%m-%d %H:%M:%S"))
print(tabulate(mycursor,headers=["empno","name","jon","basic
salary","DA","HRA","Gross Salry","Tax","Net salary"],tablefmt="fancy_grid"))
except exceptions as e :
print("something went wrong ",e)
elif choice==10 :
break
else :
print("wrong choice ....")
11 | P a g e
REQUIREMENTS
HARDWARE RQUIREMENTS
Computer for coding and typing the required documents of the
project.
Printer, to print the required documents of the project.
Compact drive.
Processor: Pentium quad core
Ram: 64 mb
Hard disk: 20 gb
SOFTWARE REQUIREMENTS
Operating system: windows 10
Python 3: for execution of program
Mysql: for storing data in the database
Python–mysql connector : for database connectivity and Microsoft
word, for presentation of output
12 | P a g e
It is cost effective as the user control the web application
himself and does not go for professional service.
It saves time as it speeds up every aspect of the employee
database management and payroll process with a range of
automated features.
It is secure as the employee database and the payroll
process is managed by the admin in house rather than
sending private information to a third party.
Validating procedures and checks restrict user from
making mistakes.
The software is easy to use and is user friendly so no
expertise is required.
The calculations are automated so no chance of error.
13 | P a g e
Diagrams of Payroll Management System
Project Documentation
14 | P a g e
OUTPUT SCREEN
15 | P a g e
BIBLIOGRAPHY:-
Computer science in python by-
SUMITA ARORA
16 | P a g e