[go: up one dir, main page]

0% found this document useful (0 votes)
22 views38 pages

Payroll Management System - Final

Uploaded by

phoon.csgo17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views38 pages

Payroll Management System - Final

Uploaded by

phoon.csgo17
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 38

Narayana School - Newtown

COMPUTER SCIENCE (083)


PROJECT
2024-2025
TOPIC:

PAYROLL MANAGEMENT SYSTEM


GUIDED BY:- MRS. ROSHNI
CHAKRABORTY

SUBMITTED BY :
CLASS AND SECTION :
ROLL NUMBER :
REGISTRATION NUMBER :

1 |Computer Science Narayana School


CERTIFICATE

This is to certify that of class XII, Narayana School, New


Town has successfully completed his/her project in
Computer Science Practical for the AISSCE as prescribed
by CBSE in the year 2024-2025.

Roll No :

Sign. of Internal Sign. of


External

____________ _____________

2 |Computer Science Narayana School


TABLE OF CONTENTS
S NO CONTENTS PAGE NO
1 ACKNOWLEDGEMENT
2 INTRODUCTION TO PYTHON
3 INTRODUCTION TO THE PROJECT
4 LIFE CYCLE OF A PROJECT
5 SYSTEM REQUIREMENTS
6 MOTIVE

PROGRAM CODE DETAILS


7

BACKEND DETAILS
8

FRONTEND DETAILS
9

SCREEN SHOTS OF EXECUTION


10

LIMITATIONS
11

BIBLIOGRAPHY
12

3 |Computer Science Narayana School


ACKNOWLEDGEMENT

I thank my Computer Science teacher Mrs.

Roshni Chakraborty for guidance and support. I

am also thankful to our principal Mrs. Jyotica

Shafaat. I would also thank to my parents for

encouraging during the course of this project.

Finally, I would like to thank CBSE for giving me

this opportunity to undertake this project.

4 |Computer Science Narayana School


INTRODUCTION TO PYTHON

Python is an interpreted, object-oriented, high-level programming


language with dynamic semantics. Its high-level built in data structures,
combined with dynamic typing and dynamic binding, make it very
attractive for Rapid Application Development, as well as for use as a
scripting or glue language to connect existing components together.
Python's simple, easy to learn syntax emphasizes readability and therefore
reduces the cost of program maintenance. Python supports modules and
packages, which encourages program modularity and code reuse. The
Python interpreter and the extensive standard library are available in
source or binary form without charge for all major platforms, and can be
freely distributed.

5 |Computer Science Narayana School


History of Python:

Python is a widely used general-purpose, high-level programming


language. It was initially designed by Guido van Rossum in 1991 and
developed by Python Software Foundation. It was mainly developed for
emphasis on code readability, and its syntax allows programmers to
express concepts in fewer lines of code.

6 |Computer Science Narayana School


INTRODUCTION TO THE PROJECT

The Payroll Management System software


is an ERP software used by the HR
Department of any organisation. This
software stores details of the employees
and helps us to generate pay slip of an
employee in a particular month. It is
possible to edit employee’s address and
contact number. The Basic Salary, DA,
HRA and other allowances can be
graphically analysed for a particular
employee. The system has the facility to
credit salary of an employee in a
particular month and deduct salary in
case the number of leaves taken is more
than the prescribed leaves.

7 |Computer Science Narayana School


LIFE CYCLE OF PROJECT

The System Development Life Cycle (SDLC) is a set of activities


that analysts, designers and users carry out to develop and
implement an information system .The SDLC consists of the
following:

Feasibility Study

Requirement Definition

Design (Database and program)

Development of Software

Unit Testing

System Testing

Implementation

Evaluation

Maintenance

8 |Computer Science Narayana School


SYSTEM REQUIREMENTS

HARDWARE REQUIREMENT:

Printer- to print the required documents


of the project.
Compact Drive
Processor: Pentium III and above
RAM: 256 MB(minimum)
Hard-Disk : 20 GB(minimum)

SOFTWARE REQUIREMENT:

 Windows 7 or higher
 My-SQL server 5.5 or higher (as
backend)
 Python idle 3.6 or higher or spyder (as
frontend).
 Microsoft Word 2010 or higher for
documentation.

9 |Computer Science Narayana School


MOTIVE

 To maintain the employee details, their


basic salary, DA, HRA, allowances and
keep an account of the leaves taken by
the employees.

 To credit salary for a particular employee


in a particular month and to generate
pay-slip for a particular employee.

 To generate a graphical analysis by


