0% found this document useful (0 votes)
84 views56 pages

Loan Management System

The existing loan management system is a manual process that lacks proper security and tracking of details. It does not allow customers to easily check their profile or download loan forms. The proposed system aims to address these issues through a digital system that securely stores and easily retrieves customer and loan details.

Uploaded by

ramagowda416
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
84 views56 pages

Loan Management System

The existing loan management system is a manual process that lacks proper security and tracking of details. It does not allow customers to easily check their profile or download loan forms. The proposed system aims to address these issues through a digital system that securely stores and easily retrieves customer and loan details.

Uploaded by

ramagowda416
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 56

LOAN MANAGEMENT SYSTEM

USING PYTHON
A Project work submitted in partial fulfillment of the requirements for
the degree of
Bachelor of Computer Applications
to the
Periyar University, Salem-11
By
ARAVIND B
[C21UG155CAP004]

PG & RESEARCH DEPARTMENT OF COMPUTER


SCIENCE
DON BOSCO COLLEGE
(Affiliated to Periyar University, Salem-11)
DHARMAPURI - 636 809

MAR/APR – 2024
Mr. S. Vadamalai M.C.A., M.Phil.., B.Ed.,
Head of the department
PG & Research Department of Computer Science,
Don Bosco College,
Dharmapuri - 636 809.
Place : Dharmapuri,

Date :03-04-2024.

CERTIFICATE
This is to certify that the project work entitled “LOAN MANAGEMENT SYSTEM ”
submitted in partial fulfillment of the requirements of the degree of Bachelor Of Computer
Applications to the Periyar University, Salem is record of bonafide work carried out by
ARAVIND B [REG.NO:C21UG155CAP004] under my supervision and guidance.

Head of the Department Signature of the Guide

[With Seal] [With Seal]

Submitted for the viva-voce Examination held on 03-04-2024

Internal Examiner External Examiner

[With Seal] [With Seal]


DECLARATION

I hereby declare that the project entitled “LOAN MANAGEMENT SYSTEM


USING PYTHON” submitted to the Periyar University, Salem in partial fulfillment of the
requirements for the award of the degree of Master of Science in Computer Science is a
record of original work done by me under the supervision and guidance of. Mr. S.
Vadamalai M.C.A., M.Phil.., B.Ed., Head of the Department PG & Research Department
of Computer Science, Don Bosco College, Dharmapuri and that it has not previously formed
the basis of the award of any Degree, Diploma, Associate ship, Fellowship or any other
similar title of any University or Institution.

Place : Dharmapuri Signature of candidate


Date : 03-04-2024 ARAVIND B
ACKNOWLEDGEMENT

I thank the almighty God for the blessings that have been showered upon me to
complete the project successfully. I express my heartfelt thanks to my parents who have
encouraged me in all ways to do my project.

I wish to express my thanks to Rev. Fr. Dr. Robert Ramesh Babu SDB, Secretary
and Rector, Don Bosco College, Dharmapuri, for his constant encouragement.

I render my special thanks to Rev. Fr. Dr. J. Angelo Joseph SDB, Principal, and
Rev.Fr. Dr. S. Bharathi Bernadsha SDB, Vice-Principal, from Don Bosco College,
Dharmapuri, for their support and constant encouragement.

I am highly thankful to Mr. S. Vadamalai M.C.A., M.Phil.., B.Ed., Head of the


Department, PG Research Department of Computer Science, Don Bosco College,
Dharmapuri, for his valuable guidance, encouragement, and keen interest in completion of
my project work.

I also take the opportunity to express my gratitude to my Guide Mr. S. Vadamalai


M.C.A., M.Phil.., B.Ed., Head, PG Research Department of Computer Science, Don Bosco
College, Dharmapuri, for her outstanding computing workmanship evinced in executing my
project work.

I also take the opportunity to express my gratitude to my Class In charge Mr. S.


Micheal Bosco Duraisamy, M.Sc., M.Phil.., B.Ed. Assistant Professor, PG Research
Department of Computer Science, Don Bosco College, Dharmapuri, for her support evinced
in executing my project work.

I sincerely thank my department staff members of Don Bosco College, Dharmapuri,


for their guidance evinced in executing my project.

[ARAVIND B]
ABSTRACT

