0% found this document useful (0 votes)
256 views13 pages

Billing Management System Using Python With Source Code

The document describes building a billing management system using Python. It includes the prerequisites, steps to build it, and provides sample source code to create a graphical user interface for the billing system using Tkinter. The code sample shows how to create frames to enter customer details, items, and generate bills.

Uploaded by

mirzabid24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
256 views13 pages

Billing Management System Using Python With Source Code

The document describes building a billing management system using Python. It includes the prerequisites, steps to build it, and provides sample source code to create a graphical user interface for the billing system using Tkinter. The code sample shows how to create frames to enter customer details, items, and generate bills.

Uploaded by

mirzabid24
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 13

Billing Management System Using Python with Source Code

The Coding Hubs


Last updated: 2024/02/22 at 7:08 AM

Hello Programmers, Welcome to the TheCodingHubs Bog. In this blog, we are going to build a billing
management system using Python. To Build a graphical user interface (GUI) of a Billing Management
System Using Python we are going to use the Tkinter model. If you want to learn more about
programming and create practical applications, creating a Billing Management System Using Python
could be a great undertaking.

I am a Programmer and Content creator, writing programs and blogs since 2015 and I know how to
program in Python programming languages easily and step by step.

What is a Billing Management Software?

An application created specifically to produce and handle bills for a business is known as a Billing
Management System Using Python. Businesses usually utilize it to handle their accounting and billing
requirements. The functionality of the billing software might include storing client data, producing
reports on sales and costs, monitoring payments, and making invoices. Python’s ease of use,
versatility, and abundance of libraries and frameworks that facilitate the development of billing software
Python
applications make it a popular programming language. All things considered, Python billing software
may help companies automate their accounting and billing procedures, save time, and lower mistake
rates.
Read More: Random Password Generator Using Python

Prerequisites To Billing Management System Using Python

To draw the build billing software using Python we require a Python library. Here is an overview
description of this library.

Tkinter: With the help of the Python package Tkinter, simple graphical user interface (GUI) programs
can be created.

Read More: YouTube Video Downloader Using Python

Steps to Billing Management System Using Python

First, we need to install the Tkinter library to install it I have mentioned the command below. Run this
command in the terminal.

1. pip install tk

Billing Management System Using Python Source Code

1. from tkinter import *


