You are on page 1of 27

PROJECT SYNOPSIS

TOPIC: - STORE MANGMENT SYSTEM


NAME (SUBMITTED BY): - SHAKTI SINGH
SHEKHAWAT
CLASS: - XII- ‘A’
ROLL NO:-
SUBJECT: - COMPUTER SCIENCE CODE-083
EXAM- AISSCE 2022-23(CBSE)

SUBMITTED TO: -
MR. ADARSH BHATNAGAR

1
CERTIFICATE
THIS IS TO CERTIFY THAT MASTER SHAKTI SINGH
SHEKHAWAT OF CLASS 12TH SCIENCE HAS
COMPLETED HIS COMPUTER SCIENCE PROJECT
UNDER MY SUPERVISION.

HE HAS TAKEN PROPOER CARE AND SHOWN ATMOST


AINCERITY IN THE COMPLETION OF THIS
PROJECT.

I CERTIFY THAT THIS IS UPTO MY EXPECTATIOS


AND AS PER THE GUIDE LINES ISSUED BY
C.B.S.E

_______________ ________________
SUBJECT TEACHER PRINCIPAL SIGN
SIGN

2
ACKNOWLEDGEMENT
THE SUCCESS OF ANY PROJECT IS ALL ABOUT TEAM -
WORK WHICH INVOLVES PARTICIPATION, ENCOURAGEMENT
AND GUIDELINES OF MANY OTHERS.
I TAKE THIS OPPORTUNITY TO EXPRESS MY GRATITUDE
TO OUR DYNAMIC PRINCIPAL MR. UMED SINGH FOR HER
CONSTANT ENCOURAGEMENT TO WORK HARD TO
SUCCESSFULLY COMPLETE OUR PROJECTS AND
ASSIGNMENTS.
MY SINCERE THANKS TO MY COMPUTER SCIENCE TEACHER
MR. ADDARSH BHTNAGAR WHO GUIDED ME IN SOLVING
PROBLEMS ENCOUNTERED, EVERY TIME CORRECTED ME
WHEN I WAS WRONG, I LEARN A LOT FROM HIM AND HE
CRITICALLY REVIEWED MY PROJECT TO MAKE IT A
SUCCESS.
I ALSO WISH TO THANK MY SCHOOL TEACHERS, FAMILY
AND FRIENDS FOR THEIR SUPPORT WHILE I WAS WORKING
ON THE PROJECT.

SUBJECT TEACHER SIGN

3
TABLE OF CONTENTS

S.NO TITLE PAGE


NO.
1. CERTIFICATE 2

2. SACKNOWLEDGEMENT 3

3. PREFACE 5

4. INTRODUCTION 7

5. NEED OF THE PROJECT 8

6. HARDWARE AND SOFTWARE 9


REQUIREMENTS.
INSTALING GUIDE LINES
7. DATABASES 10

8. SOURCE CODE 12

9. 23
OUTPUT SCREENS

10. 26
BIBLOGRAPHY

4
PREFACE

PYTHON IS A POWERFUL, MODERN, HIGH-LEVEL


PROGRAMMING LANGUAGE. IT IS AN INTERPRETED
LANGUAGE WHOSE EXECUTION RUNS LINE BY LINE.

PYTHON IS A FREE AND OPEN-SOURCE SOFTWARE WHICH


ANYONE CAN DOWNLOAD FROM THE WEBSITE
WWW.PYTHON.ORG, EVEN IT IS EASIER TO UNDERSTAND
AND APPLY THAN OTHER COMPLICATED LANGUAGES LIKE
C++

IT WAS DEVELOPED BY GUIDO VAN ROSSUM IN THE LATE


1980S, IN THE NETHERLANDS AS THE SUCCESSOR TO
ABC PROGRAMMING LANGUAGE.
IT IS DYNAMICALLY TYPED AND HAS A LARGE AND
STANDARD LIBRARY.

IT TAKES LESS TIME TO DEVELOP AS PYTHON PROGRAMS


ARE TYPICALLY 3-5 TIMES SHORTER THAN EQUIVALENT
JAVA PROGRAMS. THIS IS BECAUSE OF ITS BUILT-IN
HIGH-LEVEL DATA TYPES AND ITS DYNAMIC TYPING.

5
IT SUPPORTS GUI (GRAPHICAL USER INTERFACE) AND
GARBAGE COLLECTION (BETTER MEMORY MANAGEMENT).
IT IS EASILY COMPATIBLE WITH OTHER LANGUAGES
LIKE: C++, CORE JAVA ETC.