comparing different categories of salary
along with the figures.

 Globalized usage.

10 |Computer Science Narayana School


PROGRAM CODE
DETAILS

BACKEND DETAILS

11 |Computer Science Narayana School


Database Name: PAYROLL
Code:
Create Database Payroll;
Use Payroll;
Table Name: EMPLOYEE
Attributes:
emp_no int(11) Primary Key
name varchar(50)
dob date
doj date
dept varchar(40)
desig varchar(40)
emp_type varchar(40)
address varchar(70)
contact varchar(20)

Code:

12 |Computer Science Narayana School


CREATE TABLE EMPLOYEE (
emp_no int(11) Primary Key,
name varchar(50),
dob date,
doj date ,
dept varchar(40),
desig varchar(40),
emp_type varchar(40),
address varchar(70),
contact varchar(20));

Table Name: PAY


Attributes:
Pay_id int(11)
emp_no int(11)
month varchar(50)
basic int(11)
da int(11)
hra int(11)
13 |Computer Science Narayana School
allowances int(11)
pf int(11)
cur_leave int(3)
deduction int(3)
overtime int(11)
total int(11)
Code:

CREATE TABLE PAY (


Pay_id int(11),
emp_no int(11),
month varchar(50),
basic int(11),
da int(11),
hra int(11),
allowances int(11),
pf int(11),
cur_leave int(3),

14 |Computer Science Narayana School


deduction int(3),
overtime int(11),
total int(11) );

FRONT-END DETAILS

import sys

15 |Computer Science Narayana School


import random
import mysql.connector
mycon=mysql.connector.connect(host='localhost',
user='root',password='1234',database='payroll')
mycur=mycon.cursor()

