Skip to content

Commit

Permalink
Merge pull request #85 from frappe/mergify/copy/poc-staging/pr-84
Browse files Browse the repository at this point in the history
fix: Unable to book loan (copy #84)
  • Loading branch information
deepeshgarg007 authored Oct 10, 2023
2 parents e7a1a26 + eb6c62f commit 00bc696
Showing 1 changed file with 13 additions and 2 deletions.
15 changes: 13 additions & 2 deletions lending/loan_management/doctype/loan/loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,16 @@
import frappe
from frappe import _
from frappe.query_builder import Order
from frappe.utils import add_days, date_diff, flt, get_last_day, getdate, now_datetime, nowdate
from frappe.utils import (
add_days,
cint,
date_diff,
flt,
get_last_day,
getdate,
now_datetime,
nowdate,
)

import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry
Expand Down Expand Up @@ -64,7 +73,9 @@ def validate_cost_center(self):

def set_cyclic_date(self):
if self.repayment_schedule_type == "Monthly as per cycle date":
cycle_day = frappe.db.get_value("Loan Product", self.loan_product, "cyclic_day_of_the_month")
cycle_day = cint(
frappe.db.get_value("Loan Product", self.loan_product, "cyclic_day_of_the_month")
)
last_day_of_month = get_last_day(self.posting_date)
cyclic_date = add_days(last_day_of_month, cycle_day)

Expand Down

0 comments on commit 00bc696

Please sign in to comment.