0% found this document useful (0 votes)
8 views

Stock Management Project

Python Project in class 12th on Stock Management Project

Uploaded by

raghavkapil2346
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)
8 views

Stock Management Project

Python Project in class 12th on Stock Management Project

Uploaded by

raghavkapil2346
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/ 29

B.K. Sr. Sec.

School, Jahangirabad

A
PROJECT REPORT
ON
“Stock Management Project”
As
AISSCE Project

Based on summer study of Computer Science with PYTHON


(Session2019-20)

XII (Computer Science New-083)


C.B.S.E, New Delhi
Under The Distinguish Guidance of :- Submitted by:-

Mr. FAIQ MASSOD KAPIL RAGHAV


PGT Computer Science
B.K. Sr. Sec. School, Class XII
Jahangirabad C
CONTENTS
1. Acknowledgement
2. Certificate
3. Student Declaration
4. About the Project:
a. Introduction
b. Objective Of Project
c. Hardware/ Software Requirements
5. Coding
6. Snapshots
7. Bibliography
ACKNOWLEDGEMENT

I take this opportunity to express my profound sense of gratitude and respect to all
those who helped me throughout the duration of this project.

First and foremost, would like to give my deepest and sincerest thanks to my
project guide, Mr. FAIQ MASOOD for his constant encouragement
and support in my studies and activity of the project right from its
beginning.
Finally, my scope of profound thanks extend to all those staff members
who have directly or indirectly contributed in making this project a
success and up to the mark. I also thank to all my esteemed colleagues
and my team members who extremely helped me very much in specific
area of this project.

THANK YOU

Name – KAPIL RAGHAV


Roll No –
B.K. Sr. Sec. School, Jahangirabad
Certificate

This is to certify that KAPIL RAGHAV of class 12th C, B.K. Sr. Sec. School,
Jahangirabad has successfully completed his project of Computer Science as
prescribed by CBSE.

Date:

Signature of Internal Signature of External


Examiner Examiner
STUDENET DECELARATION

I, solemnly affirm and declare that the project “Stock Management System” under
the guidance of Mr. FAIQ MASSOD is my original work. No part of this work
whether documentation and coding has not been copied or taken in any form or by
any means.

I, certify that my work is original work and it has been made as Computer Science
Project in class 12th.

Name Signature
KAPIL RAGHAV

1. About the Project


a. Introduction
Stock management is the practice of ordering, storing, tracking, and
controlling inventory.
Stock management applies to every item a business uses to produce its
products or services – from raw materials to finished goods. In other
words, stock management covers every aspect of a business’s inventory.
Stock management may also be called stock control, inventory
management, or inventory control.

Inventory is a major asset that represents tied-up capital; managing stock


effectively therefore enables a business to free up capital.

Features of the Project:

1. Product Management

2. Sales Management

3. Purchase Management

4. User Management

b. Objective of project

Efficient stock control requires understanding the mix of different kinds


of stock and acknowledging the demands on that stock. This help keep
stock at a reasonable level, balancing the need for surplus supplies with
the need to reduce tied-up capital.
The purpose of stock control is to reduce the costs of holding stock, while
ensuring you can meet customer demand and making sure that there's
enough material for production. Businesses should always have a 'safe'
amount of stock so that they're able to react and cover any unforeseen
issues
The objectives of the project is as follows:
i. To keep inventory at sufficiently high level to perform
production and sales activities smoothly.
ii. To minimize investment in inventory at minimum level to
maximize profitability.
iii. Integrate entire business.
iv. Automation of manual tasks

c. Hardware/Software Requirements

SOFTWARE SPECIFICATIONS-:

Operating System : Windows 7, 8, 8.1, 10 and above


Platform : Python IDLE 3.8
Database System : MySQL
Languages : Structured Query Language (SQL)
Python
Other Software : mysql-connector module
datetime module

HARDWARE SPECIFICATIONS-:

Processor : Dual Core and above


Hardware : 40 GB
Ram : 1024 MB

d. Coding

