feat: add sanctioned amount tolerance on loan product#1320
Draft
Nihantra-Patel wants to merge 2 commits into
Draft
feat: add sanctioned amount tolerance on loan product#1320Nihantra-Patel wants to merge 2 commits into
Nihantra-Patel wants to merge 2 commits into
Conversation
Loan and Loan Application creation reject any loan whose amount plus the applicant's existing outstanding exceeds their sanctioned amount limit, with no allowance for rounding. When the LOS and Frappe compute the limit slightly differently, a valid loan fails by a small margin. Add a Sanctioned Amount Tolerance (Currency, default 0) field on Loan Product and allow the total to exceed the sanctioned limit by up to this tolerance during the check on both Loan and Loan Application.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## develop #1320 +/- ##
===========================================
+ Coverage 82.56% 82.59% +0.03%
===========================================
Files 154 154
Lines 10881 10900 +19
===========================================
+ Hits 8984 9003 +19
Misses 1897 1897
🚀 New features to boost your workflow:
|
3b3e478 to
b71ea2b
Compare
|
@Nihantra-Patel @deepeshgarg007 any fixed amount may have issues based on amount.. for e.g. on loan of 10 lac. 100 rs is only .001% so wont fix things. but 100 on 1000 loan becomes 10% which will breach RBI limit |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
When a customer's securities are pledged, the system automatically sanctions a credit limit (Sanctioned Loan Amount) for that customer, equal to the post-haircut value of their pledged securities.
When a new loan (or loan application) is created, the system checks that:
This check was exact, with zero tolerance. If the requested loan was even 1 rupee over the sanctioned limit, it was rejected with "Sanctioned Amount limit crossed."
In practice, the limit is often calculated in more than one place, and small rounding differences cause the limit to end up a few paise/rupees below the intended figure. As a result, loans that should be perfectly valid fail at creation and block legitimate business.
Solution
Add a Sanctioned Amount Tolerance field on Loan Product. The sanctioned-amount check now rejects a loan only when:
Because the comparison is strictly greater-than, a loan exactly at
sanctioned limit + toleranceis allowed (i.e. loans less than or equal to the limit plus tolerance pass). This is applied in both Loan and Loan Application creation. With tolerance0(default), behaviour is unchanged.Example (limit ₹10,00,000, tolerance ₹100)
Loans up to limit + tolerance go through; anything beyond is still blocked.
Configuration
On the Loan Product form, under the Limits section, set Sanctioned Amount Tolerance to the amount you want to allow above the sanctioned limit. Leave it at
0to keep the strict check.