The loan management system project is using in Python. The Loan management
system is important and helps to ensure success or failure of any credit institution. Mortgage
loan problems have always been a key note on the risk of loan loss. The scope of this project
is to provide good communication and communication between the customer and the
manager. The current system can be a user-friendly system, which does not store data in the
proper security. The Financial Management System is designed to perform the functions of
the back offices of a bank and a non-cash financial institution offers any sort of loan. The
system can make daily operations more efficient and provide faster response. Including
adding, editing, retrieving customer information, maintaining and issuing new loans, change
the loan rate. The scope of this project is to use the loan in a very smart way. The project
includes a system analysis and style for obtaining a loan details process, settlement process,
and approving the payment process.
CONTENTS

Chapter No Title of the Content Page No

1 INTRODUCTION

1.1 ORGANIZATION PROFILE


1.2 SYSTEM SPECIFICATION
1.2.1 HARDWARE CONFIGURATION
1.2.2 SOFTWARE CONFIGRATION

2 SYSTEM STUDY

2.1 EXISTING SYSTEM


2.1.1 DESCRIPTION
2.1.2 DRAWBACKS
2.2 PROPOSED SYSTEM
2.2.1 DESCRIPTION
2.2.2 FEATURES

3 SYSTEM DESIGN AND DEVELOPMENT

3.1 FILE DESIGN


3.2 INPUT DESIGN
3.3 OUTPUT DESIGN
3.4 CODE DESIGN
3.5 DATABASE DESIGN
3.6 SYSTEM DEVELOPMENT
3.6.1 DISCRIPTION OF MODULES
4 TESTING AND IMPLEMENTATION

5 CONCULUSION

6 BIBLIOGRAPHY

7 APPENDENCIES
A. DATA FLOW DIAGRAM
B. TABLE STRUCTURE
C. SAMPLE CODING
D. SAMPLE INPUT
E. SAMPLE OUTPUT
CHAPTER I
INTRODUCTION
Introduction:

This program is called an loan management program. This approach is


intended to simply preserve the details of the direct lenders. This method is created to keep
records about consumers who have taken out bank loans. A registered user can sign in to the
Loan system using their user id and password. After logging in to this process there are
decisions to add new customers, manage check other details etc. Many new customers are
visiting this bank, so adding new customer information and keeping records is very easy to
use. There are many other ways like changing the repo rate, adding new accounts etc. New
and unique ids are provided to everyone. There are decisions to evaluate the customer's loan
amount, rate and unpaid amount. The amount paid by any customer or can be kept there and
it is easy to calculate daily how much money is collected. Bank employees are a type of
manager, the cashier can also assess their customer's key points if any customer has not paid
a monthly instalment for the past three months. It's easy to calculate money with a hosting
account every month. this method also has the option of running a backup, which means that
if we back up the database it will never be lost. An employee may have taken out a loan that
the bank may appear to have. Therefore, this whole loan management system can be the
solution to all of the issues we face in the industry at large
1.1 ORGANIZATION PROFILE

IT and IT-Enabled Solution Provider for Corporates and Service Sectors

In our industrial orchestration of technologies, tools, processes and methods, we strive


to be on level with our professional philosophy of “customer-friendly investments”.

• Developing complete feature rich and scalable ERP solutions as per need requirement.

• Innovative products and excellent support that meet or exceed Client's expectations.

• Timely delivery.

• Products at affordable price.

• Unassailable support.

• Address.
1.2. SYSTEM SPECIFICATION

1.2.1. HARDWARE CONFIGURATION


 Processor : Intel Core i3
 RAM : 8 GB
 Hard disk capacity : SSD 250 GB
 System type : 64-bit operating system

1.2.2. SOFTWARE SPECIFICATION


 Operating System : Windows 10 Pro
 Front-end : PYTHON
 Back-end : SQLITE 3
CHAPTER II
SYSTEM STUDY
2.0. SYSTEM STUDY
2.1. Existing System

2.1.1. Drawbacks

 The existing system is a manual that doesn't maintain details with


proper security and can't

 track details easily

 It doesn't allow the customer to check their profile in proper way


which leads customer dis-

 Does not provide option to download loan form

 Existing system doesn't contains functionalities of fast retrieval


information such as customer

 Details and maintenance of all the loan details so it involves lots of


paperwork

 Doesn't user-friendly interface.

 Lots of time is required to manage customer info & details so it feels


that existing system not

 Accurate and therefore maintenance becomes very complicate.

 It used to take more time to find customers because there are required
extra manual effort such

 to hire candidate,

 Difficulty in generating different reports as per the


business requirement
2.2. Proposed System:

2.2.1. Description

The proposed system facilitates the patients to fill up their details, and to
give a brief description of a Loan Management System they want to loan apply. This new
system is very helpful for customers who want to hire their loan management system through
this python. This Loan Management System project will enable the user to service a hospital.
The user specifies a type of loan management system Loan Id, Full Name, Mobile no, Aadhar
no, Address, Pincode, Amount of Loan, Number of years, Interest Rate, Monthly Payment,
Total Payment is a GUI based application which is very easy to understand and use. It uses
tkinter module for the GUI. Talking about the application, the user can easily loan apply, add,
update and delete, reset in the customer details.

2.2.2 Features

 Easy to loan apply

 Real-Time Availability

 User Authentication and Security

 Updating the Records

 Delete the Records

 Customer details
CHAPTER III
SYSTEM DESIGN AND DEVELOPMENT
3.1 FILE DESIGN
3.2 INPUT DESIGN
CODE DESIGN

3.4. DATABASE DESIGN

Database design is required to manage the large bodies of information. The


management of data involves both the definition of structure of the storage of information
and provisions of mechanism for the manipulation of information. In addition, the database
system must provide for the safety of information handled, despite the system crashes due to
attempts are unauthorized access. For developing an efficient database, we must fulfill certain
conditions such as:

 Control redundancy
 Ease of use
 Data independence
 Accuracy and integrity
 Avoiding inordinate delays
 Recovery form failure
 Privacy and security
3.6 SYSTEM DEVELOPMENT

System development in Python typically involves creating software systems or


applications using the Python programming language. Here's a general outline of the process
Define Requirements: Understand the purpose and goals of the system, Identify user
requirements and expectations. Design: Create a system architecture and design based on the
requirements, Decide on the overall structure of the system, Break down the system into
modules or components, Design the user interface if applicable, Setup Development
Environment: Install Python and any necessary libraries or frameworks, Choose an integrated
development environment (IDE) or a text editor. Coding: Implement the system logic based
on the design, Write Python code for each module or component. Follow coding best
practices to ensure maintainability. Testing: Develop and execute test cases to verify the
functionality of the system, Perform unit testing for individual components, Conduct
integration testing to ensure different modules work together, Address and fix any bugs or
issues discovered during testing. Documentation: Create documentation for the code,
including comments, docstrings, and any necessary user or developer documentation.
Document the system architecture and design choices. Version Control: Use a version control
system (e.g., Git) to track changes in the code base. Collaborate with a team if applicable.
Deployment: Package the application for deployment. Choose deployment options, whether
it's on-premises or on a cloud platform. Set up any necessary databases, servers, or
infrastructure. Maintenance and Updates: Monitor and maintain the system after deployment.
Address any issues that arise in a timely manner, Plan for and implement updates or new
features as needed. Security Considerations: Implement security measures to protect the
system from vulnerabilities. Regularly update dependencies and libraries to patch security
issues. Remember that Python supports a variety of frameworks and libraries that can help in
different aspects of system development. Some popular ones include Django and Flask for
web development, Tkinter for GUI applications, and NumPy or Pandas for data-related tasks.
The exact steps and tools used may vary based on the specific requirements and nature of the
system being developed.
3.6.1 DISCRIPTION OF MODULES

Modules List :
 Login
 Loan management system

Login :
 Username
 Password
Loan management system :
 Loan Id, Full Name, Mobile no, Aadhar no, Address, Pincode, Amount
of Loan, Number of years, Interest Rate, Monthly Payment, Total
Payment and then add record, update, delete and reset in the loan
management system.
CHAPTER IV

TESTING AND IMPLEMENTATION


TESTINGAND IMPLEMENTATION

Testing and implementing a hospital appointment system involve several steps to


ensure the functionality, reliability, and security of the system. Below are key phases for
testing and implementation:

Testing:

Unit Testing:

Test individual components (modules, functions, classes) of the appointment


system. Verify that each unit performs its intended functionality.

Integration Testing:

Test the interaction between different components to ensure they work


together as expected. Verify that data flows correctly between modules.

Functional Testing:

Verify that the system meets the specified functional requirements. Test
different use cases, including scheduling appointments, canceling appointments, and
viewing appointment details.

User Interface (UI) Testing:

Ensure that the user interface is intuitive and user-friendly. Verify that all UI elements
are responsive and functional.

Performance Testing:

Test the system's performance under various conditions (e.g., high load).

Check response times for critical operations.

Security Testing:

Assess the system's security measures to protect patient data. Test for
vulnerabilities and implement measures to secure the system.
Usability Testing:

Conduct usability tests to ensure the system is easy to use for both staff and
patients. Gather feedback on the user experience.

Compatibility Testing:

Ensure the system works correctly on different browsers and devices. Verify
compatibility with various operating systems.

Regression Testing:

Re-run previous tests after making updates to ensure existing functionality is


not affected.

Database Setup:

Create and configure the database for storing appointment data. Implement
data models to represent appointments, patients, and other relevant information.

Backend Development:

Implement server-side logic for handling appointment scheduling,


cancellations, and other operations. Connect the backend to the database.

Frontend Development:

Develop the user interface for staff and patient interactions. Ensure a
responsive design that works well on various devices.

Integration:

Integrate the frontend and backend components. Verify that data is correctly
transferred between the user interface and the server.

Security Implementation:

Implement security measures, including encryption of sensitive data and


proper user authentication. Set up access controls based on user roles.
User Training:

Provide training sessions for hospital staff to use the new appointment system.
Create user manuals or documentation for reference.

Deployment:

Deploy the system to a staging environment for final testing. Once satisfied,
deploy to the production environment.

Monitoring and Support:

Set up monitoring tools to track system performance. Provide ongoing support


and address any issues that arise post-deployment.

Feedback and Iteration:

Gather feedback from users and stakeholders. Iterate on the system based on
feedback and continuously improve it.

Remember to involve end-users and stakeholders throughout the testing and


implementation phases to ensure that the system meets their needs and expectations.
Regular communication and collaboration are crucial for the success of the hospital
appointment system.
CHAPTER V

CONCLUTION
CONCLUTION

The conclusion, a well-designed loan management system is a crucial tool for


loan apply. It not only improves the efficiency of administrative processes but also
contributes to a better overall customer experience and more effective use of resources.
Implementing such a system can positively impact both the customer loan apply provider and
the customer, fostering a more streamlined and customer loan management system
environment.
CHAPTER VI

BIBLIOGRAPHY
6.0. BIBLIOGRAPHY

 The python is a printed edition of the official python language reference


manual by Guido van Rossum.
 A concise desktop reference for Python 3/5 and 2.7 (with mention of 3.6
features).
 Covers the language itself, built-in types and functions, the standard library,
and crucial third-party extensions such as Numeric, Tkinter, twisted.internet,
Cheetah.
 A concise reference book, awarded as one of the best regular expression books
in the year 2020 and 2021, is written in a very friendly manner to teach and
practice regular expression easily and efficiently.

WEBSITE

1. www.geeksforgeeks.org

2. www.w3schools.com

3, www.learnpython.org
CHAPTER VII

APPENDENCIES
APPENDENCIES

A. DATA FLOW DIAGRAM

DFD INTRODUCTION

DFD is the abbreviation for Data Flow Diagram. The flow of data of a system or a
process is represented by DFD. It also gives insight into the inputs and outputs of each entity
and the process itself. DFD does not have control flow and no loops or decision rules are
present. Specific operations depending on the type of data can be explained by a flowchart.
Data Flow Diagram can be represented in several ways. The DFD belongs to structured-
analysis modeling tools. Data Flow diagrams are extremely popular because they help us to
visualize the major steps and data involved in software- system processes.

The Data Flow Diagram has four components:

1. process
Input to output transformation in a system takes place because of process
function. The symbols of a process are rectangular with rounded corners, oval,
rectangle, or a circle. The process is named a short sentence, in one word or a
phrase to express its essence.

2. Data Flow

Data flow describes the information transferring between different parts of


the systems. The arrow symbol is the symbol of data flow. A relatable name
should be given to the flow to determine the information which is being moved.
Data flow also represents material along with information that is being moved.
Material shifts are modeled in systems that are not merely informative. A given
flow should only transfer a single type of information. The direction of flow is
represented by the arrow which can also be bi-directional.
3. Warehouse
The data is stored in the warehouse for later use. Two horizontal lines
represent the symbol of the store. The warehouse is simply not restricted to being
a data file, rather it can be anything like a folder with documents, an optical disc, a
filing cabinet. The data warehouse can be viewed independent of its
implementation. When the data flows from the warehouse it is considered as data
reading and when data flows to the warehouse it is called data entry or data
updating.

4. Terminator

The Terminator is an external entity that stands outside of the system and
communicates with the system. It can be, for example, organizations like banks,
groups of people like customers or different departments of the same organization,
which is not a part of the model system and is an external entity. Modeled systems
also communicate with terminators.

Rules for creating DFD

4. The name of the entity should be easy and understandable without any extra
assistance(like comments).

5. The processes should be numbered or put in an ordered list to be referred


easily.

6. The DFD should maintain consistency across all the DFD levels.

7. A single DFD can have maximum processes up to nine and minimum three
processes.
Levels of DFD
Uses hierarchy to maintain transparency thus multilevel DFD’s can be created.
Levels of DFD are as follows:
7.6 0-level DFD

7.7 1-level DFD

7.8 2-level DFD


Advantages of DFD

8. It helps us to understand the functioning and the limits of a system.

9. It is a graphical representation which is very easy to understand as it helps


visualize contents.

10. Data Flow Diagram represents detailed and well explained diagram of
system components.

11. It is used as a part of a system documentation file.


12. Both technical and nontechnical people can understand Data Flow
Diagrams because they are quite easy to understand.

Disadvantages of DFD
13. At times DFD can confuse the programmers regarding the system.
14. Data Flow Diagram takes a long time to be generated, and many times due
to this reasons analyst are denied permission to work on it.
DATA FLOW DIAGRAM

USER
B. TABLE STRUCTURE

Designing a table structure for a hospital appointment system would involve creating
tables to store relevant information.

1. Login:
Username
Password

2. Loan apply:
Loan Id
Full name
Mobile No
Aadhar No
Address
PinCode
Amount of Loan
Number of years
Interest Rate
Monthly Payment
Total Payment

Add record
Update
Delete
Reset
C. SAMPLE CODING

Bank.py

import sqlite3

from tkinter import *

from tkinter import ttk, messagebox

class LoanManager:

def __init__(self, root):

# Initialize the class with the root window passed as an argument

self.root = root

# Set the title and size of the root window

self.root.title("Loan Management System")

self.root.geometry("1350x720+0+0")

# Create a label with the title text and style it

title = Label(self.root, text="Loan Management System", font=(

"Comic Sans MS", 20, ), bd=8, bg='black', fg='white')

title.pack(side=TOP, fill=X)

# Create StringVar variables to store the loan details

self.LoanId = StringVar()

self.name = StringVar()

self.mob = StringVar()

self.aadhar = StringVar()

self.add = StringVar()

self.pin = StringVar()

self.amount = StringVar()
self.year = StringVar()

self.rate = StringVar()

self.mpay = StringVar()

self.tpay = StringVar()

# Create a frame to hold the loan details

Detail_F = Frame(self.root, bd=4, relief=RIDGE, bg='white')

Detail_F.place(x=10, y=90, width=520, height=620)

# Create a label and entry field for the loan ID

lbl_id = Label(Detail_F, text="Loan Id", font=("Comic Sans MS", 12, ))

lbl_id.grid(row=0, column=0, pady=10, padx=20, sticky="w")

txt_id = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.LoanId)

txt_id.grid(row=0, column=1, pady=10, sticky="w")

# Create a label and entry field for the name

lbl_name = Label(Detail_F, text="Full Name",

font=("Comic Sans MS", 12, ))

lbl_name.grid(row=1, column=0, pady=10, padx=20, sticky="w")

txt_name = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.name)

txt_name.grid(row=1, column=1, pady=10, sticky="w")

# Create a label and entry field for the mobile number

lbl_mob = Label(Detail_F, text="Mobile No.",


font=("Comic Sans MS", 12, ))

lbl_mob.grid(row=2, column=0, pady=10, padx=20, sticky="w")

txt_mob = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.mob)

txt_mob.grid(row=2, column=1, pady=10, sticky="w")

