Billing
Billing
ABSTRACT
LIST OF ABBREVIATION ................................................................................... 1
1 INTRODUCTION ............................................................................................ 2
1.1 BACKGROUND ...................................................................................... 2
1.2 Objective of Project .................................................................................. 3
1.3 Problem Definition.................................................................................... 3
1.4 Project Overview ...................................................................................... 4
1.5 Scopes and Limitations ............................................................................. 4
1.6 Tools Used ................................................................................................ 5
2 FUNCTIONAL REQUIREMENTS ................................................................. 6
2.1 Non-functional requirements .................................................................... 6
2.2 Feasibility Study ....................................................................................... 7
2.3 Technical feasibility .................................................................................. 8
2.4 Economic feasibility ................................................................................. 9
2.5 Operational feasibility............................................................................... 9
3 GENERAL ARCHITECTURE ...................................................................... 10
3.1 Unified Modeling language (UML) ........................................................ 11
3.2 Use case diagram .................................................................................... 11
3.3 Class Diagram ......................................................................................... 13
3.4 Sequence Diagram .................................................................................. 15
3.5 Admin Login ........................................................................................... 15
3.6 Add User ................................................................................................. 16
3.7 Edit User ................................................................................................. 17
3.8 Delete User.............................................................................................. 18
3.9 User Login .............................................................................................. 19
3.10 User Password Change ........................................................................... 20
3.11 Reservation ............................................................................................. 21
3.12 Billing ..................................................................................................... 22
4 DATA MODELING....................................................................................... 23
4.1 Database .................................................................................................. 23
4.2 Design of the Database ........................................................................... 23
4.3 ER Diagram ............................................................................................ 23
5 CODING TOOLS ........................................................................................... 26
5.1 User Interface .......................................................................................... 26
5.2 Login Page .............................................................................................. 27
5.3 Dashboard ............................................................................................... 28
5.4 Manage menu Page ................................................................................. 29
5.5 Billing Interface Page ............................................................................. 30
5.6 Staff Information Page ............................................................................ 31
6 RESULT ......................................................................................................... 32
6.1 Adding a new staff Page ......................................................................... 32
6.2 Removing a staff Page ............................................................................ 33
6.3 Updating staff information Page ............................................................. 34
6.4 Reservation Page ..................................................................................... 35
6.5 Billing Output Page................................................................................. 36
6.6 Bill Print Output Page ............................................................................. 37
7 IMPLEMENTATION .................................................................................... 38
7.1 Admin Login Function ............................................................................ 38
7.2 Admin Dashboard Function .................................................................... 39
7.3 Add User Function .................................................................................. 40
7.4 Add Category Function ........................................................................... 41
7.5 Add Menu Function ................................................................................ 42
7.6 Update Menu Function ........................................................................... 43
7.7 Delete Employee Function ...................................................................... 44
7.8 Change Password Function ..................................................................... 45
7.9 Reservation Function .............................................................................. 46
7.10 Billing Function ...................................................................................... 47
8 TESTING ....................................................................................................... 49
9 SUMMARY ................................................................................................... 52
10 CONCLUSION .............................................................................................. 53
10.1 Future Enhancement ............................................................................... 53
REFERENCES: .................................................................................................... 54
LIST OF FIGURES AND TABLES
LIST OF ABBREVIATION
IT Information Technology
OS Operating System
DB Database
1 INTRODUCTION
This desktop based application is designed to administer its users and customers.
RBS is a billing system, made for the effective utilization of modern technology
in the organization. It is an automated software that can handle a lot of informa-
tion about the restaurant’s employees, order history, reservation data. It has the
capability to process bills and gather information about its employees and billing
history. It is designed for the sole purpose of efficiency, speed and accuracy.
Waterfall Model is used to develop this software where different requirements are
identified at first, analyze the requirements then design the software using various
tools and techniques and using the development language the software is devel-
oped. Different testing like unit testing and integration testing are done during the
development process. /1/
1.1 BACKGROUND
A restaurant is a business which prepares and serves food and drinks to customers
in exchange for money, either paid before the meal, after the meal, or with an
open account. Meals are generally served and eaten on premises. Restaurants vary
greatly in appearance and offerings, including a wide variety of cuisines and ser-
vice models ranging from inexpensive fast food restaurants to high-priced luxury
establishments.
Restaurants are one of the growing business in recent times. In Nepal, many res-
taurants are doing very well by providing quality service to its customers. It has to
deal with a lot of information about its client and employees, all of which are kept
3
and recorded manually and physically in a drawer or a room. Due to this situation,
finding any reliable data when required and in time is not possible.
The billing process is done manually by manpower. It results in delayed time for
the consumer and to the organization while the bill is being processed. So, there is
a room for improvement here. A certain computer based billing system could aid
the organization to utilize its resources better. Computerized Billing System pro-
vide capabilities for entering client, employee and payment information, building
a record and managing other related data needs in the organization.
The currently used system contains the following problems which are listed be-
low:
Restaurant Billing System is a computer based billing system with user friendly
interface which automatically manages the billing process of the customer very
easily taking only a short period of time. The system can large amount of data and
also generates bill for the customer. Billing history, reservation information and
staff information can also be obtained with the use of RBS.
It is an automated desktop based software which has a simple design and very
easy to use also. This project’s main focus is on proper management of informa-
tion regarding the staffs, billing and reservation records. It is also specialized in
automatically processing the customer bills and discounts.
The proposed system either does not require paper work or very few paper works
are required. All the data is fetched into the computer immediately and various
bills can be generated through computers. Since all the data is kept in a database,
no data of the organization can be destroyed. Moreover works become very easy
because there is no need to keep data on papers.
The software has a lot of features and advantages over the paper based billing sys-
tem. It has the following scopes:/3/
Various tools have been used to develop this software. They are listed below :
Front-end:
Back-end:
Other tools:
2 FUNCTIONAL REQUIREMENTS
Staff management – The admin has the full power to manage (add, de-
lete, update, view) the staffs’ records. RBS provides an easy view of the
staff records from which the management of the staffs can be done.
Make order –The staffs can record orders by simply selecting the cate-
gory and type of the item or meal. The order will be added to database.
Billing – The orders made can be billed as well. The staffs as well as the
admin can make bills of the orders made by the customers easily.
Menu management – The admin can manage the menu of the restaurant.
He/she can add, delete, update or view the menu of the restaurant.
To-do list – Users can add tasks to be done as well as clear the task from
the list after its completion.
Usability – The RBS software is ready to use system. The users will feel
easy to use the system without much technical expertise.
The feasibility study is carried out to test whether the proposed system is worth
being implemented. Feasibility study is a test of system proposed regarding its
work ability, its impact on the organization to meet user needs and effective use of
resources. It is usually carried out by a small number of people who are familiar
with the information system techniques, understand the part of the business or or-
ganization that will be involved or affected by the project and are skilled in the
system analysis and design process.
8
All projects are feasible if they have unlimited resources and infinite time. But the
development of software is plagued by the scarcity of resources and difficult de-
livery rates. It is necessary and prudent to evaluate the feasibility of a project at
the earliest possible time.
1. Technical feasibility
2. Economic feasibility
3. Operational feasibility
4. Schedule feasibility
Software:
Front End
Back End
SQL
Operating System:
Hardware:
9
Intel based processor run computer system, which have keyboard and
mouse as input devices.
This has been decided for the case of availability and up-gradation.
This feasibility study is to determine the benefits and savings that are ex-
pected from a system and compare it with its costs. If a benefit outweighs costs,
then the decision is made to design and implement the system. Otherwise further
alterations are made in the proposed system. Some of the costs to be considered
are:
Manpower cost
Hardware and software cost
3 GENERAL ARCHITECTURE
A use case diagram is a graphical representation of the interaction among the ele-
ments of a system. A use case is a methodology used in a system analysis to iden-
tify, clarify and organize system requirements. /6/
12
Menu
Menu : List<item>
+ giveMenu()
+ display()
Order
- oId
+ addOrder()
Item ItemOrder
- ItemId - iItem
- ItemName - inumberOfPlates
- ItemPrice -memberName
+ getItemId() + getItem()
+ setItemId(ItemId) : void + setItem(item) : void
+ getItemName() + getNumberOfPlates()
+ setItemName(ItemName) : void + getNumberOfPlates(): void
+ getItemPrice()
+ setItemPrice(ItemPrice) : void
Bill
- Order
- BillId
+ calculateTotal()
This sequence diagram shows the different steps how admin can log in, first
admin input his / her username and password then it checks whether the en-
tered values are right or wrong if the data are in database and are for admin
login then it will open admin dashboard otherwise it will give an error mes-
sage. Figure 5 shows the process.
This sequence diagram shows the different steps how admin can add new user,
after admin login to the application he /she clicks on the add user option which
opens add new user page. Then admin can add new user by filling up the neces-
sary details like (Name, Gender, Contact, Address, Salary, username, password)
and click add employee button. Then the request is sent to the database ,here the
entered parameters are checked to make sure that the entered data are correct. If
all the entered data are correct then new user is created in the database otherwise
error message is displayed.
This sequence diagram shows the different steps how admin can edit or update the
user information, after admin login to the application he /she clicks on the staff
option in the dashboard which opens edit user page. Then admin can make all the
necessary changes to the staff information and click edit employee button. Then
the request is sent to the database ,here the entered parameters are checked to
make sure that the entered data are correct. If all the entered data are correct then
new user is created in the database otherwise error message is displayed.
This sequence diagram shows the different steps how admin can delete the user
account, after admin login to the application he /she clicks on the staff option in
the dashboard which opens delete user page. Then admin can simply click on the
employee to be deleted and click on delete employee button. Then the request is
sent to the database and returns the success mes-
sage.
This sequence diagram explains the various steps that are needed for the user to
log in the application. First user enters his / her username and password, for the
very first login they must enter user name and password assigned by the admin.
Once the login details are entered and clicked on login button, the request goes on
to validate user which checks in the database. If the entered details are found in
the database, the user can view dashboard otherwise the application will show an
error message.
This sequence diagram shows the step by step process how user can change their
password. First user log in with their old password once they are logged in they
can click change password option from menu and enter their old password and
new password they want to update and click on Ok button.
3.11 Reservation
This sequence diagram show how the reservations are made. First the booking re-
quest is made by the customer then employee checks if there is any free table if
there is one then booking is confirmed if not then the customer waits in line. Fig-
ure 11 below shows this process.
3.12 Billing
This sequence diagram show step by step process of how billing is done once the
customer is done with the meal, he/she ask for the bill and staff first click on the
billing page and enters all the item's the customer had then the application shows
the total amount include service tax and VAT and the user click on print bill op-
tion which prints the bill and all the items ordered by the customer are stored in
the database. Figure 11 shows the process in detail.
4 DATA MODELING
Data modelling is often the first step in database design and object-oriented pro-
gramming as the designers first create a conceptual model of how data items relate
to each other. Data modelling involves a progression from conceptual model to
logical model to physical schema.
4.1 Database
In this we design and configure the database for the applications. Since the appli-
cation is desktop application, we setup database in the local host server.
The MySQL database is used to design the database. The database name is rbs it
is in the local computer.
4.3 ER Diagram
The ER diagram describes the relationship between the different tables in the da-
tabase. Figure 13 shows that the application database contains six main database
tables which are:
Admin: This table is only for admin, admin username and password are in this
table.
Employee: This table consists of details of all the employees like name, address,
contact info, salary.
Category: This table consists of all the different type of food category available.
Reservation: This table shows all the tables that are reserved for now and also for
the future.
Billing history: This table consists of bill achieve, admin can view this table to
know how the business have been progressing so far.
5 CODING TOOLS
There are various tools available for the development of a project. Our Restaurant
Billing System software has been developed using the front end java and back end
MySQL. Following tools are used for the RBS project.
Netbeans IDE
Netbeans is the tool we have used to implement the code and design the user in-
terface for the Restaurant Billing System.
Together
Together is a diagramming and vector graphics application that has been used to
design system models like, Use-Case Diagram, Sequence Diagrams and so on.
Exe4j
exe4j is a Windows launcher generator, that is included for free when you pur-
chase install4j. exe4j is useful if you want to create a Java launcher without an
installer.
This part provides a detail description of the user interface for the application.
There are two user interfaces. /10/
User's Interface
27
The login page allows the manager to log in to a dashboard/home page using
username and password. The manager can log in using the user name and pass-
word created while developing this application and once he/she successfully log
in then he/she can create other user's as well as admin users.
The log in page contains two input text fields username and password, two radio
field to specify either admin or local user and login button and cancel button. Fig-
ure 15 shows the login interface.
5.3 Dashboard
After the successful login user can see the welcome message and his/her user
name on the top right side of the screen and on the left side there are various
clickable options from where user can perform various tasks and also you can see
"To do" form there you can add any information or activities you perform or want
someone else to perform. Figure 16 shows the dashboard interface.
In this page admin can add, remove and edit the items in the menu. Here admin
can add food category, food name and its price. For instance
Here user can add all the items ordered by the customers to prepare the bill for
that particular customer. Here user can see the sub total once added all the ordered
items and application automatically calculates the grand total including 2% ser-
vice tax and 13% VAT. And also application calculates the amount to be returned
it there is any once the customer pays the bill. The billing interface in given in the
figure 18.
This page is only accessible by the admin. In this page admin can see all the de-
tails about the staffs such as name, gender, contact info, salary and also their user-
name and password used for the log in. Admin can also add and remove the user
from this page. Figure 19 shows the staff information interface.
6 RESULT
In the staff information page, admin can add a new staff once he/she entered all
the necessary data then press add employee button to add a new employee. Figure
20 shows the result of adding employee command.
In the same staff information page, admin can simply click on the name of the
staff and press delete employee button to remove the staff information. Figure 21
shows the result of removing the employee command.
In the same staff information page, admin can update the detail of the employee
by simply choosing staff name and clicking update employee button. Figure 22
shows the result of updating the employee command.
In this page user can add the reservation time as per the customer's wish. Here
customers details like name, contact number and address are entered and also the
number of guests they are coming with and the date and time then the reservation
is made. Figure 23 shows the output of reservation page once all the details are
added.
In this page once you provide all the necessary data then you will get following
output as shown in the figure 24.
Once all the necessary data in the billing page are entered and click on the print
bill option then it will print the bill on the paper. Figure 25 shows the format of
the bill printed on the paper.
7 IMPLEMENTATION
This part consists of description of the implementation of the graphical user inter-
faces which is built for the application. This portion shows how the codes are used
to acquire the desired goal of the project. Java is used for the backend of the ap-
plication and MySQL is used to store database of the application. The following
code snippets shows the implementation of the application.
The admin enter the data to the variables that are assigned and click on login and
the data entered are checked in the database if they exist then the dashboard or
home page is displayed otherwise an error message is shown.
} else {
JOptionPane.showMessageDialog(null, "Wrong u
or password or user type. Please try again.");
}
After the successful login of admin, the dashboard is displayed. There are several
pages in the dashboard and different classes are used to switch between the pages.
when button is clicked a new form is created and set visible (true) will display a
add category form, username given by user matched in keyword "admin" then
only dashboard is visible or displayed.
String empty=nameLabel.getText();
if(empty.equalsIgnoreCase("admin")){
frame.setContentPane(new DashboardItem());
}else{
frame.setContentPane(new DashboardItem());
new EmployeeDAO().addEmployee(employee);
loadDatas();
clearFields();
}
Once the user inputs all the necessary data and click on add employee button, the
query is send to database.
try {
Connection con=new ConnectionFactory()
.getConnection();
int id=parseInt(idTxt.getText());
int dec_id=id+1;
pstmt.setString(1,password);
pstmt.setInt(2,dec_id);
pstmt.executeUpdate();
System.out.println("a");
} catch (Exception e) {
}
Admin can add category simply by add category button. When he/she click that
button with the help of following functions, new category is added in the data-
base.
42
pstmt.setString(1,addcategoryField.getText());
if(pstmt.executeUpdate()==1){
JOptionPane.showMessageDialog(null, "Category Added
addcategoryField.setText("");
}
} catch (Exception e) {
}
Admin can add menu under the category by simply clicking on manage menu op-
tion in the tool bar. When add menu button is clicked under manage menu, fol-
lowing action takes place
43
pstmt = (PreparedStatement)
con.prepareStatement(sql);
pstmt.setString(1,menu.getCategory_name());
pstmt.setString(2, menu.getItem_name());
pstmt.setInt(3, menu.getItem_price());
if(pstmt.executeUpdate()== 1){
JOptionPane.showMessageDialog(null, "One
Record Inserted");
}
} catch (Exception e) {
e.printStackTrace();
}
}
Menu can be updated simply by clicking on edit button of the manage menu page,
first choose the item to be updated and click on edit button. And after that you can
make necessary changes and save it. It will update the data in the database.
44
if (pstmt.executeUpdate() == 1){
JOptionPane.showMessageDialog(null, "Menu
Update Successful");
}
} catch (Exception e) {
e.printStackTrace();
}
}
When the staff button is clicked in the dashboard, list of all the staffs are dis-
played. In order to delete the staff who is no longer working, simply click on the
name of the staff and click delete employee button. It will send the query to data-
base and will be deleted from the record.
if (resulte == 1) {
loadDatas();
JOptionPane.showMessageDialog(null, "One
Record Deleted.");
}
Change password command is used to change the password, Public class Change
password command is used to change the password.
private void
jButton1ActionPerformed(java.awt.event.ActionEvent
evt) {
int result = 0;
String types = null;
JOptionPane.showMessageDialog(null, "Password
Changed...Again Login!!!");
dispose();
flag = true;
new Dashboard();
} else {
JOptionPane.showMessageDialog(null, "Password Not
Changed...Error!!!");
}
} else {
JOptionPane.showMessageDialog(null,
"current password mismatch");
oldPasswordField.requestFocus();
}
} catch (Exception e) {
e.printStackTrace(); }
private void
reserveBttnActionPerformed(java.awt.event.ActionEvent
evt) {
new ReservationPanel();
ReservationDTO reserve = new ReservationDTO();
reserve.setTokenNo(tokenField.getText());
reserve.setCustomerName(customernameField.getText());
reserve.setCustomerAddress(customeraddressField.getText
());
reserve.setContact(contactField.getText());
reserve.setDate(date);
reserve.setTime((String)
combo.getSelectedItem());
String dayCombo = (String)
dayCombobox.getSelectedItem();
reserve.setDay(dayCombo);
new ReservationDAO().addReservation(reserve);
loadDatas();
clearFields();
RefName();
}
Once the customers are done with their meal, they ask for the bill. All the items
they have ordered are entered in the application according to the category of the
food and it will automatically generate the total amount including tax and VAT.
try {
Connection con = new
ConnectionFactory().getConnection();
String sql = "SELECT * FROM category";
while (rs.next()) {
String a = rs.getString("cat_name");
categoryComboBox.addItem(a);
}
} catch (Exception e) {
}
try {
Connection con = new
ConnectionFactory().getConnection();
Statement stmt = con.createStatement();
int b = 0;
while (rs.next()) {
b = total + b;
subtotalField.setText(Integer.toString(b));
int subtotal =
parseInt(subtotalField.getText());
servicechargeField.setText(Float.toString(charge));
float discount = 0;
if (subtotal < 1000) {
discountField.setText("0.00");
} else if (subtotal >= 1000 && subtotal <=
1500) {
discount = (float) (subtotal * 0.5);
discountField.setText(Float.toString(discount));
} else {
discountField.setText(Float.toString(discount));
}
float total;
total = subtotal + vat + charge - discount;
totalField.setText(Float.toString(total));
float paid;
paid=Float.parseFloat(paidField.getText());
float returns=total-paid;
returnField.setText(Float.toString(returns))
} catch (Exception e) {
8 TESTING
In order to find any errors or the problems in the application, testing is carried out.
Software Testing is the validation and certification process where the software
fulfils the requirements of the users and project specifications.
Since this is a desktop application testing is done in only one environment i.e. on
the Windows 10 environment. Table below consists of various tests performed
during the development of this project.
9 SUMMARY
The main goal of developing this desktop application was to make the day to day
operation of the SASA restaurant easy and smooth. This application helps to
know how busy the restaurant is going to be in a certain day or in a certain time of
the day. Since the employee know when and how busy they are going to be in ad-
vance they can make a pre plan to make their operation smooth and give their cus-
tomers high level satisfaction.
The features of this application are that it can be used to create or remove users,
view billing history print bill and update username and password.
Since we have tested the application in the Windows environment and it runs
smoothly we can state that the main objective of this application had been
achieved.
53
10 CONCLUSION
The documentation includes all necessary information on the structure and the
coding of the program created for Restaurant Billing system. Creating the pro-
gram was an overwhelming task that required a lot of analyzing, research work
and personal skills.
Creating this report has been a great experience and numerous facts have been
learned since the required tasks were very challenging. Tasks such as creating a
system to a restaurant, needed research work as well as personal skills. Creating
proper design and smooth flow of operation was a very tiring task that consumed
a lot of time. The program has been created successfully with proper design and
working flow of operation.
The billing part was the most important and difficult part of this project. Retriev-
ing data from database for the billing purpose was quite a tough task. Making
changes on multiple data base using SQL queries was also a bit time consuming
and though provoking task.
REFERENCES: