Telephone Billing System
Telephone Billing System
1 .INTRODUCTION
1.1 PROJECT OVERVIEW
1.2 ORGANIZATIONAL OVERVIEW
3. SYSTEM SPECIFICATION
3.1 HARDWARE SPECIFICATION
3.2 SOFTWARE SPESIFICATION
4 SYSTEM DESIGN
4.1 INPUT DESIGN
4.2 OUTPUT DESIGN
4.3 DATABASE DESIGN
4.4 SYSTEM FLOW CHART
4.5 DATA FLOW DIAGRAM (DFD)
4.6 MENU TREE
5. SYSTEM CODING
6. SYSTEM TESTING
7. IMPLEMENTATION
8. SYSTEM MAINTENANCE
9. SYSTEM SECURITY
11. CONCLUSION
12. APPENDIX
APPENDIX 1 FORM LAYOUT
APPENDIX 2 REPORT LAYOUT
APPENDIX 3 MEETING MINUTES
APPENDIX 4 GANTT CHART
13. BIBLIOGRAPHY
INTRODUCTION
System was to minimize the work and at the same time increase the speed
built using Visual Basic 6.0 as front-end. It entails looking into duplication of
System analysis is a vast field of study through which system analyst puts his
thoughts and searches for the solution of problem. He has to get a clear idea of
what he has in hand and what he has to produce. He has to extract the essence of
expectations. He has to satisfy the user in the very possible way. System analysis
desired.
detailed one. During the preliminary analysis the Analyst takes a quick look at
what is needed and whether the cost benefits. Detailed analysis studies in depth
all the cornered factors, which builds and strengthens the software.
A system study is a step-by-step process used to identify and then developed the
1. Problem Definition
2. Feasibility Study
3. System Analysis
4. System Design
5. Implementation
6. Post Implementation
7. Maintenance
2.1 EXISTING SYSTEM
The existing system was a manual one. Whatever be the process involved in the
system were done through register (files). There were lots of complexities
involved in the system. When any customer takes new connections then separate
files were maintained. Updating of data was very tedious job. It was not easy to
In the existing system all the office works was done manually. The manual work
processes was time consuming and hence slow. Following are the main
The existing system is totally manual thus there are chances of error in
processing.
The basic and major drawbacks in the existing system are the speed of
There is no central database from where one can get different statistical
The above facts, figures and drawbacks clearly indicate that there is need for
SYSTEM”. Since the existing system was totally manual which has lots of
complexities, shortcomings in itself and all the data was being stored in registers,
files etc thus to overcome the limitation of the existing system, the new
computerized system was needed, so that information can be provided to the user
management of any organization. Thus any system should have the ability to
provide error free filtered information after processing the required data. This
system has been taken up with a view for developing a more sophisticated system
that can be easily handled by any kind of users. The proposed system aims at
Consistent user interface with high economic features built into it.
User has complete control as it provides and accepts only appropriate and
valid data.
consistency.
3. SYSTEM SPECIFICATION
describes what the proposed should do, without describing how the software does
it.
user friendly, easy to use , maintain and satisfies all the requirements of
the user.
PERFORMANCE REQUIREMENT
1) The operation time should be small and the throughput should be high.
this tool is very much portable. This tool uses several canvases on
enhancements.
4. SYSTEM DESIGN
INTRODUCTION
System design is the second step in the system life cycle, in which overall
and studied in this phase. The first step is designing of program specification.
This determines the various data inputs to the system, data flow and the format in
oriented document to computer data. The activity in the design phase is the
Flow charts prepared in the study time received and decomposed until all
architecture, procedural details( algorithms etc) and links between the modules.
The design process goes through logical and physical stages. In logical design
reviews are made linking existing system and specification gathered. The
physical plan specifies any hardware and software requirement, which satisfies
system depends on the planning of each and every fundamental module. Usually
criteria for design quality. Software design leads three technical activities-design,
The techniques for software design do exit with the availability of criteria
for design quality. Software design leads three technical activities-design, code
and test that are required to build and verify software. Each activity transforms
information, which validates the software. The design system converts theoretical
computer-based format. The goal of design input data is to make data entry as
easy, logical and free. The most common source of data processing errors is
inactive input data. Effective design of the input data minimizes the error made
by data entry operators. Catching errors on input is far less costly than correcting
Verification and validation is the most important in input design. Since the
the point contact of the user with the system and the input to the internal system
i.e. Databases. For full efficiency of the system, it is necessary that the input must
be accurate. Since the user of the system may not be a technical person and may
not know input concepts so it is required that he warn, prevent and correct invalid
data entry.
There are many ways that can be designed to handle such a situation. We
can prevent the user entering invalid data into the databases by warning,
data. Some help provisions may aid the user to point out the error. In this system
Output design has been an ongoing activity from the very beginning of the
project. The objective of the output design is to convey the information of all past
activities, current status and to emphasize important events. The output generally
refers to the results and information that is generated from the system.
following activities:
In the output design phase one or more output media can be selected. Out of
which the most common ones are CRT displays and print out. Here only CRT
display has been attempted. A rapid enquiry is obtained from CRT displays. From
made possible.
4.3 DATABASE DESIGN
1. CUSTOMER_RECORDS
custname Text
custadd Text
custphno Number
2. CALL_RATES
Local Number
Mobile Number
STD Number
ISD Number
MonthlyRental Number
3. CUSTOMER_METER_READING
Custphno Text
mLocal Number
Mmobile Number
mSTD Number
mISD Number
4. BILL_RECORD
custname Text
Custphno Text
Custadd Text
Localmt Number
Mobilemt Number
STDmt Number
ISDmt Number
5. LOGIN
LOGIN_ID AutoNumber
LOGIN_NAME Text
LOGIN_PASSWORD Text
Hardware environment
Software environment
Hardware Requirements:
1. Processor – Pentium 4
2. RAM – 1 GB
3. Hard Disk – 40GB
4. Mouse – Standard Mouse
5. Keyboard – Logitech Keyboard
6. Processor Speed – 2.4GHZ
Software Requirements:
Hardware Environment
Software Environment
Text Boxes:
It is used to display text or to accept user input. Most of the code is written to
process the information users enter into them. Several properties of text boxes are
as follows: -
Text: The text property in text box is the analog of the caption property for a
command button or a form; it controls text the users see. It determines whether
text on the control such as label or command button, is left justified, centered, or
right justified on the control. The Alignment property take one of the three
values: 0-Left justify, 1-Right justify, 2-Center.
Multiline: This property determines whether a text box can accept more than one
line of text when the user runs the application, and it is usually combine with
resulting the value of the scrollbar property. If true the property specifies the text
box can hold more than a line of text.
Max Length: This property specifies the maximum number of characters that the
text box will accept. A value of 0 indicates that the user can enter a value of any
length.
Locked: This property determines whether the user can enter a value or change
the default value of the text box. If true, the user cannot change the text box value
until the program, at run time assigns a false to this property.
Password char: The Password property lets us limit what the text box displays.
Labels: Use Labels to display information programmer does not want the user to
be able to change. Most common use for Labels is to identify a text box or other
control by describing its contents. Another common use is to display help
information.
Message Boxes:
Message boxes display information in the dialog box superimposed on the form.
They want for the user to choose a button before return to the application. User
cannot switch to another form in programmers applications as long as Visual
Basic is displaying a message box.
0 vbOKOnly OK button
Frames:
Option Buttons:
They all work together. When the user chooses one button, all other buttons in the
group are turned off. The value property of the option button tells us whether a
button was selected by the user. If the value property is true, the user selected that
button; otherwise, its value property is false.
Check Boxes:
Check Boxes differ from option button in that, regardless of how many Check
Boxes one places on a form, they can all be turned on and off independently. If
the user has selected Check Boxes, the value property switches to true. It stays
true until the user deselects that box.
Use list boxes when we have a fixed list of choices. Visual Basic automatically
adds vertical scroll bars when the list box is small for all items it contains.
To allow users to input data as well as choices from a list, we use a Combo Box.
Data List
Data Combo
Data Grid
Rich Textbox
Microsoft Chart
Image Combo
Database: -A database is a set of data, organized for easy access. The database is
the actual data. It is the database that you will be accessing when you need to
retrieve data.
Data Dictionary: -The data dictionary is a set of tables Access uses to maintain
information about the database. The data dictionary contains information about
tables, indexes, clusters, and so on.
DBA (Database Administrator): -The DBA is the person responsible for the
operation, configuration, and performance of the database. The DBA is charged
with keeping the database operating smoothly, ensuring that backups are done on
a regular basis (and that the backups work), and installing new software. Other
responsibilities might include planning for future expansion and disk space
needs, creating databases and tablespaces, adding users and maintaining security,
and monitoring the database and retuning it as necessary. Large installations
might have teams of DBAs to keep the system running smoothly; alternatively,
the tasks might be segmented among the DBAs.
Microsoft Access is a very effective DBMS tool which is generally used by all
the users. It is compatible with all types of systems & can be installed and used as
and when required.
5) SOURCE CODE
*******************Code For Start Form*******************
width = 1024
height = 520
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
root.geometry("%dx%d+%d+%d" % (width, height, x, y))
root.resizable(0, 0)
root.config(bg="#8EE4AF")
#========================================VARIABLES=
=======================================
USERNAME = StringVar()
PASSWORD = StringVar()
CUSTOMER_NAME = StringVar()
CUSTOMER_ADDRESS =StringVar()
CUSTOMER_PHONE = StringVar()
MOBILE = StringVar()
STD = StringVar()
ISD = StringVar()
#CUSTOMER_NAME = StringVar()
MOBILE_AMT = StringVar()
STD_AMT = StringVar()
SEARCH = StringVar()
#========================================METHODS==
========================================
def Database():
global conn, cursor
conn = mysql.connector.connect(user='root', password='',
host='127.0.0.1',
charset='utf8',
database='telephone')
#conn = sqlite3.connect("telephone.db")
cursor = conn.cursor()
#cursor.execute("CREATE TABLE IF NOT EXISTS `admin`
(admin_id INTEGER PRIMARY KEY AUTOINCREMENT NOT
NULL, username TEXT, password TEXT)")
#cursor.execute("CREATE TABLE IF NOT EXISTS `customer`
(customer_id INTEGER PRIMARY KEY AUTOINCREMENT NOT
NULL, customer_name TEXT, customer_address TEXT,
customer_phone TEXT)")
#cursor.execute("CREATE TABLE IF NOT EXISTS `bill` (bill_id
INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL,
customer_name TEXT,mobileamt TEXT,stdamt TEXT)")
cursor.execute("SELECT * FROM `admin` WHERE `username` =
'admin' AND `password` = 'admin'")
if cursor.fetchone() is None:
cursor.execute("INSERT INTO `admin` (username, password)
VALUES('admin', 'admin')")
conn.commit()
def Exit():
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to exit?', icon="warning")
if result == 'yes':
root.destroy()
exit()
def Exit2():
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to exit?', icon="warning")
if result == 'yes':
Home.destroy()
exit()
def ShowLoginForm():
global loginform
loginform = Toplevel()
loginform.title("Telephone Billing System/Account Login")
width = 600
height = 500
screen_width = root.winfo_screenwidth()
screen_height = root.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
loginform.resizable(0, 0)
loginform.geometry("%dx%d+%d+%d" % (width, height, x, y))
LoginForm()
def LoginForm():
global lbl_result
TopLoginForm = Frame(loginform, width=600, height=100, bd=1,
relief=SOLID)
TopLoginForm.pack(side=TOP, pady=20)
lbl_text = Label(TopLoginForm, text="Administrator Login",
font=('arial', 18), width=600)
lbl_text.pack(fill=X)
MidLoginForm = Frame(loginform, width=600)
MidLoginForm.pack(side=TOP, pady=50)
lbl_username = Label(MidLoginForm, text="Username:",
font=('arial', 25), bd=18)
lbl_username.grid(row=0)
lbl_password = Label(MidLoginForm, text="Password:",
font=('arial', 25), bd=18)
lbl_password.grid(row=1)
lbl_result = Label(MidLoginForm, text="", font=('arial', 18))
lbl_result.grid(row=3, columnspan=2)
username = Entry(MidLoginForm, textvariable=USERNAME,
font=('arial', 25), width=15)
username.grid(row=0, column=1)
password = Entry(MidLoginForm, textvariable=PASSWORD,
font=('arial', 25), width=15, show="*")
password.grid(row=1, column=1)
btn_login = Button(MidLoginForm, text="Login", font=('arial',
18), width=30, command=Login)
btn_login.grid(row=2, columnspan=2, pady=20)
btn_login.bind('<Return>', Login)
def Home():
global Home
Home = Tk()
Home.title("Telephone Billing System/Home")
width = 1024
height = 520
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
Home.geometry("%dx%d+%d+%d" % (width, height, x, y))
Home.resizable(0, 0)
Title = Frame(Home, bd=1, relief=SOLID)
Title.pack(pady=10)
lbl_display = Label(Title, text="Telephone Billing System",
font=('arial', 45))
lbl_display.pack()
menubar = Menu(Home)
filemenu = Menu(menubar, tearoff=0)
filemenu2 = Menu(menubar, tearoff=0)
filemenu.add_command(label="Logout", command=Logout)
filemenu.add_command(label="Exit", command=Exit2)
filemenu2.add_command(label="Add new",
command=ShowAddNew)
filemenu2.add_command(label="View", command=ShowView)
menubar.add_cascade(label="Account", menu=filemenu)
menubar.add_cascade(label="Customer Details", menu=filemenu2)
#filemenu2.add_command(label="Add Rates",
command=ShowAddNew1)
#filemenu2.add_command(label="View", command=ShowView1)
filemenu2.add_command(label="bill", command=ShowAddNew2)
filemenu2.add_command(label="View", command=ShowView2)
#menubar.add_cascade(label="Bill", menu=filemenu2)
#filemenu2.add_command(label="Bill details",
command=ShowAddNew)
#filemenu2.add_command(label="View", command=ShowView)
def ShowAddNew():
global addnewform
addnewform = Toplevel()
addnewform.title("Telephone Billing System/Add new")
width = 600
height = 500
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
addnewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
addnewform.resizable(0, 0)
AddNewForm()
def ShowAddNew1():
global addnewform
addnewform = Toplevel()
addnewform.title("Telephone Billing System/Add new")
width = 600
height = 700
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
addnewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
addnewform.resizable(0, 0)
AddNewForm1()
def ShowAddNew2():
global addnewform
addnewform = Toplevel()
addnewform.title("Telephone Billing System/Add new")
width = 600
height = 700
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
addnewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
addnewform.resizable(0, 0)
AddNewForm2()
def AddNewForm():
TopAddNew = Frame(addnewform, width=600, height=100, bd=1,
relief=SOLID)
TopAddNew.pack(side=TOP, pady=20)
lbl_text = Label(TopAddNew, text="Add New Product",
font=('arial', 18), width=600)
lbl_text.pack(fill=X)
MidAddNew = Frame(addnewform, width=600)
MidAddNew.pack(side=TOP, pady=50)
lbl_customername = Label(MidAddNew, text="Customer Name:",
font=('arial', 25), bd=10)
lbl_customername.grid(row=0, sticky=W)
lbl_address = Label(MidAddNew, text="Customer Address:",
font=('arial', 25), bd=10)
lbl_address.grid(row=1, sticky=W)
lbl_phone = Label(MidAddNew, text="Customer Phone:",
font=('arial', 25), bd=10)
lbl_phone.grid(row=2, sticky=W)
customername = Entry(MidAddNew,
textvariable=CUSTOMER_NAME, font=('arial', 25), width=15)
customername.grid(row=0, column=1)
mobileamt = Entry(MidAddNew,
textvariable=CUSTOMER_ADDRESS, font=('arial', 25), width=15)
mobileamt.grid(row=1, column=1)
stdamt = Entry(MidAddNew, textvariable=CUSTOMER_PHONE,
font=('arial', 25), width=15)
stdamt.grid(row=2, column=1)
btn_add = Button(MidAddNew, text="Save", font=('arial', 18),
width=30, bg="#009ACD", command=AddNew)
btn_add.grid(row=3, columnspan=2, pady=20)
def AddNewForm1():
TopAddNew = Frame(addnewform, width=600, height=100, bd=1,
relief=SOLID)
TopAddNew.pack(side=TOP, pady=20)
lbl_text = Label(TopAddNew, text="Add New Rates", font=('arial',
18), width=600)
lbl_text.pack(fill=X)
MidAddNew = Frame(addnewform, width=600)
MidAddNew.pack(side=TOP, pady=50)
lbl_mobile = Label(MidAddNew, text="Mobile :", font=('arial',
25), bd=10)
lbl_mobile.grid(row=0, sticky=W)
lbl_std = Label(MidAddNew, text="Std:", font=('arial', 25),
bd=10)
lbl_std.grid(row=1, sticky=W)
lbl_isd = Label(MidAddNew, text="Isd:", font=('arial', 25),
bd=10)
lbl_isd.grid(row=2, sticky=W)
mobile = Entry(MidAddNew, textvariable=MOBILE, font=('arial',
25), width=15)
mobile.grid(row=0, column=1)
std = Entry(MidAddNew, textvariable=STD, font=('arial', 25),
width=15)
std.grid(row=1, column=1)
isd = Entry(MidAddNew, textvariable=ISD, font=('arial', 25),
width=15)
isd.grid(row=2, column=1)
btn_add = Button(MidAddNew, text="Save", font=('arial', 18),
width=30, bg="#009ACD", command=AddNew1)
btn_add.grid(row=3, columnspan=2, pady=20)
def AddNewForm2():
TopAddNew = Frame(addnewform, width=600, height=100, bd=1,
relief=SOLID)
TopAddNew.pack(side=TOP, pady=20)
lbl_text = Label(TopAddNew, text="Add New Product",
font=('arial', 18), width=600)
lbl_text.pack(fill=X)
MidAddNew = Frame(addnewform, width=600)
MidAddNew.pack(side=TOP, pady=50)
lbl_customername = Label(MidAddNew, text="Customer Name:",
font=('arial', 25), bd=10)
lbl_customername.grid(row=0, sticky=W)
lbl_address = Label(MidAddNew, text="Mobile Amount:",
font=('arial', 25), bd=10)
lbl_address.grid(row=1, sticky=W)
lbl_phone = Label(MidAddNew, text="Std Amount:", font=('arial',
25), bd=10)
lbl_phone.grid(row=2, sticky=W)
customername = Entry(MidAddNew,
textvariable=CUSTOMER_NAME, font=('arial', 25), width=15)
customername.grid(row=0, column=1)
mobileamt = Entry(MidAddNew, textvariable=MOBILE_AMT,
font=('arial', 25), width=15)
mobileamt.grid(row=1, column=1)
stdamt = Entry(MidAddNew, textvariable=STD_AMT,
font=('arial', 25), width=15)
stdamt.grid(row=2, column=1)
btn_add = Button(MidAddNew, text="Save", font=('arial', 18),
width=30, bg="#009ACD", command=AddNew2)
btn_add.grid(row=3, columnspan=2, pady=20)
def AddNew():
Database()
cursor.execute("INSERT INTO `customer` (customer_name,
customer_Address, customer_phone) VALUES(%s, %s, %s)",
(str(CUSTOMER_NAME.get()), str(CUSTOMER_ADDRESS.get()),
str(CUSTOMER_PHONE.get())))
conn.commit()
CUSTOMER_NAME.set("")
CUSTOMER_ADDRESS.set("")
CUSTOMER_PHONE.set("")
cursor.close()
conn.close()
def AddNew2():
Database()
cursor.execute("INSERT INTO `bill` (customer_name, mobileamt,
stdamt) VALUES(%s, %s, %s)", (str(CUSTOMER_NAME.get()),
str(MOBILE_AMT.get()), str(STD_AMT.get())))
conn.commit()
CUSTOMER_NAME.set("")
#CUSTOMER_ADDRESS.set("")
#CUSTOMER_PHONE.set("")
MOBILE_AMT.set("")
STD_AMT.set("")
#ISD_AMT.set("")
cursor.close()
conn.close()
def ViewForm():
global tree
TopViewForm = Frame(viewform, width=600, bd=1,
relief=SOLID)
TopViewForm.pack(side=TOP, fill=X)
LeftViewForm = Frame(viewform, width=600)
LeftViewForm.pack(side=LEFT, fill=Y)
MidViewForm = Frame(viewform, width=600)
MidViewForm.pack(side=RIGHT)
lbl_text = Label(TopViewForm, text="View Customers",
font=('arial', 18), width=600)
lbl_text.pack(fill=X)
lbl_txtsearch = Label(LeftViewForm, text="Search", font=('arial',
15))
lbl_txtsearch.pack(side=TOP, anchor=W)
search = Entry(LeftViewForm, textvariable=SEARCH,
font=('arial', 15), width=10)
search.pack(side=TOP, padx=10, fill=X)
btn_search = Button(LeftViewForm, text="Search",
command=Search)
btn_search.pack(side=TOP, padx=10, pady=10, fill=X)
btn_reset = Button(LeftViewForm, text="Reset", command=Reset)
btn_reset.pack(side=TOP, padx=10, pady=10, fill=X)
#btn_delete = Button(LeftViewForm, text="Delete",
command=Delete)
#btn_delete.pack(side=TOP, padx=10, pady=10, fill=X)
scrollbarx = Scrollbar(MidViewForm, orient=HORIZONTAL)
scrollbary = Scrollbar(MidViewForm, orient=VERTICAL)
tree = ttk.Treeview(MidViewForm, columns=("CustomerID",
"Customer Name", "Customer Address", "Customer Phone"),
selectmode="extended", height=100, yscrollcommand=scrollbary.set,
xscrollcommand=scrollbarx.set)
scrollbary.config(command=tree.yview)
scrollbary.pack(side=RIGHT, fill=Y)
scrollbarx.config(command=tree.xview)
scrollbarx.pack(side=BOTTOM, fill=X)
tree.heading('CustomerID', text="ProductID",anchor=W)
tree.heading('Customer Name', text="Customer Name",anchor=W)
tree.heading('Customer Address', text="Customer
Address",anchor=W)
tree.heading('Customer Phone', text="Customer Phone",anchor=W)
tree.column('#0', stretch=NO, minwidth=0, width=0)
tree.column('#1', stretch=NO, minwidth=0, width=0)
tree.column('#2', stretch=NO, minwidth=0, width=200)
tree.column('#3', stretch=NO, minwidth=0, width=120)
tree.column('#4', stretch=NO, minwidth=0, width=120)
tree.pack()
DisplayData()
def ViewForm1():
global tree
TopViewForm = Frame(viewform, width=600, bd=1,
relief=SOLID)
TopViewForm.pack(side=TOP, fill=X)
LeftViewForm = Frame(viewform, width=600)
LeftViewForm.pack(side=LEFT, fill=Y)
MidViewForm = Frame(viewform, width=600)
MidViewForm.pack(side=RIGHT)
lbl_text = Label(TopViewForm, text="View Call rates",
font=('arial', 18), width=600)
lbl_text.pack(fill=X)
lbl_txtsearch = Label(LeftViewForm, text="Search", font=('arial',
15))
lbl_txtsearch.pack(side=TOP, anchor=W)
search = Entry(LeftViewForm, textvariable=SEARCH,
font=('arial', 15), width=10)
search.pack(side=TOP, padx=10, fill=X)
btn_search = Button(LeftViewForm, text="Search",
command=Search1)
btn_search.pack(side=TOP, padx=10, pady=10, fill=X)
btn_reset = Button(LeftViewForm, text="Reset",
command=Reset1)
btn_reset.pack(side=TOP, padx=10, pady=10, fill=X)
btn_delete = Button(LeftViewForm, text="Delete",
command=Delete1)
btn_delete.pack(side=TOP, padx=10, pady=10, fill=X)
scrollbarx = Scrollbar(MidViewForm, orient=HORIZONTAL)
scrollbary = Scrollbar(MidViewForm, orient=VERTICAL)
tree = ttk.Treeview(MidViewForm, columns=("CallerID",
"Mobile", "Std","Isd"), selectmode="extended", height=100,
yscrollcommand=scrollbary.set, xscrollcommand=scrollbarx.set)
scrollbary.config(command=tree.yview)
scrollbary.pack(side=RIGHT, fill=Y)
scrollbarx.config(command=tree.xview)
scrollbarx.pack(side=BOTTOM, fill=X)
tree.heading('CallerID', text="CallerID",anchor=W)
#tree.heading('Local', text="Local",anchor=W)
tree.heading('Mobile', text="Mobile",anchor=W)
tree.heading('Std', text="Std",anchor=W)
tree.heading('Isd', text="Isd",anchor=W)
#tree.heading('Monthly Rental', text="Monthly Rental",anchor=W)
tree.column('#0', stretch=NO, minwidth=0, width=0)
tree.column('#1', stretch=NO, minwidth=0, width=0)
tree.column('#2', stretch=NO, minwidth=0, width=200)
tree.column('#3', stretch=NO, minwidth=0, width=120)
tree.column('#4', stretch=NO, minwidth=0, width=120)
tree.pack()
DisplayData1()
def ViewForm2():
#global tree
#TopViewForm = Frame(viewform, width=600, bd=1,
relief=SOLID)
#TopViewForm.pack(side=TOP, fill=X)
#LeftViewForm = Frame(viewform, width=600)
#LeftViewForm.pack(side=LEFT, fill=Y)
#MidViewForm = Frame(viewform, width=600)
#MidViewForm.pack(side=RIGHT)
#lbl_text = Label(TopViewForm, text="View bill", font=('arial',
18), width=600)
#lbl_text.pack(fill=X)
#lbl_txtsearch = Label(LeftViewForm, text="Search", font=('arial',
15))
#lbl_txtsearch.pack(side=TOP, anchor=W)
#search = Entry(LeftViewForm, textvariable=SEARCH,
font=('arial', 15), width=10)
#search.pack(side=TOP, padx=10, fill=X)
#btn_search = Button(LeftViewForm, text="Search",
command=Search2)
#btn_search.pack(side=TOP, padx=10, pady=10, fill=X)
#btn_reset = Button(LeftViewForm, text="Reset",
command=Reset2)
#btn_reset.pack(side=TOP, padx=10, pady=10, fill=X)
#btn_delete = Button(LeftViewForm, text="Delete",
command=Delete)
#btn_delete.pack(side=TOP, padx=10, pady=10, fill=X)
#scrollbarx = Scrollbar(MidViewForm, orient=HORIZONTAL)
#scrollbary = Scrollbar(MidViewForm, orient=VERTICAL)
#tree = ttk.Treeview(MidViewForm, columns=("BillID",
"Customer Name","Mobile Amount","Std Amount"),
selectmode="extended", height=100, yscrollcommand=scrollbary.set,
xscrollcommand=scrollbarx.set)
#scrollbary.config(command=tree.yview)
#scrollbary.pack(side=RIGHT, fill=Y)
#scrollbarx.config(command=tree.xview)
#scrollbarx.pack(side=BOTTOM, fill=X)
#tree.heading('BillID', text="BillID",anchor=W)
#tree.heading('Customer Name', text="Customer
Name",anchor=W)
#tree.heading('Mobile Amount', text="Mobile Amount",anchor=W)
#tree.heading('Std Amount', text="Std Amount",anchor=W)
#tree.column('#0', stretch=NO, minwidth=0, width=0)
#tree.column('#1', stretch=NO, minwidth=0, width=0)
#tree.column('#2', stretch=NO, minwidth=0, width=200)
#tree.column('#3', stretch=NO, minwidth=0, width=120)
#tree.column('#4', stretch=NO, minwidth=0, width=120)
#tree.pack()
#DisplayData2()
global tree
TopViewForm = Frame(viewform, width=600, bd=1,
relief=SOLID)
TopViewForm.pack(side=TOP, fill=X)
LeftViewForm = Frame(viewform, width=600)
LeftViewForm.pack(side=LEFT, fill=Y)
MidViewForm = Frame(viewform, width=600)
MidViewForm.pack(side=RIGHT)
lbl_text = Label(TopViewForm, text="View Bill", font=('arial',
18), width=600)
lbl_text.pack(fill=X)
lbl_txtsearch = Label(LeftViewForm, text="Search", font=('arial',
15))
lbl_txtsearch.pack(side=TOP, anchor=W)
search = Entry(LeftViewForm, textvariable=SEARCH,
font=('arial', 15), width=10)
search.pack(side=TOP, padx=10, fill=X)
btn_search = Button(LeftViewForm, text="Search",
command=Search2)
btn_search.pack(side=TOP, padx=10, pady=10, fill=X)
btn_reset = Button(LeftViewForm, text="Reset",
command=Reset2)
btn_reset.pack(side=TOP, padx=10, pady=10, fill=X)
#btn_delete = Button(LeftViewForm, text="Delete",
command=Delete)
#btn_delete.pack(side=TOP, padx=10, pady=10, fill=X)
scrollbarx = Scrollbar(MidViewForm, orient=HORIZONTAL)
scrollbary = Scrollbar(MidViewForm, orient=VERTICAL)
tree = ttk.Treeview(MidViewForm, columns=("BillID", "Customer
Name", "Mobile Amount", "Std Amount"), selectmode="extended",
height=100, yscrollcommand=scrollbary.set,
xscrollcommand=scrollbarx.set)
scrollbary.config(command=tree.yview)
scrollbary.pack(side=RIGHT, fill=Y)
scrollbarx.config(command=tree.xview)
scrollbarx.pack(side=BOTTOM, fill=X)
tree.heading('BillID', text="BillID",anchor=W)
tree.heading('Customer Name', text="Customer Name",anchor=W)
tree.heading('Mobile Amount', text="Mobile Amount",anchor=W)
tree.heading('Std Amount', text="Std Amount",anchor=W)
tree.column('#0', stretch=NO, minwidth=0, width=0)
tree.column('#1', stretch=NO, minwidth=0, width=0)
tree.column('#2', stretch=NO, minwidth=0, width=200)
tree.column('#3', stretch=NO, minwidth=0, width=120)
tree.column('#4', stretch=NO, minwidth=0, width=120)
tree.pack()
DisplayData2()
def DisplayData():
Database()
cursor.execute("SELECT * FROM `customer`")
fetch = cursor.fetchall()
for data in fetch:
tree.insert('', 'end', values=(data))
cursor.close()
conn.close()
def DisplayData2():
Database()
cursor.execute("SELECT * FROM `bill`")
fetch = cursor.fetchall()
for data in fetch:
tree.insert('', 'end', values=(data))
cursor.close()
conn.close()
def Search():
if SEARCH.get() != "":
tree.delete(*tree.get_children())
Database()
cursor.execute("SELECT * FROM `customer` WHERE
`customer_name` LIKE %s", ('%'+str(SEARCH.get())+'%',))
fetch = cursor.fetchall()
for data in fetch:
tree.insert('', 'end', values=(data))
cursor.close()
conn.close()
def Search1():
if SEARCH.get() != "":
tree.delete(*tree.get_children())
Database()
cursor.execute("SELECT * FROM `callrates` WHERE local`
LIKE ?", ('%'+str(SEARCH.get())+'%',))
fetch = cursor.fetchall()
for data in fetch:
tree.insert('', 'end', values=(data))
cursor.close()
conn.close()
def Search2():
if SEARCH.get() != "":
tree.delete(*tree.get_children())
Database()
cursor.execute("SELECT * FROM `bill` WHERE
`customer_name` LIKE %s", ('%'+str(SEARCH.get())+'%',))
fetch = cursor.fetchall()
for data in fetch:
tree.insert('', 'end', values=(data))
cursor.close()
conn.close()
def Reset():
tree.delete(*tree.get_children())
DisplayData()
SEARCH.set("")
def Reset2():
tree.delete(*tree.get_children())
DisplayData2()
SEARCH.set("")
def Delete():
if not tree.selection():
print("ERROR")
else:
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to delete this record?', icon="warning")
if result == 'yes':
curItem = tree.focus()
contents =(tree.item(curItem))
selecteditem = contents['values']
tree.delete(curItem)
Database()
cursor.execute("DELETE FROM `customer` WHERE
`customer_id` = %d" % selecteditem[0])
conn.commit()
cursor.close()
conn.close()
def Delete1():
if not tree.selection():
print("ERROR")
else:
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to delete this record?', icon="warning")
if result == 'yes':
curItem = tree.focus()
contents =(tree.item(curItem))
selecteditem = contents['values']
tree.delete(curItem)
Database()
cursor.execute("DELETE FROM `callrates` WHERE
`customer_id` = %d" % selecteditem[0])
conn.commit()
cursor.close()
conn.close()
def Delete2():
if not tree.selection():
print("ERROR")
else:
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to delete this record?', icon="warning")
if result == 'yes':
curItem = tree.focus()
contents =(tree.item(curItem))
selecteditem = contents['values']
tree.delete(curItem)
Database()
cursor.execute("DELETE FROM `bill` WHERE `bill_id` =
%d" % selecteditem[0])
conn.commit()
cursor.close()
conn.close()
def ShowView():
global viewform
viewform = Toplevel()
viewform.title("Telephone Billing System/View Customer")
width = 600
height = 400
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
viewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
viewform.resizable(0, 0)
ViewForm()
def ShowView1():
global viewform
viewform = Toplevel()
viewform.title("Telephone Billing System/View Product")
width = 600
height = 400
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
viewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
viewform.resizable(0, 0)
ViewForm1()
def ShowView2():
global viewform
viewform = Toplevel()
viewform.title("Telephone Billing System/View bill")
width = 600
height = 400
screen_width = Home.winfo_screenwidth()
screen_height = Home.winfo_screenheight()
x = (screen_width/2) - (width/2)
y = (screen_height/2) - (height/2)
viewform.geometry("%dx%d+%d+%d" % (width, height, x, y))
viewform.resizable(0, 0)
ViewForm2()
def Logout():
result = tkMessageBox.askquestion('Telephone Billing System',
'Are you sure you want to logout?', icon="warning")
if result == 'yes':
admin_id = ""
root.deiconify()
Home.destroy()
def Login(event=None):
global admin_id
Database()
if USERNAME.get == "" or PASSWORD.get() == "":
lbl_result.config(text="Please complete the required field!",
fg="red")
else:
cursor.execute("SELECT * FROM `admin` WHERE `username`
= %s AND `password` = %s", (USERNAME.get(),
PASSWORD.get()))
if cursor.fetchone() is not None:
cursor.execute("SELECT * FROM `admin` WHERE
`username` = %s AND `password` = %s", (USERNAME.get(),
PASSWORD.get()))
data = cursor.fetchone()
admin_id = data[0]
USERNAME.set("")
PASSWORD.set("")
lbl_result.config(text="")
ShowHome()
else:
lbl_result.config(text="Invalid username or password",
fg="red")
USERNAME.set("")
PASSWORD.set("")
cursor.close()
conn.close()
def ShowHome():
root.withdraw()
Home()
loginform.destroy()
#========================================MENUBAR
WIDGETS==================================
menubar = Menu(root)
filemenu = Menu(menubar, tearoff=0)
filemenu.add_command(label="Admin Login"
, command=ShowLoginForm)
filemenu.add_command(label="Exit", command=Exit)
menubar.add_cascade(label="File", menu=filemenu)
root.config(menu=menubar)
#========================================FRAME====
========================================
Title = Frame(root, bd=1, relief=SOLID)
Title.pack(pady=10)
#========================================LABEL
WIDGET=====================================
lbl_display = Label(Title, text="Telephone Billing System",
font=('arial', 45))
lbl_display.pack()
#========================================INITIALIZAT
ION===================================
if __name__ == '__main__':
root.mainloop()
7) TESTING AND DEBUGGING
UNIT TESTING
Unit testing focuses verification effort on the smallest unit of software design, the
module. It comprises the set of test performed by the programmer prior to
integration of the unit into larger system. The testing was carried out during the
coding stage itself. In this step each module is found to be working satisfactorily
as regards to the expected output from the module.
INTEGRATION TESTING
# Bottom Up Integration
The first one is done where integration is carried out by addition of minor
modules to major modules. While Bottom Up integration follows combination of
smaller ones to large one. Here Bottom Up Integration was encouraged. Even
though correction was difficult because the isolation of causes is complicated by
the vastness of the entire program, all the errors found in the system were
corrected and then forwarded to the next testing steps.
User acceptance of a system is the key factor for the success of any system. The
system under consideration was tested for users acceptance by constantly keeping
in touch with the perspective system user at the time of developing and making
changes wherever required. This is done with the regards to the following points:
A system may be defined as a set of instruction combined in the same form and
directed to some purpose.
Before any development is undertaken certain specifications are prepared which
objectively describe the application system. The System specifications are made
after consulting the end user managers of the relevant departments.
Software to be developed is planned on the basis of requirement of the user. The
problem definition statement description of present situation and goal to be
achieved by news system.
INTRODUCTION
Even the best system developed has some flaws or others. There always exist
scope of further improvement in the system. The effect of implementations of
new computerized system is found remarkable.
The following are the major improvement of the new system over the existing
system.
Every project whether large or small has some limitations no matter however
diligently developed. In some cases limitations is small while in other cases they
may be broad also. The new system has got some limitations. Major areas where
modifications can be done are as follows:
b) The user can view the existing lists of customers, which already have
telephone connections.
c) The user can of course see bills & take billing statements.
d) The user can also do several administrative works like managing rates
of calls, addition or modification of metered calls & customer entries.
It is a computerized system, which can be used very easily & effectively by the
administrators of the telephone billing system.
BIBLIOGRAPHY
The great help from our faculty members and my project guide that led the
successful completion of the project. Besides that, I took the help of some books
and websites to develop the project. They are:
1. PYTHON BOOK
---Steven Holzner
2. BASIC DJANGO
----Evangelos Petroutsos
Screen Shot
Home Screen
Admin Login
Billing Home
Customer Bill
View customer
Bill
Bill view