# Create a label and entry field for the Aadhar number

lbl_aa = Label(Detail_F, text="Aadhar No.",

font=("Comic Sans MS", 12, ))

lbl_aa.grid(row=3, column=0, pady=10, padx=20, sticky="w")

txt_aa = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.aadhar)

txt_aa.grid(row=3, column=1, pady=10, sticky="w")

# Create a label and entry field for the address

lbl_add = Label(Detail_F, text="Address", font=("Comic Sans MS", 12, ))

lbl_add.grid(row=4, column=0, pady=10, padx=20, sticky="w")

txt_add = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.add)

txt_add.grid(row=4, column=1, pady=10, sticky="w")

# Create a label and entry field for the pincode

lbl_pin = Label(Detail_F, text="PinCode", font=("Comic Sans MS", 12, ))

lbl_pin.grid(row=5, column=0, pady=10, padx=20, sticky="w")

txt_pin = Entry(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, textvariable=self.pin)
txt_pin.grid(row=5, column=1, pady=10, sticky="w")

# Create a label and entry field for the loan amount

lbl_amount = Label(Detail_F, text="Amount of Loan",

font=("Comic Sans MS", 12, ))

lbl_amount.grid(row=6, column=0, pady=10, padx=20, sticky="w")

txt_amount = Entry(Detail_F, font=(

"Comic Sans MS", 10, ), bd=3, textvariable=self.amount)

txt_amount.grid(row=6, column=1, pady=10, sticky="w")

# Create a label and entry field for the number of years

lbl_time = Label(Detail_F, text="Number of years",

font=("Comic Sans MS", 12, ))

lbl_time.grid(row=7, column=0, pady=10, padx=20, sticky="w")

txt_time = Entry(Detail_F, font=("Comic Sans MS", 10,

), bd=3, textvariable=self.year)

txt_time.grid(row=7, column=1, pady=10, sticky="w")

# Create a label and entry field for the interest rate

lbl_rate = Label(Detail_F, text="Interest Rate",

font=("Comic Sans MS", 12, ))

lbl_rate.grid(row=8, column=0, pady=10, padx=20, sticky="w")

txt_rate = Entry(Detail_F, font=("Comic Sans MS", 10,

), bd=3, textvariable=self.rate)

txt_rate.grid(row=8, column=1, pady=10, sticky="w")

# Create a label and entry field for the monthly payment

lbl_Mp = Label(Detail_F, text="Monthly Payment",


font=("Comic Sans MS", 12, ))

lbl_Mp.grid(row=9, column=0, pady=10, padx=20, sticky="w")

txt_Mp = Label(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, state=DISABLED, textvariable=self.mpay)

txt_Mp.grid(row=9, column=1, pady=10, sticky="w")

# Create a label and entry field for the total payment

lbl_tp = Label(Detail_F, text="Total Payment",

font=("Comic Sans MS", 12, ))

lbl_tp.grid(row=10, column=0, pady=10, padx=20, sticky="w")

txt_tp = Label(Detail_F, font=("Comic Sans MS", 10, ),

bd=3, state=DISABLED, textvariable=self.tpay)

txt_tp.grid(row=10, column=1, pady=10, sticky="w")

recordFrame = Frame(self.root, bd=5, relief=RIDGE)

recordFrame.place(x=535, y=100, width=810, height=530)

yscroll = Scrollbar(recordFrame, orient=VERTICAL)

# Create a treeview to display the records

self.employee_table = ttk.Treeview(recordFrame, columns=(

"empId", "name", "years", "rate", "Mpayment", "Tpayment", "mobile"),


yscrollcommand=yscroll.set)

yscroll.pack(side=RIGHT, fill=Y)

yscroll.config(command=self.employee_table.yview)

self.employee_table.heading("empId", text="customer Id")

self.employee_table.heading("name", text="Name")

self.employee_table.heading("years", text="Number of Years")

self.employee_table.heading("rate", text="Interest Rate")


self.employee_table.heading("Mpayment", text="Monthly Payment")

self.employee_table.heading("Tpayment", text="Total Payment")

self.employee_table.heading("mobile", text="Mobile No.")

self.employee_table['show'] = 'headings'

self.employee_table.column("empId", width=100)

self.employee_table.column("name", width=100)

