Professional Documents
Culture Documents
Payroll System
Payroll System
Payroll System
DBMS: MySQL
User: root
Pass: 123
SQL Commands:
create database payroll;
USE PAYROLL;
CREATE TABLE EMP(ECODE INT(6) PRIMARY KEY, FNAME VARCHAR(20) NOT NULL, LNAME VARCHAR(20) NOT NULL,
DESIG CHAR(15) NOT NULL, LEVEL INT(2)NOT NULL, GENDER CHAR DEFAULT 'M', DOB DATE, DOJ DATE, MOB
VARCHAR(11), PAN CHAR(10), ACNO VARCHAR(15), IFSC CHAR(11),BASIC INT(6), TA INT(4), HRAYN
CHAR,NPSYN CHAR);
CREATE TABLE PAY(YEAR INT(4), MONTH INT(2), ECODE INT(6), NODAYS INT(2) NOT NULL, DA INT(6), DATA
INT(5), HRA INT(5), NPS_M INT(5), OTHER_ALLW INT(5), GROSS INT(6), ITAX INT(6), NPS_O INT(5), GPF
INT(5) DEFAULT 0, LCFEE INT(5), ODEDUCT INT(5), TOT_DEDUC INT(7), NETSAL INT(7),
PRIMARY KEY(YEAR, MONTH, ECODE), FOREIGN KEY (ECODE) REFERENCES EMP(ECODE));
CREATE TABLE SETTER(DAP INT(3), HRAP INT(2));
import subprocess
cnx = create_engine('mysql+pymysql://root:123@localhost:3306/payroll').connect()
def emp_entry():
Eligible for NPS Y/N : ") data = [[ec, fn, ln, dg, sl, ge, db, dj,
def per_setter() :
try:
y = eval(input("Enter the salary year (press enter for current year otherwise input new year:
str(datetime.datetime.today().strftime('%Y')))) except: y =
m = eval(input("Enter the salary month (press enter for current month otherwise input new mon
" + str(datetime.datetime.today().strftime('%m')))) except:
m = str(datetime.datetime.today().strftime('%m')) break
salary details for the " + str(m) + "/" + str(y)) lec=[] llevel=[]
ly.append(y)
df1["ITAX"] = it df1["ODEDUCT"]
= deduc
df1["TOTAL_DEDUC"] df1.to_csv('C:\Payroll\
Date_operations():
x = datetime.datetime.today().strftime('%Y-%m-%d')
payroll\salary.csv')
print(df)
def Show_Rates():
df = pd.read_sql(sql, cnx)
print(df)
def Show_EMP():
sql = "select *
from EMP"
df = pd.read_sql(sql, cnx)
print(df)
def
Salary_show():
DP = 0 HP = 0 sql="select *
from setter"
df=pd.read_sql(sql,cnx)
DP = df["dap"][0] HP
= df["hrap"][0]
while (True):
Salary_show() elif
(choice == 8):
Wrong choice..........")