Documentation
Documentation
1. INTRODUCTION
The Bakery Billing System is an innovative application designed to streamline
the billing process for bakeries, enhancing both operational efficiency and
customer satisfaction. This system provides a user-friendly console interface that
allows customers to easily place orders for a variety of bakery items. Customers
can select multiple products, specify quantities, and receive detailed bills that
include item descriptions and total costs. The system also incorporates a discount
feature, automatically applying reductions based on predefined criteria,
encouraging larger purchases.
On the administrative side, the application enables bakery owners to manage their
inventory effectively. Admin users can add, update, or remove items from the
product list, ensuring that the menu reflects current offerings and available stock.
The backend is supported by a database that securely stores product information
and transaction records, facilitating easy access and management.
By automating billing and inventory management tasks, the Python Bakery
Billing System minimizes manual workload and reduces the potential for errors
in transactions. This not only saves time but also allows bakery staff to focus
more on customer service and product quality. Overall, this system serves as a
practical solution for modern bakeries looking to enhance their business
operations through technology.
PAGE 1
BAKERY BILLING SYSTEM
PAGE 2
BAKERY BILLING SYSTEM
PAGE 3
BAKERY BILLING SYSTEM
3.1 Objectives
➢ The primary objective is to automate the billing process, ensuring accurate
and timely invoices for customers, thereby reducing manual errors.
➢ The system aims to facilitate effective inventory management by tracking
ingredient quantities and product stocks, helping bakeries maintain optimal
inventory levels.
➢ It provides comprehensive sales reporting and analytics, offering insights
into sales trends, customer preferences, and seasonal demands to aid in
strategic decision-making.
➢ By streamlining the billing process and providing detailed invoices, the
system aims to enhance the overall customer experience, fostering loyalty
and repeat business.
3.2 SCOPE
➢ The system automates the billing process, generating accurate invoices
quickly and reducing manual errors associated with traditional billing
methods.
➢ It includes features for real-time tracking of inventory levels, allowing
bakeries to manage stock efficiently and automate reorder processes when
items reach minimum thresholds.
➢ The system provides comprehensive sales reports and analytics, helping
bakery owners understand sales trends, customer preferences, and seasonal
demands for better decision-making.
➢ It supports customer management by storing customer data, tracking
loyalty points, and managing discounts or promotions, which can enhance
customer retention.
PAGE 4
BAKERY BILLING SYSTEM
4. MODULE DESCRIPTION
The module specification for the bakery billing system includes three key user
roles: admin, employee, and customer. Each module has distinct functionalities
tailored to meet the needs of its users.
PAGE 5
BAKERY BILLING SYSTEM
PAGE 6
BAKERY BILLING SYSTEM
PAGE 7
BAKERY BILLING SYSTEM
7.2 SQLLITE
SQLite is a Self-contained, serverless, and zero-configuration relational database
management system. It is designed to be lightweight and efficient, making it ideal
for embedded systems and applications that require a simple database solution
without the overhead of a separate server process. SQLite operates directly with
application code, allowing for seamless interaction with database files stored on
disk.
One of the key features of SQLite is its ACID compliance, ensuring that all
transactions are atomic, consistent, isolated, and durable. This means that even in
the event of a crash or power failure, all changes within a transaction will either
be fully completed or not applied at all. SQLite also supports a rich set of SQL
features, including complex queries, indexing, triggers, and views.
PAGE 8
BAKERY BILLING SYSTEM
PAGE 9
BAKERY BILLING SYSTEM
PAGE 10
BAKERY BILLING SYSTEM
PAGE 11
BAKERY BILLING SYSTEM
PAGE 12
BAKERY BILLING SYSTEM
9. TABLE DESIGN
9.1 Table Name: Customers
Sr.No Field Name Data Field size Description constraints
Type
1 Ccustomer_id integer Primary Unique identifier for Not null
key each user
2 Cname Text 10 Unique username for Not null
user login
3 Cphone varchar 10 Contact number Not null
PAGE 13
BAKERY BILLING SYSTEM
10. IMPLEMENTATION
SAMPLE CODE
10.1.1 Homepage
import os
from tkinter import *
from tkinter import messagebox
main = Tk()
main.geometry("1366x768")
main.title("Billing System")
main.resizable(0, 0)
def Exit():
sure = messagebox.askyesno("Exit","Are you sure you want to exit?",
parent=main)
if sure == True:
main.destroy()
main.protocol("WM_DELETE_WINDOW", Exit)
def emp():
main.withdraw()
os.system("python employee.py")
main.deiconify()
def adm():
main.withdraw()
os.system("python admin.py")
main.deiconify()
label1 = Label(main)
label1.place(relx=0, rely=0, width=1366, height=768)
img = PhotoImage(file="./images/main.png")
label1.configure(image=img)
button1 = Button(main)
PAGE 14
BAKERY BILLING SYSTEM
10.1.2 Employee
PAGE 15
BAKERY BILLING SYSTEM
#==================imports===================
import sqlite3
import re
import random
import string
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
from time import strftime
from datetime import date
from tkinter import scrolledtext as tkst
#============================================
root = Tk()
root.geometry("1366x768")
root.title("Billing Software")
user = StringVar()
passwd = StringVar()
fname = StringVar()
lname = StringVar()
new_user = StringVar()
new_passwd = StringVar()
cust_name = StringVar()
cust_num = StringVar()
cust_new_bill = StringVar()
cust_search_bill = StringVar()
bill_date = StringVar()
with sqlite3.connect("./Database/store.db") as db:
PAGE 16
BAKERY BILLING SYSTEM
cur = db.cursor()
def random_bill_number(stringLength):
lettersAndDigits = string.ascii_letters.upper() + string.digits
strr=''.join(random.choice(lettersAndDigits) for i in range(stringLength-2))
return ('CC'+strr)
def valid_phone(phn):
if re.match(r"[789]\d{9}$", phn):
return True
return False
def login(Event=None):
global username
username = user.get()
password = passwd.get()
with sqlite3.connect("./Database/store.db") as db:
cur = db.cursor()
cur.execute("SELECT * FROM employee WHERE emp_id = ? and
password = ?", [username, password])
results = cur.fetchall()
if results:
messagebox.showinfo("Login Page", "The login is successful")
page1.entry1.delete(0, END)
page1.entry2.delete(0, END)
root.withdraw()
global biller
global page2
biller = Toplevel()
page2 = bill_window(biller)
page2.time()
biller.protocol("WM_DELETE_WINDOW", exitt)
PAGE 17
BAKERY BILLING SYSTEM
biller.mainloop()
else:
messagebox.showerror("Error", "Incorrect username or password.")
page1.entry2.delete(0, END)
def logout():
sure = messagebox.askyesno("Logout", "Are you sure you want to logout?",
parent=biller)
if sure == True:
biller.destroy()
root.deiconify()
page1.entry1.delete(0, END)
page1.entry2.delete(0, END)
self.entry1.place(relx=0.509, rely=0.23, width=240, height=24)
self.entry1.configure(
font="-family {Poppins} -size 12",
relief="flat",
textvariable=cust_name
)
self.entry2 = Entry(biller)
self.entry2.place(relx=0.791, rely=0.23, width=240, height=24)
self.entry2.configure(
font="-family {Poppins} -size 12",
relief="flat",
textvariable=cust_num
)
self.entry3 = Entry(biller)
self.entry3.place(relx=0.102, rely=0.23, width=240, height=24)
self.entry3.configure(
font="-family {Poppins} -size 12",
PAGE 18
BAKERY BILLING SYSTEM
relief="flat",
textvariable=cust_search_bill
)
self.button1 = Button(biller)
self.button1.place(relx=0.031, rely=0.104, width=76, height=23)
self.button1.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 12",
borderwidth="0",
text="Logout",
command=logout
)
self.button2 = Button(biller)
self.button2.place(relx=0.315, rely=0.234, width=76, height=23)
self.button2.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 12",
borderwidth="0",
text="Search",
PAGE 19
BAKERY BILLING SYSTEM
command=self.search_bill
)
self.button3 = Button(biller)
self.button3.place(relx=0.048, rely=0.885, width=86, height=25)
self.button3.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="Total",
command=self.total_bill
)
self.button4 = Button(biller)
self.button4.place(relx=0.141, rely=0.885, width=84, height=25)
self.button4.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="Generate",
command=self.gen_bill
PAGE 20
BAKERY BILLING SYSTEM
)
self.button5 = Button(biller)
self.button5.place(relx=0.230, rely=0.885, width=86, height=25)
self.button5.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="Clear",
command=self.clear_bill
)
self.button6 = Button(biller)
self.button6.place(relx=0.322, rely=0.885, width=86, height=25)
self.button6.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="Exit",
command=exitt
)
PAGE 21
BAKERY BILLING SYSTEM
self.button7 = Button(biller)
self.button7.place(relx=0.098, rely=0.734, width=86, height=26)
self.button7.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="Add To Cart",
command=self.add_to_cart
)
self.button8 = Button(biller)
self.button8.place(relx=0.274, rely=0.734, width=84, height=26)
self.button8.configure(
relief="flat",
overrelief="flat",
activebackground="#CF1E14",
cursor="hand2",
foreground="#ffffff",
background="#CF1E14",
font="-family {Poppins SemiBold} -size 10",
borderwidth="0",
text="""Clear""",
command=self.clear_selection
)
self.button9 = Button(biller)
PAGE 22
BAKERY BILLING SYSTEM
PAGE 23
BAKERY BILLING SYSTEM
self.combo1.option_add("*TCombobox*Listbox.selectBackground",
"#D2463E")
self.combo2 = ttk.Combobox(biller)
self.combo2.place(relx=0.035, rely=0.479, width=477, height=26)
self.combo2.configure(font="-family {Poppins} -size 8")
self.combo2.option_add("*TCombobox*Listbox.font", text_font)
self.combo2.configure(state="disabled")
self.combo3 = ttk.Combobox(biller)
self.combo3.place(relx=0.035, rely=0.551, width=477, height=26)
self.combo3.configure(
state="disabled",
font="-family {Poppins} -size 8"
)
self.combo3.option_add("*TCombobox*Listbox.font", text_font)
self.entry4 = ttk.Entry(biller)
self.entry4.place(relx=0.035, rely=0.629, width=477, height=26)
self.entry4.configure(
font="-family {Poppins} -size 8",
foreground="#000000",
state="disabled"
)
self.Scrolledtext1 = tkst.ScrolledText(top)
self.Scrolledtext1.place(relx=0.439, rely=0.586, width=695, height=275)
self.Scrolledtext1.configure(
borderwidth=0,
font="-family {Podkova} -size 8",
state="disabled"
)
self.combo1.bind("<<ComboboxSelected>>", self.get_category)
PAGE 24
BAKERY BILLING SYSTEM
PAGE 25
BAKERY BILLING SYSTEM
self.entry4.configure(state="normal")
self.qty_label = Label(biller)
self.qty_label.place(relx=0.033, rely=0.664, width=82, height=26)
self.qty_label.configure(
font="-family {Poppins} -size 8",
anchor="w"
)
product_name = self.combo3.get()
find_qty = "SELECT stock FROM raw_inventory WHERE product_name
= ?"
cur.execute(find_qty, [product_name])
results = cur.fetchone()
self.qty_label.configure(
text=f"In Stock: {results[0]}",
background="#ffffff",
foreground="#333333"
)
cart = Cart()
def add_to_cart(self):
self.Scrolledtext1.configure(state="normal")
strr = self.Scrolledtext1.get('1.0', END)
if strr.find('Total') == -1:
product_name = self.combo3.get()
if(product_name != ""):
product_qty = self.entry4.get()
find_mrp = "SELECT mrp, stock FROM raw_inventory WHERE
product_name = ?"
cur.execute(find_mrp, [product_name])
results = cur.fetchall()
PAGE 26
BAKERY BILLING SYSTEM
stock = results[0][1]
mrp = results[0][0]
if product_qty.isdigit() == True:
if (stock - int(product_qty)) >= 0:
sp = mrp * int(product_qty)
item = Item(product_name, mrp, int(product_qty))
self.cart.add_item(item)
self.Scrolledtext1.configure(state="normal")
bill_text =
f"{product_name}\t\t\t\t\t\t\t{product_qty}\t\t\t\t\t\t{sp}\n"
self.Scrolledtext1.insert('insert', bill_text)
self.Scrolledtext1.configure(state="disabled")
else:
messagebox.showerror("Oops!", "Out of stock. Check quantity.",
parent=biller)
else:
messagebox.showerror("Oops!", "Invalid quantity.", parent=biller)
else:
messagebox.showerror("Oops!", "Choose a product.", parent=biller)
else:
self.Scrolledtext1.delete('1.0', END)
new_li = []
li = strr.split("\n")
for i in range(len(li)):
if len(li[i]) != 0:
if li[i].find('Total') == -1:
new_li.append(li[i])
else:
PAGE 27
BAKERY BILLING SYSTEM
break
for j in range(len(new_li)-1):
10.1.3 admin
# ==================imports===================
import sqlite3
import re
import random
import string
from tkinter import *
from tkinter import messagebox
from tkinter import ttk
from time import strftime
from datetime import date
from tkinter import scrolledtext as tkst
# ============================================
root = Tk()
root.geometry("1366x768")
root.title("Billing Software(ADMIN)")
user = StringVar()
passwd = StringVar()
fname = StringVar()
lname = StringVar()
with sqlite3.connect("./Database/store.db") as db:
cur = db.cursor()
def random_emp_id(stringLength):
Digits = string.digits
strr=''.join(random.choice(Digits) for i in range(stringLength-3))
return ('EMP'+ strr)
def valid_phone(phn):
PAGE 28
BAKERY BILLING SYSTEM
if re.match(r"[789]\d{9}$", phn):
return True
return False
def valid_aadhar(aad):
if aad.isdigit() and len(aad) == 12:
return True
return False
class login_page:
def __init__(self, top=None):
top.geometry("1366x768")
top.resizable(0, 0)
top.title("Billing Software(ADMIN)")
self.label1 = Label(root)
self.label1.place(relx=0, rely=0, width=1366, height=768)
self.img = PhotoImage(file="./images/admin_login.png")
self.label1.configure(image=self.img)
self.entry1 = Entry(root)
self.entry1.place(relx=0.403, rely=0.269, width=374, height=24)
self.entry1.configure(
font="-family {Poppins} -size 10",
relief="flat",
textvariable=user
)
self.entry2 = Entry(root)
self.entry2.place(relx=0.403, rely=0.384, width=374, height=24)
self.entry2.configure(
font="-family {Poppins} -size 10",
relief="flat",
show="*",
PAGE 29
BAKERY BILLING SYSTEM
textvariable=passwd
)
self.button1 = Button(root)
self.button1.place(relx=0.397, rely=0.683, width=356, height=43)
self.button1.configure(
relief="flat",
overrelief="flat",
activebackground="#D2463E",
cursor="hand2",
foreground="#ffffff",
background="#D2463E",
font="-family {Poppins SemiBold} -size 20",
borderwidth="0",
text="Login",
command=self.login
)
def login(self, Event=None):
username = user.get()
password = passwd.get()
with sqlite3.connect("./Database/store.db") as db:
cur = db.cursor()
find_user = "SELECT * FROM employee WHERE emp_id = ? and
password = ?"
cur.execute(find_user, [username, password])
results = cur.fetchall()
if results:
if results[0][6]=="Admin":
messagebox.showinfo("Login Page", "The login is successful.")
page1.entry1.delete(0, END)
PAGE 30
BAKERY BILLING SYSTEM
page1.entry2.delete(0, END)
root.withdraw()
global adm
global page2
adm = Toplevel()
page2 = Admin_Page(adm)
adm.protocol("WM_DELETE_WINDOW", exitt)
adm.mainloop()
else:
messagebox.showerror("Oops!!", "You are not an admin.")
else:
messagebox.showerror("Error", "Incorrect username or password.")
page1.entry2.delete(0, END)
def exitt():
sure = messagebox.askyesno("Exit","Are you sure you want to exit?",
parent=root)
if sure == True:
adm.destroy()
root.destroy()
def inventory():
adm.withdraw()
global inv
global page3
inv = Toplevel()
page3 = Inventory(inv)
page3.time()
inv.protocol("WM_DELETE_WINDOW", exitt)
inv.mainloop()
PAGE 31
BAKERY BILLING SYSTEM
def employee():
adm.withdraw()
global emp
global page5
emp = Toplevel()
page5 = Employee(emp)
page5.time()
emp.protocol("WM_DELETE_WINDOW", exitt)
emp.mainloop()
def invoices():
adm.withdraw()
global invoice
invoice = Toplevel()
page7 = Invoice(invoice)
page7.time()
invoice.protocol("WM_DELETE_WINDOW", exitt)
invoice.mainloop()
def about():
pass
class Admin_Page:
def __init__(self, top=None):
top.geometry("1366x768")
top.resizable(0, 0)
top.title("ADMIN Mode")
self.label1 = Label(adm)
self.label1.place(relx=0, rely=0, width=1366, height=768)
self.img = PhotoImage(file="./images/admin.png")
self.label1.configure(image=self.img)
self.button1 = Button(adm)
PAGE 32
BAKERY BILLING SYSTEM
PAGE 33
BAKERY BILLING SYSTEM
self.button3.configure(
relief="flat",
overrelief="flat",
activebackground="#ffffff",
cursor="hand2",
foreground="#333333",
background="#ffffff",
font="-family {Poppins SemiBold} -size 12",
borderwidth="0",
text="""Employees""",
command=employee
)
self.button4 = Button(adm)
self.button4.place(relx=0.536, rely=0.508, width=146, height=63)
self.button4.configure(
relief="flat",
overrelief="flat",
activebackground="#ffffff",
cursor="hand2",
foreground="#333333",
background="#ffffff",
font="-family {Poppins SemiBold} -size 12",
borderwidth="0",
text="Invoices",
command=invoices
)
self.button5 = Button(adm)
self.button5.place(relx=0.732, rely=0.508, width=146, height=63)
self.button5.configure(
PAGE 34
BAKERY BILLING SYSTEM
relief="flat",
overrelief="flat",
activebackground="#ffffff",
cursor="hand2",
foreground="#333333",
background="#ffffff",
font="-family {Poppins SemiBold} -size 12",
borderwidth="0",
text="""About Us"""
PAGE 35
BAKERY BILLING SYSTEM
PAGE 36
BAKERY BILLING SYSTEM
10.2.3 Inventory
10.2.4 Invoices
PAGE 37
BAKERY BILLING SYSTEM
11. CONCLUSION
In conclusion, implementing a bakery billing system is essential for enhancing
operational efficiency and customer satisfaction in a bakery business. Such a
system automates the billing process, ensuring accurate invoices and streamlined
transactions, which are crucial in a fast-paced environment. By integrating
features like inventory management, sales reporting, and customer relationship
management, a bakery billing system not only simplifies daily operations but also
provides valuable insights for strategic decision-making.
Moreover, the ability to track customer preferences and purchasing patterns
allows bakeries to tailor their offerings and marketing efforts effectively. This
personalization fosters customer loyalty and encourages repeat business, which
is vital for long-term success. As bakeries face increasing competition, adopting
a robust billing system can be a game-changer, enabling them to maintain high
standards of service while managing resources efficiently.
Ultimately, investing in a bakery billing system empowers business owners to
focus on what they do best—creating delightful baked goods—while the
technology handles the complexities of billing and inventory management. This
synergy between culinary artistry and technological efficiency positions bakeries
for growth and sustainability in the digital age.
PAGE 38
BAKERY BILLING SYSTEM
➢ Implementing a mobile app that allows customers to place orders and make
payments directly from their smartphones can enhance convenience and
streamline the ordering process.
➢ Incorporating real-time inventory tracking that alerts staff about low stock
levels and expiration dates can help manage supplies more effectively and
reduce waste.
➢ Integrating CRM tools can help track customer preferences, purchase
history, and feedback, enabling personalized marketing strategies and
improved customer loyalty programs.
➢ Developing a robust online ordering platform can expand the customer
base by allowing users to place orders from anywhere, thus increasing sales
opportunities.
➢ Enhancing reporting capabilities to provide insights into sales trends,
customer behavior, and product performance can aid in strategic decision-
making and inventory planning.
➢ Implementing automated loyalty programs that reward repeat customers
with discounts or special offers can encourage customer retention and
increase sales.
PAGE 39
BAKERY BILLING SYSTEM
13. REFERENCES
www.krbakers.com
https://happycake.com
https://peakoftaste.com
PAGE 40