self.employee_table.column("years", width=100)

self.employee_table.column("rate", width=100)

self.employee_table.column("Mpayment", width=110)

self.employee_table.column("Tpayment", width=100)

self.employee_table.column("mobile", width=100)

self.employee_table.pack(fill=BOTH, expand=1)

self.fetch_data()

self.employee_table.bind("<ButtonRelease-1>", self.get_cursor)

btnFrame = Frame(self.root, bd=5, relief=RIDGE)

btnFrame.place(x=700, y=630, width=480, height=60)

# Create a button to calculate the Details

btn1 = Button(btnFrame, text='Add record', font='arial 12 bold',

bg='black', fg='white', width=9, command=self.addrecord)

btn1.grid(row=0, column=0, padx=10, pady=10)

# Create a button to update the Details

btn2 = Button(btnFrame, text='Update', font='arial 12 bold',

bg='black', fg='white', width=9, command=self.update)


btn2.grid(row=0, column=1, padx=8, pady=10)

# Create a button to delete the entr

btn3 = Button(btnFrame, text='Delete', font='arial 12 bold',

bg='black', fg='white', width=9, command=self.delete)

btn3.grid(row=0, column=2, padx=8, pady=10)

# Create a button to reset the fields

btn4 = Button(btnFrame, text='Reset', font='arial 12 bold',

bg='black', fg='white', width=9, command=self.reset)

btn4.grid(row=0, column=3, padx=8, pady=10)

def total(self):

# Get the loan amount, interest rate, and number of years as integers

p = int(self.amount.get())

r = int(self.rate.get())

n = int(self.year.get())

# Calculate the total interest to be paid

t = (p*r*n*10)/100

# Calculate the monthly payment amount

m = (p+t)/(n*10)

# Set the monthly payment and total payment amounts in the corresponding
StringVar objects

self.mpay.set(str(round(m, 2)))

self.tpay.set(str(t+p))
def addrecord(self):

if self.LoanId.get() == '' or self.name.get() == '' or self.mob.get() == '' or


self.aadhar.get() == '' or self.add.get() == '' or self.pin.get() == '':

messagebox.showerror('Error', 'Please enter details ?')

else:

self.total()

con = sqlite3.connect('loanDetails.db')

cur = con.cursor()

cur.execute("Select * from customer")

rows = cur.fetchall()

for row in rows:

if row[0] == self.LoanId.get():

messagebox.showerror(

'Error', 'Duplicates not allowed')

return

cur.execute("insert into customer values(?,?,?,?,?,?,?,?,?,?,?)", (

self.LoanId.get(),

self.name.get(),

self.mob.get(),

self.aadhar.get(),

self.add.get(),

self.pin.get(),

self.amount.get(),

self.year.get(),

self.rate.get(),
self.mpay.get(),

self.tpay.get(),

))

con.commit()

self.fetch_data()

con.close()

def fetch_data(self):

con = sqlite3.connect('loanDetails.db')

cur = con.cursor()

cur.execute("select Loan_Id , Name , Year , Rate , Monthly_Payment ,


Total_Payment , MobileNumber , AadharNumber , Address , Pincode , Amount
from customer")

rows = cur.fetchall()

if len(rows) != 0:

self.employee_table.delete(*self.employee_table.get_children())

for row in rows:

self.employee_table.insert('', END, values=row)

con.commit()

con.close()

def update(self):

if self.LoanId.get() == '':

messagebox.showerror('Error', 'Select a record to update !')

else:

self.total()
con = sqlite3.connect('loanDetails.db')

cur = con.cursor()

cur.execute("update customer set Name = ?, MobileNumber = ?,


AadharNumber = ?, Address = ?, Pincode = ?, Amount = ?, Year = ?, Rate = ?,
Total_Payment = ?, Monthly_Payment = ? where Loan_Id = ?", (

self.name.get(),

self.mob.get(),

self.aadhar.get(),

self.add.get(),

self.pin.get(),

self.amount.get(),

self.year.get(),

self.rate.get(),

self.tpay.get(),

self.mpay.get(),

self.LoanId.get()

))

messagebox.showinfo(

'Info', f'Record {self.LoanId.get()} Updated Successfully')

con.commit()

con.close()

self.fetch_data()

self.reset()

def delete(self):

