When old systems don’t work, build your own. Creation of the loan management system in ERPNext.

Zerodha started a conversation about loan management features. It led to a full-fledged loan management system in ERPNext.

 · 5 min read

A few weeks ago when seasoned engineer Deepesh (part of finance module) was working from home on a minor issue, Rushabh (founder at Frappe) messaged on the engineering chat group that Zerodha wants a loan management system and asked if anyone is up to volunteer

Software development aside, Deepesh has always been curious about the finance and lending industry. With a glow in eyes, he stepped into the Zerodha office prepared to soak in all the knowledge for building some features. Little did he know that this was the beginning of a whole new loan management module in ERPNext.

This project fits right into Deepesh’s domain (Accounting). Since it aligned with his interests and knowledge, he immediately volunteered to build this.

Introducing loan management

Before delving further, let’s understand loan management and its uses. Loan management systems are used to manage the whole lending cycle including application, managing securities, calculating interests, delays, penalties, and so on.

One of Zerodha’s companies, Zerodha Capital, provides loans against securities. Simply put, you can avail loans against any stocks, etc., you have in a Zerodha account. But their older system wasn’t working for them anymore.

When in doubt, choose Frappe

Zerodha wanted to solve multiple problems with a loan management system. Their older proprietary software had many issues. Not getting expected support didn't make it easier either. Hence, Vinay had the thought, “Our accounting team was already using ERPNext, so why not build our loan management in ERPNext.”

As you’d expect from most B2B software products (not ERPNext), the older system’s interface wasn’t user-friendly and the entire loan process was cumbersome. Zerodha was already using ERPNext and Frappe Framework for their internal operations like CRM and Accounting.

Learning the lending business

To build a set of features, Deepesh needed to understand the requirements first. What would this module solve? What are the workflows? Who are the users? What transactions and situations need to be covered? And virtual communication was falling short to answer these complex questions.

To Bangalore

Hence, come September 2019, Deepesh and Rushabh boarded the 6 am to Bangalore. At the Zerodha office, Vinay, AVP of technology, and a few others from the Zerodha team greeted them along with Labeeb, senior developer. Finance guru Karthik, the creator of Zerodha Varsity and VP of education at Zerodha, joined.

After breakfast and casual conversation, Karthik led the discussion explaining most of the financial requirements like RBI rules, shortfalls, interest, payments calculations, how they should be done, and so on. He explained the payment deduction logic and the Frappe team discussed the general loan cycle flow.

Vinay and Labeeb added technical inputs while Basawaraj from Frappe joined the conversation to add inputs on ledger entries and their handling. Together, everyone mapped all the ledger entries for disbursement and Interest Accruals.

Then the Frappe team mapped all these requirements to ERPNext. All the transactions were identified before heading out to MTR, a famous dosa joint, and visiting the famous botanical garden.

The next day, Deepesh and Rushabh worked out the core solution design and explained the model to the Zerodha team and they seemed to like it now it was only a matter of implementation! Before boarding the 4 pm out of Bangalore, the Frappe team entered a Starbucks for more discussion and drafting a plan.

Putting the learning in action

The initial plan was to make a custom Frappe Framework app for Zerodha but on discussing the requirements, Frappe decided to add it in ERPNext. The requirements were generic and could be useful to other users too. Regardless, Zerodha sponsored this module.

The loan logic and flow looked like this

Since Zerodha was already using ERPNext modules, the new Loan Module would seamlessly integrate with the other parts. The entire loan cycle from customer data management to loan management to accounting to invoicing would be done in one single software—ERPNext.

Launching the complete loan module

After landing back in Mumbai, Deepesh started working on the features. Plenty of reviews and feedback followed.

Energetic start

Armed with his newfound knowledge of loans, Deepesh started development soon after landing back in Mumbai. With the foundational frame of structures ready in 4 weeks, he continued working on the transaction logic. The constant communication between Deepesh and Labeeb kept pace.

There was quick development in the next two months. Around November, things rested at a slower pace with constant reviews and enhancements based on feedback.

Almost done

In January 2020, LMS was finally merged to ERPNext’s GitHub repository. What started to be a set of features became a whole new module. But things went silent as both teams got busy with other projects. Only minor fixes were pushed.

Towards production use

Three months later, in April 2020 when some parts like collections (Loan Repayment) were refactored, the module looked almost ready for production. Zerodha started internal beta testing and shared feedback. Multiple fixes were pushed and the loan against securities service by Zerodha was set into production on 1st Dec 2020. They could finally start using it.

Deepesh recalls, “I had a great experience working on this module with Zerodha. I learned a lot of new things about the lending business. The entire Zerodha team was very supportive in reviewing, UAT, and answering my queries.

Challenges in making LMS

Most of the project was smooth sailing with constant communication and a clear understanding of requirements. The only challenge Deepesh faced was understanding some complex scenarios in the first attempt. But the multiple iterations with Zerodha helped to get it right. This is usually the case when multiple complex transactions are involved.

The loan management module in ERPNext is capable enough to handle almost any type of loan like Demand Loan, Term Loan, Secured, Unsecured. Since the implementation is very generic, it opened up possibilities for a lot of edge cases that could go wrong. Identifying and resolving those edge cases required a lot of manual tedious testing from Deepesh.

What the loan management module looks like

The new LMS solved key problems like better support and full functionality across loan transactions. Now let’s see a few screenshots from the loan management system in ERPNext.

The dashboard shows an overview of all important numbers:

A loan application shows details about the loan and the repayment schedule:

The Loan Security Pledge stores details about the security pledged for availing a loan:

The loan management module in ERPNext not only helps manage customer loans but can also manage internal loans to employees. Repayment can be done via salary slips—you get all this out of the box. Zerodha also is looking to expand LMS in ERPNext for employee loans.

What’s next?

The final loan management system Frappe made can handle any type of security like cars, gold, properties, and so on.

Deepesh continues to work on other accounting features but says that there are other things he looks forward to adding like alerts and notifications for defaulting payments, credit analysis, etc.

Labeeb from Zerodha adds about the experience, “Building our Loan Against Securities service with ERPNext's Loan Management module was a great experience. We could create custom on-boarding, loan application, and loan management workflows easily using out-of-the-box features that Frappe and ERPNext provided. Integrating the system with customer-facing apps using Frappe REST APIs was effortless and time-saving for us. The Frappe team is very proactive in addressing our requirements and suggestions regarding the loan management module.


Prasad Ramesh

Marketing at Frappe.

Add a comment
Ctrl+Enter to add comment

Moses Gitonga 2 years ago

I love ERP next, this is th best ERP in the world today.Here in Africa we are embracing it with open arms.Its the force for the future.Keep it up guys

A
AIRMASTERZ BUSINESS SERVICES 2 years ago

nice article.

S
Shibam Goswami 3 years ago

Nice write up .can we see the demo of this application ?