Project Synopsis
Project Synopsis
VIDYALAYA
NO-2
PROJECT SYNOPSIS
BIKANER
TOPIC: - STORE MANAGMENT 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
CERTIFICATE
1
THIS IS TO CERTIFY THAT MASTER SHAKTI
SINGH SHEKHAWAT OF CLASS 12TH SCIENCE HAS
COMPLETED HIS COMPUTER SCIENCE PROJECT
UNDER MY SUPERVISION.
_______________ ________________
SUBJECT TEACHER PRINCIPAL SIGN
SIGN
ACKNOWLEDGEMENT
2
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.
TABLE OF CONTENTS
S.NO TITLE PAGE
NO.
3
1. CERTIFICATE 2
2. SACKNOWLEDGEMENT 3
3. PREFACE 5
4. INTRODUCTION 7
8. SOURCE CODE 12
9. 23
OUTPUT SCREENS
10. 26
BIBLOGRAPHY
PREFACE
PYTHON IS A POWERFUL, MODERN, HIGH-LEVEL
PROGRAMMING LANGUAGE. IT IS AN INTERPRETED
LANGUAGE WHOSE EXECUTION RUNS LINE BY LINE.
4
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++
5
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.
STORE MANAGEMENT
SYSYTEM
BASED ON SYSTEM DEVELOPMENT LIFE CYCLE: -
6
NEED OF THE PROJECT
(STORE MANGEMENT SYSYTEM
7
IT ALSO HELPS IN KEEPING THE RECORD AND
MANAGING THE BILLS .IT IS USER FRENDLY
SYSTEM . IT WILL SAVE TIME OF PEPOLES.
8
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
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 | |
+-------+----------+------+-----+---------+----------------+
9
+-----------+----------+------+-----+---------+----------------+
10
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 |
+----+---------+------+---------+
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
def clear():
for _ in range(65):
print()
def last_bill_no():
cursor.execute('select max(bill_id) from bills')
record = cursor.fetchone()
return record
11
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')
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()
12
cursor.execute(sql)
print('\n\nrecord updated
successfully............')
13
print('{:<10d} {:30s}
{:.2f}'.format(row[0],row[1],row[2]))
while true:
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)
print('total payable amount : {}'.format(total))
14
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()
15
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()
16
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():
#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])))
17
print('-'*74)
print('\npress any key to continue....')
wait= input()
18
# 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()
if choice==3:
search_bill()
if choice==4:
break
19
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')
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")
20
OUTPUT
LOGIN
ADD ITEM
BILL
21
SEARCH ITEM
SEARCH CUSTOMER
22
BILL INFORMATION
23
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)
24
THANK YOU
25