CSC Project Final
CSC Project Final
AISSCE (2024-2025)
ZION INTERNATIONAL PUBLIC SCHOOL
Mappedu, Chennai -600126
BONAFIDE CERTIFICATE
This is to certify that the project titled RESTAURANT BILLING
MANAGEMENT SYSTEM is a Bonafide work done by
______________________________ in partial fulfillment of the requirements in
computer science practical as
prescribed by CBSE for AISSCE 2024-2025
REGISTER NO.
TEACHER-IN-CHARGE PRINCIPAL
Coming to the joyful task of thanking everyone those who contributed to the
completion of this project, I would like to extend my thanks to all of them.
I would like to express my gratitude towards my parents for their kind co-
operation and encouragement which helped me a lot in the completion of this
project. They never stopped believing me and my ability to finish this work.
My special thanks and appreciations also goes to my friends and classmates and
all the people who have willingly helped me out with their abilities.
TABLE OF CONTENTS
S.No Title
1. Abstract
2. Requirement Analysis
3. Design
4. Flowchart
5. Algorithm
6. Source Code
7. Execution Screen Shots
8. Future Enhancements
9. Bibliography
ABSTRACT
Restaurant Billing System Using Python can be very useful within a business
environment. The Restaurant industry is enlarging rapidly and restaurant owners
are keen to improve every section of their business. Though much attention is
paid to digitalizing the restaurant management and the menu, but not many
business owners realize the importance of applying digital billing software in
the restaurant.
Instead of doing manual work for making up a bill at Restaurant, which gets
tiring and time consuming, you can generate a bill including tax and service
charges in just few clicks. When making up a bill manually at a Restaurant may
contain some human errors like adding wrong items into the bill or summing up
their total also may end up wrong, it also sometimes results into a bad
impression towards the Restaurant from a Customer. Ideally, the user should be
able to generate bill without any mistakes and quickly, enabling them to fasten
or improve their process.
When the crowd is vast in the restaurant, it might take you some time to
generate manual bills that may leave your customers unsatisfied. This is where
the automated billing system can be used. It generates digital bills
automatically and allows customers to make quick payments.
The Restaurant Billing System Using Python is very useful to small business or
restaurant or cafe or food truck owners. This helps the owner to fasten the
process which is bug free and easy to use. It also has a calculator to ease the use
of the user. This project firstly has the menu and then adds up the selected items
by customer and sums up the total of all items and adds tax and service charges
and displays total.
To overcome this problem, I have come up with this project, that is, Restaurant
Billing System Using Python.
Requirement Analysis
In order to work out the project proposed, there are few hardware and software
requirements.
(i) Hardware Requirement
Hardware requirements for the billing software.
Hardware Value
CPU 2 cores(Minimum Requirement)
RAM 4 GB
Hard Drive 1 TB
Operation System Any OS which supports Python and
MySQL
As the billing section has to be done at a faster rate, so the system used
should also have better specifications for it to work fast. Hence, it is better to
have a system with minimum specifications as mentioned above with good
network.
(ii) Explanation
As can be seen that initially it asks for the data such as the name of the
customer, his phone number, what he/she ordered. Upon every details being
entered into the billing software, it makes the quick calculation by itself
adding all the extra charges such as the service charges, GST to the cost of
the meals and displays the particulars separately as cost of meals, service
charge, GST and the total cost. Finally, the particulars get stored to the
database of the restaurant and all particulars entered is refreshed.
Flow Chart
i. Project flow:
ii. Program flow:
Algorithm
The algorithm used for coding is described in the above flow chart.
Algorithm: To perform multitasking by adding or deleting item from menu,
introducing a new user, developing a bill and segregating data in MySQL.
1. Define functions
2. Initialize variables
3. Log in:
Login with a valid username and password
If YES
Ask for Admin panel, Customer panel or to Exit
If Admin panel
Ask for modifying the menu or to add a new user
If Customer Panel
Ask for viewing menu or to calculate Bill
If No
Logout and Exit
4. Gather information for storing in
database: If YES
Establish connection between python and MySQL
If NO
Return to main program
5. Ask for any
new order If
YES
Repeat the above steps again
If NO
Logout
Source Code
'''
Restaurant billing system
'''
#importing modules---------------------------------------------------------------------------------------
-----------------------------------------------------------------------------
import mysql.connector
import time
import datetime
import random
if userexist==False: #this will be only execute when user with specified username
doesn't exist
print("\nUser not found Please register or login with different account to
continue")
return admin() #by default returns true because forcefully everyone is registered
print("\n ")
print(" Bill ") print(" ")
print(" Date&Time:",datetime.datetime.now()," ")
print(" ")
print(" BILL ID:",tname," ")
print(" ")
number=1
t_bill=0
for i in bill.keys():
one_tbill=bill[i]*item_list[i] # total amount of one item
print(" ",number,".",i,"\t",bill[i],"x",item_list[i]," = ",one_tbill,"
") t_bill+=one_tbill
number+=1
print(" ")
print(" TOTAL BILL = ",t_bill," ")
print(" Gst 5% = "+"{:.2f}".format((t_bill/100)*5)," ")
print(" Cgst 5% = "+"{:.2f}".format((t_bill/100)*5)," ")
t_bill+=t_bill/10
print(" -------------- ")
print(" Grand Total = ",t_bill," ")
print(" -------------- ")
thank_msg()
main()
return True ## this will be excepted by order_food() function
for i in range(2):
dtcr=input("Is database for today alredy created?(y/n)")
if dtcr=='y':
db=input("Enter todays date:")
#connecting mysql and python
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri')
if con.is_connected():
print(" ")
print("| Connection with MySQL successfully established
|") print(" ")
cur=con.cursor()
cur.execute("show databases")
data=cur.fetchall()
for i in range(len(data)):
data1=str(data[i])
a=str(data1[2:-3])
if db == a:
main()
break
else:
pass
con.close()
print("No database created for today, create a new one")
elif dtcr=='n':
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri')
if con.is_connected():
print(" ")
print("| Connection with MySQL successfully established
|") print(" ")
cur=con.cursor()
db=input("enter db:")
con.close()
main()
#function for creating tables----------------------------------------------------------------------------
-----------------------------------------------------------------------------------------
def tbcreate():
#creating table
global tname
tname1=str(random.randint(1,10000000))
tname2=input("enter customer name:")
tname=tname2+tname1
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri',databa
se=db)
cur=con.cursor()
con.close()
updatetb()
#function for updating the gathered information about the order------------------------------
----------------------------------------------------------------------------------------------------------------
def updatetb():
#updating the values with order information
#connecting mysql and python
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri',databa
se=db)
cur=con.cursor()
for i in (bill.keys()):
quan=bill[i]
ctpit=item_list[i]
ctit=quan*ctpit
cur.execute("insert into {tn}(itemname,quantity,costperitem,cost)
values('{it}',{q},{ci},{c})" .format(tn=tname,it=i,q=quan,ci=ctpit,c=ctit))
con.commit()
con.close()
generate_bill()
#function for retrieving data from already updated tables---------------------------------------
----------------------------------------------------------------------------------------------------------------
def retrieve():
#retrieving data, if needed
print("--------------------DATA RETRIEVAL ")
dbdate=input("enter date of dinein/parcel:")
billid=input("enter Bill ID:")
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri',databa
se=db)
cur=con.cursor()
data=cur.fetchall()
for i in data:
print(i)
con.close()
main()
#---------------------------------------------------------------------------------------------------------------
------------------------------------------------------
def ordercount():
#to sum up the total orders and give the analysis of the total number of orders today
#connecting mysql and python
con=mysql.connector.connect(host='localhost',user='root',password='raam@tri',databa
se=db)
cur=con.cursor()
cur.execute("show tables")
data=cur.fetchall()
for i in data:
print(i)
toor=len(data)
print("Dear Admin User, our restaurant has placed",toor," successful orders today")
con.close()
#---------------------------------------------------------------------------------------------------------------
------------------------------------------------------
print("--------------------BILLING MADE EASY ")
#calling the database creating function for creating a new database or an already
existing database for today
dbcreate()
SCREENSHOTS
New Database creation:
MAIN MENU:
Bill Output:
Connecting already created Database:
Retrieval of data:
Future Enhancements:
In future, this application can be updated with some more food items. Many
other latest features will be added. Project will surely be enhanced with respect
to looks and appearance and also as per user requirements. Many more
functionalities will be added. Some enhancement can also be done with
calculator. For now, this application generates the bill but with respect to future
application it will be enhanced that it will also print a bill. It can also be used on
a large scale. Many more modification can dowith menu or prices or tax as well.
It will be easy to use and bug free to all future or upcoming users. This can also
be enhanced in future as per customer requirements. Many more features can be
added. This will surely help users instead of making a bill manually
Bibliography
1. MySQL 5.7.x Reference Manual
https://dev.mysql.com/doc/refman/5.7/en/
2. Python tutorialspoint
https://www.tutorialspoint.com/python/index.htm