Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 30

Name :- Aman VErma

Harsh chaurasia
md. shaIF
class :- 12TH
Guide Teacher :- mr. sarvesh sir

TABLE OF CONTENTS
1
Sr
No.
Topic Page no.
1. 3
Acknowledgement
2. Certificate 4
3. Introduction 5
4. Objective 6
5. Language Selection 7
6. System Requirement 8
7. Source Code 9-25
8. Output 26-27
9. Conclusion 28
10. Limitations 29
11. Bibliography 30
I would like to express my special
thanks of gratitude to my teacher Mr.
Sarvesh Sir who gave me the golden
opportunity to do this wonderful project
on the topic “Stock Management System
And Billing System” which also helped
me in doing a lot of Research and i
came to know about so many new things
I am really thankful to them.
Secondly i would also like to thank my
parents and friends who helped me a lot
in finalizing this project within the
limited time frame.

3
Certificate
THIS IS TO CERTIFY THAT AMAN
VERMA OF CLASS XII HAS
SUCCESSFULLY COMPLETED HIS
COMPUTER PROJECT ON THE TOPIC
"STOCK MANAGEMENT SYSTEM" AS
PRESCRIBED BY MR. SARVESH SIR,
DURING THE ACADEMIC YEAR 2021-
2022 AS PER THE GUIDELINES ISSUES
BY CENTRAL BOARD OF SECONDARY
EDUCATION - CBSE.

Internal Examiner External Examiner

4
Stock Management System project is written
in Python. The project file contains a python
script (sms.py). This is a simple cmd and
idle based project which is easy to
understand and use. Talking about the
system, it contains all the required functions
which include adding, viewing, deleting and
updating inventory items.
While adding inventory items, the user has
to enter the part number, its price,
description, and stock. If the part number
already exists, then its value is changed to
next upcoming number in the list. The
system shows the inventory record in a list
view. And also the user easily delete any
inventory items. The user can search for an
item as it contains a search function too. In
short, this projects mainly focus on CRUD
with a search function.
5
The main objective of the Python Project
on Sales And Inventory Management
System is to manage the details of
Customer,lnventory, Supplier,Sales,
Payment. It manages all the information
about Customer, Purchasing, Payment,
Customer. The project is totally built at
administrative end and thus only the
administrator is guaranteed the access.
The purpose of the project is to build an
application program to reduce the manual
work for managing the Customer,
Inventory, Purchasing, Supplier. It tracks
all the details about the Supplier, Sales,
Payment .

6
Python
Python is a high-level general-purpose programming language. Its
design philosophy emphasizes code readability with the use
of significant indentation. Its language constructs and object-
oriented approach aim to help programmers write clear, logical
code for small- and large-scale projects.
Python is dynamically-typed and garbage-collected. It supports
multiple programming paradigms,
including structured (particularly, procedural), object-oriented
and functional programming. It is often described as a
"batteries included" language due to its comprehensive standard
library.
Guido van Rossum began working on Python in the late 1980s, as a
successor to the ABC programming language, and first released
it in 1991 as Python 0.9.0. Python 2.0 was released in 2000 and
introduced new features such as list comprehensions, cycle-
detecting garbage collection, reference counting,
and Unicode support. Python 3.0, released in 2008, was a major
revision that is not completely backward-compatible with earlier
versions.

7
Operating Systems and CPU architecture:
Windows 7 or 10
Mac OS X 10.11 or higher, 64-bit
Linux: RHEL 6/7, 64-bit (almost all libraries also
work in Ubuntu)
x86 64-bit CPU (Intel / AMD architecture)
Python v3.9.1 is the first version supporting macOS
11 Big Sur. With Xcode 11 and later it is now
possible to build “Universal 2” binaries which work
on Apple Silicon. 
RAM and free disk space:
4 GB RAM
5 GB free disk space

8
#Dictionaries
unit_price={}
description={}
stock={}

#Open file with stock


details = open("stock.txt","r")

#First line of the file is the number of items


no_items = int((details.readline()).rstrip("\n"))