if self.LoanId.get() == '':
messagebox.showerror(

'Error', 'Enter customer ID to delete the records')

else:

con = sqlite3.connect('loanDetails.db')

cur = con.cursor()

cur.execute("delete from customer where Loan_Id = ?",

(self.LoanId.get(),))

con.commit()

con.close()

self.fetch_data()

self.reset()

def reset(self):

self.LoanId.set('')

self.name.set('')

self.mob.set('')

self.aadhar.set('')

self.add.set('')

self.pin.set('')

self.amount.set('')

self.year.set('')

self.rate.set('')

self.mpay.set('')

self.tpay.set('')

def get_cursor(self, ev):


cursor_row = self.employee_table.focus()

content = self.employee_table.item(cursor_row)

row = content['values']

self.LoanId.set(row[0])

self.name.set(row[1])

self.year.set(row[2])

self.rate.set(row[3])

self.mpay.set(row[4])

self.tpay.set(row[5])

self.mob.set(row[6])

self.aadhar.set(row[7])

self.add.set(row[8])

self.pin.set(row[9])

self.amount.set(row[10])

class Login():

def __init__(self, root):

# Initialize the class with the root window passed as an argument

self.root = root

# Set the title of the root window

self.root.title("Loan Management System")

# Create StringVar variables to store the username and password

self.username = StringVar()

self.password = StringVar()
# Create a label and entry field for the username

Label(self.root, text="Username:").grid(

row=0, column=0, padx=10, pady=10)

Entry(self.root, textvariable=self.username).grid(

row=0, column=1, padx=10, pady=10)

# Create a label and entry field for the password

Label(self.root, text="Password:").grid(

row=1, column=0, padx=10, pady=10)

Entry(self.root, textvariable=self.password,

show="*").grid(row=1, column=1, padx=10, pady=10)

# Create a login button that calls the login method when clicked

Button(self.root, text="Login", command=self.login).grid(

row=2, column=1, padx=10, pady=10)

def login(self):

# Check if the entered username and password are correct

if self.username.get() == "root" and self.password.get() == "root":

# If the login is successful, destroy the current window and open a new
window

root.destroy()

nroot = Tk()

LoanManager(nroot)

else:

# If the login is unsuccessful, show an error message

messagebox.showerror("Error", "Invalid username or password")


# Connect to the 'loanDetails.db' database

con = sqlite3.connect('loanDetails.db')

# Create a cursor to perform operations on the database

cur = con.cursor()

# Execute a SQL query to create a table named 'customer' if it doesn't already exist

# The table has 10 columns: Loan_Id, Name, MobileNumber, AadharNumber,


Address, Pincode, Amount, Year, Rate, and Monthly_Payment, Total_Payment

# The Loan_Id column is set as the primary key

cur.execute('create table if not exists customer(Loan_Id varchar(20) primary


key,Name varchar(20),MobileNumber varchar(20),AadharNumber
varchar(20),Address varchar(20),Pincode varchar(20),Amount varchar(20),Year
varchar(20),Rate varchar(20),Monthly_Payment varchar(20),Total_Payment
varchar(20))')

# Create a Tkinter root window

root = Tk()

# Create a Login object and pass the root window as an argument

obj = Login(root)

# if u want to skip the login proess then uncomment the below line and comment
the above line

# obj = LoanManager(root)

# Start the main loop of the Tkinter program

root.mainloop()
D. SAMPLE INPUT

Bank.py:
E. SAMPLE OUTPUT
Future Enhancement

The system facilitates the patients to fill up their details, and to give a brief

description of a Loan Management System they want to loan apply. This new system is very

helpful for customers who want to hire their loan management system through this python.

This Loan Management System project will enable the user to service a loan amount. The

user specifies a type of loan management system Loan Id, Full Name, Mobile no, Aadhar no,

Address, Pincode, Amount of Loan, Number of years, Interest Rate, Monthly Payment, Total

Payment. After the patients will be finished display in the patients is a GUI based application

which is very easy to understand and use. It uses tkinter module for the GUI. Talking about

the application, the user can easily book, view, update and delete appointments.

Future:

 Adding Entries to the Record

 Updating the records

 Persisting the data with the sqllite3 database

 Delete a record

 Auto calculate the total amount and EMI

 The default username and password are “root” and “root”, you can
always change that later in the code.

You might also like