def Store():
sql="Insert into
employee(emp_no,name,dob,doj,dept,desig,emp_t
ype,address,contact)values(%s,%s,%s,%s,%s,%s,
%s,%s,%s)"
print('\nPLEASE PROVIDE THE REQUIRED
INFORMATION\n')
acc=int(input('\nENTER THE NEW EMPLOYEE
NUMBER:'))
nm=input('\nENTER THE NAME OF THE
EMPLOYEE:')
dbs=input('\nENTER DATE OF BIRTH(YYYY-MM-
DD):')
dbj=input('\nENTER DATE OF JOINING(YYYY-MM-
DD):')
dep=input('\nENTER THE DEPARTMENT OF
JOINING:')

16 |Computer Science Narayana School


deg=input('\nENTER THE DESIGNATION/POST OF
THE EMPLOYEE:')
emptype=input('\nENTER THE EMPLOYEE TYPE(R
FOR REGULAR/C FOR CONTRACTUAL):')
addr=input('\nENTER THE ADDRESS AND
PINCODE:')
phn=input('\nENTER THE 10 DIGIT MOBILE
NUMBER:')

value=(acc,nm,dbs,dbj,dep,deg,emptype,addr,phn)
try:
mycur.execute(sql,value)
print('PAYROLL FOR',nm,'CREATED
SUCCESSFULLY')
mycon.commit()
except:
print('UNABLE TO CREATE EMPLOYEE
ACCOUNT!!!!!')

def Search_Employee():
ph=int(input('\nENTER THE EMPLOYEE NUMBER
TO SEARCH:'))

17 |Computer Science Narayana School


sql="Select * from employee where emp_no=
%s"
value=(ph,)
mycur.execute(sql,value)
rec=mycur.fetchone()
if(rec==None):
print('INVALID EMPLOYEE NUMBER ENTERED')
else:
print('EMPLOYEE NUMBER:\t\t',rec[0])
print('EMPLOYEE NAME:\t\t',rec[1])
print('DATE OF BIRTH:\t\t',rec[2])
print('DATE OF JOIN:\t\t',rec[3])
print('DEPARTMENT:\t\t',rec[4])
print('DESIGNATION:\t\t',rec[5])
if(rec[6]=='R'):
print('EMPLOYEE TYPE:\t\t','REGULAR')
else:
print('EMPLOYEE TYPE:\t\t','CONTRACTUAL')
print('ADRRESS:\t\t',rec[7])
print('MOBILE NUMBER:\t\t',rec[8])

18 |Computer Science Narayana School


def Change_Address():
sql="Update employee set address=%s where
emp_no=%s";
ph=int(input('\nENTER THE EMPLOYEE NUMBER
WHOSE ADDRESS TO MODIFY:'))
addr=input('\nENTER THE NEW ADDRESS:')
value=(addr,ph)
try:
mycur.execute(sql,value)
mycon.commit()
print('ADDRESS CHANGED SUCCESSFULLY')
except:
print('UNABLE TO CHANGE ADDRESS!!!!')

def Change_Contact():
sql="Update employee set contact=%s where
emp_no=%s";
ph=int(input('\nENTER THE EMPLOYEE NUMBER
WHOSE MOBILE NUMBER TO MODIFY:'))
addr=input('\nENTER THE NEW MOBILE
NUMBER:')
19 |Computer Science Narayana School
value=(addr,ph)
try:
mycur.execute(sql,value)
mycon.commit()
print('MOBILE NUMBER CHANGED
SUCCESSFULLY')
except:
print('UNABLE TO CHANGE MOBILE
NUMBER!!!!')

def Change_Des():
sql="Update employee set desig=%s where
emp_no=%s";
ph=int(input('\nENTER THE EMPLOYEE NUMBER
WHOSE DESIGNATION TO MODIFY:'))
addr=input('\nENTER THE NEW DESIGNATION:')
value=(addr,ph)
try:
mycur.execute(sql,value)
mycon.commit()

20 |Computer Science Narayana School


print('UPDATED TO THE POST OF',addr)
except:
print('UNABLE TO CHANGE DESIGNATION!!!!')

def Promote():
sql2='select emp_type from employee where
emp_no=%s';
sql="Update employee set emp_type='R' where
emp_no=%s";
ph=int(input('\nENTER THE EMPLOYEE NUMBER
WHOSE PROMOTION TO BE DONE:'))
value2=(ph,)
mycur.execute(sql2,value2)
rec=mycur.fetchone()
if(rec[0]=='R'):
print('REGUALAR EMPLOYEE CANNOT BE
PROMOTED')
else:
value=(ph,)
try:
mycur.execute(sql,value)

21 |Computer Science Narayana School


mycon.commit()
print('PROMOTED TO REGUALAR
EMPLOYEE')
except:
print('UNABLE TO CHANGE
DESIGNATION!!!!')

def Credit():
sql="Insert into
pay(pay_id,emp_no,month,basic,da,hra,allowances,
pf,cur_leave,deduction,overtime,total)values(%s,
%s,%s,%s,%s,%s,%s,%s,%s,%s,%s,%s)"
print('\nPLEASE PROVIDE THE REQUIRED
INFORMATION\n')
payid=random.randint(1000,100000)
acc=int(input('\nENTER THE EMPLOYEE
NUMBER:'))
nm=input('\nENTER THE MONTH IN WHICH
SALARY TO BE CREDITED:')
basic=int(input('\nENTER THE BASIC SALARY:'))
da=basic*125/100
hra=basic*32/100

22 |Computer Science Narayana School


allowance=(basic+da)*10/100
pf=5000
cur_leave=int(input('\nENTER THE NUMBER OF
LEAVES TAKEN:'))
if(cur_leave<=2):
deduction=0
else:
deduction=cur_leave*(basic/30)
over=int(input('\nENTER THE OVERTIME
AMOUNT WORKED:'))
total=basic+da+hra+allowance+over-pf-
deduction

value=(payid,acc,nm,basic,da,hra,allowance,pf,cur
_leave,deduction,over,total)
try:
mycur.execute(sql,value)
print('\nRS.',total,'CREDITED TO THE
ACCOUNT FOR',nm)
mycon.commit()
except:
print('UNABLE TO CREDIT SALARY.CONTACT
HR DEPARTMENT!!!!!')

23 |Computer Science Narayana School


def Payslip():
ph=int(input('\nENTER THE EMPLOYEE NUMBER
TO SEARCH:'))
nm=input('\nENTER THE MONTH FOR WHICH PAY
SLIP TO GENERATE:')
sql="Select * from pay where emp_no=%s and
month=%s"
value=(ph,nm)
mycur.execute(sql,value)
rec=mycur.fetchone()
if(rec==None):
print('INVALID EMPLOYEE NUMBER ENTERED')
else:
print('-----------------PAYSLIP
FOR',nm,'-----------------------')
print('PAYSLIP ID:\t\t',rec[0])
print('BASIC:\t\t\t',rec[3])
print('DEARNESS ALLOWANCE:\t\t',rec[4])
print('HOUSE-RENT ALLOWANCE:\t\t',rec[5])
print('OTHER ALLOWANCES:\t\t',rec[6])

24 |Computer Science Narayana School


print('PROVIDEND FUND DEDUCTION:\
t',rec[7])
print('LEAVE DEDUCTION:\t\t',rec[9])
print('OVERTIME:\t\t\t',rec[10])
print('GROSS SALARY:\t\t\t',
(rec[3]+rec[4]+rec[5]+rec[6]+rec[10]))

print('--------------------------------------------------------------'
)
print('NET SALARY:\t\t\t',rec[11])

'''def Graph():
ad=int(input('ENTER THE PAYMENT-ID:'))
sql='Select * from pay where pay_id=%s'
value=(ad,)
mycur.execute(sql,value)
T=mycur.fetchone()
N=[T[3],T[4],T[5],T[6],T[7],T[9],T[10],T[11]]

L=['BASIC','DA','HRA','ALLOWANCE','PF','DEDUCTIO
N','OVERTIME','TOTAL']

25 |Computer Science Narayana School


clr=('red','blue','green','magenta','cyan','purple','br
own','orange')
plt.bar(L,N,color=clr)
plt.xlabel('SALARY CATEGORY')
plt.ylabel('FIGURE')
plt.title('SALARY FIGURE ANALYSIS')
plt.show()'''

def Remove():
ph=int(input('\nENTER THE EMPLOYEE NUMBER
TO DELETE:'))
sql='Delete from employee where emp_no=%s'
value=(ph,)
try:
mycur.execute(sql,value)
mycon.commit()
print('EMPLOYEE REMOVED')
except:
mycon.rollback()
print('UNABLE TO REMOVE ACCOUNT!!!')

26 |Computer Science Narayana School


print('------------WELCOME TO PAYROLL
MANAGEMENT SYSTEM-------------\n\n')
while(True):
print('\n\nPRESS 1 TO CREATE A NEW
EMPLOYEE')
print('PRESS 2 TO SEARCH THE STATUS OF AN
EMPLOYEE')
print('PRESS 3 TO CHANGE ADDRESS')
print('PRESS 4 TO CHANGE CONTACT NUMBER')
print('PRESS 5 TO CHANGE DESIGNATION')
print('PRESS 6 TO PROMOTE THE EMPLOYEE')
print('PRESS 7 TO CREDIT SALARY')
print('PRESS 8 TO GENERATE AND VIEW
PAYSLIP')
print('PRESS 9 TO REMOVE AN EMPLOYEE')
print('PRESS 10 TO CLOSE THE APPLICATION')
choice=int(input('ENTER YOUR CHOICE : '))
if(choice==1):
Store()
elif(choice==2):

27 |Computer Science Narayana School


Search_Employee()
elif(choice==3):
Change_Address()
elif(choice==4):
Change_Contact()
elif(choice==5):
Change_Des()
elif(choice==6):
Promote()
elif(choice==7):
Credit()
elif(choice==8):
Payslip()
elif(choice==9):
Remove()
else:
print('\nTHANK YOU FOR USING THE
APPLICATION')
break

28 |Computer Science Narayana School


SCREEN SHOTS
OF EXECUTION

29 |Computer Science Narayana School


MAIN MENU

ADDING A NEW EMPLOYEE

30 |Computer Science Narayana School


SEARCHING EMPLOYEE BY NAME

CHANGING ADDRESS OF AN
EMPLOYEE

31 |Computer Science Narayana School


CHANGING CONTACT NUMBER
OF AN EMPLOYEE

CHANGING DESIGNATION OF AN
EMPLOYEE

UPGRADING AN EMPLOYEE

CREDITING SALARY

32 |Computer Science Narayana School


GENERATING PAY-SLIPS

REMOVING AN EMPLOYEE

33 |Computer Science Narayana School


CLOSING THE APPLICATION

LIMITATIONS

34 |Computer Science Narayana School


 Earn Leave Calculation, leave under
special circumstances is not included in
the project.

 Income Tax Calculation is not included


in the project.

 The project does not have the


facility to calculate the total income
and expenditure done by the
employees of the organisation.

35 |Computer Science Narayana School


 The project does not calculate the
total amount credited for salary
purpose in a particular month.

BIBLIOGRAPHY

36 |Computer Science Narayana School


BOOKS:

COMPUTER SCIENCE WITH PYTHON- BY


SUMITA ARORA
 COMPUTER SCIENCE WITH PYTHON- BY
PREETI ARORA
 PYTHON COOKBOOK

WEBSITES:
www.geeksforgeeks.org

https://docs.python.org/3/
https://www.w3schools.com/python/

37 |Computer Science Narayana School


38 |Computer Science Narayana School

You might also like