#Add items to dictionaries


for i in range(0,no_items):

9
line = (details.readline()).rstrip("\n")
x1,x2 = line.split("#")
x1=int(x1)
x2=float(x2)
unit_price.update({x1: x2})

for i in range(0,no_items):
line = (details.readline()).rstrip("\n")
x1,x2 = line.split("#")
x1=int(x1)
description.update({x1: x2})

for i in range(0,no_items):
line = (details.readline()).rstrip("\n")
x1,x2 = line.split("#")
x1=int(x1)
x2=int(x2)
10
stock.update({x1: x2})

details.close()

#List to store the items purchased


cart=[]

c="y" #Runs the while loop as long as user wants

#Instructions
print("Welcome to Stock Management System")
print()
print("A-Add an item")
print("R-Remove an item")
print("E-Edit specifics of an item")
print("L-List all items")
11
print("I-Inquire about a part")
print("P-Purchase")
print("C-Checkout")
print("S-Show all parts purchased")
print("Q-Quit")
print("remove-Remove an item from the cart")
print("help-See all commands again")
print()

total_cost=0
flag=0 #To check if they have checked out

while(c!= "q" or c!= "Q"):


c= input("What would you like to do? ")

if(c=="q" or c=="Q"):12
break

elif(c=="A" or c=="a"): #Add a part


p_no = int(input("Enter part number: "))
p_pr = float(input("Enter part price: "))
p_desc = input("Enter part description: ")
p_stock = int(input("Enter part stock: "))