# Creating Database
Import mysql.connector
db=mysql.connector.connect(host='localhost',user='root',password="1234
")
cursor=db.cursor()
cursor.execute("CREATE DATABASE stock_system")
db.close()

# Creating Tables

importmysql.connector
conn=mysql.connector.connect(host='localhost',user='root',passwd='1234
',database='stock_system')
mycursor=conn.cursor()
print("Creating PRODUCT table")
sql = "CREATE TABLE if not exists product (\
pcodeint(4) PRIMARY KEY,\
pname char(30) NOT NULL,\
pprice float(8,2) ,\
pqtyint(4) ,\
pcatchar(30));"
mycursor.execute(sql)
print("PRODUCT table created\n")

print("Creating ORDER table")


sql = "CREATE TABLE if not exists orders (\
orderidint(4)PRIMARY KEY ,\
orderdate DATE ,\
pcode char(30) NOT NULL , \
pprice float(8,2) ,\
pqtyint(4) ,\
supplier char(50),\
pcatchar(30));"
mycursor.execute(sql)
print("ORDER table created\n")

print("Creating SALES table")


sql = "CREATE TABLE if not exists sales (\
salesidint(4) PRIMARY KEY ,\
salesdate DATE ,\
pcode char(30) references product(pcode), \
pprice float(8,2) ,\
pqtyint(4) ,\
Total double(8,2)\
);"
mycursor.execute(sql)
print("SALES table created\n")

print('Creating USER table')


sql = "CREATE TABLE if not exists user (\
uid char(6) PRIMARY KEY,\
uname char(30) NOT NULL,\
upwdchar(30));"
mycursor.execute(sql)
print("USER table created\n")

# STOCK MANAGEMENT

importmysql.connector
importdatetime
now = datetime.datetime.now()
mydb=mysql.connector.connect(host="localhost",user="root",passwd="1
234",database="stock_system")
mycursor=mydb.cursor()

defproduct_mgmt( ):
while True :
print("\t\t\t 1. Add New Product")
print("\t\t\t 2. List Product")
print("\t\t\t 3. Update Product")
print("\t\t\t 4. Delete Product")
print("\t\t\t 5. Back (Main Menu)")
p=int (input("\t\tEnter Your Choice :"))
if p==1:
add_product()
if p==2:
search_product()
if p==3:
update_product()
if p==4:
delete_product()
if p== 5 :
break

defadd_product():
sql="INSERT INTO product(pcode,pname,pprice,pqty,pcat)
values (%s,%s,%s,%s,%s)"
code=int(input("\t\tEnter product code :"))
search="SELECT count(*) FROM product WHERE pcode=%s;"
val=(code,)
mycursor.execute(search,val)
for x in mycursor:
cnt=x[0]
ifcnt==0:
name=input("\t\tEnter product name :")
qty=int(input("\t\tEnter product quantity :"))
price=float(input("\t\tEnter product unit price :"))
cat=input("\t\tEnter Product category :")
val=(code,name,price,qty,cat)
mycursor.execute(sql,val)
mydb.commit()
else:
print("\t\t Product already exist")

defupdate_product():

code=int(input("Enter the product code :"))


qty=int(input("Enter the quantity :"))
sql="UPDATE product SET pqty=pqty+%s WHERE pcode=%s;"
val=(qty,code)
mycursor.execute(sql,val)
mydb.commit()
print("\t\t Product details updated")

defdelete_product():
code=int(input("Enter the product code :"))
sql="DELETE FROM product WHERE pcode = %s;"
val=(code,)
mycursor.execute(sql,val)
mydb.commit()
print(mycursor.rowcount," record(s) deleted");

defsearch_product():
while True :
print("\t\t\t 1. List all product")
print("\t\t\t 2. List product code wise")
print("\t\t\t 3. List product categoty wise")
print("\t\t\t 4. Back (Main Menu)")
s=int (input("\t\tEnter Your Choice :"))
if s==1 :
list_product()
if s==2 :
code=int(input(" Enter product code :"))
list_prcode(code)

if s==3 :
cat=input("Enter category :")
list_prcat(cat)

if s== 4 :
break

deflist_product():
sql="SELECT * from product"
mycursor.execute(sql)
clrscr()
print("\t\t\t\t PRODUCT DETAILS")
print("\t\t","-"*47)
print("\t\t code name price quantity category")
print("\t\t","-"*47)
fori in mycursor:
print("\t\t",i[0],"\t",i[1],"\t",i[2],"\t ",i[3],"\t\t",i[4])
print("\t\t","-"*47)

defpurchase_mgmt( ):
while True :
print("\t\t\t 1. Add Order")
print("\t\t\t 2. List Order")
print("\t\t\t 3. Back (Main Menu)")
o=int (input("\t\tEnter Your Choice :"))
if o==1 :
add_order()
if o==2 :
list_order()
if o== 3 :
break

defsales_mgmt( ):
while True :
print("\t\t\t 1. Sale Items")
print("\t\t\t 2. List Sales")
print("\t\t\t 3. Back (Main Menu)")
s=int (input("\t\tEnter Your Choice :"))
if s== 1 :
sale_product()
if s== 2 :
list_sale()
if s== 3 :
break

defuser_mgmt( ):
while True :
print("\t\t\t 1. Add user")
print("\t\t\t 2. List user")
print("\t\t\t 3. Back (Main Menu)")
u=int (input("\t\tEnter Your Choice :"))
if u==1:
add_user()
if u==2:
list_user()
if u==3:
break

defadd_order():
now = datetime.datetime.now()
sql="INSERT INTO
orders(orderid,orderdate,pcode,pprice,pqty,supplier,pcat) values
(%s,%s,%s,%s,%s,%s,%s)"
code=int(input("Enter product
code :"))oid=now.year+now.month+now.day+now.hour+now.min
ute+ow.second
qty=int(input("Enter product quantity : "))
price=float(input("Enter Product unit price: "))
cat=input("Enter product category: ")
supplier=input("Enter Supplier details: ")
val=(oid,now,code,price,qty,supplier,cat)
mycursor.execute(sql,val)
mydb.commit()

deflist_order():
sql="SELECT * from orders"
mycursor.execute(sql)
clrscr()
print("\t\t\t\t\t\t\t ORDER DETAILS")
print("-"*85)
print("orderid Date Product code price quantity Supplier
Category")
print("-"*85)
fori in mycursor:
print(i[0],"\t",i[1],"\t",i[2],"\t ",i[3],"\t",i[4],"\t",i[5],"\t",i[6])
print("-"*85)

deflist_prcode(code):
sql="SELECT * from product WHERE pcode=%s"
val=(code,)
mycursor.execute(sql,val)
clrscr()
print("\t\t\t\t PRODUCT DETAILS")
print("\t\t","-"*47)
print("\t\t code name price quantity category")
print("\t\t","-"*47)
fori in mycursor:
print("\t\t",i[0],"\t",i[1],"\t",i[2],"\t ",i[3],"\t\t",i[4])
print("\t\t","-"*47)

defsale_product():
pcode=input("Enter product code: ")
sql="SELECT count(*) from product WHERE pcode=%s;"
val=(pcode,)
mycursor.execute(sql,val)
for x in mycursor:
cnt=x[0]
ifcnt !=0 :
sql="SELECT * from product WHERE pcode=%s;"
val=(pcode,)
mycursor.execute(sql,val)
for x in mycursor:
print(x)
price=int(x[2])
pqty=int(x[3])
qty=int(input("Enter no of quantity :"))
ifqty<= pqty:
total=qty*price;
print ("Collect Rs. ", total)
sql="INSERT into sales values(%s,%s,%s,%s,%s,%s)"
val=(int(cnt)+1,datetime.datetime.now(),pcode,price,qty,total)
mycursor.execute(sql,val)
sql="UPDATE product SET pqty=pqty-%s WHERE pcode=%s"
val=(qty,pcode)
mycursor.execute(sql,val)
mydb.commit()
else:
print(" Quantity not Available")
else:
print(" Product is not avalaible")

deflist_sale():
sql="SELECT * FROM sales"
mycursor.execute(sql)
print(" \t\t\t\tSALES DETAILS")
print("-"*80)
print("Sales id Date Product Code Price Quantity
Total")
print("-"*80)
for x in mycursor:
print(x[0],"\t",x[1],"\t",x[2],"\t ",x[3],"\t\t",x[4],"\t\t",x[5])
print("-"*80)

deflist_prcat(cat):
print (cat)
sql="SELECT * from product WHERE pcat =%s"
val=(cat,)
mycursor.execute(sql,val)
clrscr()
print("\t\t\t\t PRODUCT DETAILS")
print("\t\t","-"*47)
print("\t\t code name price quantity category")
print("\t\t","-"*47)
fori in mycursor:
print("\t\t",i[0],"\t",i[1],"\t",i[2],"\t ",i[3],"\t\t",i[4])
print("\t\t","-"*47)

defadd_user():
uid=input("Enter emaid id :")
name=input(" Enter Name :")
paswd=input("Enter Password :")
sql="INSERT INTO user values (%s,%s,%s);"
val=(uid,name,paswd)
mycursor.execute(sql,val)
mydb.commit()
print(mycursor.rowcount, " user created")

deflist_user():
sql="SELECT uid,uname from user"
mycursor.execute(sql)
clrscr()
print("\t\t\t\t USER DETAILS")
print("\t\t","-"*27)
print("\t\t UID name ")
print("\t\t","-"*27)
fori in mycursor:
print("\t\t",i[0],"\t",i[1])
print("\t\t","-"*27)

defclrscr():
print("\n"*5)

def end():
clrscr()
print("|
==================================================
========|")
print("|=================THANKS FOR USING FOR
USING===============|")
print("|=====================\tTeam G18\
t==========================|")
print("|
==================================================
========|")
mydb.close()

#main block

clrscr()
print("""

\t\t\t |---------------------------------------------------------|
\t\t\t |
====================================================
=====|
\t\t\t |========== Welcome To Stock Management System
===========|
\t\t\t |=================== By Group G18
========================|
\t\t\t |
====================================================
=====|
\t\t\t |---------------------------------------------------------|

""")

while True:
clrscr()
print("\t\t\t STOCK MANAGEMENT")
print("\t\t\t ****************\n")
print("\t\t 1. PRODUCT MANAGEMENT")
print("\t\t 2. PURCHASE MANAGEMENT")
print("\t\t 3. SALES MANAGEMENT")
print("\t\t 4. USER MANAGEMENT")
print("\t\t 5. EXIT\n")
n=int(input("\t\tEnter your choice :"))
if n== 1:
product_mgmt()
elif n== 2:
purchase_mgmt()
elif n== 3:
sales_mgmt()
elif n== 4:
user_mgmt()
elif n== 5:
end()
break
else:
print('!!!!!1Entered Wrong Choice!!!!!!!!!!!1')

e. Snapshots
user table

product table

orders table

sales table
f. Bibliography

i. Online Wikipedia- the encyclopedia


ii. Software Engineering
iii. Internet
iv. Project Worlds
v. Free Projectz
vi. Code-Worlds
vii. Nevon Projects
viii. Github
ix. Code-Projects
x. Scribd
xi. Slide Share

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy