PAYROLL MANAGEMENT SYSTEM Corrected
PAYROLL MANAGEMENT SYSTEM Corrected
Class : XII A
Roll no :
Sub : Computer Science
Topic : PYROLL
MANAGEMENT SYSTEM
DESCRIPTION:
A payroll is the list of employees of that company that are entitled to receive pay
and the amounts that each should receive. Along with the amounts that each
employee should receive for time worked or tasks performed, payroll can also
refer to a company's records of payments that were previously made to employees,
including salaries and wages, bonuses, and withheld taxes, or the company's
department that calculates and pays out these amounts.
MODULE:
This program is made using the concept of PYTHON and MySQL
Connectivity and by using mysql.connector module
LANGUAGE USED:
Python and mysql
MENU IS DISPALYED
1. Adding employee records
2. For Displaying record of all the Employees
3. . For Displaying record of a particular Employee
4. For Deleting record of all employees
5. For Deleting record of a particular Employee
6. For Modification in a record
7. For displaying payroll
8. For displaying salary slip of all the Employees
9. For displaying salary slip of a particular Employee
10. For Exit
import mysql.connecter
import datetime
mybd=mysql.connecter.connect(host=’lo0calhost’,user=’root’,passwd=’1234 56’)
mycursor = mybd.cursor()
mycursor.execute(sql)
mycursor=mybd.cursor() mycursor.execute("use
"vdb)
varchar(15),\
DA float,\ GRA
GrossSalary float,\
mycursor.execute(query)
While True:
print(’\n\n\n’)
print("*"*95)
print(’\t\t\t\t\tMAINMENU’)
print("*"*95)
Modification in a record’)
choice=int(input()) if
choice==1:
try:
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.1
mgross=mbasicvmdavmhra
mnet=mgross-mtax
rec=(mempno,mname,mjob,mbasic,mda,mhra,mgross,mtax,mnet) query="insert
mycursor.execute(query,rec)
mybd.commit()
except Exception as e:
Downloaded by Kumkum Rajpoot ([email protected])
print(’Something went wrong’,e)
mycursor.execute(query)
’’’myrecords=mycursor.fetchall() for
rec in myrecords:
print(rec)’’’
except:
myrecord=mycursor.fetchone()
print(myrecord)
c=mycursor.rowcount
ch.upper()==’Y’:
mybd.commit()
mybd.commit()
c=mycursor.rowcount if
c›0:
else:
mycursor.execute(query)
myrecord=mycursor.fetchone()
c=mycursor.rowcount
if c==-1:
mname=myrecord[1]
mjob=myrecord[2]
mbasic=[3]
print(’EmpNo :’,myrecord[0])
print(’Job :’,myrecord[1])
print(’Basic :’,myrecord[3])
print(’DA :’,myrecord[4])
print(’Gross :’,myrecord[6])
print(’Tax :’,myrecord[7])
print(’Net :’,myrecord[8])
print(’ ’)
x=input(’Enter name’)
if len(x)›0:
mname=x
x=input(’Enter job’) if
len(x)›0:
mjob = x
len(x)›0:
mbasic=float(x)
salary’\
vstr(mbasic)v’ where empno=’ven
print(query) mycursor.execute(query)
mybd.commit()
print(’Record modified’)
except:
choice==7:
try:
mycursor.execute(query)
myrecord=mycursor.fetchall()
print("\n\n\n")
print(95*’*’)
print(’Employee Payroll’.center(90))
print(95*’*’) now=datetime.datetime.now()
print(now.strftime("%Y-%m-%d %G:%M:%S"))
print()
print(’95’*’-’)
%(’Empno’,’Job’,’Basic’,’DA’,’GRA’,’Gross’,’Tax’,’Net’))
print(’95’*’-’)
for r in my records:
print(’95’*’-’)
except:
mycursor.execute(query)
myrecord=datetime.datetime.now()
print("\n\n\n")
print("-"*95)
print("\t\t\t\tSalary Slip")
print("-"*95)
print(now.strftime("%Y-%m-%d %G:%M:%S"))
myrecord=mycursor.fetchall()
for r in my records:
except:
mycursor.execute(query) now=datetime.datetime.now()
print(now.strftime("%Y-%m-%d %G:%M:%S"))
except Exception as e:
elif choice==10:
break
else:
print(’Wrong Choice...’)