Rescued Document
Rescued Document
MANAGEMENT
SYSTEM
- G. VARSHA
XII-D
1
TABLE OF CONTENTS
PAGE
S.NO DESCRIPTION
NO
01 INTRODUCTION 3
03 PROPOSED SYSTEM 4
06 SOURCE CODE 7
07 OUTPUT 14
08 TESTING 19
2
➢ INTRODUCTION
The objective of this project is to let the students apply the programming
knowledge into a real- world situation/problem and exposed the students
how programming skills helps in developing a good software.
3
➢ PROPOSED SYSTEM
Today one cannot afford to rely on the fallible human beings of be really
wants to stand against today’s merciless competition where not to wise saying
“to err is human” no longer valid, it’s outdated to rationalize your mistake. So,
to keep pace with time, to bring about the best result without malfunctioning
and greater efficiency so to replace the unending heaps of flies with a much
sophisticated hard disk of the computer.
One has to use the data management software. Software has been an
ascent in atomization various organizations. Many software products working
are now in markets, which have helped in making the organizations work
easier and efficiently. Data management initially had to maintain a lot of
ledgers and a lot of paper work has to be done but now software product on
this organization has made their work faster and easier. Now only this
software has to be loaded on the computer and work can be done.
This prevents a lot of time and money. The work becomes fully
automated and any information regarding the organization can be obtained by
clicking the button. Moreover, now it’s an age of computers of and automating
such an organization gives the better look.
4
➢ SYSTEM DEVELOPMENT LIFE CYCLE (SDLC)
5
➢ HARDWARE AND SOFTWARE REQUIREMENTS
SOFTWARE REQUIREMENTS:
I. Windows OS
II. Python
6
SOURCE CODE
import pickle
import datetime
def storeitem():
f = open("grocery.dat","ab")
g = {}
icode=int(input("Enter itemcode "))
iname=input("Enter itemname ")
unit=input("Enter unit ")
ucost=int(input("Enter unit cost "))
qty=int(input("Enter quantity "))
brand=input("Enter brand name ")
g["itemcode"] = icode
g["itemname"] = iname
g["unit"] = unit
g["unitcost"] = ucost
g["qty"] = qty
g["brand"] = brand
pickle.dump(g, f)
print("New Grocery item details saved...")
def displayall():
f = open("grocery.dat","rb")
g = {}
7
print("%-10s%-20s%-10s%-10s%-10s%-15s%-
10s"% ("Itemcode","Itemname","Unit","Unitcost","Quantity","Brand")) print("------
-----------------------------------------------------------------------------------")
try:
while True:
g = pickle.load(f)
print("%-10d%-20s%-10s%-10d%-10d%-15s%-
10s"%(g["itemcode"],g["itemname"],g["unit"],g["unitcost"],g["qty"],g["brand"],g
["category"]))
print("------------------------------------------------------------------------------------")
except EOFError:
f.close()
def edititem():
f = open("grocery3.dat","rb+")
g = {}
sitemcode = int(input("Enter search itemcode "))
flag=0
try:
while True:
cpos = f.tell()#the position of the record
g = pickle.load(f)
if sitemcode == g["itemcode"]:
print("Itemcode exist..")
flag=1
break
except EOFError:
print("In except")
f.close()
8
if flag==0:
print("Itemcode does not exist...")
else:
ans=input("Do you want to change quantity / cost of item y/n ?")
if ans=='y':
x = input("Do you want to change quantity y/n? ")
if x=='y':
newqty = int(input("Enter new quantity "))
g["qty"] = g["qty"] + newqty
a = input("Do you want to change cost y/n? ")
if a=='y':
newcost = int(input("Enter new cost "))
g["unitcost"] = newcost
f.seek(cpos)
pickle.dump(g,f)
f.close()
def reports():
f=open("gsale.dat","rb")
g={}
cost=0
print('===========================')
print('daily grocessary reports:')
print('===========================')
print("%-10s%-20s%-10s%-10s"%("itemcode","itemname","qty","cost"))
try:
while True:
g=pickle.load(f)
9
print("%-10d%-20s%-10d%-
10s"%(g["itemcode"],g["itemname"],g["qty"],g["cost"]))
print('---------------------------------------------------------------------------------------
-')
except EOFError:
f.close()
def orderentry():
x=datetime.datetime.now()
sdate=str(x.day)+"/"+str(x.month)+"/"+str(x.year)
cmobile=input("Enter mobile number ")
ans='y'
myorder=[]
while ans=='y':
itemcode=int(input("Enter itemcode "))
qty=int(input("Enter sale quantity "))
f=open("grocery3.dat","rb")
g={}
cost=0
try:
while True:
g=pickle.load(f)
if g["itemcode"]==itemcode:
iname=g["itemname"]
cost=g["unitcost"]
except EOFError:
f.close()
o=[itemcode, iname, qty, cost]
myorder.append(o)
10
#print(myorder)
ans=input("Add another item y/n? ")
print("%60s"%"********************************")
print("%45s"%"Bill")
print("%60s"%"********************************")
print("%-10s%-20s%-10s%-20s%-20s"%("Itemcode","Itemname","Qty
sold","Unitcost","Amount"))
print("--------------------------------------------------------------------------------")
total=0
for x in myorder:
print("%-10d%-20s%-10d%-20d%-20d"%(x[0],x[1],x[2],x[3],x[2]*x[3]))
total = total + x[2] * x[3]
print("---------------------------------------------------------------------------------")
print("%15s%49d"%("Total amount ",total))
print("---------------------------------------------------------------------------------")
#updating stock
for x in myorder:
f=open("grocery3.dat","rb+")
try:
while True:
cpos = f.tell()
g=pickle.load(f)
if g["itemcode"]==x[0]:
g["qty"] = g["qty"] - x[2]
break
except EOFError:
f.close()
f.seek(cpos)
pickle.dump(g,f)
11
f.close()
#storing sales data
f1=open("gsale.dat","ab")
c={}
for x in myorder:
c["mobile"]= cmobile
c["sdate"]= sdate
c["itemcode"]=x[0]
c["itemname"]=x[1]
c["qty"]=x[2]
c["cost"]=x[3]
pickle.dump(c,f1)
f1.close()
while True:
print("%60s"%"********************************")
print("%57s"%"Grocery Shop Point of Sale")
print("%60s"%"********************************")
print("1.Manage Grocery Items ")
print("2.Sell Grocery Items ")
print("3.Display sales Report ")
print("4.Exit")
choice = int(input("Enter your choice 1/2/3/4 ? "))
if choice==1:
print("%60s"%"********************************")
print("%57s"%"Manage Grocery Items")
print("%60s"%"********************************")
while True:
12
print("1.Store new grocery item ")
print("2.Display all grocery items ")
print("3.Edit grocery item ")
print("4.Exit")
ch = int(input("Enter your choice 1/2/3/4 "))
if ch==1:
storeitem()
elif ch==2:
displayall()
elif ch==3:
edititem()
elif ch==4:
break
elif choice==2:
orderentry()
elif choice==3:
reports()
elif choice==4:
break
13
OUTPUT
MAIN SCREEN
14
STORE NEW GROCERY ITEM
15
EDIT GROCERY ITEM
EXIT
16
SELL GROCERY ITEMS
17
DISPLAY SALES REPORT
FINAL EXIT
18
TESTING
19
REFERENCES & BIBLIOGRAPHY
3. Website: https://www.w3resource.com
a. python.org
b. Code Academy
c. tutorialsPoint.com
d. PythonChallenge.com
e. Google’s Python Class
f. LearnPython.org
g. GreeksforGreeks
20