Professional Documents
Culture Documents
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.
_______________ ________________
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.
3
TABLE OF CONTENTS
2. SACKNOWLEDGEMENT 3
3. PREFACE 5
4. INTRODUCTION 7
8. SOURCE CODE 12
9. 23
OUTPUT SCREENS
10. 26
BIBLOGRAPHY
4
PREFACE
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.
6
STORE MANAGEMENT
SYSYTEM
BASED ON SYSTEM DEVELOPMENT LIFE CYCLE: -
7
NEED OF THE PROJECT
(STORE MANGEMENT SYSYTEM
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)
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 | |
+-------+----------+------+-----+---------+----------------+
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 |
+---------+-------+------------+------------+
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
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()
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()
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()
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()
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()
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()
20
if choice==3:
search_bill()
if choice==4:
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
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