IT IS PLATFORM-INDEPENDENT AND CAN RUN ACROSS


DIFFERENT PLATFORMS LIKE WINDOWS, LINUX/UNIX,
MAC OS X AND OTHER OPERATING SYSTEMS.
PYTHON PROGRAMS ARE CLEAR, SIMPLE, CONCISE AND
ENGLISH-LIKE INSTRUCTIONS THAT ARE EASY TO READ
AND UNDERSTAND EVEN BY NON-PROGRAMMERS OR PEOPLE
WITH NO SUBSTANTIAL PROGRAMMING BACKGROUND.

6
STORE MANAGEMENT
SYSYTEM
BASED ON SYSTEM DEVELOPMENT LIFE CYCLE: -

7
NEED OF THE PROJECT
(STORE MANGEMENT SYSYTEM

AS WE GO DAILY OR WEAKLY TO PURCHASE


ITEMS OR THINGS FOR US FROM MARKET OR
SHOP WHICH TAKES TOO MUCH TIMES DUE TO
THE SHOPKEEPERS SPEED OF WRITING AND
MAKING BILLS AND SOME TIMES CALUCULATION
ERRORS ARE THERE IN THE BILL.

TO OVERCOME THE PROBLEM THE STORE


MANAGEMENT SYSTEM BASES ON DIGITAL
PLATFORMS LIKE PYTHON AND SQL HEPLS US TO
GENRATE BILL FASTER AND CALUCLATE AMOUNT.

IT ALSO HELPS IN KEEPING THE RECORD AND


MANAGING THE BILLS .IT IS USER FRENDLY
SYSTEM . IT WILL SAVE TIME OF PEPOLES.

8
HARDWARE AND SOFTWARE
SPECIFICATIONS:
*HARDWARE-
RAM-4GB OR MORE, CPU- INTEL CORE I3 OR ABOVE /
AMD RYZEN 3 OR ABOVE.
*SOFTWARE-
WINDOWS 7 OR ABOVE OPERATING SYSTEM, PYTHON 3.X,
MY SQL.
THE FOLLOWING LIBRARIES HAVE BEEN ADDED IN THE
PYTHON 3.X INSTALLATION-
MYSQL. CONNECTOR (FOR PYTHON-MY SQL
CONNECTIVITY)

INSTALLING THE PROGRAM


 COPY THE SOURCE CODE FILES AND PYTHON FILES
FROM DRIVE

 RESTORE THE SQL FILE INTO THE PC BY MY SQL


RESTORE COMMAND

 MAKE CHANGES IN USSER NAME AND PASSWORD IN


THE PYTHON CODE AS IT VARYS SYSTEM TO SYSTEM.

 NOW RUN THE PYTHON MODULE AND A CMD WINDOW


WILL OPEN NOW THE SYSTEM WINDOW IS FRON OF
YOU WITH THE OPTIONS WHAT DO YOU WANT TO DO.

 GO THROUGH THE OPTINS TO RUN PROGRAMS

9
DATABASE
(SHAKTI)
MYSQL> DESC LOGIN;
+-------+----------+------+-----+---------+----------------+
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
+-------+----------+------+-----+---------+----------------+
| ID | INT(11) | NO | PRI | NULL | AUTO_INCREMENT |
| NAME | CHAR(30) | YES | | NULL | |
| PWD | CHAR(30) | YES | | NULL | |
+-------+----------+------+-----+---------+----------------+

MYSQL> DESC ITEMS;


+-----------+------------+------+-----+---------+----------------+
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
+-----------+------------+------+-----+---------+----------------+
| ID | INT(11) | NO | PRI | NULL | AUTO_INCREMENT |
| ITEM_NAME | CHAR(30) | YES | | NULL | |
| PRICE | FLOAT(8,2) | YES | | NULL | |
+-----------+------------+------+-----+---------+----------------+

MYSQL> DESC BILLS;


+-----------+----------+------+-----+---------+----------------+
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
+-----------+----------+------+-----+---------+----------------+
| BILL_ID | INT(11) | NO | PRI | NULL | AUTO_INCREMENT |
| NAME | CHAR(30) | YES | | NULL | |
| PHONE | CHAR(15) | YES | | NULL | |
| BILL_DATE | DATE | YES | | NULL | |
+-----------+----------+------+-----+---------+----------------+

MYSQL> DESC TRANSACTION;


+---------+---------+------+-----+---------+----------------+
| FIELD | TYPE | NULL | KEY | DEFAULT | EXTRA |
+---------+---------+------+-----+---------+----------------+
| ID | INT(11) | NO | PRI | NULL | AUTO_INCREMENT |
| ITEM_ID | INT(11) | YES | | NULL | |
| QTY | INT(11) | YES | | NULL | |
| BILL_ID | INT(11) | YES | | NULL | |
+---------+---------+------+-----+---------+----------------+
MYSQL> SELECT * FROM LOGIN;
+----+--------+-------+
| ID | NAME | PWD |
+----+--------+-------+
| 1 | SHAKTI | 123456|
+----+--------+-------+

10
MYSQL> SELECT * FROM ITEMS;
+----+------------------------+---------+
| ID | ITEM_NAME | PRICE |
+----+------------------------+---------+
| 1 | PARLE-G | 10.00 |
| 2 | COCA_COLA_2L | 95.00 |
| 3 | LAYS | 20.00 |
| 4 | FIVE_STAR | 20.00 |
| 5 | NOTE_BOOK | 30.00 |
| 6 | NOTE_BOOK 180 PAGES | 70.00 |
| 7 | PENTONIC BLUE BALL | 10.00 |
| 8 | PENTONIC BLACK BALL | 10.00 |
| 9 | PILOT V5 | 70.00 |
| 10 | FAN | 1350.00 |
| 11 | GEOMETRY BOX | 150.00 |
| 12 | LED 30W | 200.00 |
| 13 | BAG AMERICAN TOURISTER | 2000.00 |
| 14 | TAPE SMALL | 10.00 |
| 15 | TAPE BIG | 50.00 |
+----+------------------------+---------+
MYSQL> SELECT * FROM BILLS;
+---------+-------+------------+------------+
| BILL_ID | NAME | PHONE | BILL_DATE |
+---------+-------+------------+------------+
| 1 | AYUSH | 7792013379 | 2022-11-13 |
+---------+-------+------------+------------+

MYSQL> SELECT * FROM TRANSACTION;


+----+---------+------+---------+
| ID | ITEM_ID | QTY | BILL_ID |
+----+---------+------+---------+
| 1 | 2 | 1 | 1 |
| 2 | 4 | 2 | 1 |
| 3 | 8 | 1 | 1 |
| 4 | 3 | 2 | 1 |
| 5 | 14 | 2 | 1 |
+----+---------+------+---------+

11
SOURCE CODE
# project name : billing system
# made by : shakti singh
# class : 12 science
# school : kendriya vidyalaya no-2
bikaner
import mysql.connector as connector
from datetime import date

global conn, cursor


conn=
connector.connect(host="localhost",database="shakti",
user="root",password="123456")
cursor = conn.cursor()

def clear():
for _ in range(65):
print()

def last_bill_no():
cursor.execute('select max(bill_id) from bills')
record = cursor.fetchone()
return record

def find_item(no):
cursor.execute('select * from items where id
={}'.format(no))
record = cursor.fetchone()
return record

def add_item():
#clear()
print('add new item - screen')

12
print('-'*74)
item_name = input('enter new item name :')
item_price = input('enter item price :')
sql = 'select * from items where item_name like
"%{}%"'.format(item_name)
cursor.execute(sql)
record=cursor.fetchone()
if record==none:
sql = 'insert into items(item_name,price)
values("{}",{});'.format(item_name,item_price)
cursor.execute(sql)
print('\n\nnew item added
successfully.....\npress any key to continue....')
else:
print('\n\nitem name already
exist.....\npress any key to continue....')
wait= input()

# function name : modify_item


# purpose : change item details in
items table
def modify_item():
#clear()
print('modify item details - screen')
print('-'*74)
item_id = input('enter item id :')
item_name = input('enter new item name :')
item_price = input('enter item price :')
sql = 'update items set item_name = "{}", price
={} where id={}'.format(item_id,item_name,item_price)
cursor.execute(sql)
print('\n\nrecord updated
successfully............')

# function name : item_list


# purpose : to display all the
items in items tables

13
def item_list():
#clear()
sql="select * from items"
cursor.execute(sql)
records = cursor.fetchall()
for row in records:
print(row)
print('\npress any key to continue.....')
wait = input()

# function name : billing


# purpose : to generate bills
def billing():
#clear()
items =[]
bill_no = last_bill_no()
if bill_no[0]==none:
bill_no =1
else:
bill_no = bill_no[0]+1

name = input('enter customer name :')


phone = input('enter phone no :')
today = date.today()
item_name =input('enter item name :')
sql ='select * from items where item_name like
"%{}%";'.format(item_name)
cursor.execute(sql)
records = cursor.fetchall()

print('item names start with :',item_name)


print('-'*74)
print('{:10s} {:30s} {:20s}'.format('item
id','item name','item price'))
print('-'*74)
for row in records:
print('{:<10d} {:30s}
{:.2f}'.format(row[0],row[1],row[2]))
while true:

14
no = int(input('enter item no (0 to stop)
:'))
if no <=0:
break
else:
item = find_item(no)
if item==none:
print('item not found ')
else:
qty = int(input('enter item qty :'))
item = list(item)
item.append(qty)
items.append(item)

clear()
print('----------------------shree ram
departmental store------------------------')
print('----------------------rani bazar
bikaner,rajasthan------------------------')
print('phone: 9460686690-------------------------
--email: shaktidesktop@gmail.com')
print('bill no :{} date
:{}'.format(bill_no,today))
print('-'*74)
print('customer name :{} phone no
:{}'.format(name,phone))
print('-'*74)
print('item id item name price
qty amount ')
print('-'*74)
total =0
for item in items:
print('{:<10d} {:25s} {:.2f} {:>10d}
{:>.2f} \

'.format(item[0],item[1],item[2],item[3],item[2]*item
[3]))
total = total +item[2]*item[3]
print('-'*74)

15
print('total payable amount : {}'.format(total))
print('\npress any key to continue........')
#insert data into tables
sql ='insert into bills(name,phone,bill_date)
values("{}","{}","{}");'.format(name,phone,today)
cursor.execute(sql)
for item in items:
sql='insert into
transaction(item_id,qty,bill_id)
values({},{},{});'.format(item[0],item[3],bill_no)
cursor.execute(sql)
wait= input()

# function : date_wise_sell
# purpose : create a report on date wise sell
or sell between two dates
def date_wise_sale():
#clear()
print('sale of the date -- screen')
print('-'*74)
sale_date = input('enter sale date (yyyy-mm-dd)
:')
sql = 'select * from bills where
bill_date'.format(sale_date)
cursor.execute(sql)
records = cursor.fetchall()
#clear()
print('bill no customer name phone
no bill date')
print('-'*74)
for row in records:
print('{:10d} {:30s} {:20s}
{}'.format(row[0],row[1],row[2],row[3]))
print('-'*74)
print('\n\npress any key to continue....')
wait= input()

# function name : bill information


# purpose : display details of any bill

16
def bill_information():
#clear()
bill_no = input('enter bill number :')
sql = 'select
b.bill_id,b.name,b.phone,b.bill_date,t.item_id,t.qty,
i.item_name,i.price from bills b,transaction t,items
i \
where b.bill_id = t.bill_id and t.item_id=
i.id and \
b.bill_id ={};'.format(bill_no)
cursor.execute(sql)
records = cursor.fetchall()
n = cursor.rowcount
#clear()
print("bill no :",bill_no)
print('-'*74)
if n<=0:
print('bill number {} does not
exists'.format(bill_no))
else:
print('customer name : {} phone no
:{}'.format(records[0][1],records[0][2]))
print('bill date : {}'.format(records[0][3]))
print('-'*74)
print('{:10s} {:30s} {:20s} {:10s}
{:30s}'.format('id','item
name','qty','price','amount'))
print('-'*74)
for row in records:
print('{:<10d} {:30s} {:<20d} {:.2f}
{:>.2f}'.format(row[4],row[6],row[5],row[7],row[5]*ro
w[7]))
print('-'*74)
print('\npress any key to continue....')
wait = input()

# function name : amount_collected


# purpose : function to display amount
collected between two dates

17
def amount_collected():
#clear()
start_date = input('enter start date (yyyy-mm-dd)
:')
#clear()
print('amount collected '.format(start_date))
print('-'*74)
sql = 'select sum(t.qty*i.price) from bills
b,transaction t,items i \
where b.bill_date '.format(start_date)
cursor.execute(sql)
result = cursor.fetchone()
print(result)
print('\npress any key to continue.....')
wait= input()

def search_item():
#clear()
item_name =input('enter item name :')
sql ='select * from items where item_name like
"%{}%";'.format(item_name)
cursor.execute(sql)
records = cursor.fetchall()
#clear()
print('item names start with :',item_name)
print('-'*74)
print('{:10s} {:30s} {:20s}'.format('item
id','item name','item price'))
print('-'*74)
for row in records:
print('{:<10d} {:30s}
{:.2f}'.format(row[0],row[1],row[2]))
print('-'*74)
print('\npress any key to continue....')
wait= input()

def search_customer():

18
#clear()
cust_name =input('enter customer name :')
sql ='select * from bills where name like
"%{}%";'.format(cust_name)
cursor.execute(sql)
records = cursor.fetchall()
#clear()
print('customer names started with :',cust_name)
print('-'*74)
print('{:10s} {:30s} {:20s} {:20s}'.format('bill
no','customer name','phone no','bill date'))
print('-'*74)
for row in records:
print('{:<10d} {:30s} {:20s}
{:20s}'.format(row[0],row[1],row[2],str(row[3])))
print('-'*74)
print('\npress any key to continue....')
wait= input()

# function name : search_bill


# purpose : function to find out bill
information
def search_bill():
#clear()
bill_no = input('enter bill number :')
sql = 'select
b.bill_id,b.name,b.phone,b.bill_date,t.item_id,t.qty,
i.item_name,i.price from bills b,transaction t,items
i \
where b.bill_id = t.bill_id and t.item_id=
i.id and \
b.bill_id ={};'.format(bill_no)
cursor.execute(sql)
records = cursor.fetchall()
n = cursor.rowcount
#clear()
print("bill no :",bill_no)
print('-'*74)

19
if n<=0:
print('bill number {} does not
exists'.format(bill_no))
else:
print('customer name : {} phone no
:{}'.format(records[0][1],records[0][2]))
print('bill date : {}'.format(records[0][3]))
print('-'*74)
print('{:10s} {:30s} {:20s} {:10s}
{:30s}'.format('id','item
name','qty','price','amount'))
print('-'*74)
for row in records:
print('{:<10d} {:30s} {:<20d} {:.2f}
{:>.2f}'.format(row[4],row[6],row[5],row[7],row[5]*ro
w[7]))
print('-'*74)
print('\npress any key to continue....')
wait = input()

# function name : search_menu


# purpose : display search menu on the
screen
def search_menu():
while true:
#clear()
print(' s e a r c h m e n u ')
print('-'*74)
print('1. item name')
print('2. customer information')
print('3. bill information')
print('4. back to main menu')
choice = int(input('\n\nenter your choice
(1..4): '))
if choice==1:
search_item()
if choice==2:
search_customer()

20
if choice==3:
search_bill()
if choice==4:
break

# function name : report_menu


# purpose : display report menu on the
screen
def report_menu():
while true:
#clear()
print(' r e p o r t m e n u ')
print('-'*74)
print('1. item list')
print('2. sale of day')
print('3. bill information')
print('4. amount collected')
print('5. back to main menu')
choice = int(input('\n\nenter your choice
(1..5): '))
if choice==1:
item_list()
if choice==2:
date_wise_sale()
if choice==3:
bill_information()
if choice==4:
amount_collected()
if choice==5:
break

def main_menu():
while true:
#clear()
print(' m a i n m e n u')
print('-'*74)
print('1. add new item')

21
print('2. modify existing item')
print('3. billing')
print('4. search menu')
print('5. report menu')
print('6. exit')
choice = int(input('\n\nenter your choice
(1..6): '))
if choice==1:
add_item()
if choice==2:
modify_item()
if choice==3:
billing()
if choice==4:
search_menu()
if choice==5:
report_menu()
if choice==6:
break
u=input("enter username")
p=input("enter password")
if p=="123456":
print("-----------------welcome to shree ram
departmental store------------------ ")
sql ='insert into login(name,pwd)
values("{}","{}");'.format(u,p)
cursor.execute(sql)
main_menu()
else :
print("wrong password")

22
OUTPUT
 LOGIN

 ADD ITEM

 BILL

23
 SEARCH ITEM

 SEARCH CUSTOMER

 SALE OF THE DAY

24
 BILL INFORMATION

25
BIBLIOGRAPHY
WEBSITES:-

 WWW.COMPUTERSCIENCE.ORG
 CBSETODAY.COM
 GOOGLE.COM

BOOKS:-
 COMPUTER SCIENCE WITH PYTHON CLASS 12
(PREETI ARORA)
 COMPUTER SCIENCE WITH PYTHON CLASS 12
(SUMITA ARORA)

26
THANK YOU

27

You might also like