Report
Report
Report
INDUSTRIAL TRAINING
(SUMMER TRAINING)
SUBMITTED BY:
SURBHI RAJPAL (UE168108)
DEPARTMENT OF
INFORMATION TECHNOLOGY
CANDIDATE’S DECLARATION
I hereby certify that the work presented in the project entitled
RESTAURANT BILLING SYSTEM as per the requirement of
the subject summer training for the award of the degree
bachelor of engineering in information technology, University
Institute Of Engineering And Technology, Panjab University
Chandigarh is an authentic record of my own work carried out
under the mentors of Acadview,Chandigarh .
Date:
Place: Chandigarh
SURBHI RAJPAL
UE168108
Chandigarh
Acknowledgement
This major project would not have been possible without
the valuable assistance of many people to whom I am
indebted, in particular, my mentor of
Acadview,Chandigarh.
1. Introduction.…………………………………………………1
1.1. The Python Language.……………………………………..1
1.2. The Workflow.…………………………………………………2
2. Restaurant Billing System.……………………………..3
2.1. Objective.…………………………………………………………3
2.2. Components of Application.……………………………..3
2.3. Scenario.…………………………………………………………10
3. System Development.…………………………………..12
3.1. Welcome Window.………………………………………….12
3.2. Login Form.……………………………………………………..12
3.3. Main Window.…………………………………………………14
3.4. Price List Window.…………………………………………..15
3.5. Generated Bill.………………………………………………..15
3.6. Database Table.………………………………………………16
4. Conclusion.…………………………………………………..17
5. Drawbacks.…………………………………………………..18
6. References.…………………………………………………..19
CHAPTER-1
INTRODUCTION
1.1. The Python Language
Python Strength:
1
re-program the plotting of a curve, a Fourier transform or a fitting algorithm.
Don’t reinvent the wheel!
Easy to learn Most scientists are not payed as programmers, neither have
they been trained so. They need to be able to draw a curve, smooth a signal,
do a Fourier transform in a few minutes.
Easy communication To keep code alive within a lab or a company it should
be as readable as a book by collaborators, students, or maybe customers.
Python syntax is simple, avoiding strange symbols or lengthy routine
specifications that would divert the reader from mathematical or scientific
understanding of the code.
Efficient code Python numerical modules are computationally efficient. But
needless to say that a very fast code becomes useless if too much time is
spent writing it. Python aims for quick development times and quick
execution times.
Universal Python is a language used for many different problems. Learning
Python avoids learning a new software for each new problem.
2
CHAPTER-2
RESTAURANT BILLING SYSTEM
2.1. Objective
Restaurant billing system is very much needed.It is found that the billing system and
maintenance of records of the cashier is done manually using a file based method in
some restaurants. Therefore we gave our attention to avoid this weakness by
building a computerized system to replace the file based system that will help the
restaurant to give a more efficient ,effective,productive service to the customer.It
reduces a lot of hardwork and complexity. Nowadays restaurant are filled with
people so it’s very difficult to manage all the work manually. That’s why these kind of
softwares are required.
Main objective was to develop a computerized system to store and retrieve billing
records of customers. To computerize the file based system I designed a system
which enables easy access to billing records and restaurant records etc..This
application is built in Python to maintain the orders and calculate the prices of
orders at the restaurant. It allows a user to calculate the price, subtotal, taxes and
total amount of the order by managing the quantities and prices of the the items.A
special feature of this system is the login method which requires a username and a
password which increases the security of the stored data. Through out the system
we gave special attention to build interfaces that are user friendly which will make
our system a successful one.
Tkinter - Tkinter is the standard GUI library for Python. Python when
combined with Tkinter provides a fast and easy way to create GUI
applications. Tkinter provides a powerful object-oriented interface to the Tk
GUI toolkit.
3
create a Connection object that represents the database. Here the data will
be stored in the example.db file:
import sqlite3
conn = sqlite3.connect('example.db')
PIL - Python Imaging Library (abbreviated as PIL) (in newer versions known as
Pillow) is a free library for the Python programming language that adds
support for opening, manipulating,and saving many different image file
formats. It is available for Windows, Mac OS X and Linux.
Importing tkinter is same as importing any other module in the python code. Note
that the name of the module in Python 2.x is ‘Tkinter’ and in Python 3.x is ‘tkinter’.
import tkinter
There are two main methods used you the user need to remember while creating
the Python application with GUI.
Tk(screenName=None, baseName=None, className=’Tk’, useTk=1): To
create a main window, tkinter offers a method
‘Tk(screenName=None, baseName=None, className=’Tk’, useTk=1)’. To
4
change the name of the window, you can change the className to the
desired one. The basic code used to create the main window of the
application is:
m=tkinter.Tk() where m is the name of the main window object or
m=Tk()
Tkinter also offers access to the geometric configuration of the widgets which can
organize the widgets in the parent windows. There are mainly three geometry
manager classes class.
pack() method:It organizes the widgets in blocks before placing in the parent
widget.
grid() method:It organizes the widgets in grid (table-like structure) before
placing in the parent widget.
place() method:It organizes the widgets by placing them on specific positions
directed by the programmer.
There are a number of widgets used in this tkinter application. Some of the major
widgets are explained below:
1. Button:
5
command: to call a function.
font: to set the font on the button label.
image: to set the image on the button.
width: to set the width of the button.
height: to set the height of the button.
import tkinter as tk
r = tk.Tk()
r.title('Counting Seconds')
button = tk.Button(r, text='Stop', width=25,
command=r.destroy)
button.pack()
r.mainloop()
Output:
2. Entry:
It is used to input the single line text entry from the user.For multi-line text input,
Text widget is used.
6
from tkinter import *
master = Tk()
Label(master, text='First
Name').grid(row=0)
Label(master, text='Last
Name').grid(row=1)
e1 = Entry(master)
e2 = Entry(master)
e1.grid(row=0, column=1)
e2.grid(row=1, column=1)
mainloop()
Output:
3. Frame:
It acts as a container to hold the widgets. It is used for grouping and organizing the
widgets.
There are number of options which are used to change the format of the widget.
Number of options can be passed as parameters separated by commas. Some of
them are listed below.
highlightcolor: To set the color of the focus highlight when widget has to be
focused.
bd: to set the border width in pixels.
bg: to set the normal background color.
cursor: to set the cursor used.
width: to set the width of the widget.
height: to set the height of the widget.
7
from tkinter import *
root = Tk()
frame = Frame(root)
frame.pack()
bottomframe = Frame(root)
bottomframe.pack( side = BOTTOM )
redbutton = Button(frame, text = 'Red', fg ='red')
redbutton.pack( side = LEFT)
greenbutton = Button(frame, text = 'Brown', fg='brown')
greenbutton.pack( side = LEFT )
bluebutton = Button(frame, text ='Blue', fg ='blue')
bluebutton.pack( side = LEFT )
blackbutton = Button(bottomframe, text ='Black', fg='black')
blackbutton.pack( side = BOTTOM)
root.mainloop()
Output:
4. Label:
It refers to the display box where you can put any text or image which can be
updated any time as per the code.
8
from tkinter import *
root = Tk()
w = Label(root, text='GeeksForGeeks.org!')
w.pack()
root.mainloop()
Output:
5. tkMessageBox :
Parameters
FunctionName − This is the name of the appropriate message box function.
title − This is the text to be displayed in the title bar of a message box.
message − This is the text to be displayed as a message.
options − options are alternative choices that you may use to tailor a
standard message box. Some of the options that you can use are default and
parent. The default option is used to specify the default button, such as
ABORT, RETRY, or IGNORE in the message box. The parent option is used to
specify the window on top of which the message box is to be displayed.
9
Output:
The program has a prespecified menu with their prices . The user specifies the number
of portions he like to order and the backend calculates the total price including the
service charges and tax.The service charges and tax rates are to be specified by the
programmer.
Workflow:
2.3. Scenario
The newly designed and developed computerized system to be implemented in the
restaurant consists of about four interfaces created with the help of tkinter(A python
library). Firstly there is a Welcome Form. In it There are two buttons, one is to login
and the other is to cancel. Once you login then you go into the second interface
which is the login form. In the login form you have to enter your username and
password to proceed forward. Once you enter the correct username and password
you go to the main window. In the main form there are five buttons.
10
Price List -Clicking this button will give you price list of menu offered.
Total Amount - Clicking this button will calculate total amount to be paid by
customer.
Reset - Clicking this button will reset all quantities offered by user and give
zero default value to them.
Exit - Clicking this button will close the application window.
Generate Bill - Clicking this button will generate the bill of current order.
With these five buttons there are fourteen labels of order,menu and payments and
fourteen entries boxes out of which order no,cost,service charge,tax,subtotal,total is
disabled. In enabled entries,user is required to fill the quantity of food ordered.The
order record is connected to the database.
11
CHAPTER - 3
SYSTEM DEVELOPMENT
12
In this Login Window, you have to enter correct username and password to login. I
have linked three usernames and passwords for login with database. Currently only
these username and password will help you to login. I will definitely work for sign up
where user can enter his/her own username and password and link it to database in
my further version. Username and password linked with this application is as
follows:
Username1 - admin
Password1 - admin123
Username2 - surbhi
Password2 - surbhi123
Username3 - rollno
Password3 - ue168108
13
Clicking login with incorrect information will clear both username and password and
show error as follows:
This main window displays current system date and time on top. User has to enter
quantities required for food item and click total amount button for getting total
amount and simultaneously saving it in database with a pop-up message box.
14
3.4. Price List Window
Clicking on price list button will open this price list window. This price list displays
prices of menu offered.This program has a prespecified menu with their prices.
Clicking on generate bill button in main window generates bill in text document.
15
Clicking on total amount button in main window will create a database table if not
created in the same folder with “bills.db” name and extension. In this database
created order number is primary key and will never be null and autoincrement after
every insertion.
16
CHAPTER - 4
CONCLUSION
This training and project work made coding much easier than what it was before for
me. Python is a programming language used almost everywhere to build the most
common applications that we use today like, YouTube. I am able to create a
computerized system for restaurant billing system. This system able to store billing
records securely and access to them whenever required.
Problems faced by the existing system are:
Inconsistency
Low speed to data access
Time wastage
Poor performance
Lack maintainability
Non efficient representation of data.
Requires a large storage space
The scope of my project in building a computerized system is handling restaurant
records storing of restaurant records and enabling to view the records when desired.
The employees are given limited access in the system in order to safe guard the
privacy and security of the records.
Advantages of the new system are:
Fast storage and retrieval of data.
Increased accuracy of data.
User friendly interfaces.
Reduce human energy.
Reduce time waste.
Increased privacy due to security.
Reduce storage space.
Prevent data loss by backups stored in several locations.
High efficiency through out the system.
Increase the productivity of the company.
Requirement of the project
Hardware requirement - Here is the recommended hardware requirement
for this software to run efficiently.
1) Intel core i3 or higher processor
2) 10 MB RAM
3) 15 MB free hard disc space
4) SVGA monitors / Laptops
Software requirement - This software comes under application software. So
the necessary software for this is
1) Windows operating system family.
2) Python (version 3.0 or above)
3) Python IDLE (Pycharm)
4) Sqlite3 or any other database
5) Sqlite Studio(to view database)
17
CHAPTER - 5
DRAWBACKS
Due to time constraint it is possible that some points might remain uncovered by me.
In future I will update my software to give valuable information left at present.
Though the system has been designed according to the requirements of the users it
has its own limitation. Thus the limitation of system that I believe are:
No facility to create new username and password.
If project is already running,running it again in new window will create an
error.
If project is running on same window,order number is automatically
incremented but order number will be initialized to 1 every time the project
is executed .
However,this error is not generated in database i.e. In database orders are
properly stored with their proper order number.
After clicking on generate bill button in main window, .txt file opens. In this
text file,changes can be done by the user while it must be disabled and bill is
generated of only current order.
18
CHAPTER-6
REFERENCES
https://acadview.com/
https://docs.python.org/3/
https://stackoverflow.com/
https://www.tutorialspoint.com/python3/
https://www.tutorialspoint.com/python/python_gui_programm
ing.htm
https://www.geeksforgeeks.org/python-gui-tkinter
https://docs.python.org/2/library/tkinter.html
19