m=0
for i in range(0,len(unit_price)):
if(p_no in unit_price):
p_no+=1
m=1
if(m==1):
print()
print("That part number already exists :(,
changing value to ",p_no)13

unit_price.update({p_no: p_pr})
description.update({p_no: p_desc})
if(p_stock > -1):
stock.update({p_no: p_stock})
else:
p_stock = 0
stock.update({p_no: p_stock})
print("The stock of an item cannot be
negative, the stock has been set to 0.")
print()
print("Part number: ",p_no," Description:
",description.get(p_no)," Price:
",unit_price.get(p_no)," Stock: ",stock.get(p_no))
print("Part was added successfully!")
print()

elif(c=="E" or c=="e"):
14 #Edit a part
print()
p_no = int(input("Enter part number: "))
if(p_no in unit_price):
p_pr = float(input("Enter part price: "))
p_desc = input("Enter part description: ")
p_stock = int(input("Enter part stock: "))

unit_price.update({p_no: p_pr})
description.update({p_no: p_desc})
stock.update({p_no: p_stock})

else:
print("That item does not exist, to add an
item use a")
print()

15
elif(c=="R" or c=="r"): #Remove a part
print()
p_no = int(input("Enter part number: "))
if(p_no in unit_price):
are_you_sure = input("Are you sure you
want to remove that item(y/n)? ")
if(are_you_sure=="y" or
are_you_sure=="Y"):
unit_price.pop(p_no)
description.pop(p_no)
stock.pop(p_no)
print("Item successfully removed!")
print()
else:
print("Sorry, we don't have such an item!")
print()

16
elif(c=="L" or c=="l"): #List all the parts
print()
print("Parts and their prices: ",unit_price)
print("Descriptions: ",description)
print("Stock left of Item: ",stock)
print()

elif(c=="I" or c=="i"): #Inquire about a


part
print()
p_no=int(input("Enter Part Number: "))
if(p_no in unit_price):
print()
print("Part number: ",p_no," Description:
",description.get(p_no)," Price:
",unit_price.get(p_no)," Stock: ",stock.get(p_no))
if(stock.get(p_no)<3 and stock.get(p_no)!
=0):
print("Only ",stock.get(p_no),"
remaining! Hurry!") 17

print()
else:
print("Sorry we don't have such an item!")
print()
elif(c=="P" or c=="p"): #Purchase a part
print()
p_no = int(input("Enter Part number: "))
if(p_no in unit_price):
if(flag==1):
flag=0
stock_current = stock.get(p_no)
if(stock_current>0):
stock_current = stock.get(p_no)
stock[p_no] = stock_current-1
item_price = unit_price.get(p_no)
total_cost = total_cost+item_price
18

print(description.get(p_no),"added to
cart: ","$",item_price)
cart.append(p_no)#Stores item in cart
else:
print("Sorry! We don't have that item in
stock!")
else:
print("Sorry! We don't have such an
item!")
print()

elif(c=="C" or c=="c"): #Check out


print()
print("You bought the following parts: ",cart)
print("Total: ","$",round(total_cost,2))
tax= round(0.13*total_cost,2)
print("Tax is 13%: ","$",tax)
19
total = round(total_cost+tax,2)
print("After Tax: ","$",total)
total_cost=0
flag=1
print()
print("You can still purchase items after check
out, your cart has been reset. To quit press q")
print()

elif(c=="help"): #Display all commands


print()
print("Help Centre")
print("A-Add an item")
print("R-Remove an item")
print("E-Edit specifics of an item")
print("L-List all items")
print("I-Inquire about
20
a part")
print("P-Purchase")
print("C-Checkout")
print("S-Show all parts purchased")
print("remove-Remove an item from the
cart")
print("help-See all commands again")
print("If you have any other questions or
concerns please contact the manager.")
print()

elif(c=="remove" or c=="Remove"):
#To remove an item from the cart
print()
are_you_sure = input("Are you sure you want
to remove an item from the cart(y/n)? ")
if(are_you_sure=="y"):
p_no = int(input("Enter part number to
remove from cart: "))
if(p_no in cart): 21

stock_current = stock.get(p_no)
stock[p_no] = stock_current+1
item_price = unit_price.get(p_no)
total_cost = total_cost-item_price
j=0
for i in range(0,len(cart)):
#To find the index of the part in the list cart
if(i==p_no):
j=i

cart.pop(j)
print(description.get(p_no),"removed
from cart: ")
print()
else:
print() 22
print("That item is not in your cart!")
print()

elif(c=="s" or c=="S"):
#prints list cart
print()
print(cart)
print()
else:
print()
print("ERROR! Contact manager for help!")
print()

#Outputs total if the user quits without checking


out
if(total_cost>0 and flag==0):
23

print()
print("You bought: ",cart)
print("Total: ","$",round(total_cost,2))
tax= round(0.13*total_cost,2)
print("Tax is 13%: ","$",tax)
total = round(total_cost+tax,2)
print("After Tax: ","$",total)
print()
print("Thank you for using Stock Management
System!")

#Write the updated stock to the file


details = open("stock.txt","w")
no_items=len(unit_price)
details.write(str(no_items)+"\n")
24
for i in range(0,no_items):
details.write(str(i+1)+"#"+str(unit_price[i+1])+"\
n")

for i in range(0,no_items):
details.write(str(i+1)+"#"+description[i+1]+"\n")

for i in range(0,no_items):
details.write(str(i+1)+"#"+str(stock[i+1])+"\n")

details.close()
25
26
27
To conclude, Stock Management System is
a simple desktop based application basically
suitable for small organization. It has
every basic items which are used for the
small organization. Our team is successful
in making the program where we can
update, insert and delete the item as per
the requirement. This program also
provides a simple report on daily basis to
know the daily sales and purchase details.
This Program matches for small
organization where there small limited if
godwoms. Through it has some limitations,
our team strongly believes that the
implementation of this system will surely
benefit the organization.

28
Since this is our first project it has some
limitation. Due to less knowledge in
particular fields and limited time we were
not able to fulfill all our expectations that
we expected we could do while the project
got started. We hope this limitations are
considerable. Some of the project
limitations are:
This application is not suitable for those
organization where there is large quantity
of product and different level of
warehouses.
This software application is able to
generate only simple reports.
Single admin panel is only made.
It is not suitable for large organization

29
I have taken help from following sites:-
1-google.com
2.youtube.com
Book:-
Computer science with python by “sumita
arora”
People:-
1-our computer Science teacher
2-our parents
3-our Friends

30

You might also like