mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-31 10:49:09 +00:00
[Minor]ROI fix in Employee Loan (#7643)
This commit is contained in:
committed by
Rushabh Mehta
parent
c62362f064
commit
6575a0a7e2
@@ -111,12 +111,11 @@ def check_repayment_method(repayment_method, loan_amount, monthly_repayment_amou
|
|||||||
frappe.throw(_("Monthly Repayment Amount cannot be greater than Loan Amount"))
|
frappe.throw(_("Monthly Repayment Amount cannot be greater than Loan Amount"))
|
||||||
|
|
||||||
def get_monthly_repayment_amount(repayment_method, loan_amount, rate_of_interest, repayment_periods):
|
def get_monthly_repayment_amount(repayment_method, loan_amount, rate_of_interest, repayment_periods):
|
||||||
if repayment_method == "Repay Over Number of Periods":
|
if rate_of_interest:
|
||||||
if rate_of_interest:
|
monthly_interest_rate = flt(rate_of_interest) / (12 *100)
|
||||||
monthly_interest_rate = flt(rate_of_interest) / (12 *100)
|
monthly_repayment_amount = math.ceil((loan_amount * monthly_interest_rate *
|
||||||
monthly_repayment_amount = math.ceil((loan_amount * monthly_interest_rate *
|
(1 + monthly_interest_rate)**repayment_periods) \
|
||||||
(1 + monthly_interest_rate)**repayment_periods) \
|
/ ((1 + monthly_interest_rate)**repayment_periods - 1))
|
||||||
/ ((1 + monthly_interest_rate)**repayment_periods - 1))
|
|
||||||
else:
|
else:
|
||||||
monthly_repayment_amount = math.ceil(flt(loan_amount) / repayment_periods)
|
monthly_repayment_amount = math.ceil(flt(loan_amount) / repayment_periods)
|
||||||
return monthly_repayment_amount
|
return monthly_repayment_amount
|
||||||
|
|||||||
Reference in New Issue
Block a user