Skip to content

Commit

Permalink
chore: formatting and test fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
deepeshgarg007 committed Aug 14, 2023
1 parent f14bf19 commit 6140a20
Show file tree
Hide file tree
Showing 28 changed files with 32 additions and 30 deletions.
2 changes: 1 addition & 1 deletion lending/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@
],
"monthly_long": [
"lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual.process_loan_interest_accrual_for_demand_loans",
"lending.loan_management.doctype.process_loan_restructure_limit.process_loan_restructure_limit.calculate_monthly_restructure_limit"
"lending.loan_management.doctype.process_loan_restructure_limit.process_loan_restructure_limit.calculate_monthly_restructure_limit",
],
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class DaysPastDueLog(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class TestDaysPastDueLog(FrappeTestCase):
pass
pass
5 changes: 3 additions & 2 deletions lending/loan_management/doctype/loan/loan.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import erpnext
from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry
from erpnext.controllers.accounts_controller import AccountsController

from lending.loan_management.doctype.loan_security_unpledge.loan_security_unpledge import (
get_pledged_security_qty,
)
Expand Down Expand Up @@ -136,7 +137,7 @@ def update_draft_schedule(self):
"repayment_start_date": self.repayment_start_date,
"posting_date": self.posting_date,
"loan_amount": self.loan_amount,
"monthly_repayment_amount": self.monthly_repayment_amount
"monthly_repayment_amount": self.monthly_repayment_amount,
}
)
schedule.save()
Expand Down Expand Up @@ -871,4 +872,4 @@ def move_unpaid_interest_to_suspense_ledger(
)

jv.flags.ignore_mandatory = True
jv.submit()
jv.submit()
2 changes: 1 addition & 1 deletion lending/loan_management/doctype/loan/loan_dashboard.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ def get_data():
{"items": ["Loan Repayment", "Loan Interest Accrual", "Loan Write Off", "Loan Restructure"]},
{"items": ["Loan Security Unpledge", "Days Past Due Log", "Journal Entry", "Sales Invoice"]},
],
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -259,4 +259,4 @@ def get_proposed_pledge(securities):

proposed_pledges["maximum_loan_amount"] = maximum_loan_amount

return proposed_pledges
return proposed_pledges
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,7 @@ def setUp(self):
"Loan Account - _TC",
"Interest Income Account - _TC",
"Penalty Income Account - _TC",
"Repay Over Number of Periods",
18,
repayment_schedule_type="Monthly as per repayment start date",
)
self.applicant = make_employee("kate_loan@loan.com", "_Test Company")
self.create_loan_application()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class LoanAssetClassificationRange(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -151,4 +151,4 @@ def make_gl_entries(self, cancel=0, adv_adj=0):
gle_map.append(self.get_gl_dict(company_entry))

if gle_map:
make_gl_entries(gle_map, cancel=cancel, adv_adj=adv_adj, merge_entries=False)
make_gl_entries(gle_map, cancel=cancel, adv_adj=adv_adj, merge_entries=False)
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class LoanChargeReference(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class LoanCharges(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -335,4 +335,4 @@ def get_disbursal_amount(loan, on_current_security_price=0):


def get_maximum_amount_as_per_pledged_security(loan):
return flt(frappe.db.get_value("Loan Security Pledge", {"loan": loan}, "sum(maximum_loan_value)"))
return flt(frappe.db.get_value("Loan Security Pledge", {"loan": loan}, "sum(maximum_loan_value)"))
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ def get_data():
"items": ["Loan Security Deposit"],
},
],
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -379,4 +379,4 @@ def get_per_day_interest(principal_amount, rate_of_interest, posting_date=None):

return flt(
(principal_amount * rate_of_interest) / (days_in_year(get_datetime(posting_date).year) * 100)
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -243,4 +243,4 @@ def setup_asset_classification_ranges(company):
},
)

company_doc.save()
company_doc.save()
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
import erpnext
from erpnext.accounts.general_ledger import make_gl_entries
from erpnext.controllers.accounts_controller import AccountsController

from lending.loan_management.doctype.loan.loan import update_all_linked_loan_customer_npa_status
from lending.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import (
get_last_accrual_date,
Expand Down Expand Up @@ -1207,4 +1208,4 @@ def get_outstanding_invoices(loan, posting_date):
"due_date": ("<=", posting_date),
},
fields=["name as voucher_no", "outstanding_amount"],
)
)
Original file line number Diff line number Diff line change
Expand Up @@ -172,4 +172,4 @@ def get_monthly_repayment_amount(loan_amount, rate_of_interest, repayment_period
)
else:
monthly_repayment_amount = math.ceil(flt(loan_amount) / repayment_periods)
return monthly_repayment_amount
return monthly_repayment_amount
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class TestLoanRepaymentSchedule(FrappeTestCase):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
from frappe.utils import add_days, cint, flt, getdate

from erpnext.controllers.accounts_controller import AccountsController

from lending.loan_management.doctype.loan.loan import (
update_all_linked_loan_customer_npa_status,
update_watch_period_date_for_all_loans,
Expand Down Expand Up @@ -733,4 +734,4 @@ def create_loan_repayment(loan, posting_date, repayment_type, waiver_amount, res
repayment.amount_paid = waiver_amount
repayment.loan_restructure = restructure_name
repayment.save()
repayment.submit()
repayment.submit()
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ def get_data():
"transactions": [
{"items": ["Loan Repayment Schedule", "Loan Repayment"]},
],
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class TestLoanRestructure(FrappeTestCase):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class LoanRestructureLimitLog(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class TestLoanRestructureLimitLog(FrappeTestCase):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class LoanSecurityDeposit(Document):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@


class TestLoanSecurityDeposit(FrappeTestCase):
pass
pass
Original file line number Diff line number Diff line change
Expand Up @@ -37,4 +37,4 @@ def create_process_asset_classification(
asset_classification.loan = loan
asset_classification.previous_process = previous_process[0].name if previous_process else None
asset_classification.payment_reference = payment_reference
asset_classification.submit()
asset_classification.submit()
2 changes: 1 addition & 1 deletion lending/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ lending.patches.v15_0.generate_loan_repayment_schedule
[post_model_sync]
# Patches added in this section will be executed after doctypes are migrated
lending.patches.v15_0.update_loan_types
lending.patches.v15_0.create_custom_fields
lending.patches.v15_0.create_custom_fields #6
2 changes: 1 addition & 1 deletion lending/patches/v15_0/create_custom_fields.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def execute():
after_install()
after_install()

0 comments on commit 6140a20

Please sign in to comment.