2. import random
3.
4.
5. class Bill_App:
6. def __init__(self, root):
7. self.root = root
8. self.root.geometry("1300x700+0+0")
9. self.root.maxsize(width=1280, height=700)
10. self.root.minsize(width=1280, height=700)
11. self.root.title("Billing Software")
12.
13. # ====================Variables========================#
14. Python self.cus_name = StringVar()
15. self.c_phone = StringVar()
16. # For Generating Random Bill Numbers
17. x = random.randint(1000, 9999)
18. self.c_bill_no = StringVar()
19. # Seting Value to variable
20. self.c_bill_no.set(str(x))
21.
22. self.bath_soap = IntVar()
23. self.face_cream = IntVar()
24. self.face_wash = IntVar()
25. self.hair_spray = IntVar()
26. self.body_lotion = IntVar()
27. self.rice = IntVar()
28. self.daal = IntVar()
29. self.food_oil = IntVar()
30. self.wheat = IntVar()
31. self.sugar = IntVar()
32. self.maza = IntVar()
33. self.coke = IntVar()
34. self.frooti = IntVar()
35. self.nimko = IntVar()
36. self.biscuits = IntVar()
37. self.total_cosmetics = StringVar()
38. self.total_grocery = StringVar()
39. self.total_other = StringVar()
40. self.tax_cos = StringVar()
41. self.tax_groc = StringVar()
42. self.tax_other = StringVar()
43.
44. # ===================================
45. bg_color = "#074463"
46. fg_color = "white"
47. lbl_color = 'white'
48. # Title of App
49. title = Label(self.root, text="Billing Software", bd=12,
relief=GROOVE, fg=fg_color, bg=bg_color,
50. font=("times new roman", 30, "bold"),
pady=3).pack(fill=X)
51.
52. # ==========Customers Frame==========#
53. F1 = LabelFrame(text="Customer Details", font=("time new
roman", 12, "bold"), fg="gold", bg=bg_color,
54. relief=GROOVE, bd=10)
Python
55. F1.place(x=0, y=80, relwidth=1)
56.
57. # ===============Customer Name===========#
58. cname_lbl = Label(F1, text="Customer Name", bg=bg_color,
fg=fg_color,
59. font=("times new roman", 15,
"bold")).grid(row=0, column=0, padx=10, pady=5)
60. cname_en = Entry(F1, bd=8, relief=GROOVE,
textvariable=self.cus_name)
61. cname_en.grid(row=0, column=1, ipady=4, ipadx=30, pady=5)
62.
63. # =================Customer Phone==============#
64. cphon_lbl = Label(F1, text="Phone No", bg=bg_color,
fg=fg_color, font=("times new roman", 15, "bold")).grid(
65. row=0, column=2, padx=20)
66. cphon_en = Entry(F1, bd=8, relief=GROOVE,
textvariable=self.c_phone)
67. cphon_en.grid(row=0, column=3, ipady=4, ipadx=30, pady=5)
68.
69. # ====================Customer Bill No==================#
70. cbill_lbl = Label(F1, text="Bill No.", bg=bg_color,
fg=fg_color, font=("times new roman", 15, "bold"))
71. cbill_lbl.grid(row=0, column=4, padx=20)
72. cbill_en = Entry(F1, bd=8, relief=GROOVE,
textvariable=self.c_bill_no)
73. cbill_en.grid(row=0, column=5, ipadx=30, ipady=4, pady=5)
74.
75. # ====================Bill Search Button===============#
76. bill_btn = Button(F1, text="Enter", bd=7, relief=GROOVE,
font=("times new roman", 12, "bold"), bg=bg_color,
77. fg=fg_color)
78. bill_btn.grid(row=0, column=6, ipady=5, padx=60, ipadx=19,
pady=5)
79.
80. # ==================Cosmetics Frame=====================#
81. F2 = LabelFrame(self.root, text='Cosmetics', bd=10,
relief=GROOVE, bg=bg_color, fg="gold",
82. font=("times new roman", 13, "bold"))
83. F2.place(x=5, y=180, width=325, height=380)
84.
85. # ===========Frame Content
86. bath_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Bath Soap")
87. Python bath_lbl.grid(row=0, column=0, padx=10, pady=20)
88. bath_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.bath_soap)
89. bath_en.grid(row=0, column=1, ipady=5, ipadx=5)
90.
91. # =======Face Cream
92. face_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Face Cream")
93. face_lbl.grid(row=1, column=0, padx=10, pady=20)
94. face_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.face_cream)
95. face_en.grid(row=1, column=1, ipady=5, ipadx=5)
96.
97. # ========Face Wash
98. wash_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Face Wash")
99. wash_lbl.grid(row=2, column=0, padx=10, pady=20)
100. wash_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.face_wash)
101. wash_en.grid(row=2, column=1, ipady=5, ipadx=5)
102.
103. # ========Hair Spray
104. hair_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Hair Spray")
105. hair_lbl.grid(row=3, column=0, padx=10, pady=20)
106. hair_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.hair_spray)
107. hair_en.grid(row=3, column=1, ipady=5, ipadx=5)
108.
109. # ============Body Lotion
110. lot_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Body Lotion")
111. lot_lbl.grid(row=4, column=0, padx=10, pady=20)
112. lot_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.body_lotion)
113. lot_en.grid(row=4, column=1, ipady=5, ipadx=5)
114.
115. # ==================Grocery Frame=====================#
116. F2 = LabelFrame(self.root, text='Grocery', bd=10,
relief=GROOVE, bg=bg_color, fg="gold",
117. font=("times new roman", 13, "bold"))
118. F2.place(x=330, y=180, width=325, height=380)
119.
120. # ===========Frame Content
Python rice_lbl = Label(F2, font=("times new roman", 15, "bold"),
121.
fg=lbl_color, bg=bg_color, text="Rice")
122. rice_lbl.grid(row=0, column=0, padx=10, pady=20)
123. rice_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.rice)
124. rice_en.grid(row=0, column=1, ipady=5, ipadx=5)
125.
126. # =======
127. oil_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Food Oil")
128. oil_lbl.grid(row=1, column=0, padx=10, pady=20)
129. oil_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.food_oil)
130. oil_en.grid(row=1, column=1, ipady=5, ipadx=5)
131.
132. # =======
133. daal_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Daal")
134. daal_lbl.grid(row=2, column=0, padx=10, pady=20)
135. daal_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.daal)
136. daal_en.grid(row=2, column=1, ipady=5, ipadx=5)
137.
138. # ========
139. wheat_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Wheat")
140. wheat_lbl.grid(row=3, column=0, padx=10, pady=20)
141. wheat_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.wheat)
142. wheat_en.grid(row=3, column=1, ipady=5, ipadx=5)
143.
144. # ============
145. sugar_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Sugar")
146. sugar_lbl.grid(row=4, column=0, padx=10, pady=20)
147. sugar_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.sugar)
148. sugar_en.grid(row=4, column=1, ipady=5, ipadx=5)
149.
150. # ==================Other Stuff=====================#
151.
152. F2 = LabelFrame(self.root, text='Others', bd=10,
relief=GROOVE, bg=bg_color, fg="gold",
153.
Python font=("times new roman", 13, "bold"))
154. F2.place(x=655, y=180, width=325, height=380)
155.
156. # ===========Frame Content
157. maza_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Maza")
158. maza_lbl.grid(row=0, column=0, padx=10, pady=20)
159. maza_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.maza)
160. maza_en.grid(row=0, column=1, ipady=5, ipadx=5)
161.
162. # =======
163. cock_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Coke")
164. cock_lbl.grid(row=1, column=0, padx=10, pady=20)
165. cock_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.coke)
166. cock_en.grid(row=1, column=1, ipady=5, ipadx=5)
167.
168. # =======
169. frooti_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Frooti")
170. frooti_lbl.grid(row=2, column=0, padx=10, pady=20)
171. frooti_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.frooti)
172. frooti_en.grid(row=2, column=1, ipady=5, ipadx=5)
173.
174. # ========
175. cold_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Nimkos")
176. cold_lbl.grid(row=3, column=0, padx=10, pady=20)
177. cold_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.nimko)
178. cold_en.grid(row=3, column=1, ipady=5, ipadx=5)
179.
180. # ============
181. bis_lbl = Label(F2, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Biscuits")
182. bis_lbl.grid(row=4, column=0, padx=10, pady=20)
183. bis_en = Entry(F2, bd=8, relief=GROOVE,
textvariable=self.biscuits)
184. bis_en.grid(row=4, column=1, ipady=5, ipadx=5)
185.
186. # ===================Bill Aera================#
187.
Python F3 = Label(self.root, bd=10, relief=GROOVE)
188. F3.place(x=960, y=180, width=325, height=380)
189. # ===========
190. bill_title = Label(F3, text="Bill Area", font=("Lucida", 13,
"bold"), bd=7, relief=GROOVE)
191. bill_title.pack(fill=X)
192.
193. # ============
194. scroll_y = Scrollbar(F3, orient=VERTICAL)
195. self.txt = Text(F3, yscrollcommand=scroll_y.set)
196. scroll_y.pack(side=RIGHT, fill=Y)
197. scroll_y.config(command=self.txt.yview)
198. self.txt.pack(fill=BOTH, expand=1)
199.
200. # ===========Buttons Frame=============#
201. F4 = LabelFrame(self.root, text='Bill Menu', bd=10,
relief=GROOVE, bg=bg_color, fg="gold",
202. font=("times new roman", 13, "bold"))
203. F4.place(x=0, y=560, relwidth=1, height=145)
204.
205. # ===================
206. cosm_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Total Cosmetics")
207. cosm_lbl.grid(row=0, column=0, padx=10, pady=0)
208. cosm_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.total_cosmetics)
209. cosm_en.grid(row=0, column=1, ipady=2, ipadx=5)
210.
211. # ===================
212. gro_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Total Grocery")
213. gro_lbl.grid(row=1, column=0, padx=10, pady=5)
214. gro_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.total_grocery)
215. gro_en.grid(row=1, column=1, ipady=2, ipadx=5)
216.
217. # ================
218. oth_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Others Total")
219. oth_lbl.grid(row=2, column=0, padx=10, pady=5)
220. oth_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.total_other)
221. oth_en.grid(row=2, column=1, ipady=2, ipadx=5)
Python
222.
223. # ================
224. cosmt_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Cosmetics Tax")
225. cosmt_lbl.grid(row=0, column=2, padx=30, pady=0)
226. cosmt_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.tax_cos)
227. cosmt_en.grid(row=0, column=3, ipady=2, ipadx=5)
228.
229. # =================
230. grot_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Grocery Tax")
231. grot_lbl.grid(row=1, column=2, padx=30, pady=5)
232. grot_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.tax_groc)
233. grot_en.grid(row=1, column=3, ipady=2, ipadx=5)
234.
235. # ==================
236. otht_lbl = Label(F4, font=("times new roman", 15, "bold"),
fg=lbl_color, bg=bg_color, text="Others Tax")
237. otht_lbl.grid(row=2, column=2, padx=10, pady=5)
238. otht_en = Entry(F4, bd=8, relief=GROOVE,
textvariable=self.tax_other)
239. otht_en.grid(row=2, column=3, ipady=2, ipadx=5)
240.
241. # ====================
242. total_btn = Button(F4, text="Total", bg=bg_color,
fg=fg_color, font=("lucida", 12, "bold"), bd=7, relief=GROOVE,
243. command=self.total)
244. total_btn.grid(row=1, column=4, ipadx=20, padx=30)
245.
246. # ========================
247. genbill_btn = Button(F4, text="Generate Bill", bg=bg_color,
fg=fg_color, font=("lucida", 12, "bold"), bd=7,
248. relief=GROOVE, command=self.bill_area)
249. genbill_btn.grid(row=1, column=5, ipadx=20)
250.
251. # ====================
252. clear_btn = Button(F4, text="Clear", bg=bg_color,
fg=fg_color, font=("lucida", 12, "bold"), bd=7, relief=GROOVE,
253. command=self.clear)
254. clear_btn.grid(row=1, column=6, ipadx=20, padx=30)
255.
256. # ======================
Python
257. exit_btn = Button(F4, text="Exit", bg=bg_color, fg=fg_color,
font=("lucida", 12, "bold"), bd=7, relief=GROOVE,
258. command=self.exit)
259. exit_btn.grid(row=1, column=7, ipadx=20)
260.
261. # Function to get total prices
262. def total(self):
263. # =================Total Cosmetics Prices
264. self.total_cosmetics_prices = (
265. (self.bath_soap.get() * 40) +
266. (self.face_cream.get() * 140) +
267. (self.face_wash.get() * 240) +
268. (self.hair_spray.get() * 340) +
269. (self.body_lotion.get() * 260)
270. )
271. self.total_cosmetics.set("Rs. " +
str(self.total_cosmetics_prices))
272. self.tax_cos.set("Rs. " +
str(round(self.total_cosmetics_prices * 0.05)))
273. # ====================Total Grocery Prices
274. self.total_grocery_prices = (
275. (self.wheat.get() * 100) +
276. (self.food_oil.get() * 180) +
277. (self.daal.get() * 80) +
278. (self.rice.get() * 80) +
279. (self.sugar.get() * 170)
280.
281. )
282. self.total_grocery.set("Rs. " +
str(self.total_grocery_prices))
283. self.tax_groc.set("Rs. " +
str(round(self.total_grocery_prices * 0.05)))
284. # ======================Total Other Prices
285. self.total_other_prices = (
286. (self.maza.get() * 20) +
287. (self.frooti.get() * 50) +
288. (self.coke.get() * 60) +
289. (self.nimko.get() * 20) +
290. (self.biscuits.get() * 20)
291. )
292. self.total_other.set("Rs. " + str(self.total_other_prices))
293. self.tax_other.set("Rs. " +
str(round(self.total_other_prices * 0.05)))
294.
Python
295. # Function For Text Area
296. def welcome_soft(self):
297. self.txt.delete('1.0', END)
298. self.txt.insert(END, " Welcome To Hanan's Retail\n")
299. self.txt.insert(END, f"\nBill No. :
{str(self.c_bill_no.get())}")
300. self.txt.insert(END, f"\nCustomer Name :
{str(self.cus_name.get())}")
301. self.txt.insert(END, f"\nPhone No. :
{str(self.c_phone.get())}")
302. self.txt.insert(END,
"\n===================================")
303. self.txt.insert(END, "\nProduct Qty Price")
304. self.txt.insert(END,
"\n===================================")
305.
306. # Function to clear the bill area
307. def clear(self):
308. self.txt.delete('1.0', END)
309.
310. # Add Product name , qty and price to bill area
311. def bill_area(self):
312. self.welcome_soft()
313. if self.bath_soap.get() != 0:
314. self.txt.insert(END, f"\nBath Soap
{self.bath_soap.get()} {self.bath_soap.get() * 40}")
315. if self.face_cream.get() != 0:
316. self.txt.insert(END, f"\nFace Cream
{self.face_cream.get()} {self.face_cream.get() * 140}")
317. if self.face_wash.get() != 0:
318. self.txt.insert(END, f"\nFace Wash
{self.face_wash.get()} {self.face_wash.get() * 240}")
319. if self.hair_spray.get() != 0:
320. self.txt.insert(END, f"\nHair Spray
{self.hair_spray.get()} {self.hair_spray.get() * 340}")
321. if self.body_lotion.get() != 0:
322. self.txt.insert(END,
323. f"\nBody Lotion
{self.body_lotion.get()} {self.body_lotion.get() * 260}")
324. if self.wheat.get() != 0:
325. self.txt.insert(END, f"\nWheat
{self.wheat.get()} {self.wheat.get() * 100}")
326. if self.food_oil.get() != 0:
327. self.txt.insert(END, f"\nFood Oil
Python
{self.food_oil.get()} {self.food_oil.get() * 180}")
328. if self.daal.get() != 0:
329. self.txt.insert(END, f"\nDaal
{self.daal.get()} {self.daal.get() * 80}")
330. if self.rice.get() != 0:
331. self.txt.insert(END, f"\nRice
{self.rice.get()} {self.rice.get() * 80}")
332. if self.sugar.get() != 0:
333. self.txt.insert(END, f"\nSugar
{self.sugar.get()} {self.sugar.get() * 170}")
334. if self.maza.get() != 0:
335. self.txt.insert(END, f"\nMaza
{self.maza.get()} {self.maza.get() * 20}")
336. if self.frooti.get() != 0:
337. self.txt.insert(END, f"\nFrooti
{self.frooti.get()} {self.frooti.get() * 50}")
338. if self.coke.get() != 0:
339. self.txt.insert(END, f"\nCoke
{self.coke.get()} {self.coke.get() * 60}")
340. if self.nimko.get() != 0:
341. self.txt.insert(END, f"\nNimko
{self.nimko.get()} {self.nimko.get() * 20}")
342. if self.biscuits.get() != 0:
343. self.txt.insert(END, f"\nBiscuits
{self.biscuits.get()} {self.biscuits.get() * 20}")
344. self.txt.insert(END,
"\n===================================")
345. self.txt.insert(END,
346. f"\n Total :
{self.total_cosmetics_prices + self.total_grocery_prices +
self.total_other_prices + self.total_cosmetics_prices * 0.05 +
self.total_grocery_prices * 0.05 + self.total_other_prices * 0.05}")
347.
348. # Function to exit
349. def exit(self):
350. self.root.destroy()
351.
352. # Function To Clear All Fields
353.
354.
355. root = Tk()
356. object = Bill_App(root)
357. root.mainloop()

Python
Read More: Quiz Game with Python
Output of Billing Management System Using Python

Here is the output of the Billing Management System Using Python which we build in the blog.

Read More: Jai Shree Ram using Python

Conclusion

In this tutorial, I shared how to Billing Management System Using Python with Source Code. We also
used the Tkinter to create the Graphical User Interface (GUI). I hope you enjoyed reading this tutorial
and found the information provided on how to Billing Management System Using Python.

FAQs about the Billing management system in Python

What is a Billing Management Software?


A program made to manage commercial billing procedures is called billing management software. It
facilitates effective accounting job management, client data storage, report generation, payment
tracking, and invoice creation.
Why use Python for Billing Management Systems?
Python is used for developing billing software because of its ease of use, adaptability, and the
availability of Tkinter and other libraries for graphical user interfaces (GUI). Python reduces mistakes and
saves time by streamlining development and enabling automation.
What are the prerequisites for creating a Billing Management System Using Python?
To create a Python billing management system, the Tkinter library must be installed. A Python library
called Tkinter makes it easier to create basic graphical user interfaces (GUIs).

Python

You might also like