Ip Project Subham
Ip Project Subham
BENGDUBI
PROJECT REPORT ON
Page 1
CERTIFICATE
Signature Below :-
External Examiner :
Page 1
TABLE OF CONTENTS
Topic Page No
Introduction 5
Problem Statement 6
Objective 6
Project Scope 7
Overview of Python 9
Overview of SQL 10
Project Module 11
SQL Code 15
Python Code 18
Outputs 28
Conclusion 38
Bibliography 39
Page 1
INTRODUCTION
Page 1
customers. They can also analyze data by
visualization.
Page 1
PROBLEM STATEMENT
For any business Inventory is one of the most important department that
must be well managed in order to run daily business activity smoothly. But
mostly business are not able to manage inventory as they do not have good
computerized system. As a result they lacks in
OBJECTIVE
The objective of project is to build an application program to:
Page 1
This application program can be used easily by non-programming personals.
PROJECT SCOPE
Managing all products, sufficient stocks, sale and
purchase records and analyzing sales is a tedious job for
any business. To do it more effectively and correctly a
good Inventory control is required. This is provided by
our application which have following scope:
• ensures effective inventory control • manage daily
sales records easily and precisely • can perform sales
analysis of various products • user friendly interface •
very easy to use
• High level security of data.
Page 1
Plotting Matplotlib
Hardware Requirements:
Input/output Requirements:
OVERVIEW OF PYTHON
Python is a general purpose, dynamic, high-level, and
interpreted programming language. It supports Object Oriented
programming approach to develop applications. It is simple and easy
to learn and provides lots of high-level data structures. Guido Van
Rossum is known as the founder of Python programming.
Features of Python:
Page 1
• It is an interpreted language, as Python programs are executed
by an interpreter.
• Python programs are easy to understand as they have a clearly
defined syntax and relatively simple structure.
• Python is case-sensitive. For TECHTIPNOW, NUMBER and
number are not same in Python.
• Python is portable and platform independent, means it can run
on various operating systems and hardware platforms.
• Python has a rich library of predefined functions.
• Python is also helpful in web development. Many popular web
services and applications are built using Python.
• Python uses indentation for blocks and nested blocks.
OVERVIEW OF MYSQL
MySQL is a relational database management system (RDBMS). It is
pronounced as "My Sequel”. MySQL was originally founded and
developed in Sweden by David Axmark, Allan Larsson and Michael
Widenius, who had worked together since the 1980s.
Characteristics of MySQL:
Page 1
• MySQL is a platform independent application which works on
many operating systems like
• Windows, UNIX, LINUX etc. and have compatibility with many
languages including JAVA, C++, PHP, PERL, etc.
• MySQL is an easy to install RDBMS and is capable of handling
large data sets.
Since MySQL is released under an open-source license, it does not
require any cost or payment for its usage. Anyone can download and
use this software from specific location on Internet.
PROJECT MODULES
Inventory Management System is divided into following
modules:
Customer module: This module helps you to add, modify,
and delete customer data.
Supplier module: This module helps you to add, modify, and
delete supplier data.
Stock module: This module helps you to add, modify, and
delete product data.
Sale module: This module is used to manage sell information.
Page 1
Purchase module: This module is used to manage purchase
records.
Login Module: This module is used to manage login details.
User module: This module is used to manage user
credentials.
Report module: This module is used to generate sale bills,
purchase bills and visualize data by plotting charts.
Page 1
DATABASE DESIGN AND TABLE STRUCTURES
Page 1
SMASTER
Item
SALEID INT (PRIMARY KEY)
INT
(PRIMARY SDATE DATE
INO KEY)
SID INT (FOREIGN KEY)
INAME VARCHAR
TOTAL FLOAT
PRATE FLOAT
SRATE FLOAT
INT
QOH
SDETAILS
CUSTOMER
SALEID INT (FOREIGN KEY)
CID INT (PRIMARY
KEY) INO INT(FOREIGN KEY)
CNAME VARCHAR
QTY INT
TOTAL FLOAT
MOBIL CHAR(10)
E
Page 1
SUPPLIER
INT (PRIMARY
SID
KEY) VARCHAR
SNAME
SADD VARCHAR
CHAR(10)
MOBILE
PMASTER
PDETAILS
QTY INT
TOTAL FLOAT
TOTAL FLOAT
SQL SOURCE
Page 1
CODE
Page 1
Page 1
PYTHON SOURCE CODE
Page 1
➢MAIN MODULE
import item
import customer
import supplier
import transaction
import report import
os while(True):
os.system('cls') print("="*80) print("-"*80) print("\n\t\t\
tInventory Management System\n") print("-"*80) print("="*80)
print("\n\t\t\t\tEnter your choice\n\t\t\t\ t1.Items\n\t\t\t\
\t2.Customers\n\t\t\t\t3.Suppliers\
\n\t\t\t\t4.Transaction\n\t\t\t\t5.Report\n\t\t\t\t6.Exit")
ch=int(input()) if ch==1: while(True):
print("---------------\nEnter your choice\n--------------\
\n\t\t\t\t1.Add Item\n\t\t\t\t2.Edit Item\n\t\t\t\t3.Fix Rate\
\n\t\t\t\t4.Search Item\n\t\t\t\t5.Delete Item\n\t\t\t\t6.Exit")
ch=int(input()) if ch==1: item.add_item() elif
ch==2: item.edit_item() elif ch==3:
item.fix_rate() elif
ch==4:
item.search_item()
elif ch==5:
item.delete_item()
elif ch==6: break
elif ch==2: while(True):
print("\n---------------\nEnter your choice\n--------------\
\n\t\t\t\t1.Add customers\n\t\t\t\t2.Edit Customers\
\n\t\t\t\t3.Search Customers\n\t\t\t\t4.Delete Customers\n\t\t\t\t5.exit")
ch=int(input()) if ch==1:
customer.add_customer()
elif ch==2:
customer.edit_customer()
elif ch==3:
Page 1
customer.search_customer() elif
ch==4:
customer.delete_customer() elif
ch==5: break elif ch==3:
while(True):
print("\n---------------\nEnter your choice\n--------------\
\n\t\t\t\t1.Add Suppliers\n\t\t\t\t2.Edit Suppliers\
\n\t\t\t\t3.Search Suppliers\n\t\t\t\t4.Delete Suppliers\n\t\t\t\t5.exit")
ch=int(input())
if ch==1:
supplier.add_supplier() elif
ch==2:
supplier.edit_supplier()
elif ch==3:
supplier.search_supplier()
elif ch==4:
supplier.delete_supplier() elif
ch==5: break elif ch==4:
while(True):
print("\n---------------\nEnter your choice\n--------------\
\n\t\t\t\t1.Sale\n\t\t\t\t2.Purchase\n\t\t\t\t3.exit")
ch=int(input()) if ch==1: transaction.sale()
elif ch==2:
transaction.purchase()
elif ch==3: break elif
ch==5: while(True):
print("\n---------------\nEnter your choice\n--------------\
\n\t\t\t\t1.Item Details\n\t\t\t\t2.Customer Details\
\n\t\t\t\t3.Supplier Details\n\t\t\t\t4.Sale Details\n\
\t\t\t5.Purchase Details\n\t\t\t\t6.Best Selling
Product(Plot)\ \n\t\t\t\t7.Sale
Performance(Plot)\n\t\t\t\t8.exit") ch=int(input()) if
ch==1: report.show_item()
elif ch==2:
Page 1
report.show_customer() elif
ch==3:
report.show_supplier()
elif ch==4:
report.show_sale()
elif ch==5:
report.show_purchase()
elif ch==6:
report.best_product()
elif ch==7:
report.sale_performance() elif
ch==8: break elif
ch==6: break
➢ITEM MODULE
import pandas as pd from tabulate import tabulate import mysql.connector
as sqlt import matplotlib.pyplot as plt con=sqlt.connect(host = "localhost",
user = "root", passwd="sanjay", database =
"inventory")
cursor=con.curs
or() def
add_item(): try:
ino = int(input("Enter Item No")) iname = input("Enter Iname")
prate=float(input("Enter Purchase Rate")) srate=float(input("enter
Sale Rate")) qoh=int(input("Enter Qty
On Hand")) q="insert into item values({},'{}',{},{},
{});".format(ino,iname,prate,srate,qoh) cursor.execute(q)
con.commit() print("Item Added") except:
print("Wrong Entry..Please
check") def edit_item(): try:
ino=int(input("Enter Item No"))
q="select * from item where ino =
{};".format(ino) cursor.execute(q) if cursor.fetchone():
Page 1
iname=input("Enter Item Name") cursor.execute("update
item set iname = '{}' where ino={};".format(iname,ino)) con.commit()
print("item Edited") else:
print("Item Not Found")
except:
print("Wrong Entry")
def fix_rate():
ino=int(input("Enter Item No"))
q="select * from item where ino =
{};".format(ino) cursor.execute(q) if cursor.fetchone():
prate=int(input("enter new purchase rate"))
srate=int(input("Enter new Sale rate")) cursor.execute("update
item set prate={},srate={} where
ino={};".format(prate,srate,ino))
con.commit()
print("New rate applied")
else:
print("Item Not
Found") def search_item():
ino=int(input("Enter Item No"))
q="select * from item where ino =
{};".format(ino) cursor.execute(q) if cursor.fetchone():
df=pd.read_sql(q,con) print(tabulate(df,headers="keys", tablefmt
= "psql", showindex = False)) else:
print("Item Not
Found") def delete_item():
ino=int(input("Enter Item No"))
q="select * from item where ino =
{};".format(ino) cursor.execute(q) if cursor.fetchone():
cursor.execute("delete from item where
ino={};".format(ino)) con.commit()
print("item deleted") else:
print("Item Not Found")
Page 1
➢CUSTOMER MODULE
import pandas as pd from tabulate import tabulate import mysql.connector as
sql import matplotlib.pyplot as plt con=sqlt.connect(host = "localhost", user = "root",
passwd="sanjay", database = "inventory") cursor=con.cursor() def add_customer():
cid = int(input("Enter Customer ID")) cname = input("Enter
Customer Name") cadd=input("Enter Address")
mobile=input("Enter Mobile") q="insert into customer
values({},'{}','{}','{}');".format(cid,cname,cadd,mobile)
cursor.execute(q) con.commit() print("Customer Added") def
edit_customer():
cid=int(input("Enter Customer ID")) q="select
* from Customer where cid = {};".format(cid)
cursor.execute(q) if cursor.fetchone():
cadd=input("Enter Customer Address") cursor.execute("update
customer set cadd = '{}' where cid={};".format(cadd,cid))
con.commit() print("Customer Edited") else:
print("Customer Not
Found") def search_customer():
cname=input("Enter Customer Name") q="select * from
customer where cname like '%{}%';".format(cname)
cursor.execute(q) if cursor.fetchall():
df=pd.read_sql(q,con)
print(tabulate(df,headers='keys',tablefmt='psql',showindex=False))
else:
print("Customer Not
found") def delete_customer():
cid=int(input("Enter Customer ID")) q="select
* from customer where cid = {};".format(cid)
cursor.execute(q) if cursor.fetchone():
cursor.execute("delete from customer where cid={};".format(cid))
con.commit()
print("customer deleted")
Page 1
else:
print("customer Not
Found")
➢SUPPLIER MODULE
import pandas as pd from tabulate import tabulate import mysql.connector as sqlt
import matplotlib.pyplot as plt con=sqlt.connect(host = "localhost", user = "root",
passwd="sanjay", database = "inventory") cursor=con.cursor() def add_supplier():
sid = int(input("Enter Supplier ID")) sname = input("Enter
Supplier Name") sadd=input("Enter Address")
mobile=input("Enter Mobile") q="insert into supplier
values({},'{}','{}','{}');".format(sid,sname,sadd,mobile)
cursor.execute(q) con.commit() print("Supplier Added") def
edit_supplier():
sid=int(input("Enter Supplier ID")) q="select *
from Supplier where sid = {};".format(sid)
cursor.execute(q) if cursor.fetchone():
sadd=input("Enter Supplier Address") cursor.execute("update
Supplier set sadd = '{}' where sid={};".format(sadd,sid)) con.commit()
print("Supplier Edited") else:
print("Supplier Not
Found") def search_supplier():
sid=int(input("Enter Supplier ID")) q="select *
from Supplier where sid = {};".format(sid)
cursor.execute(q) if cursor.fetchone():
df=pd.read_sql(q,con) print(tabulate(df,headers="keys",
tablefmt = "psql", showindex = False)) else:
print("Supplier Not
Found") def delete_supplier():
sid=int(input("Enter Supplier ID")) q="select *
from Supplier where sid = {};".format(sid)
cursor.execute(q) if cursor.fetchone():
cursor.execute("delete from Supplier where
sid={};".format(sid)) con.commit() print("Supplier
deleted") else:
print("Supplier Not
Found")
Page 1
➢TRANSACTION MODULE
import pandas as pd from tabulate import tabulate import mysql.connector as sqlt
import matplotlib.pyplot as plt con=sqlt.connect(host = "localhost", user = "root",
passwd="sanjay", database =
"inventory")
cursor=con.cursor() def
purchase():
pid=0 total=0
grand=0
l=[] ch='y' q="select max(pid) as largest
from pmaster" cursor.execute(q)
r=cursor.fetchone()[0] if r:
pid=r+1
else:
pid=1
pdate=input("Enter Purchase date") sid = int(input("Enter
Supplier ID")) cursor.execute("select * from supplier where
sid={};".format(sid)) if cursor.fetchone():
print("Item Details") df=pd.read_sql("select * from
item",con)
print(tabulate(df,headers='keys',tablefmt='psql',showindex=False))
while(ch=='y'):
ino=int(input("Enter Item No")) cursor.execute("select
* from item where ino ={};".format(ino)) r1=cursor.fetchone()
if r1:
qty = int(input("Enter qty"))
rate=r1[2] total=qty*rate
grand=grand+total
t=(pid,ino,qty,rate,total)
l.append(t) else:
print("Item Not Found") ch=input("Do you wish to add
more Items in bucket y/n") q1="insert into pmaster values({},'{}',{},
{});".format(pid,pdate,sid,grand) cursor.execute(q1)
con.commit() q2="insert into pdetail values(%s,%s,%s,%s,%s);"
cursor.executemany(q2,l) con.commit() cursor.executemany("insert
into ptemp values(%s,%s,%s,%s,%s);",l) con.commit() q3="update item
Page 1
join ptemp using(ino) set item.qoh = item.qoh+ptemp.qty"
cursor.execute(q3) con.commit() cursor.execute("delete from ptemp")
con.commit() print("Item Purchased and Added") else:
def sale():
saleid=0 total=0
grand=0
l=[] ch='y' q="select max(saleid) as largest
from smaster" cursor.execute(q)
r=cursor.fetchone()[0] if r:
saleid=r+1
else:
saleid=1 sdate=input("Enter Sale date") sid =
int(input("Enter Supplier ID")) cursor.execute("select * from
supplier where sid={};".format(sid)) if cursor.fetchone():
print("Item Details") df=pd.read_sql("select * from
item",con)
print(tabulate(df,headers='keys',tablefmt='psql',showindex=False))
while(ch=='y'):
ino=int(input("Enter Item No"))
cursor.execute("select * from item where ino ={};".format(ino))
r1=cursor.fetchone() if r1: qty = int(input("Enter
qty"))
rate=r1[2] total=qty*rate
grand=grand+total
t=(saleid,ino,qty,rate,total)
l.append(t) else:
print("Item Not Found") ch=input("Do you wish to add more
Items in bucket y/n") q1="insert into smaster values({},'{}',{},
{});".format(saleid,sdate,sid,grand) cursor.execute(q1)
con.commit() q2="insert into sdetail values(%s,%s,%s,%s,%s);"
cursor.executemany(q2,l) con.commit()
cursor.executemany("insert into stemp values(%s,%s,%s,%s,%s);",l)
con.commit() q3="update item join stemp using(ino) set
item.qoh = item.qoh-stemp.qty" cursor.execute(q3)
con.commit() cursor.execute("delete from stemp")
Page 1
con.commit() print("Item Purchased and Added") else:
print("Supplier Not Found")
➢REPORT MODULE
import mysql.connector as sqlt
import pandas as pd from tabulate
import tabulate
plt.plot(df.month,df.total)
plt.xlabel("Month") plt.ylabel("Total
Sale")
Page 1
plt.xticks(df.month) plt.show()
PROGRAM OUTPUT
Page 1
❖ ITEM
❖ ADD ITEM
Page 1
❖EDIT ITEM
Page 1
❖SEARCH ITEM
❖DELETE ITEM
Page 1
CUSTOMER MODULE
SUPPLIER MODULE
Page 1
TRANSACTION MODULE
REPORT MODULE
Page 1
SALE MODULE
Page 1
DATA ANALYSIS
Page 1
BEST SELLING PRODUCT
Page 1
CONCLUSION
This Inventory Management System is a simple
desktop based application basically suitable for
small organization. It has all basic elements which
are used for managing inventory of small
organization. We are successful in making the
application where we can insert, delete, update,
search and analyze records as per need. This
application also provides a report including chart of
sales records to analyze the performance.
We strongly believes that he implementation of this
system will surely benefit the organization.
BIBLIOGRAPHY
References and Bibliography:
Page 1
•Informatics Practices Class-XII
NCERT Publication • Informatics Practices Class-
XII by Sumita Arora • Think Python by Allen B
Downey • Python for everybody by Charles
Severance • Learning MYSQL by Seyed M. M.
Tahaghoghi • MySQL in a nutshell by Russell J. T.
Dyer
• www.geeksforgeeks.org
• www.ncert.co.in
Page 1