From 0bc08fe3095a5a877ee7f6ba31fcd990ca281b1d Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Sun, 10 Sep 2023 20:04:21 +0530 Subject: [PATCH 01/23] chore: make loan type a non-submittable doctype --- .../doctype/loan_type/loan_type.json | 658 +++++++++--------- lending/patches.txt | 3 +- .../v15_0/make_loan_type_non_submittable.py | 9 + 3 files changed, 338 insertions(+), 332 deletions(-) create mode 100644 lending/patches/v15_0/make_loan_type_non_submittable.py diff --git a/lending/loan_management/doctype/loan_type/loan_type.json b/lending/loan_management/doctype/loan_type/loan_type.json index 2b5ff8e6..e2c77a6d 100644 --- a/lending/loan_management/doctype/loan_type/loan_type.json +++ b/lending/loan_management/doctype/loan_type/loan_type.json @@ -1,333 +1,329 @@ { -"actions": [], -"autoname": "field:loan_name", -"creation": "2019-08-29 18:08:38.159726", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan_name", - "maximum_loan_amount", - "rate_of_interest", - "penalty_interest_rate", - "grace_period_in_days", - "write_off_amount", - "column_break_2", - "company", - "is_term_loan", - "disabled", - "repayment_schedule_type", - "repayment_date_on", - "days_past_due_threshold_for_npa", - "description", - "account_details_section", - "mode_of_payment", - "disbursement_account", - "payment_account", - "suspense_interest_receivable", - "suspense_interest_income", - "suspense_collection_account", - "column_break_12", - "loan_account", - "interest_income_account", - "interest_receivable_account", - "penalty_receivable_account", - "charges_receivable_account", - "penalty_income_account", - "security_deposit_account", - "loan_waiver_accounts_section", - "principal_waiver_account", - "interest_waiver_account", - "column_break_amrb", - "penalty_waiver_account", - "charges_waiver_account", - "section_break_ia6s", - "charges_waiver_item", - "loan_charges", - "amended_from" -], -"fields": [ - { - "fieldname": "loan_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Loan Name", - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "maximum_loan_amount", - "fieldtype": "Currency", - "label": "Maximum Loan Amount", - "options": "Company:company:default_currency" - }, - { - "default": "0", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate of Interest (%) Yearly", - "reqd": 1 - }, - { - "fieldname": "column_break_2", - "fieldtype": "Column Break" - }, - { - "allow_on_submit": 1, - "default": "0", - "fieldname": "disabled", - "fieldtype": "Check", - "label": "Disabled" - }, - { - "fieldname": "description", - "fieldtype": "Text", - "label": "Description" - }, - { - "fieldname": "account_details_section", - "fieldtype": "Section Break", - "label": "Loan Account Details" - }, - { - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "reqd": 1 - }, - { - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Repayment Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "column_break_12", - "fieldtype": "Column Break" - }, - { - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "label": "Penalty Income Account", - "options": "Account", - "reqd": 1 - }, - { - "default": "0", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan" - }, - { - "description": "Penalty Interest Rate is levied on the pending interest amount on a daily basis in case of delayed repayment ", - "fieldname": "penalty_interest_rate", - "fieldtype": "Percent", - "label": "Penalty Interest Rate (%)" - }, - { - "description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment", - "fieldname": "grace_period_in_days", - "fieldtype": "Int", - "label": "Grace Period in Days" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Type", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "allow_on_submit": 1, - "description": "Loan Write Off will be automatically created on loan closure request if pending amount is below this limit", - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Auto Write Off Amount ", - "options": "Company:company:default_currency" - }, - { - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account", - "reqd": 1 - }, - { - "depends_on": "is_term_loan", - "description": "The schedule type that will be used for generating the term loan schedules (will affect the payment date and monthly repayment amount)", - "fieldname": "repayment_schedule_type", - "fieldtype": "Select", - "label": "Repayment Schedule Type", - "mandatory_depends_on": "is_term_loan", - "options": "\nMonthly as per repayment start date\nPro-rated calendar months\nMonthly as per cycle date" - }, - { - "depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", - "description": "Select whether the repayment date should be the end of the current month or start of the upcoming month", - "fieldname": "repayment_date_on", - "fieldtype": "Select", - "label": "Repayment Date On", - "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", - "options": "\nStart of the next month\nEnd of the current month" - }, - { - "description": "Loans will be marked as NPA when the days past due count exceed this threshold", - "fieldname": "days_past_due_threshold_for_npa", - "fieldtype": "Int", - "label": "Days Past Due Threshold for NPA" - }, - { - "fieldname": "loan_waiver_accounts_section", - "fieldtype": "Section Break", - "label": "Loan Waiver Accounts" - }, - { - "fieldname": "principal_waiver_account", - "fieldtype": "Link", - "label": "Principal Waiver Account", - "options": "Account" - }, - { - "fieldname": "interest_waiver_account", - "fieldtype": "Link", - "label": "Interest Waiver Account", - "options": "Account" - }, - { - "fieldname": "column_break_amrb", - "fieldtype": "Column Break" - }, - { - "fieldname": "penalty_waiver_account", - "fieldtype": "Link", - "label": "Penalty Waiver Account", - "options": "Account" - }, - { - "fieldname": "charges_waiver_account", - "fieldtype": "Link", - "label": "Charges Waiver Account", - "options": "Account" - }, - { - "fieldname": "suspense_interest_receivable", - "fieldtype": "Link", - "label": "Suspense Interest Receivable", - "options": "Account" - }, - { - "fieldname": "suspense_interest_income", - "fieldtype": "Link", - "label": "Suspense Interest Income", - "options": "Account" - }, - { - "fieldname": "suspense_collection_account", - "fieldtype": "Link", - "label": "Suspense Collection Account", - "options": "Account" - }, - { - "fieldname": "interest_receivable_account", - "fieldtype": "Link", - "label": "Interest Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "penalty_receivable_account", - "fieldtype": "Link", - "label": "Penalty Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "charges_receivable_account", - "fieldtype": "Link", - "label": "Charges Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "section_break_ia6s", - "fieldtype": "Section Break" - }, - { - "allow_on_submit": 1, - "fieldname": "loan_charges", - "fieldtype": "Table", - "label": "Loan Charges", - "options": "Loan Charges" - }, - { - "fieldname": "security_deposit_account", - "fieldtype": "Link", - "label": "Security Deposit Account", - "options": "Account" - }, - { - "fieldname": "charges_waiver_item", - "fieldtype": "Link", - "label": "Charges Waiver Item", - "options": "Item" - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-29 19:33:15.313331", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Type", -"naming_rule": "By fieldname", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "read": 1, - "role": "Employee" - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "autoname": "field:loan_name", + "creation": "2019-08-29 18:08:38.159726", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan_name", + "maximum_loan_amount", + "rate_of_interest", + "penalty_interest_rate", + "grace_period_in_days", + "write_off_amount", + "column_break_2", + "company", + "is_term_loan", + "disabled", + "repayment_schedule_type", + "repayment_date_on", + "days_past_due_threshold_for_npa", + "description", + "account_details_section", + "mode_of_payment", + "disbursement_account", + "payment_account", + "suspense_interest_receivable", + "suspense_interest_income", + "suspense_collection_account", + "column_break_12", + "loan_account", + "interest_income_account", + "interest_receivable_account", + "penalty_receivable_account", + "charges_receivable_account", + "penalty_income_account", + "security_deposit_account", + "loan_waiver_accounts_section", + "principal_waiver_account", + "interest_waiver_account", + "column_break_amrb", + "penalty_waiver_account", + "charges_waiver_account", + "section_break_ia6s", + "charges_waiver_item", + "loan_charges", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Loan Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "maximum_loan_amount", + "fieldtype": "Currency", + "label": "Maximum Loan Amount", + "options": "Company:company:default_currency" + }, + { + "default": "0", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate of Interest (%) Yearly", + "reqd": 1 + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break" + }, + { + "allow_on_submit": 1, + "default": "0", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled" + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Description" + }, + { + "fieldname": "account_details_section", + "fieldtype": "Section Break", + "label": "Loan Account Details" + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "reqd": 1 + }, + { + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Repayment Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "column_break_12", + "fieldtype": "Column Break" + }, + { + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "label": "Penalty Income Account", + "options": "Account", + "reqd": 1 + }, + { + "default": "0", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan" + }, + { + "description": "Penalty Interest Rate is levied on the pending interest amount on a daily basis in case of delayed repayment ", + "fieldname": "penalty_interest_rate", + "fieldtype": "Percent", + "label": "Penalty Interest Rate (%)" + }, + { + "description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment", + "fieldname": "grace_period_in_days", + "fieldtype": "Int", + "label": "Grace Period in Days" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Type", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "reqd": 1 + }, + { + "allow_on_submit": 1, + "description": "Loan Write Off will be automatically created on loan closure request if pending amount is below this limit", + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Auto Write Off Amount ", + "options": "Company:company:default_currency" + }, + { + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account", + "reqd": 1 + }, + { + "depends_on": "is_term_loan", + "description": "The schedule type that will be used for generating the term loan schedules (will affect the payment date and monthly repayment amount)", + "fieldname": "repayment_schedule_type", + "fieldtype": "Select", + "label": "Repayment Schedule Type", + "mandatory_depends_on": "is_term_loan", + "options": "\nMonthly as per repayment start date\nPro-rated calendar months\nMonthly as per cycle date" + }, + { + "depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", + "description": "Select whether the repayment date should be the end of the current month or start of the upcoming month", + "fieldname": "repayment_date_on", + "fieldtype": "Select", + "label": "Repayment Date On", + "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", + "options": "\nStart of the next month\nEnd of the current month" + }, + { + "description": "Loans will be marked as NPA when the days past due count exceed this threshold", + "fieldname": "days_past_due_threshold_for_npa", + "fieldtype": "Int", + "label": "Days Past Due Threshold for NPA" + }, + { + "fieldname": "loan_waiver_accounts_section", + "fieldtype": "Section Break", + "label": "Loan Waiver Accounts" + }, + { + "fieldname": "principal_waiver_account", + "fieldtype": "Link", + "label": "Principal Waiver Account", + "options": "Account" + }, + { + "fieldname": "interest_waiver_account", + "fieldtype": "Link", + "label": "Interest Waiver Account", + "options": "Account" + }, + { + "fieldname": "column_break_amrb", + "fieldtype": "Column Break" + }, + { + "fieldname": "penalty_waiver_account", + "fieldtype": "Link", + "label": "Penalty Waiver Account", + "options": "Account" + }, + { + "fieldname": "charges_waiver_account", + "fieldtype": "Link", + "label": "Charges Waiver Account", + "options": "Account" + }, + { + "fieldname": "suspense_interest_receivable", + "fieldtype": "Link", + "label": "Suspense Interest Receivable", + "options": "Account" + }, + { + "fieldname": "suspense_interest_income", + "fieldtype": "Link", + "label": "Suspense Interest Income", + "options": "Account" + }, + { + "fieldname": "suspense_collection_account", + "fieldtype": "Link", + "label": "Suspense Collection Account", + "options": "Account" + }, + { + "fieldname": "interest_receivable_account", + "fieldtype": "Link", + "label": "Interest Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "penalty_receivable_account", + "fieldtype": "Link", + "label": "Penalty Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "charges_receivable_account", + "fieldtype": "Link", + "label": "Charges Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "section_break_ia6s", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "loan_charges", + "fieldtype": "Table", + "label": "Loan Charges", + "options": "Loan Charges" + }, + { + "fieldname": "security_deposit_account", + "fieldtype": "Link", + "label": "Security Deposit Account", + "options": "Account" + }, + { + "fieldname": "charges_waiver_item", + "fieldtype": "Link", + "label": "Charges Waiver Item", + "options": "Item" + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-09-10 19:37:44.490880", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Type", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "write": 1 + }, + { + "read": 1, + "role": "Employee" + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/lending/patches.txt b/lending/patches.txt index ecdce995..8f9a6d4c 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -7,4 +7,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype [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 #6 \ No newline at end of file +lending.patches.v15_0.create_custom_fields #6 +lending.patches.v15_0.make_loan_type_non_submittable \ No newline at end of file diff --git a/lending/patches/v15_0/make_loan_type_non_submittable.py b/lending/patches/v15_0/make_loan_type_non_submittable.py new file mode 100644 index 00000000..273b7013 --- /dev/null +++ b/lending/patches/v15_0/make_loan_type_non_submittable.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +import frappe + + +def execute(): + lt = frappe.qb.DocType("Loan Type") + frappe.qb.update(lt).set(lt.docstatus, 0).run() From 5edc2831da797219df014830b4b737ee56016f55 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Sun, 10 Sep 2023 22:24:00 +0530 Subject: [PATCH 02/23] chore: rename asset classification ranges --- lending/install.py | 2 +- lending/patches.txt | 3 ++- .../v15_0/rename_asset_classification_ranges.py | 15 +++++++++++++++ 3 files changed, 18 insertions(+), 2 deletions(-) create mode 100644 lending/patches/v15_0/rename_asset_classification_ranges.py diff --git a/lending/install.py b/lending/install.py index e64918da..59945c00 100644 --- a/lending/install.py +++ b/lending/install.py @@ -72,7 +72,7 @@ }, { "fieldname": "asset_classification_ranges", - "label": "Asset Classification Ranges", + "label": "Loan Asset Classification Ranges", "fieldtype": "Table", "options": "Loan Asset Classification Range", "insert_after": "loan_section_break_2", diff --git a/lending/patches.txt b/lending/patches.txt index 8f9a6d4c..1166f3df 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -8,4 +8,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype # 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 #6 -lending.patches.v15_0.make_loan_type_non_submittable \ No newline at end of file +lending.patches.v15_0.make_loan_type_non_submittable +lending.patches.v15_0.rename_asset_classification_ranges \ No newline at end of file diff --git a/lending/patches/v15_0/rename_asset_classification_ranges.py b/lending/patches/v15_0/rename_asset_classification_ranges.py new file mode 100644 index 00000000..be90cfe2 --- /dev/null +++ b/lending/patches/v15_0/rename_asset_classification_ranges.py @@ -0,0 +1,15 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe + + +def execute(): + if frappe.db.exists("Custom Field", {"name": "Company-asset_classification_ranges"}): + frappe.db.set_value( + "Custom Field", + {"name": "Company-asset_classification_ranges"}, + "label", + "Loan Asset Classification Ranges", + ) From 82d8232f70517e5c1108ee02c648f93b13850857 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Sun, 10 Sep 2023 22:31:21 +0530 Subject: [PATCH 03/23] chore: tab for loan in company doc --- lending/install.py | 8 +++++- lending/patches.txt | 3 ++- .../update_custom_fields_for_company_tab.py | 27 +++++++++++++++++++ 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 lending/patches/v15_0/update_custom_fields_for_company_tab.py diff --git a/lending/install.py b/lending/install.py index 59945c00..bea584f7 100644 --- a/lending/install.py +++ b/lending/install.py @@ -15,11 +15,17 @@ } ], "Company": [ + { + "fieldname": "loan_tab", + "fieldtype": "Tab Break", + "label": "Loan", + "insert_after": "expenses_included_in_valuation", + }, { "fieldname": "loan_settings", "label": "Loan Settings", "fieldtype": "Section Break", - "insert_after": "exception_budget_approver_role", + "insert_after": "loan_tab", }, { "fieldname": "loan_restructure_limit", diff --git a/lending/patches.txt b/lending/patches.txt index 1166f3df..81755909 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -9,4 +9,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype lending.patches.v15_0.update_loan_types lending.patches.v15_0.create_custom_fields #6 lending.patches.v15_0.make_loan_type_non_submittable -lending.patches.v15_0.rename_asset_classification_ranges \ No newline at end of file +lending.patches.v15_0.rename_asset_classification_ranges +lending.patches.v15_0.update_custom_fields_for_company_tab \ No newline at end of file diff --git a/lending/patches/v15_0/update_custom_fields_for_company_tab.py b/lending/patches/v15_0/update_custom_fields_for_company_tab.py new file mode 100644 index 00000000..abcc1f3f --- /dev/null +++ b/lending/patches/v15_0/update_custom_fields_for_company_tab.py @@ -0,0 +1,27 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + create_custom_fields( + { + "Company": [ + { + "fieldname": "loan_tab", + "fieldtype": "Tab Break", + "label": "Loan", + "insert_after": "expenses_included_in_valuation", + }, + ] + }, + ignore_validate=True, + ) + + if frappe.db.exists("Custom Field", {"name": "Company-loan_settings"}): + frappe.db.set_value( + "Custom Field", {"name": "Company-loan_settings"}, "insert_after", "loan_tab" + ) From 43bdc5643ea7eb86a8632db0ebfe63d9832f21d2 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Mon, 11 Sep 2023 21:34:06 +0530 Subject: [PATCH 04/23] feat: setting for interest day-count convention --- lending/install.py | 9 +++- .../test_loan_disbursement.py | 5 +- .../loan_interest_accrual.py | 48 ++++++++++++++++--- .../doctype/loan_repayment/loan_repayment.py | 6 +-- lending/patches.txt | 3 +- ...field_for_interest_day_count_convention.py | 31 ++++++++++++ 6 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 lending/patches/v15_0/create_custom_field_for_interest_day_count_convention.py diff --git a/lending/install.py b/lending/install.py index bea584f7..480b31a3 100644 --- a/lending/install.py +++ b/lending/install.py @@ -39,10 +39,17 @@ "fieldtype": "Int", "insert_after": "loan_restructure_limit", }, + { + "fieldname": "interest_day_count_convention", + "label": "Interest Day-Count Convention", + "fieldtype": "Select", + "options": "Actual/365\nActual/Actual\n30/365\n30/360\nActual/360", + "insert_after": "watch_period_post_loan_restructure_in_days", + }, { "fieldname": "loan_column_break", "fieldtype": "Column Break", - "insert_after": "watch_period_post_loan_restructure_in_days", + "insert_after": "interest_day_count_convention", }, { "fieldname": "collection_offset_logic_based_on", diff --git a/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py b/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py index 18f9abbd..91ee6542 100644 --- a/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py +++ b/lending/loan_management/doctype/loan_disbursement/test_loan_disbursement.py @@ -32,7 +32,7 @@ from lending.loan_management.doctype.loan_application.loan_application import create_pledge from lending.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( days_in_year, - get_per_day_interest, + get_interest_amount, ) from lending.loan_management.doctype.loan_repayment.loan_repayment import calculate_amounts from lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( @@ -157,7 +157,6 @@ def test_loan_topup_with_additional_pledge(self): process_loan_interest_accrual_for_demand_loans(posting_date=add_days(last_date, 15)) amounts = calculate_amounts(loan.name, add_days(last_date, 15)) - per_day_interest = get_per_day_interest(1500000, 13.5, "2019-10-30") - interest = per_day_interest * 15 + interest = get_interest_amount(15, 1500000, 13.5, "_Test Company", "2019-10-30") self.assertEqual(amounts["pending_principal_amount"], 1500000) diff --git a/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index 4267bec8..22cdd07a 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -125,10 +125,9 @@ def calculate_accrual_amount_for_demand_loans( else: pending_amounts = calculate_amounts(loan.name, posting_date, payment_type="Loan Closure") - interest_per_day = get_per_day_interest( - pending_principal_amount, loan.rate_of_interest, posting_date + payable_interest = get_interest_amount( + no_of_days, pending_principal_amount, loan.rate_of_interest, loan.company, posting_date ) - payable_interest = interest_per_day * no_of_days args = frappe._dict( { @@ -195,6 +194,7 @@ def make_accrual_interest_entry_for_demand_loans( "written_off_amount", "total_principal_paid", "repayment_start_date", + "company", ], filters=query_filters, ) @@ -373,10 +373,46 @@ def days_in_year(year): return days -def get_per_day_interest(principal_amount, rate_of_interest, posting_date=None): +def get_per_day_interest( + principal_amount, rate_of_interest, company, posting_date=None, interest_day_count_convention=None +): if not posting_date: posting_date = getdate() - return flt( - (principal_amount * rate_of_interest) / (days_in_year(get_datetime(posting_date).year) * 100) + if not interest_day_count_convention: + interest_day_count_convention = frappe.get_cached_value( + "Company", company, "interest_day_count_convention" + ) + + if interest_day_count_convention == "Actual/365" or interest_day_count_convention == "30/365": + year_divisor = 365 + elif interest_day_count_convention == "30/360" or interest_day_count_convention == "Actual/360": + year_divisor = 360 + else: + # Default is Actual/Actual + year_divisor = days_in_year(get_datetime(posting_date).year) + + return flt((principal_amount * rate_of_interest) / (year_divisor * 100)) + + +def get_interest_amount( + no_of_days, + principal_amount=None, + rate_of_interest=None, + company=None, + posting_date=None, + interest_per_day=None, +): + interest_day_count_convention = frappe.get_cached_value( + "Company", company, "interest_day_count_convention" ) + + if not interest_per_day: + interest_per_day = get_per_day_interest( + principal_amount, rate_of_interest, company, posting_date, interest_day_count_convention + ) + + if interest_day_count_convention == "30/365" or interest_day_count_convention == "30/360": + no_of_days = 30 + + return interest_per_day * no_of_days diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index 6d1ba306..6b7acdbe 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.py @@ -168,7 +168,7 @@ def book_unaccrued_interest(self): # get posting date upto which interest has to be accrued per_day_interest = get_per_day_interest( - self.pending_principal_amount, self.rate_of_interest, self.posting_date + self.pending_principal_amount, self.rate_of_interest, self.company, self.posting_date ) no_of_days = ( @@ -586,7 +586,7 @@ def allocate_excess_payment_for_demand_loans(self, interest_paid, repayment_deta else: # get no of days for which interest can be paid per_day_interest = get_per_day_interest( - self.pending_principal_amount, self.rate_of_interest, self.posting_date + self.pending_principal_amount, self.rate_of_interest, self.company, self.posting_date ) no_of_days = cint(interest_paid / per_day_interest) @@ -1124,7 +1124,7 @@ def get_amounts(amounts, against_loan, posting_date, with_loan_details=False): principal_amount = flt(pending_principal_amount, precision) per_day_interest = get_per_day_interest( - principal_amount, loan_type_details.rate_of_interest, posting_date + principal_amount, loan_type_details.rate_of_interest, loan_type_details.company, posting_date ) unaccrued_interest += pending_days * per_day_interest diff --git a/lending/patches.txt b/lending/patches.txt index 81755909..df88dc8e 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -10,4 +10,5 @@ lending.patches.v15_0.update_loan_types lending.patches.v15_0.create_custom_fields #6 lending.patches.v15_0.make_loan_type_non_submittable lending.patches.v15_0.rename_asset_classification_ranges -lending.patches.v15_0.update_custom_fields_for_company_tab \ No newline at end of file +lending.patches.v15_0.update_custom_fields_for_company_tab +lending.patches.v15_0.create_custom_field_for_interest_day_count_convention \ No newline at end of file diff --git a/lending/patches/v15_0/create_custom_field_for_interest_day_count_convention.py b/lending/patches/v15_0/create_custom_field_for_interest_day_count_convention.py new file mode 100644 index 00000000..1502be6b --- /dev/null +++ b/lending/patches/v15_0/create_custom_field_for_interest_day_count_convention.py @@ -0,0 +1,31 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + create_custom_fields( + { + "Company": [ + { + "fieldname": "interest_day_count_convention", + "label": "Interest Day-Count Convention", + "fieldtype": "Select", + "options": "Actual/365\nActual/Actual\n30/365\n30/360\nActual/360", + "insert_after": "watch_period_post_loan_restructure_in_days", + }, + ] + }, + ignore_validate=True, + ) + + if frappe.db.exists("Custom Field", {"name": "Company-loan_column_break"}): + frappe.db.set_value( + "Custom Field", + {"name": "Company-loan_column_break"}, + "insert_after", + "interest_day_count_convention", + ) From bc3a4fde079600955fd8f30d64f8564f17ae2420 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Wed, 13 Sep 2023 16:51:00 +0530 Subject: [PATCH 05/23] feat: loan classification doctype and IRAC provisioning conf table --- lending/install.py | 7 ++ .../doctype/loan_classification/__init__.py | 0 .../loan_classification.js | 8 ++ .../loan_classification.json | 69 +++++++++++++++++ .../loan_classification.py | 9 +++ .../test_loan_classification.py | 9 +++ .../__init__.py | 0 .../loan_irac_provisioning_configuraton.json | 76 +++++++++++++++++++ .../loan_irac_provisioning_configuraton.py | 9 +++ lending/patches.txt | 3 +- ...ield_for_irac_provisioning_configuraton.py | 22 ++++++ 11 files changed, 211 insertions(+), 1 deletion(-) create mode 100644 lending/loan_management/doctype/loan_classification/__init__.py create mode 100644 lending/loan_management/doctype/loan_classification/loan_classification.js create mode 100644 lending/loan_management/doctype/loan_classification/loan_classification.json create mode 100644 lending/loan_management/doctype/loan_classification/loan_classification.py create mode 100644 lending/loan_management/doctype/loan_classification/test_loan_classification.py create mode 100644 lending/loan_management/doctype/loan_irac_provisioning_configuraton/__init__.py create mode 100644 lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json create mode 100644 lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py create mode 100644 lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py diff --git a/lending/install.py b/lending/install.py index e64918da..1fa72f30 100644 --- a/lending/install.py +++ b/lending/install.py @@ -77,6 +77,13 @@ "options": "Loan Asset Classification Range", "insert_after": "loan_section_break_2", }, + { + "fieldname": "irac_provisioning_configuraton", + "label": "IRAC Provisioning Configuraton", + "fieldtype": "Table", + "options": "Loan IRAC Provisioning Configuraton", + "insert_after": "asset_classification_ranges", + }, ], "Customer": [ { diff --git a/lending/loan_management/doctype/loan_classification/__init__.py b/lending/loan_management/doctype/loan_classification/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_classification/loan_classification.js b/lending/loan_management/doctype/loan_classification/loan_classification.js new file mode 100644 index 00000000..d6f11933 --- /dev/null +++ b/lending/loan_management/doctype/loan_classification/loan_classification.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Loan Classification", { +// refresh(frm) { + +// }, +// }); diff --git a/lending/loan_management/doctype/loan_classification/loan_classification.json b/lending/loan_management/doctype/loan_classification/loan_classification.json new file mode 100644 index 00000000..dddd54a2 --- /dev/null +++ b/lending/loan_management/doctype/loan_classification/loan_classification.json @@ -0,0 +1,69 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:classification_code", + "creation": "2023-09-12 17:26:59.462059", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "classification_code", + "classification_name" + ], + "fields": [ + { + "fieldname": "classification_code", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Classification Code", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "classification_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Classification Name", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-09-12 17:27:39.016761", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Classification", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_classification/loan_classification.py b/lending/loan_management/doctype/loan_classification/loan_classification.py new file mode 100644 index 00000000..21bad0dc --- /dev/null +++ b/lending/loan_management/doctype/loan_classification/loan_classification.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LoanClassification(Document): + pass diff --git a/lending/loan_management/doctype/loan_classification/test_loan_classification.py b/lending/loan_management/doctype/loan_classification/test_loan_classification.py new file mode 100644 index 00000000..16bc7286 --- /dev/null +++ b/lending/loan_management/doctype/loan_classification/test_loan_classification.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestLoanClassification(FrappeTestCase): + pass diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/__init__.py b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json new file mode 100644 index 00000000..7e569f52 --- /dev/null +++ b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json @@ -0,0 +1,76 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-09-12 15:46:09.401673", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "classification_code", + "classification_name", + "min_dpd_range", + "max_dpd_range", + "loan_type", + "provision_rate" + ], + "fields": [ + { + "columns": 1, + "fieldname": "loan_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Loan Type", + "options": "\nSecured\nUnsecured\nSemi-Secured" + }, + { + "fieldname": "provision_rate", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Provision Rate" + }, + { + "columns": 2, + "fieldname": "classification_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Classification Code", + "options": "Loan Classification" + }, + { + "columns": 1, + "fieldname": "min_dpd_range", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Min DPD Range" + }, + { + "columns": 1, + "fieldname": "max_dpd_range", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Max DPD Range" + }, + { + "columns": 3, + "fetch_from": "classification_code.classification_name", + "fieldname": "classification_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Classification Name", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-09-13 16:45:48.932385", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan IRAC Provisioning Configuraton", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py new file mode 100644 index 00000000..ef684409 --- /dev/null +++ b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LoanIRACProvisioningConfiguraton(Document): + pass diff --git a/lending/patches.txt b/lending/patches.txt index ecdce995..503ca9f9 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -7,4 +7,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype [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 #6 \ No newline at end of file +lending.patches.v15_0.create_custom_fields #6 +lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuraton \ No newline at end of file diff --git a/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py b/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py new file mode 100644 index 00000000..68834c5c --- /dev/null +++ b/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py @@ -0,0 +1,22 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + create_custom_fields( + { + "Company": [ + { + "fieldname": "irac_provisioning_configuraton", + "label": "IRAC Provisioning Configuraton", + "fieldtype": "Table", + "options": "Loan IRAC Provisioning Configuraton", + "insert_after": "asset_classification_ranges", + }, + ] + }, + ignore_validate=True, + ) From 6e22846f0d7771ffe604a0354ba5a27467a804a5 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Wed, 13 Sep 2023 16:57:28 +0530 Subject: [PATCH 06/23] chore: revert rename asset classification ranges --- lending/install.py | 2 +- lending/patches.txt | 1 - .../v15_0/rename_asset_classification_ranges.py | 15 --------------- 3 files changed, 1 insertion(+), 17 deletions(-) delete mode 100644 lending/patches/v15_0/rename_asset_classification_ranges.py diff --git a/lending/install.py b/lending/install.py index 480b31a3..2ba49af1 100644 --- a/lending/install.py +++ b/lending/install.py @@ -85,7 +85,7 @@ }, { "fieldname": "asset_classification_ranges", - "label": "Loan Asset Classification Ranges", + "label": "Asset Classification Ranges", "fieldtype": "Table", "options": "Loan Asset Classification Range", "insert_after": "loan_section_break_2", diff --git a/lending/patches.txt b/lending/patches.txt index df88dc8e..a7bd093c 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -9,6 +9,5 @@ lending.patches.v15_0.rename_process_asset_classification_doctype lending.patches.v15_0.update_loan_types lending.patches.v15_0.create_custom_fields #6 lending.patches.v15_0.make_loan_type_non_submittable -lending.patches.v15_0.rename_asset_classification_ranges lending.patches.v15_0.update_custom_fields_for_company_tab lending.patches.v15_0.create_custom_field_for_interest_day_count_convention \ No newline at end of file diff --git a/lending/patches/v15_0/rename_asset_classification_ranges.py b/lending/patches/v15_0/rename_asset_classification_ranges.py deleted file mode 100644 index be90cfe2..00000000 --- a/lending/patches/v15_0/rename_asset_classification_ranges.py +++ /dev/null @@ -1,15 +0,0 @@ -# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors -# License: GNU General Public License v3. See license.txt - - -import frappe - - -def execute(): - if frappe.db.exists("Custom Field", {"name": "Company-asset_classification_ranges"}): - frappe.db.set_value( - "Custom Field", - {"name": "Company-asset_classification_ranges"}, - "label", - "Loan Asset Classification Ranges", - ) From c20577da3b341db7c7accdaab3ca75b212635c1f Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Wed, 13 Sep 2023 17:23:26 +0530 Subject: [PATCH 07/23] chore: cleanup after making loan type non-submittable --- lending/loan_management/doctype/loan/loan.js | 2 +- lending/loan_management/doctype/loan/test_loan.py | 1 - .../process_loan_interest_accrual.js | 2 +- 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/lending/loan_management/doctype/loan/loan.js b/lending/loan_management/doctype/loan/loan.js index 800cf2c9..0e1e69c1 100644 --- a/lending/loan_management/doctype/loan/loan.js +++ b/lending/loan_management/doctype/loan/loan.js @@ -28,7 +28,7 @@ frappe.ui.form.on('Loan', { frm.set_query("loan_type", function () { return { "filters": { - "docstatus": 1, + "disabled": 0, "company": frm.doc.company } }; diff --git a/lending/loan_management/doctype/loan/test_loan.py b/lending/loan_management/doctype/loan/test_loan.py index 0533b254..40736961 100644 --- a/lending/loan_management/doctype/loan/test_loan.py +++ b/lending/loan_management/doctype/loan/test_loan.py @@ -1085,7 +1085,6 @@ def create_loan_type( loan_type.repayment_date_on = repayment_date_on loan_type.insert() - loan_type.submit() def create_loan_security_type(): diff --git a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js index 9014e83a..d0864a20 100644 --- a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js +++ b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js @@ -6,7 +6,7 @@ frappe.ui.form.on('Process Loan Interest Accrual', { frm.set_query("loan_type", function() { return { filters: { - "docstatus": 1 + "disabled": 0, } }; }); From 43b7e43cecbd504a47917a22833cd4c18df40d9d Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Wed, 13 Sep 2023 21:48:27 +0530 Subject: [PATCH 08/23] chore: remove /n option from loan type in irac table --- .../loan_irac_provisioning_configuraton.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json index 7e569f52..acef8725 100644 --- a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json +++ b/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json @@ -21,7 +21,7 @@ "fieldtype": "Select", "in_list_view": 1, "label": "Loan Type", - "options": "\nSecured\nUnsecured\nSemi-Secured" + "options": "Secured\nUnsecured\nSemi-Secured" }, { "fieldname": "provision_rate", @@ -64,7 +64,7 @@ "index_web_pages_for_search": 1, "istable": 1, "links": [], - "modified": "2023-09-13 16:45:48.932385", + "modified": "2023-09-13 21:39:55.163737", "modified_by": "Administrator", "module": "Loan Management", "name": "Loan IRAC Provisioning Configuraton", From 784bf6df98396c54809af5f37476bb54c4293264 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 14 Sep 2023 20:23:46 +0530 Subject: [PATCH 09/23] chore: update Loan Asset Classification Range table and rename all related fields with asset --- lending/install.py | 8 +- .../loan_management/doctype/loan/loan.json | 1024 ++++++++--------- lending/loan_management/doctype/loan/loan.py | 23 +- .../loan_asset_classification_range.json | 54 - .../__init__.py | 0 .../loan_classification_range.json | 59 + .../loan_classification_range.py} | 2 +- .../test_loan_interest_accrual.py | 44 +- lending/patches.txt | 6 +- ...s_from_loan_asset_classification_ranges.py | 21 + .../update_classification_fields_in_loan.py | 15 + ..._loan_asset_classification_ranges_table.py | 35 + ...update_loan_asset_classification_ranges.py | 17 + 13 files changed, 707 insertions(+), 601 deletions(-) delete mode 100644 lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.json rename lending/loan_management/doctype/{loan_asset_classification_range => loan_classification_range}/__init__.py (100%) create mode 100644 lending/loan_management/doctype/loan_classification_range/loan_classification_range.json rename lending/loan_management/doctype/{loan_asset_classification_range/loan_asset_classification_range.py => loan_classification_range/loan_classification_range.py} (80%) create mode 100644 lending/patches/v15_0/generate_loan_classifications_from_loan_asset_classification_ranges.py create mode 100644 lending/patches/v15_0/update_classification_fields_in_loan.py create mode 100644 lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py create mode 100644 lending/patches/v15_0/update_loan_asset_classification_ranges.py diff --git a/lending/install.py b/lending/install.py index 1fa72f30..2240d33f 100644 --- a/lending/install.py +++ b/lending/install.py @@ -71,10 +71,10 @@ "insert_after": "collection_offset_sequence_for_standard_asset", }, { - "fieldname": "asset_classification_ranges", - "label": "Asset Classification Ranges", + "fieldname": "loan_classification_ranges", + "label": "Loan Classification Ranges", "fieldtype": "Table", - "options": "Loan Asset Classification Range", + "options": "Loan Classification Range", "insert_after": "loan_section_break_2", }, { @@ -82,7 +82,7 @@ "label": "IRAC Provisioning Configuraton", "fieldtype": "Table", "options": "Loan IRAC Provisioning Configuraton", - "insert_after": "asset_classification_ranges", + "insert_after": "loan_classification_ranges", }, ], "Customer": [ diff --git a/lending/loan_management/doctype/loan/loan.json b/lending/loan_management/doctype/loan/loan.json index 63bc6302..44e799d3 100644 --- a/lending/loan_management/doctype/loan/loan.json +++ b/lending/loan_management/doctype/loan/loan.json @@ -1,514 +1,514 @@ { -"actions": [], -"allow_import": 1, -"autoname": "ACC-LOAN-.YYYY.-.#####", -"creation": "2022-01-25 10:30:02.294967", -"doctype": "DocType", -"document_type": "Document", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "applicant_type", - "applicant", - "applicant_name", - "loan_application", - "branch", - "column_break_3", - "company", - "posting_date", - "status", - "section_break_8", - "loan_type", - "repayment_schedule_type", - "loan_amount", - "rate_of_interest", - "is_secured_loan", - "disbursement_date", - "closure_date", - "disbursed_amount", - "column_break_11", - "maximum_loan_amount", - "repayment_method", - "repayment_periods", - "monthly_repayment_amount", - "repayment_start_date", - "is_term_loan", - "loan_asset_classification_details_section", - "days_past_due", - "asset_classification_code", - "asset_classification_name", - "column_break_zpe2", - "loan_restructure_count", - "watch_period_end_date", - "tenure_post_restructure", - "accounting_dimensions_section", - "cost_center", - "account_info", - "mode_of_payment", - "disbursement_account", - "payment_account", - "column_break_9", - "loan_account", - "interest_income_account", - "penalty_income_account", - "section_break_17", - "total_payment", - "total_principal_paid", - "written_off_amount", - "refund_amount", - "debit_adjustment_amount", - "credit_adjustment_amount", - "column_break_19", - "total_interest_payable", - "total_amount_paid", - "is_npa", - "manual_npa", - "amended_from" -], -"fields": [ - { - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "reqd": 1 - }, - { - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_standard_filter": 1, - "label": "Applicant", - "options": "applicant_type", - "reqd": 1 - }, - { - "fieldname": "applicant_name", - "fieldtype": "Data", - "in_global_search": 1, - "label": "Applicant Name", - "read_only": 1 - }, - { - "fieldname": "loan_application", - "fieldtype": "Link", - "label": "Loan Application", - "no_copy": 1, - "options": "Loan Application" - }, - { - "fieldname": "loan_type", - "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Loan Type", - "options": "Loan Type", - "reqd": 1 - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "no_copy": 1, - "reqd": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "in_standard_filter": 1, - "label": "Company", - "options": "Company", - "remember_last_selected_value": 1, - "reqd": 1 - }, - { - "default": "Sanctioned", - "fieldname": "status", - "fieldtype": "Select", - "in_standard_filter": 1, - "label": "Status", - "no_copy": 1, - "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", - "read_only": 1 - }, - { - "fieldname": "section_break_8", - "fieldtype": "Section Break", - "label": "Loan Details" - }, - { - "fieldname": "loan_amount", - "fieldtype": "Currency", - "label": "Loan Amount", - "non_negative": 1, - "options": "Company:company:default_currency" - }, - { - "fetch_from": "loan_type.rate_of_interest", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate of Interest (%) / Year", - "read_only": 1, - "reqd": 1 - }, - { - "depends_on": "eval:doc.status==\"Disbursed\"", - "fieldname": "disbursement_date", - "fieldtype": "Date", - "label": "Disbursement Date", - "no_copy": 1 - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_start_date", - "fieldtype": "Date", - "label": "Repayment Start Date", - "mandatory_depends_on": "is_term_loan" - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_method", - "fieldtype": "Select", - "label": "Repayment Method", - "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_periods", - "fieldtype": "Int", - "label": "Repayment Period in Months" - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_application.repayment_amount", - "fetch_if_empty": 1, - "fieldname": "monthly_repayment_amount", - "fieldtype": "Currency", - "label": "Monthly Repayment Amount", - "options": "Company:company:default_currency" - }, - { - "collapsible": 1, - "fieldname": "account_info", - "fieldtype": "Section Break", - "label": "Account Info" - }, - { - "fetch_from": "loan_type.mode_of_payment", - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.payment_account", - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Payment Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "column_break_9", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan_type.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.interest_income_account", - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "section_break_17", - "fieldtype": "Section Break", - "label": "Totals" - }, - { - "default": "0", - "fieldname": "total_payment", - "fieldtype": "Currency", - "label": "Total Payable Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_19", - "fieldtype": "Column Break" - }, - { - "default": "0", - "depends_on": "is_term_loan", - "fieldname": "total_interest_payable", - "fieldtype": "Currency", - "label": "Total Interest Payable", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "total_amount_paid", - "fieldtype": "Currency", - "label": "Total Amount Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_secured_loan", - "fieldtype": "Check", - "label": "Is Secured Loan" - }, - { - "default": "0", - "fetch_from": "loan_type.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan", - "read_only": 1 - }, - { - "fetch_from": "loan_type.penalty_income_account", - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "label": "Penalty Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "total_principal_paid", - "fieldtype": "Currency", - "label": "Total Principal Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "disbursed_amount", - "fieldtype": "Currency", - "label": "Disbursed Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "depends_on": "eval:doc.is_secured_loan", - "fieldname": "maximum_loan_amount", - "fieldtype": "Currency", - "label": "Maximum Loan Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "written_off_amount", - "fieldtype": "Currency", - "label": "Written Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "closure_date", - "fieldtype": "Date", - "label": "Closure Date", - "read_only": 1 - }, - { - "fetch_from": "loan_type.disbursement_account", - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "refund_amount", - "fieldtype": "Currency", - "label": "Refund amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "credit_adjustment_amount", - "fieldtype": "Currency", - "label": "Credit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "debit_adjustment_amount", - "fieldtype": "Currency", - "label": "Debit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Loan is a Non Performing Asset", - "fieldname": "is_npa", - "fieldtype": "Check", - "label": "Is NPA", - "read_only": 1 - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_type.repayment_schedule_type", - "fieldname": "repayment_schedule_type", - "fieldtype": "Data", - "label": "Repayment Schedule Type", - "read_only": 1 - }, - { - "fieldname": "days_past_due", - "fieldtype": "Int", - "label": "Days Past Due", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Manually marked as NPA", - "fieldname": "manual_npa", - "fieldtype": "Check", - "label": "Manual NPA" - }, - { - "fieldname": "asset_classification_code", - "fieldtype": "Select", - "label": "Asset Classification Code", - "no_copy": 1, - "options": "\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3", - "read_only": 1 - }, - { - "fieldname": "asset_classification_name", - "fieldtype": "Select", - "label": "Asset Classification Name", - "no_copy": 1, - "options": "\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset", - "read_only": 1 - }, - { - "fieldname": "branch", - "fieldtype": "Link", - "label": "Branch", - "options": "Branch" - }, - { - "fieldname": "loan_restructure_count", - "fieldtype": "Int", - "label": "Loan Restructure Count", - "read_only": 1 - }, - { - "fieldname": "loan_asset_classification_details_section", - "fieldtype": "Section Break", - "label": "Loan Asset Classification Details" - }, - { - "fieldname": "column_break_zpe2", - "fieldtype": "Column Break" - }, - { - "fieldname": "watch_period_end_date", - "fieldtype": "Date", - "label": "Watch Period End Date", - "read_only": 1 - }, - { - "fieldname": "tenure_post_restructure", - "fieldtype": "Int", - "label": "Tenure Post Restructure", - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-29 18:12:28.333911", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "read": 1, - "role": "Employee" - } -], -"search_fields": "posting_date", -"sort_field": "creation", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "allow_import": 1, + "autoname": "ACC-LOAN-.YYYY.-.#####", + "creation": "2022-01-25 10:30:02.294967", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "applicant_type", + "applicant", + "applicant_name", + "loan_application", + "branch", + "column_break_3", + "company", + "posting_date", + "status", + "section_break_8", + "loan_type", + "repayment_schedule_type", + "loan_amount", + "rate_of_interest", + "is_secured_loan", + "disbursement_date", + "closure_date", + "disbursed_amount", + "column_break_11", + "maximum_loan_amount", + "repayment_method", + "repayment_periods", + "monthly_repayment_amount", + "repayment_start_date", + "is_term_loan", + "loan_asset_classification_details_section", + "days_past_due", + "classification_code", + "classification_name", + "column_break_zpe2", + "loan_restructure_count", + "watch_period_end_date", + "tenure_post_restructure", + "accounting_dimensions_section", + "cost_center", + "account_info", + "mode_of_payment", + "disbursement_account", + "payment_account", + "column_break_9", + "loan_account", + "interest_income_account", + "penalty_income_account", + "section_break_17", + "total_payment", + "total_principal_paid", + "written_off_amount", + "refund_amount", + "debit_adjustment_amount", + "credit_adjustment_amount", + "column_break_19", + "total_interest_payable", + "total_amount_paid", + "is_npa", + "manual_npa", + "amended_from" + ], + "fields": [ + { + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "reqd": 1 + }, + { + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_standard_filter": 1, + "label": "Applicant", + "options": "applicant_type", + "reqd": 1 + }, + { + "fieldname": "applicant_name", + "fieldtype": "Data", + "in_global_search": 1, + "label": "Applicant Name", + "read_only": 1 + }, + { + "fieldname": "loan_application", + "fieldtype": "Link", + "label": "Loan Application", + "no_copy": 1, + "options": "Loan Application" + }, + { + "fieldname": "loan_type", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Loan Type", + "options": "Loan Type", + "reqd": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "no_copy": 1, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Company", + "options": "Company", + "remember_last_selected_value": 1, + "reqd": 1 + }, + { + "default": "Sanctioned", + "fieldname": "status", + "fieldtype": "Select", + "in_standard_filter": 1, + "label": "Status", + "no_copy": 1, + "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", + "read_only": 1 + }, + { + "fieldname": "section_break_8", + "fieldtype": "Section Break", + "label": "Loan Details" + }, + { + "fieldname": "loan_amount", + "fieldtype": "Currency", + "label": "Loan Amount", + "non_negative": 1, + "options": "Company:company:default_currency" + }, + { + "fetch_from": "loan_type.rate_of_interest", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate of Interest (%) / Year", + "read_only": 1, + "reqd": 1 + }, + { + "depends_on": "eval:doc.status==\"Disbursed\"", + "fieldname": "disbursement_date", + "fieldtype": "Date", + "label": "Disbursement Date", + "no_copy": 1 + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_start_date", + "fieldtype": "Date", + "label": "Repayment Start Date", + "mandatory_depends_on": "is_term_loan" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_method", + "fieldtype": "Select", + "label": "Repayment Method", + "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_periods", + "fieldtype": "Int", + "label": "Repayment Period in Months" + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_application.repayment_amount", + "fetch_if_empty": 1, + "fieldname": "monthly_repayment_amount", + "fieldtype": "Currency", + "label": "Monthly Repayment Amount", + "options": "Company:company:default_currency" + }, + { + "collapsible": 1, + "fieldname": "account_info", + "fieldtype": "Section Break", + "label": "Account Info" + }, + { + "fetch_from": "loan_type.mode_of_payment", + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.payment_account", + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Payment Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan_type.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.interest_income_account", + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "section_break_17", + "fieldtype": "Section Break", + "label": "Totals" + }, + { + "default": "0", + "fieldname": "total_payment", + "fieldtype": "Currency", + "label": "Total Payable Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_19", + "fieldtype": "Column Break" + }, + { + "default": "0", + "depends_on": "is_term_loan", + "fieldname": "total_interest_payable", + "fieldtype": "Currency", + "label": "Total Interest Payable", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "total_amount_paid", + "fieldtype": "Currency", + "label": "Total Amount Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_secured_loan", + "fieldtype": "Check", + "label": "Is Secured Loan" + }, + { + "default": "0", + "fetch_from": "loan_type.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan", + "read_only": 1 + }, + { + "fetch_from": "loan_type.penalty_income_account", + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "label": "Penalty Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "total_principal_paid", + "fieldtype": "Currency", + "label": "Total Principal Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "disbursed_amount", + "fieldtype": "Currency", + "label": "Disbursed Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "depends_on": "eval:doc.is_secured_loan", + "fieldname": "maximum_loan_amount", + "fieldtype": "Currency", + "label": "Maximum Loan Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "written_off_amount", + "fieldtype": "Currency", + "label": "Written Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "closure_date", + "fieldtype": "Date", + "label": "Closure Date", + "read_only": 1 + }, + { + "fetch_from": "loan_type.disbursement_account", + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "refund_amount", + "fieldtype": "Currency", + "label": "Refund amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "credit_adjustment_amount", + "fieldtype": "Currency", + "label": "Credit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "debit_adjustment_amount", + "fieldtype": "Currency", + "label": "Debit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Loan is a Non Performing Asset", + "fieldname": "is_npa", + "fieldtype": "Check", + "label": "Is NPA", + "read_only": 1 + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_type.repayment_schedule_type", + "fieldname": "repayment_schedule_type", + "fieldtype": "Data", + "label": "Repayment Schedule Type", + "read_only": 1 + }, + { + "fieldname": "days_past_due", + "fieldtype": "Int", + "label": "Days Past Due", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Manually marked as NPA", + "fieldname": "manual_npa", + "fieldtype": "Check", + "label": "Manual NPA" + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "options": "Branch" + }, + { + "fieldname": "loan_restructure_count", + "fieldtype": "Int", + "label": "Loan Restructure Count", + "read_only": 1 + }, + { + "fieldname": "loan_asset_classification_details_section", + "fieldtype": "Section Break", + "label": "Loan Asset Classification Details" + }, + { + "fieldname": "column_break_zpe2", + "fieldtype": "Column Break" + }, + { + "fieldname": "watch_period_end_date", + "fieldtype": "Date", + "label": "Watch Period End Date", + "read_only": 1 + }, + { + "fieldname": "tenure_post_restructure", + "fieldtype": "Int", + "label": "Tenure Post Restructure", + "read_only": 1 + }, + { + "fieldname": "classification_code", + "fieldtype": "Link", + "label": "Classification Code", + "no_copy": 1, + "options": "Loan Classification", + "read_only": 1 + }, + { + "fetch_from": "classification_code.classification_name", + "fieldname": "classification_name", + "fieldtype": "Data", + "label": "Classification Name", + "no_copy": 1, + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-09-14 17:49:24.386484", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "read": 1, + "role": "Employee" + } + ], + "search_fields": "posting_date", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan/loan.py b/lending/loan_management/doctype/loan/loan.py index 88d10804..6b4bb4e2 100644 --- a/lending/loan_management/doctype/loan/loan.py +++ b/lending/loan_management/doctype/loan/loan.py @@ -637,15 +637,15 @@ def create_dpd_record(loan, posting_date, days_past_due, process_loan_asset_clas def update_loan_and_customer_status( loan, company, applicant_type, applicant, days_past_due, is_npa, posting_date ): - asset_code, asset_name = get_asset_classification_code_and_name(days_past_due, company) + asset_code, asset_name = get_classification_code_and_name(days_past_due, company) frappe.db.set_value( "Loan", loan, { "days_past_due": days_past_due, - "asset_classification_code": asset_code, - "asset_classification_name": asset_name, + "classification_code": asset_code, + "classification_name": asset_name, }, ) @@ -720,19 +720,24 @@ def update_watch_period_date_for_all_loans(watch_period_end_date, applicant_type ).run() -def get_asset_classification_code_and_name(days_past_due, company): +def get_classification_code_and_name(days_past_due, company): asset_code = "" asset_name = "" ranges = frappe.get_all( - "Loan Asset Classification Range", - fields=["min_range", "max_range", "asset_classification_code", "asset_classification_name"], + "Loan Classification Range", + fields=[ + "min_dpd_range", + "max_dpd_range", + "classification_code", + "classification_name", + ], filters={"parent": company}, - order_by="min_range", + order_by="min_dpd_range", ) for range in ranges: - if range.min_range <= days_past_due <= range.max_range: - return range.asset_classification_code, range.asset_classification_name + if range.min_dpd_range <= days_past_due <= range.max_dpd_range: + return range.classification_code, range.classification_name return asset_code, asset_name diff --git a/lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.json b/lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.json deleted file mode 100644 index 1bfeb122..00000000 --- a/lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.json +++ /dev/null @@ -1,54 +0,0 @@ -{ -"actions": [], -"allow_rename": 1, -"creation": "2023-05-06 16:38:45.403816", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "min_range", - "max_range", - "asset_classification_code", - "asset_classification_name" -], -"fields": [ - { - "fieldname": "min_range", - "fieldtype": "Int", - "in_list_view": 1, - "label": "Min Range" - }, - { - "fieldname": "max_range", - "fieldtype": "Int", - "in_list_view": 1, - "label": "Max Range" - }, - { - "fieldname": "asset_classification_code", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Asset Classification Code", - "options": "\nStandard\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3" - }, - { - "fieldname": "asset_classification_name", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Asset Classification Name", - "options": "\nStandard\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset" - } -], -"index_web_pages_for_search": 1, -"istable": 1, -"links": [], -"modified": "2023-05-26 12:39:06.079137", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Asset Classification Range", -"owner": "Administrator", -"permissions": [], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] -} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_asset_classification_range/__init__.py b/lending/loan_management/doctype/loan_classification_range/__init__.py similarity index 100% rename from lending/loan_management/doctype/loan_asset_classification_range/__init__.py rename to lending/loan_management/doctype/loan_classification_range/__init__.py diff --git a/lending/loan_management/doctype/loan_classification_range/loan_classification_range.json b/lending/loan_management/doctype/loan_classification_range/loan_classification_range.json new file mode 100644 index 00000000..c6f7592c --- /dev/null +++ b/lending/loan_management/doctype/loan_classification_range/loan_classification_range.json @@ -0,0 +1,59 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-05-06 16:38:45.403816", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "classification_code", + "classification_name", + "min_dpd_range", + "max_dpd_range" + ], + "fields": [ + { + "columns": 2, + "fieldname": "classification_code", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Classification Code", + "options": "Loan Classification" + }, + { + "columns": 3, + "fetch_from": "classification_code.classification_name", + "fieldname": "classification_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Classification Name", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "min_dpd_range", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Min DPD Range" + }, + { + "columns": 3, + "fieldname": "max_dpd_range", + "fieldtype": "Int", + "in_list_view": 1, + "label": "Max DPD Range" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-09-13 21:41:03.820275", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Classification Range", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.py b/lending/loan_management/doctype/loan_classification_range/loan_classification_range.py similarity index 80% rename from lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.py rename to lending/loan_management/doctype/loan_classification_range/loan_classification_range.py index 884e54b2..d2b7ae2b 100644 --- a/lending/loan_management/doctype/loan_asset_classification_range/loan_asset_classification_range.py +++ b/lending/loan_management/doctype/loan_classification_range/loan_classification_range.py @@ -5,5 +5,5 @@ from frappe.model.document import Document -class LoanAssetClassificationRange(Document): +class LoanClassificationRange(Document): pass diff --git a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index 785a86de..4edf7488 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -79,7 +79,7 @@ def setUp(self): self.applicant = frappe.db.get_value("Customer", {"name": "_Test Loan Customer"}, "name") - setup_asset_classification_ranges("_Test Company") + setup_loan_classification_ranges("_Test Company") def test_loan_interest_accural(self): pledge = [{"loan_security": "Test Security 1", "qty": 4000.00}] @@ -129,13 +129,13 @@ def test_dpd_calculation(self): loan_details = frappe.db.get_value( "Loan", loan.name, - ["days_past_due", "asset_classification_code", "asset_classification_name"], + ["days_past_due", "classification_code", "classification_name"], as_dict=1, ) self.assertEqual(loan_details.days_past_due, 2) - self.assertEqual(loan_details.asset_classification_code, "SMA-0") - self.assertEqual(loan_details.asset_classification_name, "Special Mention Account - 0") + self.assertEqual(loan_details.classification_code, "SMA-0") + self.assertEqual(loan_details.classification_name, "Special Mention Account - 0") create_process_loan_asset_classification( posting_date="2023-04-05", loan_type=loan.loan_type, loan=loan.name @@ -143,13 +143,13 @@ def test_dpd_calculation(self): loan_details = frappe.db.get_value( "Loan", loan.name, - ["days_past_due", "asset_classification_code", "asset_classification_name"], + ["days_past_due", "classification_code", "classification_name"], as_dict=1, ) self.assertEqual(loan_details.days_past_due, 64) - self.assertEqual(loan_details.asset_classification_code, "SMA-2") - self.assertEqual(loan_details.asset_classification_name, "Special Mention Account - 2") + self.assertEqual(loan_details.classification_code, "SMA-2") + self.assertEqual(loan_details.classification_name, "Special Mention Account - 2") create_process_loan_asset_classification( posting_date="2023-07-05", loan_type=loan.loan_type, loan=loan.name @@ -159,8 +159,8 @@ def test_dpd_calculation(self): loan.name, [ "days_past_due", - "asset_classification_code", - "asset_classification_name", + "classification_code", + "classification_name", "is_npa", "manual_npa", ], @@ -170,8 +170,8 @@ def test_dpd_calculation(self): applicant_status = frappe.db.get_value("Customer", self.applicant, "is_npa") self.assertEqual(loan_details.days_past_due, 155) - self.assertEqual(loan_details.asset_classification_code, "D1") - self.assertEqual(loan_details.asset_classification_name, "Substandard Asset") + self.assertEqual(loan_details.classification_code, "D1") + self.assertEqual(loan_details.classification_name, "Substandard Asset") self.assertEqual(loan_details.is_npa, 1) self.assertEqual(loan_details.manual_npa, 1) self.assertEqual(applicant_status, 1) @@ -220,8 +220,8 @@ def test_accumulated_amounts(self): ) -def setup_asset_classification_ranges(company): - ranges = [ +def setup_loan_classification_ranges(company): + classification_ranges = [ ["SMA-0", "Special Mention Account - 0", 0, 30], ["SMA-1", "Special Mention Account - 1", 31, 60], ["SMA-2", "Special Mention Account - 2", 61, 90], @@ -230,16 +230,20 @@ def setup_asset_classification_ranges(company): ["D3", "Loss Asset", 1099, 10000000], ] company_doc = frappe.get_doc("Company", company) - company_doc.set("asset_classification_ranges", []) + company_doc.set("loan_classification_ranges", []) + + for classification_range in classification_ranges: + loan_classification = frappe.new_doc("Loan Classification") + loan_classification.classification_code = classification_range[0] + loan_classification.classification_name = classification_range[1] + loan_classification.insert() - for range in ranges: company_doc.append( - "asset_classification_ranges", + "loan_classification_ranges", { - "asset_classification_code": range[0], - "asset_classification_name": range[1], - "min_range": range[2], - "max_range": range[3], + "classification_code": classification_range[0], + "min_dpd_range": classification_range[2], + "max_dpd_range": classification_range[3], }, ) diff --git a/lending/patches.txt b/lending/patches.txt index 503ca9f9..08caa97a 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -8,4 +8,8 @@ lending.patches.v15_0.rename_process_asset_classification_doctype # 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 #6 -lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuraton \ No newline at end of file +lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuraton +lending.patches.v15_0.update_loan_asset_classification_ranges +lending.patches.v15_0.generate_loan_classifications_from_loan_asset_classification_ranges +lending.patches.v15_0.update_company_loan_asset_classification_ranges_table +lending.patches.v15_0.update_classification_fields_in_loan \ No newline at end of file diff --git a/lending/patches/v15_0/generate_loan_classifications_from_loan_asset_classification_ranges.py b/lending/patches/v15_0/generate_loan_classifications_from_loan_asset_classification_ranges.py new file mode 100644 index 00000000..cb73f00b --- /dev/null +++ b/lending/patches/v15_0/generate_loan_classifications_from_loan_asset_classification_ranges.py @@ -0,0 +1,21 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +import frappe + + +def execute(): + classification_ranges = frappe.get_all( + "Loan Classification Range", + fields=[ + "classification_code", + "classification_name", + ], + ) + + for classification_range in classification_ranges: + loan_classification = frappe.new_doc("Loan Classification") + loan_classification.classification_code = classification_range.classification_code + loan_classification.classification_name = classification_range.classification_name + loan_classification.flags.ignore_validate = True + loan_classification.insert() diff --git a/lending/patches/v15_0/update_classification_fields_in_loan.py b/lending/patches/v15_0/update_classification_fields_in_loan.py new file mode 100644 index 00000000..5e624863 --- /dev/null +++ b/lending/patches/v15_0/update_classification_fields_in_loan.py @@ -0,0 +1,15 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +from frappe.model.utils.rename_field import rename_field + + +def execute(): + try: + rename_field("Loan", "asset_classification_code", "classification_code") + rename_field("Loan", "asset_classification_name", "classification_name") + + except Exception as e: + if e.args[0] != 1054: + raise diff --git a/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py b/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py new file mode 100644 index 00000000..c590ed6b --- /dev/null +++ b/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py @@ -0,0 +1,35 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + frappe.delete_doc("Custom Field", "Company-asset_classification_ranges") + + create_custom_fields( + { + "Company": [ + { + "fieldname": "loan_classification_ranges", + "label": "Loan Classification Ranges", + "fieldtype": "Table", + "options": "Loan Classification Range", + "insert_after": "loan_section_break_2", + }, + ] + }, + ignore_validate=True, + ) + + lcr = frappe.qb.DocType("Loan Classification Range") + frappe.qb.update(lcr).set(lcr.parentfield, "loan_classification_ranges").run() + + frappe.db.set_value( + "Custom Field", + {"name": "Company-irac_provisioning_configuraton"}, + "insert_after", + "loan_classification_ranges", + ) diff --git a/lending/patches/v15_0/update_loan_asset_classification_ranges.py b/lending/patches/v15_0/update_loan_asset_classification_ranges.py new file mode 100644 index 00000000..2ae79d8d --- /dev/null +++ b/lending/patches/v15_0/update_loan_asset_classification_ranges.py @@ -0,0 +1,17 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +from frappe.model.utils.rename_field import rename_field + + +def execute(): + try: + rename_field("Loan Classification Range", "min_range", "min_dpd_range") + rename_field("Loan Classification Range", "max_range", "max_dpd_range") + rename_field("Loan Classification Range", "asset_classification_code", "classification_code") + rename_field("Loan Classification Range", "asset_classification_name", "classification_name") + + except Exception as e: + if e.args[0] != 1054: + raise From 5e38af9be9e3c7079b0cd52c32c34876ca1d2ccf Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 14 Sep 2023 20:46:46 +0530 Subject: [PATCH 10/23] chore: rename process_loan_asset_classification and remove 'asset' --- lending/hooks.py | 2 +- .../days_past_due_log/days_past_due_log.json | 10 +++---- .../loan_management/doctype/loan/loan.json | 14 ++++----- lending/loan_management/doctype/loan/loan.py | 29 ++++++++++--------- .../test_loan_interest_accrual.py | 10 +++---- .../doctype/loan_repayment/loan_repayment.js | 2 +- .../doctype/loan_repayment/loan_repayment.py | 8 ++--- .../loan_restructure/loan_restructure.js | 2 +- .../__init__.py | 0 .../process_loan_classification.js} | 2 +- .../process_loan_classification.json} | 6 ++-- .../process_loan_classification.py} | 24 ++++++++------- .../test_process_loan_classification.py} | 2 +- lending/patches.txt | 1 + ..._process_asset_classification_doctype_2.py | 15 ++++++++++ 15 files changed, 74 insertions(+), 53 deletions(-) rename lending/loan_management/doctype/{process_loan_asset_classification => process_loan_classification}/__init__.py (100%) rename lending/loan_management/doctype/{process_loan_asset_classification/process_loan_asset_classification.js => process_loan_classification/process_loan_classification.js} (72%) rename lending/loan_management/doctype/{process_loan_asset_classification/process_loan_asset_classification.json => process_loan_classification/process_loan_classification.json} (92%) rename lending/loan_management/doctype/{process_loan_asset_classification/process_loan_asset_classification.py => process_loan_classification/process_loan_classification.py} (55%) rename lending/loan_management/doctype/{process_loan_asset_classification/test_asset_classification.py => process_loan_classification/test_process_loan_classification.py} (74%) create mode 100644 lending/patches/v15_0/rename_process_asset_classification_doctype_2.py diff --git a/lending/hooks.py b/lending/hooks.py index 6ad9fce6..e75b9c9b 100644 --- a/lending/hooks.py +++ b/lending/hooks.py @@ -128,7 +128,7 @@ "daily_long": [ "lending.loan_management.doctype.process_loan_security_shortfall.process_loan_security_shortfall.create_process_loan_security_shortfall", "lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual.process_loan_interest_accrual_for_term_loans", - "lending.loan_management.doctype.process_loan_asset_classification.process_loan_asset_classification.create_process_loan_asset_classification", + "lending.loan_management.doctype.process_loan_classification.process_loan_classification.create_process_loan_classification", ], "monthly_long": [ "lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual.process_loan_interest_accrual_for_demand_loans", diff --git a/lending/loan_management/doctype/days_past_due_log/days_past_due_log.json b/lending/loan_management/doctype/days_past_due_log/days_past_due_log.json index 9fc0ab94..dc541978 100644 --- a/lending/loan_management/doctype/days_past_due_log/days_past_due_log.json +++ b/lending/loan_management/doctype/days_past_due_log/days_past_due_log.json @@ -9,7 +9,7 @@ "loan", "posting_date", "days_past_due", - "process_loan_asset_classification" + "process_loan_classification" ], "fields": [ { @@ -32,16 +32,16 @@ "read_only": 1 }, { - "fieldname": "process_loan_asset_classification", + "fieldname": "process_loan_classification", "fieldtype": "Link", - "label": "Process Loan Asset Classification", - "options": "Process Loan Asset Classification", + "label": "Process Loan Classification", + "options": "Process Loan Classification", "read_only": 1 } ], "in_create": 1, "links": [], - "modified": "2023-08-25 15:37:21.206963", + "modified": "2023-09-14 20:29:11.095918", "modified_by": "Administrator", "module": "Loan Management", "name": "Days Past Due Log", diff --git a/lending/loan_management/doctype/loan/loan.json b/lending/loan_management/doctype/loan/loan.json index 44e799d3..96dcc302 100644 --- a/lending/loan_management/doctype/loan/loan.json +++ b/lending/loan_management/doctype/loan/loan.json @@ -33,7 +33,7 @@ "monthly_repayment_amount", "repayment_start_date", "is_term_loan", - "loan_asset_classification_details_section", + "loan_classification_details_section", "days_past_due", "classification_code", "classification_name", @@ -438,11 +438,6 @@ "label": "Loan Restructure Count", "read_only": 1 }, - { - "fieldname": "loan_asset_classification_details_section", - "fieldtype": "Section Break", - "label": "Loan Asset Classification Details" - }, { "fieldname": "column_break_zpe2", "fieldtype": "Column Break" @@ -474,12 +469,17 @@ "label": "Classification Name", "no_copy": 1, "read_only": 1 + }, + { + "fieldname": "loan_classification_details_section", + "fieldtype": "Section Break", + "label": "Loan Classification Details" } ], "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2023-09-14 17:49:24.386484", + "modified": "2023-09-14 20:41:41.531824", "modified_by": "Administrator", "module": "Loan Management", "name": "Loan", diff --git a/lending/loan_management/doctype/loan/loan.py b/lending/loan_management/doctype/loan/loan.py index 6b4bb4e2..31c106d5 100644 --- a/lending/loan_management/doctype/loan/loan.py +++ b/lending/loan_management/doctype/loan/loan.py @@ -549,7 +549,7 @@ def make_refund_jv(loan, amount=0, reference_number=None, reference_date=None, s @frappe.whitelist() def update_days_past_due_in_loans( - posting_date=None, loan_type=None, loan_name=None, process_loan_asset_classification=None + posting_date=None, loan_type=None, loan_name=None, process_loan_classification=None ): """Update days past due in loans""" posting_date = posting_date or getdate() @@ -579,7 +579,7 @@ def update_days_past_due_in_loans( posting_date or getdate(), ) - create_dpd_record(loan.loan, posting_date, days_past_due, process_loan_asset_classification) + create_dpd_record(loan.loan, posting_date, days_past_due, process_loan_classification) checked_loans.append(loan.loan) open_loans_with_no_overdue = [] @@ -601,19 +601,19 @@ def update_days_past_due_in_loans( d.name, d.company, d.applicant_type, d.applicant, 0, 0, posting_date or getdate() ) - create_dpd_record(d.name, posting_date, 0, process_loan_asset_classification) + create_dpd_record(d.name, posting_date, 0, process_loan_classification) def restore_pervious_dpd_state(applicant_type, applicant, repayment_reference): pac = frappe.db.get_value( - "Process Loan Asset Classification", + "Process Loan Classification", {"payment_reference": repayment_reference}, "previous_process", ) for d in frappe.db.get_all( "Days Past Due Log", filters={ - "process_loan_asset_classification": pac, + "process_loan_classification": pac, "applicant_type": applicant_type, "applicant": applicant, }, @@ -622,14 +622,14 @@ def restore_pervious_dpd_state(applicant_type, applicant, repayment_reference): frappe.db.set_value("Loan", d.loan, "days_past_due", d.days_past_due) -def create_dpd_record(loan, posting_date, days_past_due, process_loan_asset_classification=None): +def create_dpd_record(loan, posting_date, days_past_due, process_loan_classification=None): frappe.get_doc( { "doctype": "Days Past Due Log", "loan": loan, "posting_date": posting_date, "days_past_due": days_past_due, - "process_loan_asset_classification": process_loan_asset_classification, + "process_loan_classification": process_loan_classification, } ).insert(ignore_permissions=True) @@ -637,15 +637,17 @@ def create_dpd_record(loan, posting_date, days_past_due, process_loan_asset_clas def update_loan_and_customer_status( loan, company, applicant_type, applicant, days_past_due, is_npa, posting_date ): - asset_code, asset_name = get_classification_code_and_name(days_past_due, company) + classification_code, classification_name = get_classification_code_and_name( + days_past_due, company + ) frappe.db.set_value( "Loan", loan, { "days_past_due": days_past_due, - "classification_code": asset_code, - "classification_name": asset_name, + "classification_code": classification_code, + "classification_name": classification_name, }, ) @@ -721,8 +723,9 @@ def update_watch_period_date_for_all_loans(watch_period_end_date, applicant_type def get_classification_code_and_name(days_past_due, company): - asset_code = "" - asset_name = "" + classification_code = "" + classification_name = "" + ranges = frappe.get_all( "Loan Classification Range", fields=[ @@ -739,7 +742,7 @@ def get_classification_code_and_name(days_past_due, company): if range.min_dpd_range <= days_past_due <= range.max_dpd_range: return range.classification_code, range.classification_name - return asset_code, asset_name + return classification_code, classification_name def get_pending_loan_interest_accruals( diff --git a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index 4edf7488..c9c96ff8 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -20,8 +20,8 @@ from lending.loan_management.doctype.loan_interest_accrual.loan_interest_accrual import ( days_in_year, ) -from lending.loan_management.doctype.process_loan_asset_classification.process_loan_asset_classification import ( - create_process_loan_asset_classification, +from lending.loan_management.doctype.process_loan_classification.process_loan_classification import ( + create_process_loan_classification, ) from lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( process_loan_interest_accrual_for_demand_loans, @@ -122,7 +122,7 @@ def test_dpd_calculation(self): make_loan_disbursement_entry(loan.name, loan.loan_amount, disbursement_date="2023-02-01") process_loan_interest_accrual_for_term_loans(posting_date="2023-02-01") - create_process_loan_asset_classification( + create_process_loan_classification( posting_date="2023-02-02", loan_type=loan.loan_type, loan=loan.name ) @@ -137,7 +137,7 @@ def test_dpd_calculation(self): self.assertEqual(loan_details.classification_code, "SMA-0") self.assertEqual(loan_details.classification_name, "Special Mention Account - 0") - create_process_loan_asset_classification( + create_process_loan_classification( posting_date="2023-04-05", loan_type=loan.loan_type, loan=loan.name ) loan_details = frappe.db.get_value( @@ -151,7 +151,7 @@ def test_dpd_calculation(self): self.assertEqual(loan_details.classification_code, "SMA-2") self.assertEqual(loan_details.classification_name, "Special Mention Account - 2") - create_process_loan_asset_classification( + create_process_loan_classification( posting_date="2023-07-05", loan_type=loan.loan_type, loan=loan.name ) loan_details = frappe.db.get_value( diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.js b/lending/loan_management/doctype/loan_repayment/loan_repayment.js index 390096d9..1250bc79 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.js +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.js @@ -5,7 +5,7 @@ lending.common.setup_filters("Loan Repayment"); frappe.ui.form.on('Loan Repayment', { setup(frm) { - frm.ignore_doctypes_on_cancel_all = ["Process Loan Asset Classification"]; + frm.ignore_doctypes_on_cancel_all = ["Process Loan Classification"]; }, onload: function(frm) { frm.set_query('against_loan', function() { diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index a3865c34..0bdf581a 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.py @@ -18,8 +18,8 @@ from lending.loan_management.doctype.loan_security_shortfall.loan_security_shortfall import ( update_shortfall_status, ) -from lending.loan_management.doctype.process_loan_asset_classification.process_loan_asset_classification import ( - create_process_loan_asset_classification, +from lending.loan_management.doctype.process_loan_classification.process_loan_classification import ( + create_process_loan_classification, ) from lending.loan_management.doctype.process_loan_interest_accrual.process_loan_interest_accrual import ( process_loan_interest_accrual_for_demand_loans, @@ -41,7 +41,7 @@ def before_submit(self): def on_submit(self): if self.repayment_type == "Normal Repayment": - create_process_loan_asset_classification( + create_process_loan_classification( posting_date=self.posting_date, loan_type=self.loan_type, loan=self.against_loan, @@ -71,7 +71,7 @@ def on_cancel(self): self.ignore_linked_doctypes = [ "GL Entry", "Payment Ledger Entry", - "Process Loan Asset Classification", + "Process Loan Classification", ] self.make_gl_entries(cancel=1) diff --git a/lending/loan_management/doctype/loan_restructure/loan_restructure.js b/lending/loan_management/doctype/loan_restructure/loan_restructure.js index 1a6c7bc6..b178acfc 100644 --- a/lending/loan_management/doctype/loan_restructure/loan_restructure.js +++ b/lending/loan_management/doctype/loan_restructure/loan_restructure.js @@ -4,7 +4,7 @@ frappe.ui.form.on("Loan Restructure", { refresh: function (frm) { frm.trigger("toggle_fields"); - frm.ignore_doctypes_on_cancel_all = ['Loan Balance Adjustment', 'Loan Repayment', 'Loan Repayment Schedule', 'Process Loan Asset Classification']; + frm.ignore_doctypes_on_cancel_all = ['Loan Balance Adjustment', 'Loan Repayment', 'Loan Repayment Schedule', 'Process Loan Classification']; }, new_repayment_method: function (frm) { diff --git a/lending/loan_management/doctype/process_loan_asset_classification/__init__.py b/lending/loan_management/doctype/process_loan_classification/__init__.py similarity index 100% rename from lending/loan_management/doctype/process_loan_asset_classification/__init__.py rename to lending/loan_management/doctype/process_loan_classification/__init__.py diff --git a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.js b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.js similarity index 72% rename from lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.js rename to lending/loan_management/doctype/process_loan_classification/process_loan_classification.js index 20d07580..5b622cf4 100644 --- a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.js +++ b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.js @@ -1,7 +1,7 @@ // Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -// frappe.ui.form.on("Process Loan Asset Classification", { +// frappe.ui.form.on("Process Loan Classification", { // refresh(frm) { // }, diff --git a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.json b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.json similarity index 92% rename from lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.json rename to lending/loan_management/doctype/process_loan_classification/process_loan_classification.json index c0552d3a..49e1f2be 100644 --- a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.json +++ b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.json @@ -39,7 +39,7 @@ "fieldtype": "Link", "label": "Amended From", "no_copy": 1, - "options": "Process Loan Asset Classification", + "options": "Process Loan Classification", "print_hide": 1, "read_only": 1 }, @@ -47,7 +47,7 @@ "fieldname": "previous_process", "fieldtype": "Link", "label": "Previous Process", - "options": "Process Loan Asset Classification", + "options": "Process Loan Classification", "read_only": 1 }, { @@ -64,7 +64,7 @@ "modified": "2023-05-17 10:59:34.824696", "modified_by": "Administrator", "module": "Loan Management", - "name": "Process Loan Asset Classification", + "name": "Process Loan Classification", "naming_rule": "Expression (old style)", "owner": "Administrator", "permissions": [ diff --git a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.py b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.py similarity index 55% rename from lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.py rename to lending/loan_management/doctype/process_loan_classification/process_loan_classification.py index c19c941c..1ff87b82 100644 --- a/lending/loan_management/doctype/process_loan_asset_classification/process_loan_asset_classification.py +++ b/lending/loan_management/doctype/process_loan_classification/process_loan_classification.py @@ -6,7 +6,7 @@ from frappe.utils import getdate -class ProcessLoanAssetClassification(Document): +class ProcessLoanClassification(Document): def on_submit(self): from lending.loan_management.doctype.loan.loan import update_days_past_due_in_loans @@ -14,27 +14,29 @@ def on_submit(self): posting_date=self.posting_date, loan_type=self.loan_type, loan_name=self.loan, - process_loan_asset_classification=self.name, + process_loan_classification=self.name, ) -def create_process_loan_asset_classification( +def create_process_loan_classification( posting_date=None, loan_type=None, loan=None, payment_reference=None ): posting_date = posting_date or getdate() previous_process = frappe.db.get_all( - "Process Loan Asset Classification", + "Process Loan Classification", filters={"posting_date": ("<=", posting_date), "loan": ("in", ["", loan])}, fields=["name"], order_by="posting_date desc", limit=1, ) - asset_classification = frappe.new_doc("Process Loan Asset Classification") - asset_classification.posting_date = posting_date - asset_classification.loan_type = loan_type - 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() + process_loan_classification = frappe.new_doc("Process Loan Classification") + process_loan_classification.posting_date = posting_date + process_loan_classification.loan_type = loan_type + process_loan_classification.loan = loan + process_loan_classification.previous_process = ( + previous_process[0].name if previous_process else None + ) + process_loan_classification.payment_reference = payment_reference + process_loan_classification.submit() diff --git a/lending/loan_management/doctype/process_loan_asset_classification/test_asset_classification.py b/lending/loan_management/doctype/process_loan_classification/test_process_loan_classification.py similarity index 74% rename from lending/loan_management/doctype/process_loan_asset_classification/test_asset_classification.py rename to lending/loan_management/doctype/process_loan_classification/test_process_loan_classification.py index fbf22e6c..b8ed4e47 100644 --- a/lending/loan_management/doctype/process_loan_asset_classification/test_asset_classification.py +++ b/lending/loan_management/doctype/process_loan_classification/test_process_loan_classification.py @@ -5,5 +5,5 @@ from frappe.tests.utils import FrappeTestCase -class TestProcessAssetClassification(FrappeTestCase): +class TestProcessLoanClassification(FrappeTestCase): pass diff --git a/lending/patches.txt b/lending/patches.txt index 08caa97a..e425e15d 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -3,6 +3,7 @@ # Read docs to understand patches: https://frappeframework.com/docs/v14/user/en/database-migrations lending.patches.v15_0.generate_loan_repayment_schedule lending.patches.v15_0.rename_process_asset_classification_doctype +lending.patches.v15_0.rename_process_asset_classification_doctype_2 [post_model_sync] # Patches added in this section will be executed after doctypes are migrated diff --git a/lending/patches/v15_0/rename_process_asset_classification_doctype_2.py b/lending/patches/v15_0/rename_process_asset_classification_doctype_2.py new file mode 100644 index 00000000..e440873d --- /dev/null +++ b/lending/patches/v15_0/rename_process_asset_classification_doctype_2.py @@ -0,0 +1,15 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe + + +def execute(): + if frappe.db.table_exists("Process Loan Asset Classification") and not frappe.db.table_exists( + "Process Loan Classification" + ): + frappe.rename_doc( + "DocType", "Process Loan Asset Classification", "Process Loan Classification", force=True + ) + frappe.reload_doc("loan_management", "doctype", "process_loan_classification") From 684c12a47fee261228a186e00d492b5b0f3e5247 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 14 Sep 2023 21:00:53 +0530 Subject: [PATCH 11/23] chore: fix test by adding ignore_if_duplicate in setup_loan_classification_ranges --- .../doctype/loan_interest_accrual/test_loan_interest_accrual.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py index c9c96ff8..e8c18bb7 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py +++ b/lending/loan_management/doctype/loan_interest_accrual/test_loan_interest_accrual.py @@ -236,7 +236,7 @@ def setup_loan_classification_ranges(company): loan_classification = frappe.new_doc("Loan Classification") loan_classification.classification_code = classification_range[0] loan_classification.classification_name = classification_range[1] - loan_classification.insert() + loan_classification.insert(ignore_if_duplicate=True) company_doc.append( "loan_classification_ranges", From 91ee3e0b417eb49da31adc1a5a5a5b1309b0e4ec Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Thu, 14 Sep 2023 21:58:49 +0530 Subject: [PATCH 12/23] chore: add collection_offset_sequence_for_written_off_asset --- lending/install.py | 9 +++++- lending/patches.txt | 3 +- ...n_offset_sequence_for_written_off_asset.py | 30 +++++++++++++++++++ 3 files changed, 40 insertions(+), 2 deletions(-) create mode 100644 lending/patches/v15_0/create_custom_field_for_collection_offset_sequence_for_written_off_asset.py diff --git a/lending/install.py b/lending/install.py index 2240d33f..5535a74b 100644 --- a/lending/install.py +++ b/lending/install.py @@ -65,10 +65,17 @@ "options": "IP...IP...IP...CCC\nPPP...III...CCC", "insert_after": "collection_offset_sequence_for_sub_standard_asset", }, + { + "fieldname": "collection_offset_sequence_for_written_off_asset", + "label": "Collection Offset Sequence for Written Off Asset", + "fieldtype": "Select", + "options": "IP...IP...IP...CCC\nPPP...III...CCC", + "insert_after": "collection_offset_sequence_for_standard_asset", + }, { "fieldname": "loan_section_break_2", "fieldtype": "Section Break", - "insert_after": "collection_offset_sequence_for_standard_asset", + "insert_after": "collection_offset_sequence_for_written_off_asset", }, { "fieldname": "loan_classification_ranges", diff --git a/lending/patches.txt b/lending/patches.txt index e425e15d..efc6a563 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -13,4 +13,5 @@ lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuraton lending.patches.v15_0.update_loan_asset_classification_ranges lending.patches.v15_0.generate_loan_classifications_from_loan_asset_classification_ranges lending.patches.v15_0.update_company_loan_asset_classification_ranges_table -lending.patches.v15_0.update_classification_fields_in_loan \ No newline at end of file +lending.patches.v15_0.update_classification_fields_in_loan +lending.patches.v15_0.create_custom_field_for_collection_offset_sequence_for_written_off_asset \ No newline at end of file diff --git a/lending/patches/v15_0/create_custom_field_for_collection_offset_sequence_for_written_off_asset.py b/lending/patches/v15_0/create_custom_field_for_collection_offset_sequence_for_written_off_asset.py new file mode 100644 index 00000000..5af4a591 --- /dev/null +++ b/lending/patches/v15_0/create_custom_field_for_collection_offset_sequence_for_written_off_asset.py @@ -0,0 +1,30 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + create_custom_fields( + { + "Company": [ + { + "fieldname": "collection_offset_sequence_for_written_off_asset", + "label": "Collection Offset Sequence for Written Off Asset", + "fieldtype": "Select", + "options": "IP...IP...IP...CCC\nPPP...III...CCC", + "insert_after": "collection_offset_sequence_for_standard_asset", + }, + ] + }, + ignore_validate=True, + ) + + frappe.db.set_value( + "Custom Field", + {"name": "Company-loan_section_break_2"}, + "insert_after", + "collection_offset_sequence_for_written_off_asset", + ) From 6f53aa080f8c23ae4cee030ffe2d767b892a89a5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Oliver=20S=C3=BCnderhauf?= <46800703+bosue@users.noreply.github.com> Date: Fri, 15 Sep 2023 10:44:25 +0200 Subject: [PATCH 13/23] fix: Disallow zero disbursement --- .../doctype/loan_disbursement/loan_disbursement.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lending/loan_management/doctype/loan_disbursement/loan_disbursement.py b/lending/loan_management/doctype/loan_disbursement/loan_disbursement.py index 21201963..dd7b5e6f 100644 --- a/lending/loan_management/doctype/loan_disbursement/loan_disbursement.py +++ b/lending/loan_management/doctype/loan_disbursement/loan_disbursement.py @@ -87,7 +87,10 @@ def delete_security_deposit(self): def validate_disbursal_amount(self): possible_disbursal_amount = get_disbursal_amount(self.against_loan) - if self.disbursed_amount > possible_disbursal_amount: + if not self.disbursed_amount: + frappe.throw(_("Disbursed amount cannot be zero")) + + elif self.disbursed_amount > possible_disbursal_amount: frappe.throw(_("Disbursed Amount cannot be greater than {0}").format(possible_disbursal_amount)) def set_status_and_amounts(self, cancel=0): From b94e442612dd3afe98d8fa82f29aae3cf1b20282 Mon Sep 17 00:00:00 2001 From: anandbaburajan Date: Fri, 15 Sep 2023 18:25:14 +0530 Subject: [PATCH 14/23] chore: remove unnecessary disabled conditions for loan type --- lending/loan_management/doctype/loan/loan.js | 1 - .../process_loan_interest_accrual.js | 16 +++++----------- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/lending/loan_management/doctype/loan/loan.js b/lending/loan_management/doctype/loan/loan.js index 0e1e69c1..16904526 100644 --- a/lending/loan_management/doctype/loan/loan.js +++ b/lending/loan_management/doctype/loan/loan.js @@ -28,7 +28,6 @@ frappe.ui.form.on('Loan', { frm.set_query("loan_type", function () { return { "filters": { - "disabled": 0, "company": frm.doc.company } }; diff --git a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js index d0864a20..414ac2eb 100644 --- a/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js +++ b/lending/loan_management/doctype/process_loan_interest_accrual/process_loan_interest_accrual.js @@ -1,14 +1,8 @@ // Copyright (c) 2019, Frappe Technologies Pvt. Ltd. and contributors // For license information, please see license.txt -frappe.ui.form.on('Process Loan Interest Accrual', { - refresh: function(frm) { - frm.set_query("loan_type", function() { - return { - filters: { - "disabled": 0, - } - }; - }); - } -}); +// frappe.ui.form.on('Process Loan Interest Accrual', { +// refresh: function(frm) { + +// } +// }); From eed2329a1756b7a49be003c83130279c97df6055 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Tue, 19 Sep 2023 15:14:48 +0530 Subject: [PATCH 15/23] fix: fetch logic for repay_from_salary in loan_repayment (#32) --- .../doctype/loan_repayment/loan_repayment.js | 4 ++++ .../doctype/loan_repayment/loan_repayment.json | 1 + .../doctype/loan_repayment/loan_repayment.py | 6 ++++++ 3 files changed, 11 insertions(+) diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.js b/lending/loan_management/doctype/loan_repayment/loan_repayment.js index 390096d9..07030eab 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.js +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.js @@ -5,8 +5,12 @@ lending.common.setup_filters("Loan Repayment"); frappe.ui.form.on('Loan Repayment', { setup(frm) { + if (frappe.meta.has_field("Loan Repayment", "repay_from_salary")) { + frm.add_fetch("against_loan", "repay_from_salary", "repay_from_salary"); + } frm.ignore_doctypes_on_cancel_all = ["Process Loan Asset Classification"]; }, + onload: function(frm) { frm.set_query('against_loan', function() { return { diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.json b/lending/loan_management/doctype/loan_repayment/loan_repayment.json index e9308ff1..fb98db4a 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.json +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.json @@ -275,6 +275,7 @@ "label": "Accounting Details" }, { + "depends_on": "eval:!doc.repay_from_salary", "fetch_from": "against_loan.payment_account", "fetch_if_empty": 1, "fieldname": "payment_account", diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.py b/lending/loan_management/doctype/loan_repayment/loan_repayment.py index a3865c34..c1bdbc04 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.py @@ -145,6 +145,12 @@ def set_missing_values(self, amounts): if amounts.get("due_date"): self.due_date = amounts.get("due_date") + if hasattr(self, "repay_from_salary") and hasattr(self, "payroll_payable_account"): + if self.repay_from_salary and not self.payroll_payable_account: + frappe.throw(_("Please set Payroll Payable Account in Loan Repayment")) + elif not self.repay_from_salary and self.payroll_payable_account: + self.repay_from_salary = 1 + def check_future_entries(self): future_repayment_date = frappe.db.get_value( "Loan Repayment", From bedcad1f005aa97a13ecf9cf065f61ceebd6f6b4 Mon Sep 17 00:00:00 2001 From: Marica Date: Tue, 19 Sep 2023 19:59:07 +0530 Subject: [PATCH 16/23] refactor: `get_matching_vouchers_for_bank_reconciliation` -> `get_matching_queries` (#11) * refactor: `get_matching_vouchers_for_bank_reconciliation` -> `get_matching_queries` - Maintaining single way to plug in queries. Ref: https://github.com/frappe/erpnext/pull/36893 - Keep uniform paramters for `get_matching_queries` in all apps * refactor: use append instead of extend to add queries Co-authored-by: Marica * refactor: use append instead of extend to add queries Co-authored-by: Marica --------- Co-authored-by: Anand Baburajan --- lending/hooks.py | 5 +-- lending/loan_management/utils.py | 62 ++++++++++++++++---------------- 2 files changed, 32 insertions(+), 35 deletions(-) diff --git a/lending/hooks.py b/lending/hooks.py index 6ad9fce6..0765da3c 100644 --- a/lending/hooks.py +++ b/lending/hooks.py @@ -148,10 +148,7 @@ # Overriding Methods # ------------------------------ - -get_matching_vouchers_for_bank_reconciliation = ( - "lending.loan_management.utils.get_matching_vouchers_for_bank_reconciliation" -) +get_matching_queries = "lending.loan_management.utils.get_matching_queries" get_amounts_not_reflected_in_system_for_bank_reconciliation_statement = "lending.loan_management.utils.get_amounts_not_reflected_in_system_for_bank_reconciliation_statement" diff --git a/lending/loan_management/utils.py b/lending/loan_management/utils.py index 9f8b956c..2ed80e53 100644 --- a/lending/loan_management/utils.py +++ b/lending/loan_management/utils.py @@ -77,45 +77,47 @@ def get_payment_entries_for_bank_clearance( return entries -def get_matching_vouchers_for_bank_reconciliation( +def get_matching_queries( bank_account, company, transaction, document_types, + exact_match, + account_from_to, from_date, to_date, filter_by_reference_date, from_reference_date, to_reference_date, - exact_match, - filters, ): - vouchers = [] + queries = [] if transaction.withdrawal > 0.0 and "loan_disbursement" in document_types: - vouchers.extend(get_ld_matching_query(bank_account, exact_match, filters)) + queries.append(get_ld_matching_query(bank_account, exact_match, transaction)) if transaction.deposit > 0.0 and "loan_repayment" in document_types: - vouchers.extend(get_lr_matching_query(bank_account, exact_match, filters)) + queries.append(get_lr_matching_query(bank_account, exact_match, transaction)) - return vouchers + return queries -def get_ld_matching_query(bank_account, exact_match, filters): +def get_ld_matching_query(bank_account, exact_match, transaction): loan_disbursement = frappe.qb.DocType("Loan Disbursement") - matching_reference = loan_disbursement.reference_number == filters.get("reference_number") - matching_party = loan_disbursement.applicant_type == filters.get( - "party_type" - ) and loan_disbursement.applicant == filters.get("party") - rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0) + matching_reference = loan_disbursement.reference_number == transaction.get("reference_number") + ref_rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0) - rank1 = frappe.qb.terms.Case().when(matching_party, 1).else_(0) + matching_party = ( + (loan_disbursement.applicant_type == transaction.party_type) + & (loan_disbursement.applicant == transaction.party) + & loan_disbursement.applicant.isnotnull() + ) + party_rank = frappe.qb.terms.Case().when(matching_party, 1).else_(0) query = ( frappe.qb.from_(loan_disbursement) .select( - rank + rank1 + 1, + ref_rank + party_rank + 1, ConstantColumn("Loan Disbursement").as_("doctype"), loan_disbursement.name, loan_disbursement.disbursed_amount, @@ -130,30 +132,30 @@ def get_ld_matching_query(bank_account, exact_match, filters): ) if exact_match: - query.where(loan_disbursement.disbursed_amount == filters.get("amount")) + query.where(loan_disbursement.disbursed_amount == transaction.unallocated_amount) else: query.where(loan_disbursement.disbursed_amount > 0.0) - vouchers = query.run(as_list=True) + return query - return vouchers - -def get_lr_matching_query(bank_account, exact_match, filters): +def get_lr_matching_query(bank_account, exact_match, transaction): loan_repayment = frappe.qb.DocType("Loan Repayment") - matching_reference = loan_repayment.reference_number == filters.get("reference_number") - matching_party = loan_repayment.applicant_type == filters.get( - "party_type" - ) and loan_repayment.applicant == filters.get("party") - rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0) + matching_reference = loan_repayment.reference_number == transaction.get("reference_number") + ref_rank = frappe.qb.terms.Case().when(matching_reference, 1).else_(0) - rank1 = frappe.qb.terms.Case().when(matching_party, 1).else_(0) + matching_party = ( + (loan_repayment.applicant_type == transaction.party_type) + & (loan_repayment.applicant == transaction.party) + & loan_repayment.applicant.isnotnull() + ) + party_rank = frappe.qb.terms.Case().when(matching_party, 1).else_(0) query = ( frappe.qb.from_(loan_repayment) .select( - rank + rank1 + 1, + ref_rank + party_rank + 1, ConstantColumn("Loan Repayment").as_("doctype"), loan_repayment.name, loan_repayment.amount_paid, @@ -171,13 +173,11 @@ def get_lr_matching_query(bank_account, exact_match, filters): query = query.where((loan_repayment.repay_from_salary == 0)) if exact_match: - query.where(loan_repayment.amount_paid == filters.get("amount")) + query.where(loan_repayment.amount_paid == transaction.unallocated_amount) else: query.where(loan_repayment.amount_paid > 0.0) - vouchers = query.run() - - return vouchers + return query def get_entries_for_bank_clearance_summary(filters): From b687a897e1467350285afb01085dbacd49cd555c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bernd=20Oliver=20S=C3=BCnderhauf?= <46800703+bosue@users.noreply.github.com> Date: Tue, 19 Sep 2023 19:42:02 +0200 Subject: [PATCH 17/23] fix: Repayment amount validation (#33) --- .../doctype/loan_application/loan_application.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lending/loan_management/doctype/loan_application/loan_application.py b/lending/loan_management/doctype/loan_application/loan_application.py index ca678d3b..f09be506 100644 --- a/lending/loan_management/doctype/loan_application/loan_application.py +++ b/lending/loan_management/doctype/loan_application/loan_application.py @@ -42,9 +42,9 @@ def validate_repayment_method(self): frappe.throw(_("Please enter Repayment Periods")) if self.repayment_method == "Repay Fixed Amount per Period": - if not self.monthly_repayment_amount: + if not self.repayment_amount: frappe.throw(_("Please enter repayment Amount")) - if self.monthly_repayment_amount > self.loan_amount: + if self.repayment_amount > self.loan_amount: frappe.throw(_("Monthly Repayment Amount cannot be greater than Loan Amount")) def validate_loan_type(self): From 40471bcdaa393f99501cefe8e7643b15a6592ed5 Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Thu, 21 Sep 2023 00:38:43 +0530 Subject: [PATCH 18/23] chore: format inconsistent doctype jsons (#39) * chore: format inconsistent doctype jsons * chore: add .git-blame-ignore-revs --- .git-blame-ignore-revs | 12 + .../loan_management/doctype/loan/loan.json | 1024 +++++++-------- .../loan_balance_adjustment.json | 407 +++--- .../loan_charge_reference.json | 88 +- .../doctype/loan_charges/loan_charges.json | 120 +- .../loan_disbursement/loan_disbursement.json | 522 ++++---- .../loan_interest_accrual.json | 526 ++++---- .../loan_repayment/loan_repayment.json | 843 +++++++------ .../loan_restructure/loan_restructure.json | 1105 +++++++++-------- .../loan_security_deposit.json | 178 +-- .../doctype/loan_type/loan_type.json | 663 +++++----- .../{__inti__.py => __init__.py} | 0 .../process_loan_restructure_limit.json | 128 +- .../repayment_schedule.json | 176 +-- 14 files changed, 2898 insertions(+), 2894 deletions(-) create mode 100644 .git-blame-ignore-revs rename lending/loan_management/doctype/process_loan_restructure_limit/{__inti__.py => __init__.py} (100%) diff --git a/.git-blame-ignore-revs b/.git-blame-ignore-revs new file mode 100644 index 00000000..3aeedb85 --- /dev/null +++ b/.git-blame-ignore-revs @@ -0,0 +1,12 @@ +# Since version 2.23 (released in August 2019), git-blame has a feature +# to ignore or bypass certain commits. +# +# This file contains a list of commits that are not likely what you +# are looking for in a blame, such as mass reformatting or renaming. +# You can set this file as a default ignore file for blame by running +# the following command. +# +# $ git config blame.ignoreRevsFile .git-blame-ignore-revs + +# This commit just formats inconsistent doctype jsons +7755c1d141ac081f5f6c2ba215e25a44e06e2460 diff --git a/lending/loan_management/doctype/loan/loan.json b/lending/loan_management/doctype/loan/loan.json index 63bc6302..4a298ad8 100644 --- a/lending/loan_management/doctype/loan/loan.json +++ b/lending/loan_management/doctype/loan/loan.json @@ -1,514 +1,514 @@ { -"actions": [], -"allow_import": 1, -"autoname": "ACC-LOAN-.YYYY.-.#####", -"creation": "2022-01-25 10:30:02.294967", -"doctype": "DocType", -"document_type": "Document", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "applicant_type", - "applicant", - "applicant_name", - "loan_application", - "branch", - "column_break_3", - "company", - "posting_date", - "status", - "section_break_8", - "loan_type", - "repayment_schedule_type", - "loan_amount", - "rate_of_interest", - "is_secured_loan", - "disbursement_date", - "closure_date", - "disbursed_amount", - "column_break_11", - "maximum_loan_amount", - "repayment_method", - "repayment_periods", - "monthly_repayment_amount", - "repayment_start_date", - "is_term_loan", - "loan_asset_classification_details_section", - "days_past_due", - "asset_classification_code", - "asset_classification_name", - "column_break_zpe2", - "loan_restructure_count", - "watch_period_end_date", - "tenure_post_restructure", - "accounting_dimensions_section", - "cost_center", - "account_info", - "mode_of_payment", - "disbursement_account", - "payment_account", - "column_break_9", - "loan_account", - "interest_income_account", - "penalty_income_account", - "section_break_17", - "total_payment", - "total_principal_paid", - "written_off_amount", - "refund_amount", - "debit_adjustment_amount", - "credit_adjustment_amount", - "column_break_19", - "total_interest_payable", - "total_amount_paid", - "is_npa", - "manual_npa", - "amended_from" -], -"fields": [ - { - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "reqd": 1 - }, - { - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_standard_filter": 1, - "label": "Applicant", - "options": "applicant_type", - "reqd": 1 - }, - { - "fieldname": "applicant_name", - "fieldtype": "Data", - "in_global_search": 1, - "label": "Applicant Name", - "read_only": 1 - }, - { - "fieldname": "loan_application", - "fieldtype": "Link", - "label": "Loan Application", - "no_copy": 1, - "options": "Loan Application" - }, - { - "fieldname": "loan_type", - "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Loan Type", - "options": "Loan Type", - "reqd": 1 - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "no_copy": 1, - "reqd": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "in_standard_filter": 1, - "label": "Company", - "options": "Company", - "remember_last_selected_value": 1, - "reqd": 1 - }, - { - "default": "Sanctioned", - "fieldname": "status", - "fieldtype": "Select", - "in_standard_filter": 1, - "label": "Status", - "no_copy": 1, - "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", - "read_only": 1 - }, - { - "fieldname": "section_break_8", - "fieldtype": "Section Break", - "label": "Loan Details" - }, - { - "fieldname": "loan_amount", - "fieldtype": "Currency", - "label": "Loan Amount", - "non_negative": 1, - "options": "Company:company:default_currency" - }, - { - "fetch_from": "loan_type.rate_of_interest", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate of Interest (%) / Year", - "read_only": 1, - "reqd": 1 - }, - { - "depends_on": "eval:doc.status==\"Disbursed\"", - "fieldname": "disbursement_date", - "fieldtype": "Date", - "label": "Disbursement Date", - "no_copy": 1 - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_start_date", - "fieldtype": "Date", - "label": "Repayment Start Date", - "mandatory_depends_on": "is_term_loan" - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_method", - "fieldtype": "Select", - "label": "Repayment Method", - "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_periods", - "fieldtype": "Int", - "label": "Repayment Period in Months" - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_application.repayment_amount", - "fetch_if_empty": 1, - "fieldname": "monthly_repayment_amount", - "fieldtype": "Currency", - "label": "Monthly Repayment Amount", - "options": "Company:company:default_currency" - }, - { - "collapsible": 1, - "fieldname": "account_info", - "fieldtype": "Section Break", - "label": "Account Info" - }, - { - "fetch_from": "loan_type.mode_of_payment", - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.payment_account", - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Payment Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "column_break_9", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan_type.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.interest_income_account", - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "section_break_17", - "fieldtype": "Section Break", - "label": "Totals" - }, - { - "default": "0", - "fieldname": "total_payment", - "fieldtype": "Currency", - "label": "Total Payable Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_19", - "fieldtype": "Column Break" - }, - { - "default": "0", - "depends_on": "is_term_loan", - "fieldname": "total_interest_payable", - "fieldtype": "Currency", - "label": "Total Interest Payable", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "total_amount_paid", - "fieldtype": "Currency", - "label": "Total Amount Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_secured_loan", - "fieldtype": "Check", - "label": "Is Secured Loan" - }, - { - "default": "0", - "fetch_from": "loan_type.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan", - "read_only": 1 - }, - { - "fetch_from": "loan_type.penalty_income_account", - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "label": "Penalty Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "total_principal_paid", - "fieldtype": "Currency", - "label": "Total Principal Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "disbursed_amount", - "fieldtype": "Currency", - "label": "Disbursed Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "depends_on": "eval:doc.is_secured_loan", - "fieldname": "maximum_loan_amount", - "fieldtype": "Currency", - "label": "Maximum Loan Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "written_off_amount", - "fieldtype": "Currency", - "label": "Written Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "closure_date", - "fieldtype": "Date", - "label": "Closure Date", - "read_only": 1 - }, - { - "fetch_from": "loan_type.disbursement_account", - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "refund_amount", - "fieldtype": "Currency", - "label": "Refund amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "credit_adjustment_amount", - "fieldtype": "Currency", - "label": "Credit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "debit_adjustment_amount", - "fieldtype": "Currency", - "label": "Debit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Loan is a Non Performing Asset", - "fieldname": "is_npa", - "fieldtype": "Check", - "label": "Is NPA", - "read_only": 1 - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_type.repayment_schedule_type", - "fieldname": "repayment_schedule_type", - "fieldtype": "Data", - "label": "Repayment Schedule Type", - "read_only": 1 - }, - { - "fieldname": "days_past_due", - "fieldtype": "Int", - "label": "Days Past Due", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Manually marked as NPA", - "fieldname": "manual_npa", - "fieldtype": "Check", - "label": "Manual NPA" - }, - { - "fieldname": "asset_classification_code", - "fieldtype": "Select", - "label": "Asset Classification Code", - "no_copy": 1, - "options": "\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3", - "read_only": 1 - }, - { - "fieldname": "asset_classification_name", - "fieldtype": "Select", - "label": "Asset Classification Name", - "no_copy": 1, - "options": "\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset", - "read_only": 1 - }, - { - "fieldname": "branch", - "fieldtype": "Link", - "label": "Branch", - "options": "Branch" - }, - { - "fieldname": "loan_restructure_count", - "fieldtype": "Int", - "label": "Loan Restructure Count", - "read_only": 1 - }, - { - "fieldname": "loan_asset_classification_details_section", - "fieldtype": "Section Break", - "label": "Loan Asset Classification Details" - }, - { - "fieldname": "column_break_zpe2", - "fieldtype": "Column Break" - }, - { - "fieldname": "watch_period_end_date", - "fieldtype": "Date", - "label": "Watch Period End Date", - "read_only": 1 - }, - { - "fieldname": "tenure_post_restructure", - "fieldtype": "Int", - "label": "Tenure Post Restructure", - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-29 18:12:28.333911", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "read": 1, - "role": "Employee" - } -], -"search_fields": "posting_date", -"sort_field": "creation", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "allow_import": 1, + "autoname": "ACC-LOAN-.YYYY.-.#####", + "creation": "2022-01-25 10:30:02.294967", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "applicant_type", + "applicant", + "applicant_name", + "loan_application", + "branch", + "column_break_3", + "company", + "posting_date", + "status", + "section_break_8", + "loan_type", + "repayment_schedule_type", + "loan_amount", + "rate_of_interest", + "is_secured_loan", + "disbursement_date", + "closure_date", + "disbursed_amount", + "column_break_11", + "maximum_loan_amount", + "repayment_method", + "repayment_periods", + "monthly_repayment_amount", + "repayment_start_date", + "is_term_loan", + "loan_asset_classification_details_section", + "days_past_due", + "asset_classification_code", + "asset_classification_name", + "column_break_zpe2", + "loan_restructure_count", + "watch_period_end_date", + "tenure_post_restructure", + "accounting_dimensions_section", + "cost_center", + "account_info", + "mode_of_payment", + "disbursement_account", + "payment_account", + "column_break_9", + "loan_account", + "interest_income_account", + "penalty_income_account", + "section_break_17", + "total_payment", + "total_principal_paid", + "written_off_amount", + "refund_amount", + "debit_adjustment_amount", + "credit_adjustment_amount", + "column_break_19", + "total_interest_payable", + "total_amount_paid", + "is_npa", + "manual_npa", + "amended_from" + ], + "fields": [ + { + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "reqd": 1 + }, + { + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_standard_filter": 1, + "label": "Applicant", + "options": "applicant_type", + "reqd": 1 + }, + { + "fieldname": "applicant_name", + "fieldtype": "Data", + "in_global_search": 1, + "label": "Applicant Name", + "read_only": 1 + }, + { + "fieldname": "loan_application", + "fieldtype": "Link", + "label": "Loan Application", + "no_copy": 1, + "options": "Loan Application" + }, + { + "fieldname": "loan_type", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Loan Type", + "options": "Loan Type", + "reqd": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "no_copy": 1, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Company", + "options": "Company", + "remember_last_selected_value": 1, + "reqd": 1 + }, + { + "default": "Sanctioned", + "fieldname": "status", + "fieldtype": "Select", + "in_standard_filter": 1, + "label": "Status", + "no_copy": 1, + "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", + "read_only": 1 + }, + { + "fieldname": "section_break_8", + "fieldtype": "Section Break", + "label": "Loan Details" + }, + { + "fieldname": "loan_amount", + "fieldtype": "Currency", + "label": "Loan Amount", + "non_negative": 1, + "options": "Company:company:default_currency" + }, + { + "fetch_from": "loan_type.rate_of_interest", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate of Interest (%) / Year", + "read_only": 1, + "reqd": 1 + }, + { + "depends_on": "eval:doc.status==\"Disbursed\"", + "fieldname": "disbursement_date", + "fieldtype": "Date", + "label": "Disbursement Date", + "no_copy": 1 + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_start_date", + "fieldtype": "Date", + "label": "Repayment Start Date", + "mandatory_depends_on": "is_term_loan" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_method", + "fieldtype": "Select", + "label": "Repayment Method", + "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_periods", + "fieldtype": "Int", + "label": "Repayment Period in Months" + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_application.repayment_amount", + "fetch_if_empty": 1, + "fieldname": "monthly_repayment_amount", + "fieldtype": "Currency", + "label": "Monthly Repayment Amount", + "options": "Company:company:default_currency" + }, + { + "collapsible": 1, + "fieldname": "account_info", + "fieldtype": "Section Break", + "label": "Account Info" + }, + { + "fetch_from": "loan_type.mode_of_payment", + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.payment_account", + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Payment Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan_type.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.interest_income_account", + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "section_break_17", + "fieldtype": "Section Break", + "label": "Totals" + }, + { + "default": "0", + "fieldname": "total_payment", + "fieldtype": "Currency", + "label": "Total Payable Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_19", + "fieldtype": "Column Break" + }, + { + "default": "0", + "depends_on": "is_term_loan", + "fieldname": "total_interest_payable", + "fieldtype": "Currency", + "label": "Total Interest Payable", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "total_amount_paid", + "fieldtype": "Currency", + "label": "Total Amount Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_secured_loan", + "fieldtype": "Check", + "label": "Is Secured Loan" + }, + { + "default": "0", + "fetch_from": "loan_type.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan", + "read_only": 1 + }, + { + "fetch_from": "loan_type.penalty_income_account", + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "label": "Penalty Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "total_principal_paid", + "fieldtype": "Currency", + "label": "Total Principal Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "disbursed_amount", + "fieldtype": "Currency", + "label": "Disbursed Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "depends_on": "eval:doc.is_secured_loan", + "fieldname": "maximum_loan_amount", + "fieldtype": "Currency", + "label": "Maximum Loan Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "written_off_amount", + "fieldtype": "Currency", + "label": "Written Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "closure_date", + "fieldtype": "Date", + "label": "Closure Date", + "read_only": 1 + }, + { + "fetch_from": "loan_type.disbursement_account", + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "refund_amount", + "fieldtype": "Currency", + "label": "Refund amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "credit_adjustment_amount", + "fieldtype": "Currency", + "label": "Credit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "debit_adjustment_amount", + "fieldtype": "Currency", + "label": "Debit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Loan is a Non Performing Asset", + "fieldname": "is_npa", + "fieldtype": "Check", + "label": "Is NPA", + "read_only": 1 + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_type.repayment_schedule_type", + "fieldname": "repayment_schedule_type", + "fieldtype": "Data", + "label": "Repayment Schedule Type", + "read_only": 1 + }, + { + "fieldname": "days_past_due", + "fieldtype": "Int", + "label": "Days Past Due", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Manually marked as NPA", + "fieldname": "manual_npa", + "fieldtype": "Check", + "label": "Manual NPA" + }, + { + "fieldname": "asset_classification_code", + "fieldtype": "Select", + "label": "Asset Classification Code", + "no_copy": 1, + "options": "\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3", + "read_only": 1 + }, + { + "fieldname": "asset_classification_name", + "fieldtype": "Select", + "label": "Asset Classification Name", + "no_copy": 1, + "options": "\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset", + "read_only": 1 + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "options": "Branch" + }, + { + "fieldname": "loan_restructure_count", + "fieldtype": "Int", + "label": "Loan Restructure Count", + "read_only": 1 + }, + { + "fieldname": "loan_asset_classification_details_section", + "fieldtype": "Section Break", + "label": "Loan Asset Classification Details" + }, + { + "fieldname": "column_break_zpe2", + "fieldtype": "Column Break" + }, + { + "fieldname": "watch_period_end_date", + "fieldtype": "Date", + "label": "Watch Period End Date", + "read_only": 1 + }, + { + "fieldname": "tenure_post_restructure", + "fieldtype": "Int", + "label": "Tenure Post Restructure", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-29 18:12:28.333911", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "read": 1, + "role": "Employee" + } + ], + "search_fields": "posting_date", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_balance_adjustment/loan_balance_adjustment.json b/lending/loan_management/doctype/loan_balance_adjustment/loan_balance_adjustment.json index a0e1785e..30e1886b 100644 --- a/lending/loan_management/doctype/loan_balance_adjustment/loan_balance_adjustment.json +++ b/lending/loan_management/doctype/loan_balance_adjustment/loan_balance_adjustment.json @@ -1,210 +1,201 @@ { -"actions": [], -"autoname": "LM-ADJ-.#####", -"creation": "2022-06-28 14:48:47.736269", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan", - "applicant_type", - "applicant", - "column_break_3", - "company", - "posting_date", - "accounting_dimensions_section", - "cost_center", - "section_break_9", - "adjustment_account", - "adjustment_receivable_account", - "reference_document_type", - "reference_name", - "column_break_11", - "adjustment_type", - "amount", - "reference_number", - "remarks", - "amended_from" -], -"fields": [ - { - "fieldname": "loan", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Loan", - "options": "Loan", - "reqd": 1 - }, - { - "fetch_from": "loan.applicant_type", - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "read_only": 1 - }, - { - "fetch_from": "loan.applicant", - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "label": "Applicant ", - "options": "applicant_type", - "read_only": 1 - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan.company", - "fieldname": "company", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Company", - "options": "Company", - "read_only": 1, - "reqd": 1 - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "reqd": 1 - }, - { - "collapsible": 1, - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "section_break_9", - "fieldtype": "Section Break", - "label": "Adjustment Details" - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, - { - "fieldname": "reference_number", - "fieldtype": "Data", - "label": "Reference Number" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Balance Adjustment", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Balance Adjustment", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "adjustment_account", - "fieldtype": "Link", - "label": "Adjustment Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "amount", - "fieldtype": "Currency", - "label": "Amount", - "options": "Company:company:default_currency", - "reqd": 1 - }, - { - "fieldname": "adjustment_type", - "fieldtype": "Select", - "label": "Adjustment Type", - "options": "Credit Adjustment\nDebit Adjustment", - "reqd": 1 - }, - { - "fieldname": "remarks", - "fieldtype": "Data", - "label": "Remarks" - }, - { - "fieldname": "reference_document_type", - "fieldtype": "Select", - "label": "Reference Document Type", - "options": "Loan Repayment\nLoan Restructure" - }, - { - "fieldname": "reference_name", - "fieldtype": "Dynamic Link", - "label": "Reference Name", - "options": "reference_document_type" - }, - { - "fieldname": "adjustment_receivable_account", - "fieldtype": "Link", - "label": "Adjustment Receivable Account", - "options": "Account" - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-18 14:39:17.560757", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Balance Adjustment", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "autoname": "LM-ADJ-.#####", + "creation": "2022-06-28 14:48:47.736269", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan", + "applicant_type", + "applicant", + "column_break_3", + "company", + "posting_date", + "accounting_dimensions_section", + "cost_center", + "section_break_9", + "adjustment_account", + "adjustment_receivable_account", + "reference_document_type", + "reference_name", + "column_break_11", + "adjustment_type", + "amount", + "reference_number", + "remarks", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Loan", + "options": "Loan", + "reqd": 1 + }, + { + "fetch_from": "loan.applicant_type", + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "read_only": 1 + }, + { + "fetch_from": "loan.applicant", + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "label": "Applicant ", + "options": "applicant_type", + "read_only": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan.company", + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company", + "read_only": 1, + "reqd": 1 + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "reqd": 1 + }, + { + "collapsible": 1, + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "section_break_9", + "fieldtype": "Section Break", + "label": "Adjustment Details" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" + }, + { + "fieldname": "reference_number", + "fieldtype": "Data", + "label": "Reference Number" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Balance Adjustment", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "adjustment_account", + "fieldtype": "Link", + "label": "Adjustment Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "label": "Amount", + "options": "Company:company:default_currency", + "reqd": 1 + }, + { + "fieldname": "adjustment_type", + "fieldtype": "Select", + "label": "Adjustment Type", + "options": "Credit Adjustment\nDebit Adjustment", + "reqd": 1 + }, + { + "fieldname": "remarks", + "fieldtype": "Data", + "label": "Remarks" + }, + { + "fieldname": "reference_document_type", + "fieldtype": "Select", + "label": "Reference Document Type", + "options": "Loan Repayment\nLoan Restructure" + }, + { + "fieldname": "reference_name", + "fieldtype": "Dynamic Link", + "label": "Reference Name", + "options": "reference_document_type" + }, + { + "fieldname": "adjustment_receivable_account", + "fieldtype": "Link", + "label": "Adjustment Receivable Account", + "options": "Account" + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-09-19 23:19:09.442382", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Balance Adjustment", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_charge_reference/loan_charge_reference.json b/lending/loan_management/doctype/loan_charge_reference/loan_charge_reference.json index 32f5fba1..86d27d79 100644 --- a/lending/loan_management/doctype/loan_charge_reference/loan_charge_reference.json +++ b/lending/loan_management/doctype/loan_charge_reference/loan_charge_reference.json @@ -1,46 +1,46 @@ { -"actions": [], -"allow_rename": 1, -"creation": "2023-05-16 07:46:48.289502", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "sales_invoice", - "pending_charge_amount", - "allocated_amount" -], -"fields": [ - { - "fieldname": "sales_invoice", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Sales Invoice", - "options": "Sales Invoice" - }, - { - "fieldname": "pending_charge_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Pending Charge Amount" - }, - { - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Allocated Amount" - } -], -"index_web_pages_for_search": 1, -"istable": 1, -"links": [], -"modified": "2023-05-16 09:14:13.972294", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Charge Reference", -"owner": "Administrator", -"permissions": [], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "allow_rename": 1, + "creation": "2023-05-16 07:46:48.289502", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "sales_invoice", + "pending_charge_amount", + "allocated_amount" + ], + "fields": [ + { + "fieldname": "sales_invoice", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Sales Invoice", + "options": "Sales Invoice" + }, + { + "fieldname": "pending_charge_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Pending Charge Amount" + }, + { + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Allocated Amount" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-05-16 09:14:13.972294", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Charge Reference", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_charges/loan_charges.json b/lending/loan_management/doctype/loan_charges/loan_charges.json index 1f7ce5ba..31a586cc 100644 --- a/lending/loan_management/doctype/loan_charges/loan_charges.json +++ b/lending/loan_management/doctype/loan_charges/loan_charges.json @@ -1,62 +1,62 @@ { -"actions": [], -"allow_rename": 1, -"creation": "2023-05-08 15:03:25.836509", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "charge_type", - "event", - "charge_based_on", - "amount", - "percentage" -], -"fields": [ - { - "fieldname": "charge_type", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Charge Type", - "options": "Item" - }, - { - "fieldname": "event", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Event", - "options": "Disbursement\nRepayment\nRestructure" - }, - { - "fieldname": "charge_based_on", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Charge Based On", - "options": "Percentage\nFixed Amount" - }, - { - "fieldname": "amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Amount" - }, - { - "fieldname": "percentage", - "fieldtype": "Percent", - "in_list_view": 1, - "label": "Percentage" - } -], -"index_web_pages_for_search": 1, -"istable": 1, -"links": [], -"modified": "2023-05-09 10:27:46.934165", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Charges", -"owner": "Administrator", -"permissions": [], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "allow_rename": 1, + "creation": "2023-05-08 15:03:25.836509", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "charge_type", + "event", + "charge_based_on", + "amount", + "percentage" + ], + "fields": [ + { + "fieldname": "charge_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Charge Type", + "options": "Item" + }, + { + "fieldname": "event", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Event", + "options": "Disbursement\nRepayment\nRestructure" + }, + { + "fieldname": "charge_based_on", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Charge Based On", + "options": "Percentage\nFixed Amount" + }, + { + "fieldname": "amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Amount" + }, + { + "fieldname": "percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Percentage" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-05-09 10:27:46.934165", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Charges", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_disbursement/loan_disbursement.json b/lending/loan_management/doctype/loan_disbursement/loan_disbursement.json index df4c66c1..ffdb6e1e 100644 --- a/lending/loan_management/doctype/loan_disbursement/loan_disbursement.json +++ b/lending/loan_management/doctype/loan_disbursement/loan_disbursement.json @@ -1,263 +1,263 @@ { -"actions": [], -"autoname": "LM-DIS-.#####", -"creation": "2019-09-07 12:44:49.125452", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "against_loan", - "posting_date", - "applicant_type", - "loan_type", - "monthly_repayment_amount", - "column_break_4", - "company", - "applicant", - "is_term_loan", - "withhold_security_deposit", - "section_break_7", - "disbursement_date", - "clearance_date", - "column_break_8", - "disbursed_amount", - "accounting_dimensions_section", - "cost_center", - "accounting_details", - "disbursement_account", - "column_break_16", - "loan_account", - "bank_account", - "disbursement_references_section", - "reference_date", - "column_break_17", - "reference_number", - "amended_from" -], -"fields": [ - { - "fieldname": "against_loan", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Against Loan ", - "options": "Loan", - "reqd": 1 - }, - { - "fieldname": "disbursement_date", - "fieldtype": "Date", - "label": "Disbursement Date", - "reqd": 1 - }, - { - "fieldname": "disbursed_amount", - "fieldtype": "Currency", - "label": "Disbursed Amount", - "non_negative": 1, - "options": "Company:company:default_currency", - "reqd": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Disbursement", - "print_hide": 1, - "read_only": 1 - }, - { - "fetch_from": "against_loan.company", - "fieldname": "company", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Company", - "options": "Company", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "against_loan.applicant", - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_list_view": 1, - "label": "Applicant", - "options": "applicant_type", - "read_only": 1, - "reqd": 1 - }, - { - "collapsible": 1, - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "posting_date", - "fieldtype": "Date", - "hidden": 1, - "label": "Posting Date", - "read_only": 1 - }, - { - "fieldname": "column_break_4", - "fieldtype": "Column Break" - }, - { - "fieldname": "section_break_7", - "fieldtype": "Section Break", - "label": "Disbursement Details" - }, - { - "fetch_from": "against_loan.applicant_type", - "fieldname": "applicant_type", - "fieldtype": "Select", - "in_list_view": 1, - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "bank_account", - "fieldtype": "Link", - "label": "Bank Account", - "options": "Bank Account" - }, - { - "fieldname": "column_break_8", - "fieldtype": "Column Break" - }, - { - "fieldname": "disbursement_references_section", - "fieldtype": "Section Break", - "label": "Disbursement References" - }, - { - "fieldname": "reference_date", - "fieldtype": "Date", - "label": "Reference Date" - }, - { - "fieldname": "column_break_17", - "fieldtype": "Column Break" - }, - { - "fieldname": "reference_number", - "fieldtype": "Data", - "label": "Reference Number" - }, - { - "fieldname": "clearance_date", - "fieldtype": "Date", - "label": "Clearance Date", - "no_copy": 1, - "read_only": 1 - }, - { - "fieldname": "accounting_details", - "fieldtype": "Section Break", - "label": "Accounting Details" - }, - { - "fetch_from": "against_loan.disbursement_account", - "fetch_if_empty": 1, - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account" - }, - { - "fieldname": "column_break_16", - "fieldtype": "Column Break" - }, - { - "fetch_from": "against_loan.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "read_only": 1 - }, - { - "default": "0", - "fetch_from": "against_loan.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan" - }, - { - "default": "0", - "fieldname": "withhold_security_deposit", - "fieldtype": "Check", - "label": "Withhold Security Deposit" - }, - { - "fetch_from": "against_loan.monthly_repayment_amount", - "fieldname": "monthly_repayment_amount", - "fieldtype": "Currency", - "label": "Monthly Repayment Amount", - "read_only": 1 - }, - { - "fetch_from": "against_loan.loan_type", - "fieldname": "loan_type", - "fieldtype": "Link", - "hidden": 1, - "label": "Loan Type", - "options": "Loan Type", - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-16 20:42:49.024069", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Disbursement", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "autoname": "LM-DIS-.#####", + "creation": "2019-09-07 12:44:49.125452", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "against_loan", + "posting_date", + "applicant_type", + "loan_type", + "monthly_repayment_amount", + "column_break_4", + "company", + "applicant", + "is_term_loan", + "withhold_security_deposit", + "section_break_7", + "disbursement_date", + "clearance_date", + "column_break_8", + "disbursed_amount", + "accounting_dimensions_section", + "cost_center", + "accounting_details", + "disbursement_account", + "column_break_16", + "loan_account", + "bank_account", + "disbursement_references_section", + "reference_date", + "column_break_17", + "reference_number", + "amended_from" + ], + "fields": [ + { + "fieldname": "against_loan", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Against Loan ", + "options": "Loan", + "reqd": 1 + }, + { + "fieldname": "disbursement_date", + "fieldtype": "Date", + "label": "Disbursement Date", + "reqd": 1 + }, + { + "fieldname": "disbursed_amount", + "fieldtype": "Currency", + "label": "Disbursed Amount", + "non_negative": 1, + "options": "Company:company:default_currency", + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Disbursement", + "print_hide": 1, + "read_only": 1 + }, + { + "fetch_from": "against_loan.company", + "fieldname": "company", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Company", + "options": "Company", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "against_loan.applicant", + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_list_view": 1, + "label": "Applicant", + "options": "applicant_type", + "read_only": 1, + "reqd": 1 + }, + { + "collapsible": 1, + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "hidden": 1, + "label": "Posting Date", + "read_only": 1 + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_7", + "fieldtype": "Section Break", + "label": "Disbursement Details" + }, + { + "fetch_from": "against_loan.applicant_type", + "fieldname": "applicant_type", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "bank_account", + "fieldtype": "Link", + "label": "Bank Account", + "options": "Bank Account" + }, + { + "fieldname": "column_break_8", + "fieldtype": "Column Break" + }, + { + "fieldname": "disbursement_references_section", + "fieldtype": "Section Break", + "label": "Disbursement References" + }, + { + "fieldname": "reference_date", + "fieldtype": "Date", + "label": "Reference Date" + }, + { + "fieldname": "column_break_17", + "fieldtype": "Column Break" + }, + { + "fieldname": "reference_number", + "fieldtype": "Data", + "label": "Reference Number" + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "label": "Clearance Date", + "no_copy": 1, + "read_only": 1 + }, + { + "fieldname": "accounting_details", + "fieldtype": "Section Break", + "label": "Accounting Details" + }, + { + "fetch_from": "against_loan.disbursement_account", + "fetch_if_empty": 1, + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account" + }, + { + "fieldname": "column_break_16", + "fieldtype": "Column Break" + }, + { + "fetch_from": "against_loan.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "read_only": 1 + }, + { + "default": "0", + "fetch_from": "against_loan.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan" + }, + { + "default": "0", + "fieldname": "withhold_security_deposit", + "fieldtype": "Check", + "label": "Withhold Security Deposit" + }, + { + "fetch_from": "against_loan.monthly_repayment_amount", + "fieldname": "monthly_repayment_amount", + "fieldtype": "Currency", + "label": "Monthly Repayment Amount", + "read_only": 1 + }, + { + "fetch_from": "against_loan.loan_type", + "fieldname": "loan_type", + "fieldtype": "Link", + "hidden": 1, + "label": "Loan Type", + "options": "Loan Type", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-16 20:42:49.024069", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Disbursement", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.json b/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.json index 58a13a7f..b7750bfa 100644 --- a/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.json +++ b/lending/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.json @@ -1,265 +1,265 @@ { -"actions": [], -"autoname": "LM-LIA-.#####", -"creation": "2019-09-09 22:34:36.346812", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan", - "loan_type", - "applicant_type", - "applicant", - "interest_income_account", - "loan_account", - "column_break_4", - "company", - "posting_date", - "due_date", - "accrual_type", - "is_term_loan", - "is_npa", - "section_break_7", - "pending_principal_amount", - "payable_principal_amount", - "paid_principal_amount", - "column_break_14", - "interest_amount", - "total_pending_interest_amount", - "paid_interest_amount", - "penalty_amount", - "section_break_15", - "process_loan_interest_accrual", - "repayment_schedule_name", - "last_accrual_date", - "amended_from" -], -"fields": [ - { - "fieldname": "loan", - "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Loan", - "options": "Loan" - }, - { - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date" - }, - { - "fieldname": "pending_principal_amount", - "fieldtype": "Currency", - "label": "Pending Principal Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "interest_amount", - "fieldtype": "Currency", - "label": "Interest Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Interest Accrual", - "print_hide": 1, - "read_only": 1 - }, - { - "fetch_from": "loan.applicant_type", - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer" - }, - { - "fetch_from": "loan.applicant", - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Applicant", - "options": "applicant_type" - }, - { - "fieldname": "column_break_4", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan.interest_income_account", - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account" - }, - { - "fetch_from": "loan.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account" - }, - { - "fieldname": "section_break_7", - "fieldtype": "Section Break", - "label": "Amounts" - }, - { - "fetch_from": "loan.company", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company" - }, - { - "default": "0", - "fetch_from": "loan.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan", - "read_only": 1 - }, - { - "depends_on": "is_term_loan", - "fieldname": "payable_principal_amount", - "fieldtype": "Currency", - "label": "Payable Principal Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "section_break_15", - "fieldtype": "Section Break" - }, - { - "fieldname": "process_loan_interest_accrual", - "fieldtype": "Link", - "label": "Process Loan Interest Accrual", - "options": "Process Loan Interest Accrual" - }, - { - "fieldname": "column_break_14", - "fieldtype": "Column Break" - }, - { - "fieldname": "repayment_schedule_name", - "fieldtype": "Data", - "hidden": 1, - "label": "Repayment Schedule Name", - "read_only": 1 - }, - { - "depends_on": "eval:doc.is_term_loan", - "fieldname": "paid_principal_amount", - "fieldtype": "Currency", - "label": "Paid Principal Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "paid_interest_amount", - "fieldtype": "Currency", - "label": "Paid Interest Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "accrual_type", - "fieldtype": "Select", - "in_filter": 1, - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Accrual Type", - "options": "Regular\nRepayment\nDisbursement\nCredit Adjustment\nDebit Adjustment\nRefund" - }, - { - "fieldname": "penalty_amount", - "fieldtype": "Currency", - "label": "Penalty Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "last_accrual_date", - "fieldtype": "Date", - "hidden": 1, - "label": "Last Accrual Date", - "read_only": 1 - }, - { - "fieldname": "total_pending_interest_amount", - "fieldtype": "Currency", - "label": "Total Pending Interest Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "due_date", - "fieldtype": "Date", - "label": "Due Date" - }, - { - "fetch_from": "loan.loan_type", - "fieldname": "loan_type", - "fieldtype": "Link", - "hidden": 1, - "label": "Loan Type", - "options": "Loan Type", - "read_only": 1 - }, - { - "default": "0", - "fetch_from": "loan.manual_npa", - "fieldname": "is_npa", - "fieldtype": "Check", - "label": "Is NPA" - } -], -"in_create": 1, -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-10 11:43:51.963869", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Interest Accrual", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - } -], -"quick_entry": 1, -"sort_field": "modified", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "autoname": "LM-LIA-.#####", + "creation": "2019-09-09 22:34:36.346812", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan", + "loan_type", + "applicant_type", + "applicant", + "interest_income_account", + "loan_account", + "column_break_4", + "company", + "posting_date", + "due_date", + "accrual_type", + "is_term_loan", + "is_npa", + "section_break_7", + "pending_principal_amount", + "payable_principal_amount", + "paid_principal_amount", + "column_break_14", + "interest_amount", + "total_pending_interest_amount", + "paid_interest_amount", + "penalty_amount", + "section_break_15", + "process_loan_interest_accrual", + "repayment_schedule_name", + "last_accrual_date", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Loan", + "options": "Loan" + }, + { + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date" + }, + { + "fieldname": "pending_principal_amount", + "fieldtype": "Currency", + "label": "Pending Principal Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "interest_amount", + "fieldtype": "Currency", + "label": "Interest Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Interest Accrual", + "print_hide": 1, + "read_only": 1 + }, + { + "fetch_from": "loan.applicant_type", + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer" + }, + { + "fetch_from": "loan.applicant", + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Applicant", + "options": "applicant_type" + }, + { + "fieldname": "column_break_4", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan.interest_income_account", + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account" + }, + { + "fetch_from": "loan.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account" + }, + { + "fieldname": "section_break_7", + "fieldtype": "Section Break", + "label": "Amounts" + }, + { + "fetch_from": "loan.company", + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company" + }, + { + "default": "0", + "fetch_from": "loan.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan", + "read_only": 1 + }, + { + "depends_on": "is_term_loan", + "fieldname": "payable_principal_amount", + "fieldtype": "Currency", + "label": "Payable Principal Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "section_break_15", + "fieldtype": "Section Break" + }, + { + "fieldname": "process_loan_interest_accrual", + "fieldtype": "Link", + "label": "Process Loan Interest Accrual", + "options": "Process Loan Interest Accrual" + }, + { + "fieldname": "column_break_14", + "fieldtype": "Column Break" + }, + { + "fieldname": "repayment_schedule_name", + "fieldtype": "Data", + "hidden": 1, + "label": "Repayment Schedule Name", + "read_only": 1 + }, + { + "depends_on": "eval:doc.is_term_loan", + "fieldname": "paid_principal_amount", + "fieldtype": "Currency", + "label": "Paid Principal Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "paid_interest_amount", + "fieldtype": "Currency", + "label": "Paid Interest Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "accrual_type", + "fieldtype": "Select", + "in_filter": 1, + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Accrual Type", + "options": "Regular\nRepayment\nDisbursement\nCredit Adjustment\nDebit Adjustment\nRefund" + }, + { + "fieldname": "penalty_amount", + "fieldtype": "Currency", + "label": "Penalty Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "last_accrual_date", + "fieldtype": "Date", + "hidden": 1, + "label": "Last Accrual Date", + "read_only": 1 + }, + { + "fieldname": "total_pending_interest_amount", + "fieldtype": "Currency", + "label": "Total Pending Interest Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "label": "Due Date" + }, + { + "fetch_from": "loan.loan_type", + "fieldname": "loan_type", + "fieldtype": "Link", + "hidden": 1, + "label": "Loan Type", + "options": "Loan Type", + "read_only": 1 + }, + { + "default": "0", + "fetch_from": "loan.manual_npa", + "fieldname": "is_npa", + "fieldtype": "Check", + "label": "Is NPA" + } + ], + "in_create": 1, + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-10 11:43:51.963869", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Interest Accrual", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + } + ], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_repayment/loan_repayment.json b/lending/loan_management/doctype/loan_repayment/loan_repayment.json index fb98db4a..66500076 100644 --- a/lending/loan_management/doctype/loan_repayment/loan_repayment.json +++ b/lending/loan_management/doctype/loan_repayment/loan_repayment.json @@ -1,424 +1,423 @@ { -"actions": [], -"autoname": "LM-REP-.####", -"creation": "2022-01-25 10:30:02.767941", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "against_loan", - "applicant_type", - "applicant", - "loan_type", - "repayment_type", - "loan_restructure", - "column_break_3", - "company", - "posting_date", - "clearance_date", - "rate_of_interest", - "days_past_due", - "is_term_loan", - "offset_based_on_npa", - "is_npa", - "manual_npa", - "payment_details_section", - "due_date", - "pending_principal_amount", - "interest_payable", - "payable_amount", - "column_break_9", - "shortfall_amount", - "payable_principal_amount", - "penalty_amount", - "amount_paid", - "accounting_dimensions_section", - "cost_center", - "section_break_a5v1", - "pending_charges", - "column_break_g9f3", - "total_charges_payable", - "total_paid_charges", - "references_section", - "reference_number", - "column_break_21", - "reference_date", - "principal_amount_paid", - "total_penalty_paid", - "total_interest_paid", - "section_break_55wc", - "repayment_details", - "amended_from", - "accounting_details_section", - "payment_account", - "penalty_income_account", - "column_break_36", - "loan_account" -], -"fields": [ - { - "fieldname": "against_loan", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Against Loan", - "options": "Loan", - "reqd": 1 - }, - { - "fieldname": "posting_date", - "fieldtype": "Datetime", - "in_list_view": 1, - "label": "Posting Date", - "reqd": 1 - }, - { - "fieldname": "payment_details_section", - "fieldtype": "Section Break", - "label": "Payment Details" - }, - { - "fieldname": "penalty_amount", - "fieldtype": "Currency", - "label": "Penalty Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "interest_payable", - "fieldtype": "Currency", - "label": "Interest Payable", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "fetch_from": "against_loan.applicant", - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_list_view": 1, - "label": "Applicant", - "options": "applicant_type", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "against_loan.loan_type", - "fieldname": "loan_type", - "fieldtype": "Link", - "label": "Loan Type", - "options": "Loan Type", - "read_only": 1 - }, - { - "fieldname": "column_break_9", - "fieldtype": "Column Break" - }, - { - "fieldname": "payable_amount", - "fieldtype": "Currency", - "label": "Payable Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "bold": 1, - "fieldname": "amount_paid", - "fieldtype": "Currency", - "label": "Amount Paid", - "non_negative": 1, - "options": "Company:company:default_currency", - "reqd": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Repayment", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fetch_from": "against_loan.company", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "read_only": 1 - }, - { - "fieldname": "pending_principal_amount", - "fieldtype": "Currency", - "label": "Pending Principal Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "0", - "fetch_from": "against_loan.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan", - "read_only": 1 - }, - { - "depends_on": "eval:doc.payment_type==\"Loan Closure\" || doc.is_term_loan", - "fieldname": "payable_principal_amount", - "fieldtype": "Currency", - "label": "Payable Principal Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "references_section", - "fieldtype": "Section Break", - "label": "Payment References" - }, - { - "fieldname": "reference_number", - "fieldtype": "Data", - "label": "Reference Number" - }, - { - "fieldname": "reference_date", - "fieldtype": "Date", - "label": "Reference Date" - }, - { - "fieldname": "column_break_21", - "fieldtype": "Column Break" - }, - { - "default": "0.0", - "fieldname": "principal_amount_paid", - "fieldtype": "Currency", - "hidden": 1, - "label": "Principal Amount Paid", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fetch_from": "against_loan.applicant_type", - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "read_only": 1 - }, - { - "fieldname": "due_date", - "fieldtype": "Date", - "label": "Due Date", - "read_only": 1 - }, - { - "fieldname": "repayment_details", - "fieldtype": "Table", - "label": "Repayment Details", - "options": "Loan Repayment Detail", - "read_only": 1 - }, - { - "fieldname": "total_interest_paid", - "fieldtype": "Currency", - "hidden": 1, - "label": "Total Interest Paid", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fetch_from": "loan_type.rate_of_interest", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate Of Interest", - "read_only": 1 - }, - { - "fieldname": "shortfall_amount", - "fieldtype": "Currency", - "label": "Shortfall Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "total_penalty_paid", - "fieldtype": "Currency", - "hidden": 1, - "label": "Total Penalty Paid", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "clearance_date", - "fieldtype": "Date", - "label": "Clearance Date", - "no_copy": 1, - "read_only": 1 - }, - { - "fieldname": "accounting_details_section", - "fieldtype": "Section Break", - "label": "Accounting Details" - }, - { - "depends_on": "eval:!doc.repay_from_salary", - "fetch_from": "against_loan.payment_account", - "fetch_if_empty": 1, - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Repayment Account", - "options": "Account" - }, - { - "fieldname": "column_break_36", - "fieldtype": "Column Break" - }, - { - "fetch_from": "against_loan.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "read_only": 1 - }, - { - "fetch_from": "against_loan.penalty_income_account", - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "hidden": 1, - "label": "Penalty Income Account", - "options": "Account" - }, - { - "default": "0", - "fieldname": "offset_based_on_npa", - "fieldtype": "Check", - "label": "Offset Based On Asset Classification" - }, - { - "default": "0", - "fetch_from": "against_loan.is_npa", - "fieldname": "is_npa", - "fieldtype": "Check", - "label": "Is NPA" - }, - { - "fetch_from": "against_loan.days_past_due", - "fieldname": "days_past_due", - "fieldtype": "Int", - "label": "Days Past Due", - "read_only": 1 - }, - { - "fieldname": "section_break_55wc", - "fieldtype": "Section Break" - }, - { - "default": "0", - "fetch_from": "against_loan.manual_npa", - "fieldname": "manual_npa", - "fieldtype": "Check", - "label": "Manual NPA" - }, - { - "fieldname": "section_break_a5v1", - "fieldtype": "Section Break" - }, - { - "fieldname": "pending_charges", - "fieldtype": "Table", - "label": "Pending Charges", - "options": "Loan Charge Reference", - "read_only": 1 - }, - { - "fieldname": "total_charges_payable", - "fieldtype": "Currency", - "label": "Total Charges Payable", - "read_only": 1 - }, - { - "fieldname": "total_paid_charges", - "fieldtype": "Currency", - "label": "Total Paid Charges", - "read_only": 1 - }, - { - "fieldname": "column_break_g9f3", - "fieldtype": "Column Break" - }, - { - "default": "Normal Repayment", - "fieldname": "repayment_type", - "fieldtype": "Select", - "label": "Repayment Type", - "options": "Normal Repayment\nInterest Waiver\nPenalty Waiver\nCharges Waiver\nPrincipal Capitalization\nInterest Capitalization\nCharges Capitalization\nPenalty Capitalization\nPrincipal Adjustment\nInterest Adjustment\nInterest Carry Forward" - }, - { - "fieldname": "loan_restructure", - "fieldtype": "Link", - "label": "Loan Restructure", - "options": "Loan Restructure", - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-31 13:42:59.005424", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Repayment", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "autoname": "LM-REP-.####", + "creation": "2022-01-25 10:30:02.767941", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "against_loan", + "applicant_type", + "applicant", + "loan_type", + "repayment_type", + "loan_restructure", + "column_break_3", + "company", + "posting_date", + "clearance_date", + "rate_of_interest", + "days_past_due", + "is_term_loan", + "offset_based_on_npa", + "is_npa", + "manual_npa", + "payment_details_section", + "due_date", + "pending_principal_amount", + "interest_payable", + "payable_amount", + "column_break_9", + "shortfall_amount", + "payable_principal_amount", + "penalty_amount", + "amount_paid", + "accounting_dimensions_section", + "cost_center", + "section_break_a5v1", + "pending_charges", + "column_break_g9f3", + "total_charges_payable", + "total_paid_charges", + "references_section", + "reference_number", + "column_break_21", + "reference_date", + "principal_amount_paid", + "total_penalty_paid", + "total_interest_paid", + "section_break_55wc", + "repayment_details", + "amended_from", + "accounting_details_section", + "payment_account", + "penalty_income_account", + "column_break_36", + "loan_account" + ], + "fields": [ + { + "fieldname": "against_loan", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Against Loan", + "options": "Loan", + "reqd": 1 + }, + { + "fieldname": "posting_date", + "fieldtype": "Datetime", + "in_list_view": 1, + "label": "Posting Date", + "reqd": 1 + }, + { + "fieldname": "payment_details_section", + "fieldtype": "Section Break", + "label": "Payment Details" + }, + { + "fieldname": "penalty_amount", + "fieldtype": "Currency", + "label": "Penalty Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "interest_payable", + "fieldtype": "Currency", + "label": "Interest Payable", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "fetch_from": "against_loan.applicant", + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_list_view": 1, + "label": "Applicant", + "options": "applicant_type", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "against_loan.loan_type", + "fieldname": "loan_type", + "fieldtype": "Link", + "label": "Loan Type", + "options": "Loan Type", + "read_only": 1 + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "fieldname": "payable_amount", + "fieldtype": "Currency", + "label": "Payable Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "bold": 1, + "fieldname": "amount_paid", + "fieldtype": "Currency", + "label": "Amount Paid", + "non_negative": 1, + "options": "Company:company:default_currency", + "reqd": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Repayment", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fetch_from": "against_loan.company", + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "read_only": 1 + }, + { + "fieldname": "pending_principal_amount", + "fieldtype": "Currency", + "label": "Pending Principal Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "0", + "fetch_from": "against_loan.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan", + "read_only": 1 + }, + { + "depends_on": "eval:doc.payment_type==\"Loan Closure\" || doc.is_term_loan", + "fieldname": "payable_principal_amount", + "fieldtype": "Currency", + "label": "Payable Principal Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "references_section", + "fieldtype": "Section Break", + "label": "Payment References" + }, + { + "fieldname": "reference_number", + "fieldtype": "Data", + "label": "Reference Number" + }, + { + "fieldname": "reference_date", + "fieldtype": "Date", + "label": "Reference Date" + }, + { + "fieldname": "column_break_21", + "fieldtype": "Column Break" + }, + { + "default": "0.0", + "fieldname": "principal_amount_paid", + "fieldtype": "Currency", + "hidden": 1, + "label": "Principal Amount Paid", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fetch_from": "against_loan.applicant_type", + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "read_only": 1 + }, + { + "fieldname": "due_date", + "fieldtype": "Date", + "label": "Due Date", + "read_only": 1 + }, + { + "fieldname": "repayment_details", + "fieldtype": "Table", + "label": "Repayment Details", + "options": "Loan Repayment Detail", + "read_only": 1 + }, + { + "fieldname": "total_interest_paid", + "fieldtype": "Currency", + "hidden": 1, + "label": "Total Interest Paid", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fetch_from": "loan_type.rate_of_interest", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate Of Interest", + "read_only": 1 + }, + { + "fieldname": "shortfall_amount", + "fieldtype": "Currency", + "label": "Shortfall Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "total_penalty_paid", + "fieldtype": "Currency", + "hidden": 1, + "label": "Total Penalty Paid", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "clearance_date", + "fieldtype": "Date", + "label": "Clearance Date", + "no_copy": 1, + "read_only": 1 + }, + { + "fieldname": "accounting_details_section", + "fieldtype": "Section Break", + "label": "Accounting Details" + }, + { + "fetch_from": "against_loan.payment_account", + "fetch_if_empty": 1, + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Repayment Account", + "options": "Account" + }, + { + "fieldname": "column_break_36", + "fieldtype": "Column Break" + }, + { + "fetch_from": "against_loan.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "read_only": 1 + }, + { + "fetch_from": "against_loan.penalty_income_account", + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "hidden": 1, + "label": "Penalty Income Account", + "options": "Account" + }, + { + "default": "0", + "fieldname": "offset_based_on_npa", + "fieldtype": "Check", + "label": "Offset Based On Asset Classification" + }, + { + "default": "0", + "fetch_from": "against_loan.is_npa", + "fieldname": "is_npa", + "fieldtype": "Check", + "label": "Is NPA" + }, + { + "fetch_from": "against_loan.days_past_due", + "fieldname": "days_past_due", + "fieldtype": "Int", + "label": "Days Past Due", + "read_only": 1 + }, + { + "fieldname": "section_break_55wc", + "fieldtype": "Section Break" + }, + { + "default": "0", + "fetch_from": "against_loan.manual_npa", + "fieldname": "manual_npa", + "fieldtype": "Check", + "label": "Manual NPA" + }, + { + "fieldname": "section_break_a5v1", + "fieldtype": "Section Break" + }, + { + "fieldname": "pending_charges", + "fieldtype": "Table", + "label": "Pending Charges", + "options": "Loan Charge Reference", + "read_only": 1 + }, + { + "fieldname": "total_charges_payable", + "fieldtype": "Currency", + "label": "Total Charges Payable", + "read_only": 1 + }, + { + "fieldname": "total_paid_charges", + "fieldtype": "Currency", + "label": "Total Paid Charges", + "read_only": 1 + }, + { + "fieldname": "column_break_g9f3", + "fieldtype": "Column Break" + }, + { + "default": "Normal Repayment", + "fieldname": "repayment_type", + "fieldtype": "Select", + "label": "Repayment Type", + "options": "Normal Repayment\nInterest Waiver\nPenalty Waiver\nCharges Waiver\nPrincipal Capitalization\nInterest Capitalization\nCharges Capitalization\nPenalty Capitalization\nPrincipal Adjustment\nInterest Adjustment\nInterest Carry Forward" + }, + { + "fieldname": "loan_restructure", + "fieldtype": "Link", + "label": "Loan Restructure", + "options": "Loan Restructure", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-31 13:42:59.005424", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Repayment", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_restructure/loan_restructure.json b/lending/loan_management/doctype/loan_restructure/loan_restructure.json index e3e6ed61..9312d6b4 100644 --- a/lending/loan_management/doctype/loan_restructure/loan_restructure.json +++ b/lending/loan_management/doctype/loan_restructure/loan_restructure.json @@ -1,554 +1,555 @@ { -"actions": [], -"autoname": "LOAN-RES-.YYYY.-.#####", -"creation": "2023-04-30 17:58:03.482907", -"default_view": "List", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan", - "applicant_type", - "applicant", - "repayment_method", - "restructure_type", - "branch", - "status", - "total_amount_paid", - "total_principal_paid", - "column_break_xph8", - "company", - "restructure_date", - "reason_for_restructure", - "loan_details_section", - "loan_type", - "old_tenure", - "completed_tenure", - "old_rate_of_interest", - "old_loan_amount", - "column_break_gl0p", - "old_emi", - "current_restructure_count", - "pre_restructure_dpd", - "disbursed_amount", - "principal_amount_details_section", - "total_overdue_amount", - "restructure_charges", - "waive_off_restructure_charges", - "column_break_bnny", - "pending_principal_amount", - "available_security_deposit", - "section_break_tbpw", - "principal_overdue", - "column_break_m3kb", - "principal_adjusted", - "column_break_gtuc", - "balance_principal", - "section_break_suab", - "interest_overdue", - "unaccrued_interest", - "penalty_overdue", - "charges_overdue", - "column_break_jvss", - "adjusted_interest_amount", - "adjusted_unaccrued_interest", - "column_break_hkgd", - "interest_waiver_amount", - "unaccrued_interest_waiver", - "penal_interest_waiver", - "other_charges_waiver", - "column_break_ujcs", - "balance_interest_amount", - "balance_unaccrued_interest", - "balance_penalty_amount", - "balance_charges", - "column_break_x8or", - "treatment_of_normal_interest", - "unaccrued_interest_treatment", - "treatment_of_penal_interest", - "treatment_of_other_charges", - "loan_restructure_details_section", - "new_rate_of_interest", - "repayment_start_date", - "column_break_mqcp", - "new_repayment_method", - "new_repayment_period_in_months", - "new_monthly_repayment_amount", - "new_loan_amount", - "amended_from" -], -"fields": [ - { - "fieldname": "loan", - "fieldtype": "Link", - "in_list_view": 1, - "label": "Loan", - "options": "Loan", - "reqd": 1 - }, - { - "fetch_from": "loan.applicant_type", - "fieldname": "applicant_type", - "fieldtype": "Select", - "hidden": 1, - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "read_only": 1 - }, - { - "fetch_from": "loan.applicant", - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "label": "Applicant", - "options": "applicant_type", - "read_only": 1 - }, - { - "fieldname": "column_break_xph8", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan.company", - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Restructure", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "loan_details_section", - "fieldtype": "Section Break", - "label": "Pre Restructure Details" - }, - { - "fetch_from": "loan.disbursed_amount", - "fieldname": "disbursed_amount", - "fieldtype": "Currency", - "label": "Disbursed Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "reason_for_restructure", - "fieldtype": "Small Text", - "label": "Reason for Restructure" - }, - { - "fieldname": "loan_restructure_details_section", - "fieldtype": "Section Break", - "label": "Loan Restructure Details" - }, - { - "fieldname": "new_repayment_method", - "fieldtype": "Select", - "label": "New Repayment Method", - "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" - }, - { - "fieldname": "new_repayment_period_in_months", - "fieldtype": "Int", - "label": "New Repayment Period in Months" - }, - { - "fieldname": "new_monthly_repayment_amount", - "fieldtype": "Currency", - "label": "New Monthly Repayment Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "new_rate_of_interest", - "fieldtype": "Percent", - "label": "New Rate Of Interest" - }, - { - "fieldname": "column_break_mqcp", - "fieldtype": "Column Break" - }, - { - "fieldname": "interest_waiver_amount", - "fieldtype": "Currency", - "label": "Interest Waiver Amount", - "options": "Company:company:default_currency" - }, - { - "fieldname": "other_charges_waiver", - "fieldtype": "Currency", - "label": "Other Charges Waiver", - "options": "Company:company:default_currency" - }, - { - "fieldname": "total_overdue_amount", - "fieldtype": "Currency", - "label": "Total Overdue Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "principal_overdue", - "fieldtype": "Currency", - "label": "Principal Overdue", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "interest_overdue", - "fieldtype": "Currency", - "label": "Interest Overdue", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "charges_overdue", - "fieldtype": "Currency", - "label": "Charges Overdue", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "restructure_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Restructure Date", - "reqd": 1 - }, - { - "fieldname": "new_loan_amount", - "fieldtype": "Currency", - "label": "New Loan Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fetch_from": "loan.days_past_due", - "fieldname": "pre_restructure_dpd", - "fieldtype": "Int", - "label": "Pre Restructure DPD", - "read_only": 1 - }, - { - "fieldname": "repayment_start_date", - "fieldtype": "Date", - "label": "New Repayment Start Date" - }, - { - "fieldname": "pending_principal_amount", - "fieldtype": "Currency", - "label": "Pending Principal Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fetch_from": "loan.rate_of_interest", - "fieldname": "old_rate_of_interest", - "fieldtype": "Percent", - "label": "Old Rate of Interest", - "read_only": 1 - }, - { - "fetch_from": "loan.loan_type", - "fieldname": "loan_type", - "fieldtype": "Link", - "hidden": 1, - "label": "Loan Type", - "options": "Loan Type" - }, - { - "fieldname": "penal_interest_waiver", - "fieldtype": "Currency", - "label": "Penal Interest Waiver", - "options": "Company:company:default_currency" - }, - { - "fieldname": "restructure_type", - "fieldtype": "Select", - "label": "Restructure Type", - "options": "Normal Restructure\nPre Payment" - }, - { - "fetch_from": "loan.branch", - "fieldname": "branch", - "fieldtype": "Link", - "label": "Branch", - "options": "Branch", - "read_only": 1 - }, - { - "fieldname": "penalty_overdue", - "fieldtype": "Currency", - "label": "Penalty Overdue", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fetch_from": "loan.repayment_method", - "fieldname": "repayment_method", - "fieldtype": "Data", - "hidden": 1, - "label": "Repayment Method" - }, - { - "allow_on_submit": 1, - "depends_on": "eval:doc.docstatus == 1", - "fieldname": "status", - "fieldtype": "Select", - "label": "Status", - "options": "\nInitiated\nApproved\nRejected" - }, - { - "fetch_from": "loan.loan_restructure_count", - "fieldname": "current_restructure_count", - "fieldtype": "Int", - "label": "Current Restructure Count", - "read_only": 1 - }, - { - "fieldname": "unaccrued_interest", - "fieldtype": "Currency", - "label": "Unaccrued Interest", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "old_tenure", - "fieldtype": "Int", - "label": "Old Tenure", - "read_only": 1 - }, - { - "fetch_from": "loan.monthly_repayment_amount", - "fieldname": "old_emi", - "fieldtype": "Currency", - "label": "Old EMI", - "read_only": 1 - }, - { - "default": "Capitalize", - "fieldname": "treatment_of_penal_interest", - "fieldtype": "Select", - "label": "Penal Treatment", - "options": "Capitalize\nCarry Forward" - }, - { - "default": "Capitalize", - "fieldname": "treatment_of_other_charges", - "fieldtype": "Select", - "label": "Charges Treatment", - "options": "Capitalize\nCarry Forward" - }, - { - "default": "Add To First EMI", - "fieldname": "treatment_of_normal_interest", - "fieldtype": "Select", - "label": "Interest Treatment", - "options": "Capitalize\nAdd To First EMI" - }, - { - "fieldname": "column_break_gl0p", - "fieldtype": "Column Break" - }, - { - "fieldname": "principal_amount_details_section", - "fieldtype": "Section Break", - "label": "Loan Amount Details" - }, - { - "fieldname": "column_break_bnny", - "fieldtype": "Column Break" - }, - { - "fieldname": "adjusted_interest_amount", - "fieldtype": "Currency", - "label": "Adjusted Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_hkgd", - "fieldtype": "Column Break" - }, - { - "fieldname": "section_break_tbpw", - "fieldtype": "Section Break" - }, - { - "fieldname": "balance_interest_amount", - "fieldtype": "Currency", - "label": "Balance Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_ujcs", - "fieldtype": "Column Break" - }, - { - "fieldname": "balance_penalty_amount", - "fieldtype": "Currency", - "label": "Balance Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "balance_charges", - "fieldtype": "Currency", - "label": "Balance Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_x8or", - "fieldtype": "Column Break" - }, - { - "fieldname": "column_break_jvss", - "fieldtype": "Column Break" - }, - { - "fieldname": "available_security_deposit", - "fieldtype": "Currency", - "label": "Available Security Deposit", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "section_break_suab", - "fieldtype": "Section Break" - }, - { - "fieldname": "column_break_m3kb", - "fieldtype": "Column Break" - }, - { - "fieldname": "principal_adjusted", - "fieldtype": "Currency", - "label": "Principal Adjusted", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_gtuc", - "fieldtype": "Column Break" - }, - { - "fieldname": "balance_principal", - "fieldtype": "Currency", - "label": "Balance Overdue Principal", - "read_only": 1 - }, - { - "fieldname": "restructure_charges", - "fieldtype": "Currency", - "label": "Restructure Charges", - "read_only": 1 - }, - { - "fieldname": "completed_tenure", - "fieldtype": "Int", - "label": "Completed Tenure" - }, - { - "default": "0", - "fieldname": "waive_off_restructure_charges", - "fieldtype": "Check", - "label": "Waive Off Restructure Charges" - }, - { - "fieldname": "adjusted_unaccrued_interest", - "fieldtype": "Currency", - "label": "Adjusted Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "unaccrued_interest_waiver", - "fieldtype": "Currency", - "label": "Unaccrued Interest Waiver", - "options": "Company:company:default_currency" - }, - { - "fieldname": "balance_unaccrued_interest", - "fieldtype": "Currency", - "label": "Balance Amount", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "Add To First EMI", - "fieldname": "unaccrued_interest_treatment", - "fieldtype": "Select", - "label": "Unaccrued Interest Treatment", - "options": "Capitalize\nAdd To First EMI" - }, - { - "fetch_from": "loan.total_amount_paid", - "fieldname": "total_amount_paid", - "fieldtype": "Currency", - "hidden": 1, - "label": "Total Amount Paid" - }, - { - "fetch_from": "loan.total_principal_paid", - "fieldname": "total_principal_paid", - "fieldtype": "Currency", - "hidden": 1, - "label": "Total Principal Paid" - }, - { - "fetch_from": "loan.loan_amount", - "fieldname": "old_loan_amount", - "fieldtype": "Currency", - "label": "Old Loan Amount" - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-31 13:25:01.899763", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Restructure", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "select": 1, - "share": 1, - "submit": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "select": 1, - "share": 1, - "submit": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "autoname": "LOAN-RES-.YYYY.-.#####", + "creation": "2023-04-30 17:58:03.482907", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan", + "applicant_type", + "applicant", + "repayment_method", + "restructure_type", + "branch", + "status", + "total_amount_paid", + "total_principal_paid", + "column_break_xph8", + "company", + "restructure_date", + "reason_for_restructure", + "loan_details_section", + "loan_type", + "old_tenure", + "completed_tenure", + "old_rate_of_interest", + "old_loan_amount", + "column_break_gl0p", + "old_emi", + "current_restructure_count", + "pre_restructure_dpd", + "disbursed_amount", + "principal_amount_details_section", + "total_overdue_amount", + "restructure_charges", + "waive_off_restructure_charges", + "column_break_bnny", + "pending_principal_amount", + "available_security_deposit", + "section_break_tbpw", + "principal_overdue", + "column_break_m3kb", + "principal_adjusted", + "column_break_gtuc", + "balance_principal", + "section_break_suab", + "interest_overdue", + "unaccrued_interest", + "penalty_overdue", + "charges_overdue", + "column_break_jvss", + "adjusted_interest_amount", + "adjusted_unaccrued_interest", + "column_break_hkgd", + "interest_waiver_amount", + "unaccrued_interest_waiver", + "penal_interest_waiver", + "other_charges_waiver", + "column_break_ujcs", + "balance_interest_amount", + "balance_unaccrued_interest", + "balance_penalty_amount", + "balance_charges", + "column_break_x8or", + "treatment_of_normal_interest", + "unaccrued_interest_treatment", + "treatment_of_penal_interest", + "treatment_of_other_charges", + "loan_restructure_details_section", + "new_rate_of_interest", + "repayment_start_date", + "column_break_mqcp", + "new_repayment_method", + "new_repayment_period_in_months", + "new_monthly_repayment_amount", + "new_loan_amount", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Loan", + "options": "Loan", + "reqd": 1 + }, + { + "fetch_from": "loan.applicant_type", + "fieldname": "applicant_type", + "fieldtype": "Select", + "hidden": 1, + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "read_only": 1 + }, + { + "fetch_from": "loan.applicant", + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "label": "Applicant", + "options": "applicant_type", + "read_only": 1 + }, + { + "fieldname": "column_break_xph8", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan.company", + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Restructure", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "loan_details_section", + "fieldtype": "Section Break", + "label": "Pre Restructure Details" + }, + { + "fetch_from": "loan.disbursed_amount", + "fieldname": "disbursed_amount", + "fieldtype": "Currency", + "label": "Disbursed Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "reason_for_restructure", + "fieldtype": "Small Text", + "label": "Reason for Restructure" + }, + { + "fieldname": "loan_restructure_details_section", + "fieldtype": "Section Break", + "label": "Loan Restructure Details" + }, + { + "fieldname": "new_repayment_method", + "fieldtype": "Select", + "label": "New Repayment Method", + "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" + }, + { + "fieldname": "new_repayment_period_in_months", + "fieldtype": "Int", + "label": "New Repayment Period in Months" + }, + { + "fieldname": "new_monthly_repayment_amount", + "fieldtype": "Currency", + "label": "New Monthly Repayment Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "new_rate_of_interest", + "fieldtype": "Percent", + "label": "New Rate Of Interest" + }, + { + "fieldname": "column_break_mqcp", + "fieldtype": "Column Break" + }, + { + "fieldname": "interest_waiver_amount", + "fieldtype": "Currency", + "label": "Interest Waiver Amount", + "options": "Company:company:default_currency" + }, + { + "fieldname": "other_charges_waiver", + "fieldtype": "Currency", + "label": "Other Charges Waiver", + "options": "Company:company:default_currency" + }, + { + "fieldname": "total_overdue_amount", + "fieldtype": "Currency", + "label": "Total Overdue Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "principal_overdue", + "fieldtype": "Currency", + "label": "Principal Overdue", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "interest_overdue", + "fieldtype": "Currency", + "label": "Interest Overdue", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "charges_overdue", + "fieldtype": "Currency", + "label": "Charges Overdue", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "restructure_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Restructure Date", + "reqd": 1 + }, + { + "fieldname": "new_loan_amount", + "fieldtype": "Currency", + "label": "New Loan Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fetch_from": "loan.days_past_due", + "fieldname": "pre_restructure_dpd", + "fieldtype": "Int", + "label": "Pre Restructure DPD", + "read_only": 1 + }, + { + "fieldname": "repayment_start_date", + "fieldtype": "Date", + "label": "New Repayment Start Date" + }, + { + "fieldname": "pending_principal_amount", + "fieldtype": "Currency", + "label": "Pending Principal Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fetch_from": "loan.rate_of_interest", + "fieldname": "old_rate_of_interest", + "fieldtype": "Percent", + "label": "Old Rate of Interest", + "read_only": 1 + }, + { + "fetch_from": "loan.loan_type", + "fieldname": "loan_type", + "fieldtype": "Link", + "hidden": 1, + "label": "Loan Type", + "options": "Loan Type" + }, + { + "fieldname": "penal_interest_waiver", + "fieldtype": "Currency", + "label": "Penal Interest Waiver", + "options": "Company:company:default_currency" + }, + { + "fieldname": "restructure_type", + "fieldtype": "Select", + "label": "Restructure Type", + "options": "Normal Restructure\nPre Payment" + }, + { + "fetch_from": "loan.branch", + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "options": "Branch", + "read_only": 1 + }, + { + "fieldname": "penalty_overdue", + "fieldtype": "Currency", + "label": "Penalty Overdue", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fetch_from": "loan.repayment_method", + "fieldname": "repayment_method", + "fieldtype": "Data", + "hidden": 1, + "label": "Repayment Method" + }, + { + "allow_on_submit": 1, + "depends_on": "eval:doc.docstatus == 1", + "fieldname": "status", + "fieldtype": "Select", + "label": "Status", + "options": "\nInitiated\nApproved\nRejected" + }, + { + "fetch_from": "loan.loan_restructure_count", + "fieldname": "current_restructure_count", + "fieldtype": "Int", + "label": "Current Restructure Count", + "read_only": 1 + }, + { + "fieldname": "unaccrued_interest", + "fieldtype": "Currency", + "label": "Unaccrued Interest", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "old_tenure", + "fieldtype": "Int", + "label": "Old Tenure", + "read_only": 1 + }, + { + "fetch_from": "loan.monthly_repayment_amount", + "fieldname": "old_emi", + "fieldtype": "Currency", + "label": "Old EMI", + "read_only": 1 + }, + { + "default": "Capitalize", + "fieldname": "treatment_of_penal_interest", + "fieldtype": "Select", + "label": "Penal Treatment", + "options": "Capitalize\nCarry Forward" + }, + { + "default": "Capitalize", + "fieldname": "treatment_of_other_charges", + "fieldtype": "Select", + "label": "Charges Treatment", + "options": "Capitalize\nCarry Forward" + }, + { + "default": "Add To First EMI", + "fieldname": "treatment_of_normal_interest", + "fieldtype": "Select", + "label": "Interest Treatment", + "options": "Capitalize\nAdd To First EMI" + }, + { + "fieldname": "column_break_gl0p", + "fieldtype": "Column Break" + }, + { + "fieldname": "principal_amount_details_section", + "fieldtype": "Section Break", + "label": "Loan Amount Details" + }, + { + "fieldname": "column_break_bnny", + "fieldtype": "Column Break" + }, + { + "fieldname": "adjusted_interest_amount", + "fieldtype": "Currency", + "label": "Adjusted Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_hkgd", + "fieldtype": "Column Break" + }, + { + "fieldname": "section_break_tbpw", + "fieldtype": "Section Break" + }, + { + "fieldname": "balance_interest_amount", + "fieldtype": "Currency", + "label": "Balance Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_ujcs", + "fieldtype": "Column Break" + }, + { + "fieldname": "balance_penalty_amount", + "fieldtype": "Currency", + "label": "Balance Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "balance_charges", + "fieldtype": "Currency", + "label": "Balance Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_x8or", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_jvss", + "fieldtype": "Column Break" + }, + { + "fieldname": "available_security_deposit", + "fieldtype": "Currency", + "label": "Available Security Deposit", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "section_break_suab", + "fieldtype": "Section Break" + }, + { + "fieldname": "column_break_m3kb", + "fieldtype": "Column Break" + }, + { + "fieldname": "principal_adjusted", + "fieldtype": "Currency", + "label": "Principal Adjusted", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_gtuc", + "fieldtype": "Column Break" + }, + { + "fieldname": "balance_principal", + "fieldtype": "Currency", + "label": "Balance Overdue Principal", + "read_only": 1 + }, + { + "fieldname": "restructure_charges", + "fieldtype": "Currency", + "label": "Restructure Charges", + "read_only": 1 + }, + { + "fieldname": "completed_tenure", + "fieldtype": "Int", + "label": "Completed Tenure" + }, + { + "default": "0", + "fieldname": "waive_off_restructure_charges", + "fieldtype": "Check", + "label": "Waive Off Restructure Charges" + }, + { + "fieldname": "adjusted_unaccrued_interest", + "fieldtype": "Currency", + "label": "Adjusted Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "unaccrued_interest_waiver", + "fieldtype": "Currency", + "label": "Unaccrued Interest Waiver", + "options": "Company:company:default_currency" + }, + { + "fieldname": "balance_unaccrued_interest", + "fieldtype": "Currency", + "label": "Balance Amount", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "Add To First EMI", + "fieldname": "unaccrued_interest_treatment", + "fieldtype": "Select", + "label": "Unaccrued Interest Treatment", + "options": "Capitalize\nAdd To First EMI" + }, + { + "fetch_from": "loan.total_amount_paid", + "fieldname": "total_amount_paid", + "fieldtype": "Currency", + "hidden": 1, + "label": "Total Amount Paid" + }, + { + "fetch_from": "loan.total_principal_paid", + "fieldname": "total_principal_paid", + "fieldtype": "Currency", + "hidden": 1, + "label": "Total Principal Paid" + }, + { + "fetch_from": "loan.loan_amount", + "fieldname": "old_loan_amount", + "fieldtype": "Currency", + "label": "Old Loan Amount" + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-09-19 23:24:10.776579", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Restructure", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "select": 1, + "share": 1, + "submit": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "select": 1, + "share": 1, + "submit": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_security_deposit/loan_security_deposit.json b/lending/loan_management/doctype/loan_security_deposit/loan_security_deposit.json index e7ea94d3..e819de87 100644 --- a/lending/loan_management/doctype/loan_security_deposit/loan_security_deposit.json +++ b/lending/loan_management/doctype/loan_security_deposit/loan_security_deposit.json @@ -1,91 +1,91 @@ { -"actions": [], -"allow_rename": 1, -"creation": "2023-05-16 19:55:31.455143", -"default_view": "List", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan", - "loan_disbursement", - "deposit_amount", - "allocated_amount", - "amended_from" -], -"fields": [ - { - "fieldname": "loan", - "fieldtype": "Link", - "label": "Loan", - "options": "Loan", - "read_only": 1 - }, - { - "fieldname": "loan_disbursement", - "fieldtype": "Link", - "label": "Loan Disbursement", - "options": "Loan Disbursement", - "read_only": 1 - }, - { - "fieldname": "deposit_amount", - "fieldtype": "Currency", - "label": "Deposit Amount", - "read_only": 1 - }, - { - "fieldname": "allocated_amount", - "fieldtype": "Currency", - "label": "Allocated Amount", - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Security Deposit", - "print_hide": 1, - "read_only": 1 - } -], -"in_create": 1, -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-18 13:54:55.236732", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Security Deposit", -"owner": "Administrator", -"permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "allow_rename": 1, + "creation": "2023-05-16 19:55:31.455143", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan", + "loan_disbursement", + "deposit_amount", + "allocated_amount", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan", + "fieldtype": "Link", + "label": "Loan", + "options": "Loan", + "read_only": 1 + }, + { + "fieldname": "loan_disbursement", + "fieldtype": "Link", + "label": "Loan Disbursement", + "options": "Loan Disbursement", + "read_only": 1 + }, + { + "fieldname": "deposit_amount", + "fieldtype": "Currency", + "label": "Deposit Amount", + "read_only": 1 + }, + { + "fieldname": "allocated_amount", + "fieldtype": "Currency", + "label": "Allocated Amount", + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Security Deposit", + "print_hide": 1, + "read_only": 1 + } + ], + "in_create": 1, + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-18 13:54:55.236732", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Security Deposit", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_type/loan_type.json b/lending/loan_management/doctype/loan_type/loan_type.json index 2b5ff8e6..d34427b1 100644 --- a/lending/loan_management/doctype/loan_type/loan_type.json +++ b/lending/loan_management/doctype/loan_type/loan_type.json @@ -1,333 +1,334 @@ { -"actions": [], -"autoname": "field:loan_name", -"creation": "2019-08-29 18:08:38.159726", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "loan_name", - "maximum_loan_amount", - "rate_of_interest", - "penalty_interest_rate", - "grace_period_in_days", - "write_off_amount", - "column_break_2", - "company", - "is_term_loan", - "disabled", - "repayment_schedule_type", - "repayment_date_on", - "days_past_due_threshold_for_npa", - "description", - "account_details_section", - "mode_of_payment", - "disbursement_account", - "payment_account", - "suspense_interest_receivable", - "suspense_interest_income", - "suspense_collection_account", - "column_break_12", - "loan_account", - "interest_income_account", - "interest_receivable_account", - "penalty_receivable_account", - "charges_receivable_account", - "penalty_income_account", - "security_deposit_account", - "loan_waiver_accounts_section", - "principal_waiver_account", - "interest_waiver_account", - "column_break_amrb", - "penalty_waiver_account", - "charges_waiver_account", - "section_break_ia6s", - "charges_waiver_item", - "loan_charges", - "amended_from" -], -"fields": [ - { - "fieldname": "loan_name", - "fieldtype": "Data", - "in_list_view": 1, - "label": "Loan Name", - "reqd": 1, - "unique": 1 - }, - { - "fieldname": "maximum_loan_amount", - "fieldtype": "Currency", - "label": "Maximum Loan Amount", - "options": "Company:company:default_currency" - }, - { - "default": "0", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate of Interest (%) Yearly", - "reqd": 1 - }, - { - "fieldname": "column_break_2", - "fieldtype": "Column Break" - }, - { - "allow_on_submit": 1, - "default": "0", - "fieldname": "disabled", - "fieldtype": "Check", - "label": "Disabled" - }, - { - "fieldname": "description", - "fieldtype": "Text", - "label": "Description" - }, - { - "fieldname": "account_details_section", - "fieldtype": "Section Break", - "label": "Loan Account Details" - }, - { - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "reqd": 1 - }, - { - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Repayment Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "column_break_12", - "fieldtype": "Column Break" - }, - { - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "label": "Penalty Income Account", - "options": "Account", - "reqd": 1 - }, - { - "default": "0", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan" - }, - { - "description": "Penalty Interest Rate is levied on the pending interest amount on a daily basis in case of delayed repayment ", - "fieldname": "penalty_interest_rate", - "fieldtype": "Percent", - "label": "Penalty Interest Rate (%)" - }, - { - "description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment", - "fieldname": "grace_period_in_days", - "fieldtype": "Int", - "label": "Grace Period in Days" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan Type", - "print_hide": 1, - "read_only": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "label": "Company", - "options": "Company", - "reqd": 1 - }, - { - "allow_on_submit": 1, - "description": "Loan Write Off will be automatically created on loan closure request if pending amount is below this limit", - "fieldname": "write_off_amount", - "fieldtype": "Currency", - "label": "Auto Write Off Amount ", - "options": "Company:company:default_currency" - }, - { - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account", - "reqd": 1 - }, - { - "depends_on": "is_term_loan", - "description": "The schedule type that will be used for generating the term loan schedules (will affect the payment date and monthly repayment amount)", - "fieldname": "repayment_schedule_type", - "fieldtype": "Select", - "label": "Repayment Schedule Type", - "mandatory_depends_on": "is_term_loan", - "options": "\nMonthly as per repayment start date\nPro-rated calendar months\nMonthly as per cycle date" - }, - { - "depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", - "description": "Select whether the repayment date should be the end of the current month or start of the upcoming month", - "fieldname": "repayment_date_on", - "fieldtype": "Select", - "label": "Repayment Date On", - "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", - "options": "\nStart of the next month\nEnd of the current month" - }, - { - "description": "Loans will be marked as NPA when the days past due count exceed this threshold", - "fieldname": "days_past_due_threshold_for_npa", - "fieldtype": "Int", - "label": "Days Past Due Threshold for NPA" - }, - { - "fieldname": "loan_waiver_accounts_section", - "fieldtype": "Section Break", - "label": "Loan Waiver Accounts" - }, - { - "fieldname": "principal_waiver_account", - "fieldtype": "Link", - "label": "Principal Waiver Account", - "options": "Account" - }, - { - "fieldname": "interest_waiver_account", - "fieldtype": "Link", - "label": "Interest Waiver Account", - "options": "Account" - }, - { - "fieldname": "column_break_amrb", - "fieldtype": "Column Break" - }, - { - "fieldname": "penalty_waiver_account", - "fieldtype": "Link", - "label": "Penalty Waiver Account", - "options": "Account" - }, - { - "fieldname": "charges_waiver_account", - "fieldtype": "Link", - "label": "Charges Waiver Account", - "options": "Account" - }, - { - "fieldname": "suspense_interest_receivable", - "fieldtype": "Link", - "label": "Suspense Interest Receivable", - "options": "Account" - }, - { - "fieldname": "suspense_interest_income", - "fieldtype": "Link", - "label": "Suspense Interest Income", - "options": "Account" - }, - { - "fieldname": "suspense_collection_account", - "fieldtype": "Link", - "label": "Suspense Collection Account", - "options": "Account" - }, - { - "fieldname": "interest_receivable_account", - "fieldtype": "Link", - "label": "Interest Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "penalty_receivable_account", - "fieldtype": "Link", - "label": "Penalty Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "charges_receivable_account", - "fieldtype": "Link", - "label": "Charges Receivable Account", - "options": "Account", - "reqd": 1 - }, - { - "fieldname": "section_break_ia6s", - "fieldtype": "Section Break" - }, - { - "allow_on_submit": 1, - "fieldname": "loan_charges", - "fieldtype": "Table", - "label": "Loan Charges", - "options": "Loan Charges" - }, - { - "fieldname": "security_deposit_account", - "fieldtype": "Link", - "label": "Security Deposit Account", - "options": "Account" - }, - { - "fieldname": "charges_waiver_item", - "fieldtype": "Link", - "label": "Charges Waiver Item", - "options": "Item" - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-29 19:33:15.313331", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan Type", -"naming_rule": "By fieldname", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "read": 1, - "role": "Employee" - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "autoname": "field:loan_name", + "creation": "2019-08-29 18:08:38.159726", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan_name", + "maximum_loan_amount", + "rate_of_interest", + "penalty_interest_rate", + "grace_period_in_days", + "write_off_amount", + "column_break_2", + "company", + "is_term_loan", + "disabled", + "repayment_schedule_type", + "repayment_date_on", + "days_past_due_threshold_for_npa", + "description", + "account_details_section", + "mode_of_payment", + "disbursement_account", + "payment_account", + "suspense_interest_receivable", + "suspense_interest_income", + "suspense_collection_account", + "column_break_12", + "loan_account", + "interest_income_account", + "interest_receivable_account", + "penalty_receivable_account", + "charges_receivable_account", + "penalty_income_account", + "security_deposit_account", + "loan_waiver_accounts_section", + "principal_waiver_account", + "interest_waiver_account", + "column_break_amrb", + "penalty_waiver_account", + "charges_waiver_account", + "section_break_ia6s", + "charges_waiver_item", + "loan_charges", + "amended_from" + ], + "fields": [ + { + "fieldname": "loan_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Loan Name", + "reqd": 1, + "unique": 1 + }, + { + "fieldname": "maximum_loan_amount", + "fieldtype": "Currency", + "label": "Maximum Loan Amount", + "options": "Company:company:default_currency" + }, + { + "default": "0", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate of Interest (%) Yearly", + "reqd": 1 + }, + { + "fieldname": "column_break_2", + "fieldtype": "Column Break" + }, + { + "allow_on_submit": 1, + "default": "0", + "fieldname": "disabled", + "fieldtype": "Check", + "label": "Disabled" + }, + { + "fieldname": "description", + "fieldtype": "Text", + "label": "Description" + }, + { + "fieldname": "account_details_section", + "fieldtype": "Section Break", + "label": "Loan Account Details" + }, + { + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "reqd": 1 + }, + { + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Repayment Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "column_break_12", + "fieldtype": "Column Break" + }, + { + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "label": "Penalty Income Account", + "options": "Account", + "reqd": 1 + }, + { + "default": "0", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan" + }, + { + "description": "Penalty Interest Rate is levied on the pending interest amount on a daily basis in case of delayed repayment ", + "fieldname": "penalty_interest_rate", + "fieldtype": "Percent", + "label": "Penalty Interest Rate (%)" + }, + { + "description": "No. of days from due date until which penalty won't be charged in case of delay in loan repayment", + "fieldname": "grace_period_in_days", + "fieldtype": "Int", + "label": "Grace Period in Days" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan Type", + "print_hide": 1, + "read_only": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company", + "reqd": 1 + }, + { + "allow_on_submit": 1, + "description": "Loan Write Off will be automatically created on loan closure request if pending amount is below this limit", + "fieldname": "write_off_amount", + "fieldtype": "Currency", + "label": "Auto Write Off Amount ", + "options": "Company:company:default_currency" + }, + { + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account", + "reqd": 1 + }, + { + "depends_on": "is_term_loan", + "description": "The schedule type that will be used for generating the term loan schedules (will affect the payment date and monthly repayment amount)", + "fieldname": "repayment_schedule_type", + "fieldtype": "Select", + "label": "Repayment Schedule Type", + "mandatory_depends_on": "is_term_loan", + "options": "\nMonthly as per repayment start date\nPro-rated calendar months\nMonthly as per cycle date" + }, + { + "depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", + "description": "Select whether the repayment date should be the end of the current month or start of the upcoming month", + "fieldname": "repayment_date_on", + "fieldtype": "Select", + "label": "Repayment Date On", + "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Pro-rated calendar months\"", + "options": "\nStart of the next month\nEnd of the current month" + }, + { + "description": "Loans will be marked as NPA when the days past due count exceed this threshold", + "fieldname": "days_past_due_threshold_for_npa", + "fieldtype": "Int", + "label": "Days Past Due Threshold for NPA" + }, + { + "fieldname": "loan_waiver_accounts_section", + "fieldtype": "Section Break", + "label": "Loan Waiver Accounts" + }, + { + "fieldname": "principal_waiver_account", + "fieldtype": "Link", + "label": "Principal Waiver Account", + "options": "Account" + }, + { + "fieldname": "interest_waiver_account", + "fieldtype": "Link", + "label": "Interest Waiver Account", + "options": "Account" + }, + { + "fieldname": "column_break_amrb", + "fieldtype": "Column Break" + }, + { + "fieldname": "penalty_waiver_account", + "fieldtype": "Link", + "label": "Penalty Waiver Account", + "options": "Account" + }, + { + "fieldname": "charges_waiver_account", + "fieldtype": "Link", + "label": "Charges Waiver Account", + "options": "Account" + }, + { + "fieldname": "suspense_interest_receivable", + "fieldtype": "Link", + "label": "Suspense Interest Receivable", + "options": "Account" + }, + { + "fieldname": "suspense_interest_income", + "fieldtype": "Link", + "label": "Suspense Interest Income", + "options": "Account" + }, + { + "fieldname": "suspense_collection_account", + "fieldtype": "Link", + "label": "Suspense Collection Account", + "options": "Account" + }, + { + "fieldname": "interest_receivable_account", + "fieldtype": "Link", + "label": "Interest Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "penalty_receivable_account", + "fieldtype": "Link", + "label": "Penalty Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "charges_receivable_account", + "fieldtype": "Link", + "label": "Charges Receivable Account", + "options": "Account", + "reqd": 1 + }, + { + "fieldname": "section_break_ia6s", + "fieldtype": "Section Break" + }, + { + "allow_on_submit": 1, + "fieldname": "loan_charges", + "fieldtype": "Table", + "label": "Loan Charges", + "options": "Loan Charges" + }, + { + "fieldname": "security_deposit_account", + "fieldtype": "Link", + "label": "Security Deposit Account", + "options": "Account" + }, + { + "fieldname": "charges_waiver_item", + "fieldtype": "Link", + "label": "Charges Waiver Item", + "options": "Item" + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-09-19 23:25:49.472523", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Type", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "read": 1, + "role": "Employee" + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/process_loan_restructure_limit/__inti__.py b/lending/loan_management/doctype/process_loan_restructure_limit/__init__.py similarity index 100% rename from lending/loan_management/doctype/process_loan_restructure_limit/__inti__.py rename to lending/loan_management/doctype/process_loan_restructure_limit/__init__.py diff --git a/lending/loan_management/doctype/process_loan_restructure_limit/process_loan_restructure_limit.json b/lending/loan_management/doctype/process_loan_restructure_limit/process_loan_restructure_limit.json index 4687586e..9a525e89 100644 --- a/lending/loan_management/doctype/process_loan_restructure_limit/process_loan_restructure_limit.json +++ b/lending/loan_management/doctype/process_loan_restructure_limit/process_loan_restructure_limit.json @@ -1,66 +1,66 @@ { -"actions": [], -"allow_rename": 1, -"creation": "2023-05-09 12:58:56.984024", -"default_view": "List", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "posting_date", - "amended_from" -], -"fields": [ - { - "fieldname": "posting_date", - "fieldtype": "Date", - "label": "Posting Date" - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Process Loan Restructure Limit", - "print_hide": 1, - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-18 13:55:11.292399", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Process Loan Restructure Limit", -"owner": "Administrator", -"permissions": [ - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "System Manager", - "share": 1, - "write": 1 - }, - { - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "write": 1 - } -], -"sort_field": "modified", -"sort_order": "DESC", -"states": [] + "actions": [], + "allow_rename": 1, + "creation": "2023-05-09 12:58:56.984024", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "posting_date", + "amended_from" + ], + "fields": [ + { + "fieldname": "posting_date", + "fieldtype": "Date", + "label": "Posting Date" + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Process Loan Restructure Limit", + "print_hide": 1, + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-05-18 13:55:11.292399", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Process Loan Restructure Limit", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] } \ No newline at end of file diff --git a/lending/loan_management/doctype/repayment_schedule/repayment_schedule.json b/lending/loan_management/doctype/repayment_schedule/repayment_schedule.json index b14c8bcf..f5ec6a07 100644 --- a/lending/loan_management/doctype/repayment_schedule/repayment_schedule.json +++ b/lending/loan_management/doctype/repayment_schedule/repayment_schedule.json @@ -1,90 +1,90 @@ { -"actions": [], -"creation": "2019-09-12 12:57:07.940159", -"doctype": "DocType", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "payment_date", - "number_of_days", - "principal_amount", - "interest_amount", - "total_payment", - "balance_loan_amount", - "is_accrued" -], -"fields": [ - { - "columns": 2, - "fieldname": "payment_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Payment Date" - }, - { - "columns": 2, - "fieldname": "principal_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Principal Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "columns": 2, - "fieldname": "interest_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Interest Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "columns": 2, - "fieldname": "total_payment", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Total Payment", - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "columns": 2, - "fieldname": "balance_loan_amount", - "fieldtype": "Currency", - "in_list_view": 1, - "label": "Balance Loan Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_accrued", - "fieldtype": "Check", - "in_list_view": 1, - "label": "Is Accrued", - "read_only": 1 - }, - { - "fieldname": "number_of_days", - "fieldtype": "Int", - "label": "Number Of Days" - } -], -"istable": 1, -"links": [], -"modified": "2023-04-27 19:24:05.440274", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Repayment Schedule", -"owner": "Administrator", -"permissions": [], -"quick_entry": 1, -"sort_field": "modified", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "creation": "2019-09-12 12:57:07.940159", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "payment_date", + "number_of_days", + "principal_amount", + "interest_amount", + "total_payment", + "balance_loan_amount", + "is_accrued" + ], + "fields": [ + { + "columns": 2, + "fieldname": "payment_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Payment Date" + }, + { + "columns": 2, + "fieldname": "principal_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Principal Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "interest_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Interest Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "total_payment", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Total Payment", + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "columns": 2, + "fieldname": "balance_loan_amount", + "fieldtype": "Currency", + "in_list_view": 1, + "label": "Balance Loan Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_accrued", + "fieldtype": "Check", + "in_list_view": 1, + "label": "Is Accrued", + "read_only": 1 + }, + { + "fieldname": "number_of_days", + "fieldtype": "Int", + "label": "Number Of Days" + } + ], + "istable": 1, + "links": [], + "modified": "2023-04-27 19:24:05.440274", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Repayment Schedule", + "owner": "Administrator", + "permissions": [], + "quick_entry": 1, + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file From c0a2952d22433e1f8041074de5b22dd13c0232d3 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Thu, 21 Sep 2023 16:40:25 +0530 Subject: [PATCH 19/23] feat: Minimum broken period interest configuration --- lending/install.py | 6 + .../loan_management/doctype/loan/loan.json | 1023 ++++++++--------- lending/loan_management/doctype/loan/loan.py | 17 +- .../loan_repayment_schedule.json | 10 +- .../loan_repayment_schedule.py | 8 +- .../doctype/loan_type/loan_type.json | 17 +- .../workspace/loans/loans.json | 11 +- lending/patches.txt | 3 +- .../v15_0/create_custom_field_for_bpi.py | 21 + 9 files changed, 591 insertions(+), 525 deletions(-) create mode 100644 lending/patches/v15_0/create_custom_field_for_bpi.py diff --git a/lending/install.py b/lending/install.py index 2ba49af1..48780ae3 100644 --- a/lending/install.py +++ b/lending/install.py @@ -46,6 +46,12 @@ "options": "Actual/365\nActual/Actual\n30/365\n30/360\nActual/360", "insert_after": "watch_period_post_loan_restructure_in_days", }, + { + "fieldname": "min_bpi_application_days", + "label": "Minimum Days for Broken Period Interest Application", + "fieldtype": "Int", + "insert_after": "interest_day_count_convention", + }, { "fieldname": "loan_column_break", "fieldtype": "Column Break", diff --git a/lending/loan_management/doctype/loan/loan.json b/lending/loan_management/doctype/loan/loan.json index 63bc6302..2d4af97e 100644 --- a/lending/loan_management/doctype/loan/loan.json +++ b/lending/loan_management/doctype/loan/loan.json @@ -1,514 +1,513 @@ { -"actions": [], -"allow_import": 1, -"autoname": "ACC-LOAN-.YYYY.-.#####", -"creation": "2022-01-25 10:30:02.294967", -"doctype": "DocType", -"document_type": "Document", -"editable_grid": 1, -"engine": "InnoDB", -"field_order": [ - "applicant_type", - "applicant", - "applicant_name", - "loan_application", - "branch", - "column_break_3", - "company", - "posting_date", - "status", - "section_break_8", - "loan_type", - "repayment_schedule_type", - "loan_amount", - "rate_of_interest", - "is_secured_loan", - "disbursement_date", - "closure_date", - "disbursed_amount", - "column_break_11", - "maximum_loan_amount", - "repayment_method", - "repayment_periods", - "monthly_repayment_amount", - "repayment_start_date", - "is_term_loan", - "loan_asset_classification_details_section", - "days_past_due", - "asset_classification_code", - "asset_classification_name", - "column_break_zpe2", - "loan_restructure_count", - "watch_period_end_date", - "tenure_post_restructure", - "accounting_dimensions_section", - "cost_center", - "account_info", - "mode_of_payment", - "disbursement_account", - "payment_account", - "column_break_9", - "loan_account", - "interest_income_account", - "penalty_income_account", - "section_break_17", - "total_payment", - "total_principal_paid", - "written_off_amount", - "refund_amount", - "debit_adjustment_amount", - "credit_adjustment_amount", - "column_break_19", - "total_interest_payable", - "total_amount_paid", - "is_npa", - "manual_npa", - "amended_from" -], -"fields": [ - { - "fieldname": "applicant_type", - "fieldtype": "Select", - "label": "Applicant Type", - "options": "Employee\nMember\nCustomer", - "reqd": 1 - }, - { - "fieldname": "applicant", - "fieldtype": "Dynamic Link", - "in_standard_filter": 1, - "label": "Applicant", - "options": "applicant_type", - "reqd": 1 - }, - { - "fieldname": "applicant_name", - "fieldtype": "Data", - "in_global_search": 1, - "label": "Applicant Name", - "read_only": 1 - }, - { - "fieldname": "loan_application", - "fieldtype": "Link", - "label": "Loan Application", - "no_copy": 1, - "options": "Loan Application" - }, - { - "fieldname": "loan_type", - "fieldtype": "Link", - "in_list_view": 1, - "in_standard_filter": 1, - "label": "Loan Type", - "options": "Loan Type", - "reqd": 1 - }, - { - "fieldname": "column_break_3", - "fieldtype": "Column Break" - }, - { - "default": "Today", - "fieldname": "posting_date", - "fieldtype": "Date", - "in_list_view": 1, - "label": "Posting Date", - "no_copy": 1, - "reqd": 1 - }, - { - "fieldname": "company", - "fieldtype": "Link", - "in_standard_filter": 1, - "label": "Company", - "options": "Company", - "remember_last_selected_value": 1, - "reqd": 1 - }, - { - "default": "Sanctioned", - "fieldname": "status", - "fieldtype": "Select", - "in_standard_filter": 1, - "label": "Status", - "no_copy": 1, - "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", - "read_only": 1 - }, - { - "fieldname": "section_break_8", - "fieldtype": "Section Break", - "label": "Loan Details" - }, - { - "fieldname": "loan_amount", - "fieldtype": "Currency", - "label": "Loan Amount", - "non_negative": 1, - "options": "Company:company:default_currency" - }, - { - "fetch_from": "loan_type.rate_of_interest", - "fieldname": "rate_of_interest", - "fieldtype": "Percent", - "label": "Rate of Interest (%) / Year", - "read_only": 1, - "reqd": 1 - }, - { - "depends_on": "eval:doc.status==\"Disbursed\"", - "fieldname": "disbursement_date", - "fieldtype": "Date", - "label": "Disbursement Date", - "no_copy": 1 - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_start_date", - "fieldtype": "Date", - "label": "Repayment Start Date", - "mandatory_depends_on": "is_term_loan" - }, - { - "fieldname": "column_break_11", - "fieldtype": "Column Break" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_method", - "fieldtype": "Select", - "label": "Repayment Method", - "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" - }, - { - "depends_on": "is_term_loan", - "fieldname": "repayment_periods", - "fieldtype": "Int", - "label": "Repayment Period in Months" - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_application.repayment_amount", - "fetch_if_empty": 1, - "fieldname": "monthly_repayment_amount", - "fieldtype": "Currency", - "label": "Monthly Repayment Amount", - "options": "Company:company:default_currency" - }, - { - "collapsible": 1, - "fieldname": "account_info", - "fieldtype": "Section Break", - "label": "Account Info" - }, - { - "fetch_from": "loan_type.mode_of_payment", - "fieldname": "mode_of_payment", - "fieldtype": "Link", - "label": "Mode of Payment", - "options": "Mode of Payment", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.payment_account", - "fieldname": "payment_account", - "fieldtype": "Link", - "label": "Payment Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "column_break_9", - "fieldtype": "Column Break" - }, - { - "fetch_from": "loan_type.loan_account", - "fieldname": "loan_account", - "fieldtype": "Link", - "label": "Loan Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fetch_from": "loan_type.interest_income_account", - "fieldname": "interest_income_account", - "fieldtype": "Link", - "label": "Interest Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "section_break_17", - "fieldtype": "Section Break", - "label": "Totals" - }, - { - "default": "0", - "fieldname": "total_payment", - "fieldtype": "Currency", - "label": "Total Payable Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "column_break_19", - "fieldtype": "Column Break" - }, - { - "default": "0", - "depends_on": "is_term_loan", - "fieldname": "total_interest_payable", - "fieldtype": "Currency", - "label": "Total Interest Payable", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "fieldname": "total_amount_paid", - "fieldtype": "Currency", - "label": "Total Amount Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "amended_from", - "fieldtype": "Link", - "label": "Amended From", - "no_copy": 1, - "options": "Loan", - "print_hide": 1, - "read_only": 1 - }, - { - "default": "0", - "fieldname": "is_secured_loan", - "fieldtype": "Check", - "label": "Is Secured Loan" - }, - { - "default": "0", - "fetch_from": "loan_type.is_term_loan", - "fieldname": "is_term_loan", - "fieldtype": "Check", - "label": "Is Term Loan", - "read_only": 1 - }, - { - "fetch_from": "loan_type.penalty_income_account", - "fieldname": "penalty_income_account", - "fieldtype": "Link", - "label": "Penalty Income Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "total_principal_paid", - "fieldtype": "Currency", - "label": "Total Principal Paid", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "disbursed_amount", - "fieldtype": "Currency", - "label": "Disbursed Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "depends_on": "eval:doc.is_secured_loan", - "fieldname": "maximum_loan_amount", - "fieldtype": "Currency", - "label": "Maximum Loan Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "written_off_amount", - "fieldtype": "Currency", - "label": "Written Off Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "closure_date", - "fieldtype": "Date", - "label": "Closure Date", - "read_only": 1 - }, - { - "fetch_from": "loan_type.disbursement_account", - "fieldname": "disbursement_account", - "fieldtype": "Link", - "label": "Disbursement Account", - "options": "Account", - "read_only": 1, - "reqd": 1 - }, - { - "fieldname": "accounting_dimensions_section", - "fieldtype": "Section Break", - "label": "Accounting Dimensions" - }, - { - "fieldname": "cost_center", - "fieldtype": "Link", - "label": "Cost Center", - "options": "Cost Center" - }, - { - "fieldname": "refund_amount", - "fieldtype": "Currency", - "label": "Refund amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "credit_adjustment_amount", - "fieldtype": "Currency", - "label": "Credit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "fieldname": "debit_adjustment_amount", - "fieldtype": "Currency", - "label": "Debit Adjustment Amount", - "no_copy": 1, - "options": "Company:company:default_currency", - "read_only": 1 - }, - { - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Loan is a Non Performing Asset", - "fieldname": "is_npa", - "fieldtype": "Check", - "label": "Is NPA", - "read_only": 1 - }, - { - "depends_on": "is_term_loan", - "fetch_from": "loan_type.repayment_schedule_type", - "fieldname": "repayment_schedule_type", - "fieldtype": "Data", - "label": "Repayment Schedule Type", - "read_only": 1 - }, - { - "fieldname": "days_past_due", - "fieldtype": "Int", - "label": "Days Past Due", - "read_only": 1 - }, - { - "allow_on_submit": 1, - "default": "0", - "depends_on": "eval:doc.docstatus == 1", - "description": "Manually marked as NPA", - "fieldname": "manual_npa", - "fieldtype": "Check", - "label": "Manual NPA" - }, - { - "fieldname": "asset_classification_code", - "fieldtype": "Select", - "label": "Asset Classification Code", - "no_copy": 1, - "options": "\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3", - "read_only": 1 - }, - { - "fieldname": "asset_classification_name", - "fieldtype": "Select", - "label": "Asset Classification Name", - "no_copy": 1, - "options": "\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset", - "read_only": 1 - }, - { - "fieldname": "branch", - "fieldtype": "Link", - "label": "Branch", - "options": "Branch" - }, - { - "fieldname": "loan_restructure_count", - "fieldtype": "Int", - "label": "Loan Restructure Count", - "read_only": 1 - }, - { - "fieldname": "loan_asset_classification_details_section", - "fieldtype": "Section Break", - "label": "Loan Asset Classification Details" - }, - { - "fieldname": "column_break_zpe2", - "fieldtype": "Column Break" - }, - { - "fieldname": "watch_period_end_date", - "fieldtype": "Date", - "label": "Watch Period End Date", - "read_only": 1 - }, - { - "fieldname": "tenure_post_restructure", - "fieldtype": "Int", - "label": "Tenure Post Restructure", - "read_only": 1 - } -], -"index_web_pages_for_search": 1, -"is_submittable": 1, -"links": [], -"modified": "2023-05-29 18:12:28.333911", -"modified_by": "Administrator", -"module": "Loan Management", -"name": "Loan", -"naming_rule": "Expression (old style)", -"owner": "Administrator", -"permissions": [ - { - "amend": 1, - "cancel": 1, - "create": 1, - "delete": 1, - "email": 1, - "export": 1, - "print": 1, - "read": 1, - "report": 1, - "role": "Loan Manager", - "share": 1, - "submit": 1, - "write": 1 - }, - { - "read": 1, - "role": "Employee" - } -], -"search_fields": "posting_date", -"sort_field": "creation", -"sort_order": "DESC", -"states": [], -"track_changes": 1 + "actions": [], + "allow_import": 1, + "autoname": "ACC-LOAN-.YYYY.-.#####", + "creation": "2022-01-25 10:30:02.294967", + "doctype": "DocType", + "document_type": "Document", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "applicant_type", + "applicant", + "applicant_name", + "loan_application", + "branch", + "column_break_3", + "company", + "posting_date", + "status", + "section_break_8", + "loan_type", + "repayment_schedule_type", + "loan_amount", + "rate_of_interest", + "is_secured_loan", + "disbursement_date", + "closure_date", + "disbursed_amount", + "column_break_11", + "maximum_loan_amount", + "repayment_method", + "repayment_periods", + "monthly_repayment_amount", + "repayment_start_date", + "is_term_loan", + "loan_asset_classification_details_section", + "days_past_due", + "asset_classification_code", + "asset_classification_name", + "column_break_zpe2", + "loan_restructure_count", + "watch_period_end_date", + "tenure_post_restructure", + "accounting_dimensions_section", + "cost_center", + "account_info", + "mode_of_payment", + "disbursement_account", + "payment_account", + "column_break_9", + "loan_account", + "interest_income_account", + "penalty_income_account", + "section_break_17", + "total_payment", + "total_principal_paid", + "written_off_amount", + "refund_amount", + "debit_adjustment_amount", + "credit_adjustment_amount", + "column_break_19", + "total_interest_payable", + "total_amount_paid", + "is_npa", + "manual_npa", + "amended_from" + ], + "fields": [ + { + "fieldname": "applicant_type", + "fieldtype": "Select", + "label": "Applicant Type", + "options": "Employee\nMember\nCustomer", + "reqd": 1 + }, + { + "fieldname": "applicant", + "fieldtype": "Dynamic Link", + "in_standard_filter": 1, + "label": "Applicant", + "options": "applicant_type", + "reqd": 1 + }, + { + "fieldname": "applicant_name", + "fieldtype": "Data", + "in_global_search": 1, + "label": "Applicant Name", + "read_only": 1 + }, + { + "fieldname": "loan_application", + "fieldtype": "Link", + "label": "Loan Application", + "no_copy": 1, + "options": "Loan Application" + }, + { + "fieldname": "loan_type", + "fieldtype": "Link", + "in_list_view": 1, + "in_standard_filter": 1, + "label": "Loan Type", + "options": "Loan Type", + "reqd": 1 + }, + { + "fieldname": "column_break_3", + "fieldtype": "Column Break" + }, + { + "default": "Today", + "fieldname": "posting_date", + "fieldtype": "Date", + "in_list_view": 1, + "label": "Posting Date", + "no_copy": 1, + "reqd": 1 + }, + { + "fieldname": "company", + "fieldtype": "Link", + "in_standard_filter": 1, + "label": "Company", + "options": "Company", + "remember_last_selected_value": 1, + "reqd": 1 + }, + { + "default": "Sanctioned", + "fieldname": "status", + "fieldtype": "Select", + "in_standard_filter": 1, + "label": "Status", + "no_copy": 1, + "options": "Sanctioned\nPartially Disbursed\nDisbursed\nLoan Closure Requested\nClosed", + "read_only": 1 + }, + { + "fieldname": "section_break_8", + "fieldtype": "Section Break", + "label": "Loan Details" + }, + { + "fieldname": "loan_amount", + "fieldtype": "Currency", + "label": "Loan Amount", + "non_negative": 1, + "options": "Company:company:default_currency" + }, + { + "fetch_from": "loan_type.rate_of_interest", + "fieldname": "rate_of_interest", + "fieldtype": "Percent", + "label": "Rate of Interest (%) / Year", + "read_only": 1, + "reqd": 1 + }, + { + "depends_on": "eval:doc.status==\"Disbursed\"", + "fieldname": "disbursement_date", + "fieldtype": "Date", + "label": "Disbursement Date", + "no_copy": 1 + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_start_date", + "fieldtype": "Date", + "label": "Repayment Start Date" + }, + { + "fieldname": "column_break_11", + "fieldtype": "Column Break" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_method", + "fieldtype": "Select", + "label": "Repayment Method", + "options": "\nRepay Fixed Amount per Period\nRepay Over Number of Periods" + }, + { + "depends_on": "is_term_loan", + "fieldname": "repayment_periods", + "fieldtype": "Int", + "label": "Repayment Period in Months" + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_application.repayment_amount", + "fetch_if_empty": 1, + "fieldname": "monthly_repayment_amount", + "fieldtype": "Currency", + "label": "Monthly Repayment Amount", + "options": "Company:company:default_currency" + }, + { + "collapsible": 1, + "fieldname": "account_info", + "fieldtype": "Section Break", + "label": "Account Info" + }, + { + "fetch_from": "loan_type.mode_of_payment", + "fieldname": "mode_of_payment", + "fieldtype": "Link", + "label": "Mode of Payment", + "options": "Mode of Payment", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.payment_account", + "fieldname": "payment_account", + "fieldtype": "Link", + "label": "Payment Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "column_break_9", + "fieldtype": "Column Break" + }, + { + "fetch_from": "loan_type.loan_account", + "fieldname": "loan_account", + "fieldtype": "Link", + "label": "Loan Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fetch_from": "loan_type.interest_income_account", + "fieldname": "interest_income_account", + "fieldtype": "Link", + "label": "Interest Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "section_break_17", + "fieldtype": "Section Break", + "label": "Totals" + }, + { + "default": "0", + "fieldname": "total_payment", + "fieldtype": "Currency", + "label": "Total Payable Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "column_break_19", + "fieldtype": "Column Break" + }, + { + "default": "0", + "depends_on": "is_term_loan", + "fieldname": "total_interest_payable", + "fieldtype": "Currency", + "label": "Total Interest Payable", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "fieldname": "total_amount_paid", + "fieldtype": "Currency", + "label": "Total Amount Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "amended_from", + "fieldtype": "Link", + "label": "Amended From", + "no_copy": 1, + "options": "Loan", + "print_hide": 1, + "read_only": 1 + }, + { + "default": "0", + "fieldname": "is_secured_loan", + "fieldtype": "Check", + "label": "Is Secured Loan" + }, + { + "default": "0", + "fetch_from": "loan_type.is_term_loan", + "fieldname": "is_term_loan", + "fieldtype": "Check", + "label": "Is Term Loan", + "read_only": 1 + }, + { + "fetch_from": "loan_type.penalty_income_account", + "fieldname": "penalty_income_account", + "fieldtype": "Link", + "label": "Penalty Income Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "total_principal_paid", + "fieldtype": "Currency", + "label": "Total Principal Paid", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "disbursed_amount", + "fieldtype": "Currency", + "label": "Disbursed Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "depends_on": "eval:doc.is_secured_loan", + "fieldname": "maximum_loan_amount", + "fieldtype": "Currency", + "label": "Maximum Loan Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "written_off_amount", + "fieldtype": "Currency", + "label": "Written Off Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "closure_date", + "fieldtype": "Date", + "label": "Closure Date", + "read_only": 1 + }, + { + "fetch_from": "loan_type.disbursement_account", + "fieldname": "disbursement_account", + "fieldtype": "Link", + "label": "Disbursement Account", + "options": "Account", + "read_only": 1, + "reqd": 1 + }, + { + "fieldname": "accounting_dimensions_section", + "fieldtype": "Section Break", + "label": "Accounting Dimensions" + }, + { + "fieldname": "cost_center", + "fieldtype": "Link", + "label": "Cost Center", + "options": "Cost Center" + }, + { + "fieldname": "refund_amount", + "fieldtype": "Currency", + "label": "Refund amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "credit_adjustment_amount", + "fieldtype": "Currency", + "label": "Credit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "fieldname": "debit_adjustment_amount", + "fieldtype": "Currency", + "label": "Debit Adjustment Amount", + "no_copy": 1, + "options": "Company:company:default_currency", + "read_only": 1 + }, + { + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Loan is a Non Performing Asset", + "fieldname": "is_npa", + "fieldtype": "Check", + "label": "Is NPA", + "read_only": 1 + }, + { + "depends_on": "is_term_loan", + "fetch_from": "loan_type.repayment_schedule_type", + "fieldname": "repayment_schedule_type", + "fieldtype": "Data", + "label": "Repayment Schedule Type", + "read_only": 1 + }, + { + "fieldname": "days_past_due", + "fieldtype": "Int", + "label": "Days Past Due", + "read_only": 1 + }, + { + "allow_on_submit": 1, + "default": "0", + "depends_on": "eval:doc.docstatus == 1", + "description": "Manually marked as NPA", + "fieldname": "manual_npa", + "fieldtype": "Check", + "label": "Manual NPA" + }, + { + "fieldname": "asset_classification_code", + "fieldtype": "Select", + "label": "Asset Classification Code", + "no_copy": 1, + "options": "\nSMA-0\nSMA-1\nSMA-2\nD1\nD2\nD3", + "read_only": 1 + }, + { + "fieldname": "asset_classification_name", + "fieldtype": "Select", + "label": "Asset Classification Name", + "no_copy": 1, + "options": "\nSpecial Mention Account - 0\nSpecial Mention Account - 1\nSpecial Mention Account - 2\nSubstandard Asset\nDoubtful Asset\nLoss Asset", + "read_only": 1 + }, + { + "fieldname": "branch", + "fieldtype": "Link", + "label": "Branch", + "options": "Branch" + }, + { + "fieldname": "loan_restructure_count", + "fieldtype": "Int", + "label": "Loan Restructure Count", + "read_only": 1 + }, + { + "fieldname": "loan_asset_classification_details_section", + "fieldtype": "Section Break", + "label": "Loan Asset Classification Details" + }, + { + "fieldname": "column_break_zpe2", + "fieldtype": "Column Break" + }, + { + "fieldname": "watch_period_end_date", + "fieldtype": "Date", + "label": "Watch Period End Date", + "read_only": 1 + }, + { + "fieldname": "tenure_post_restructure", + "fieldtype": "Int", + "label": "Tenure Post Restructure", + "read_only": 1 + } + ], + "index_web_pages_for_search": 1, + "is_submittable": 1, + "links": [], + "modified": "2023-09-21 14:47:03.263549", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan", + "naming_rule": "Expression (old style)", + "owner": "Administrator", + "permissions": [ + { + "amend": 1, + "cancel": 1, + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "submit": 1, + "write": 1 + }, + { + "read": 1, + "role": "Employee" + } + ], + "search_fields": "posting_date", + "sort_field": "creation", + "sort_order": "DESC", + "states": [], + "track_changes": 1 } \ No newline at end of file diff --git a/lending/loan_management/doctype/loan/loan.py b/lending/loan_management/doctype/loan/loan.py index 88d10804..a704d1ca 100644 --- a/lending/loan_management/doctype/loan/loan.py +++ b/lending/loan_management/doctype/loan/loan.py @@ -7,7 +7,7 @@ import frappe from frappe import _ from frappe.query_builder import Order -from frappe.utils import date_diff, flt, getdate, now_datetime, nowdate +from frappe.utils import add_days, date_diff, flt, get_last_day, getdate, now_datetime, nowdate import erpnext from erpnext.accounts.doctype.journal_entry.journal_entry import get_payment_entry @@ -26,6 +26,8 @@ def validate(self): self.validate_cost_center() self.validate_accounts() self.check_sanctioned_amount_limit() + self.set_cyclic_date() + if self.is_term_loan and not self.is_new(): self.update_draft_schedule() @@ -60,6 +62,19 @@ def validate_cost_center(self): if not self.cost_center: frappe.throw(_("Cost center is mandatory for loans having rate of interest greater than 0")) + def set_cyclic_date(self): + if self.repayment_schedule_type == "Monthly as per cycle date": + cycle_day = frappe.db.get_value("Loan Type", self.loan_type, "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) + + broken_period_limit = frappe.db.get_value("Company", self.company, "min_bpi_application_days") + broken_period_days = date_diff(cyclic_date, self.posting_date) + if broken_period_days < broken_period_limit: + cyclic_date = add_days(get_last_day(cyclic_date), cycle_day) + + self.repayment_start_date = cyclic_date + def on_submit(self): self.link_loan_security_pledge() # Interest accrual for backdated term loans diff --git a/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.json b/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.json index 5b9977c2..dd4e856e 100644 --- a/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.json +++ b/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.json @@ -8,6 +8,7 @@ "engine": "InnoDB", "field_order": [ "loan", + "company", "loan_restructure", "loan_amount", "rate_of_interest", @@ -135,12 +136,19 @@ "fieldtype": "Currency", "label": "Adjusted Interest", "options": "Company:company:default_currency" + }, + { + "fetch_from": "loan.company", + "fieldname": "company", + "fieldtype": "Link", + "label": "Company", + "options": "Company" } ], "index_web_pages_for_search": 1, "is_submittable": 1, "links": [], - "modified": "2023-08-13 12:45:03.247814", + "modified": "2023-09-21 15:00:31.576439", "modified_by": "Administrator", "module": "Loan Management", "name": "Loan Repayment Schedule", diff --git a/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.py b/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.py index 4bf307b3..13e4f727 100644 --- a/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.py +++ b/lending/loan_management/doctype/loan_repayment_schedule/loan_repayment_schedule.py @@ -38,7 +38,7 @@ def make_repayment_schedule(self): self.repayment_schedule = [] payment_date = self.repayment_start_date balance_amount = self.loan_amount - bmi_days = date_diff(add_months(payment_date, -1), self.posting_date) + 1 + broken_period_interest_days = date_diff(add_months(payment_date, -1), self.posting_date) carry_forward_interest = self.adjusted_interest while balance_amount > 0: @@ -47,7 +47,7 @@ def make_repayment_schedule(self): balance_amount, schedule_type_details.repayment_schedule_type, schedule_type_details.repayment_date_on, - bmi_days, + broken_period_interest_days, carry_forward_interest, ) @@ -114,6 +114,10 @@ def get_amounts( if schedule_type == "Monthly as per cycle date": days = date_diff(payment_date, add_months(payment_date, -1)) + if additional_days < 0: + days = date_diff(self.repayment_start_date, self.posting_date) + additional_days = 0 + months = 365 if additional_days: days += additional_days diff --git a/lending/loan_management/doctype/loan_type/loan_type.json b/lending/loan_management/doctype/loan_type/loan_type.json index e2c77a6d..68577441 100644 --- a/lending/loan_management/doctype/loan_type/loan_type.json +++ b/lending/loan_management/doctype/loan_type/loan_type.json @@ -17,6 +17,7 @@ "is_term_loan", "disabled", "repayment_schedule_type", + "cyclic_day_of_the_month", "repayment_date_on", "days_past_due_threshold_for_npa", "description", @@ -295,11 +296,19 @@ "fieldtype": "Link", "label": "Charges Waiver Item", "options": "Item" + }, + { + "depends_on": "eval:doc.repayment_schedule_type == \"Monthly as per cycle date\"", + "description": "Day of every month on which the repayment date is considered", + "fieldname": "cyclic_day_of_the_month", + "fieldtype": "Int", + "label": "Cyclic Day Of the Month", + "mandatory_depends_on": "eval:doc.repayment_schedule_type == \"Monthly as per cycle date\"" } ], "index_web_pages_for_search": 1, "links": [], - "modified": "2023-09-10 19:37:44.490880", + "modified": "2023-09-21 11:51:37.789220", "modified_by": "Administrator", "module": "Loan Management", "name": "Loan Type", @@ -314,13 +323,9 @@ "print": 1, "read": 1, "report": 1, - "role": "Loan Manager", + "role": "System Manager", "share": 1, "write": 1 - }, - { - "read": 1, - "role": "Employee" } ], "sort_field": "modified", diff --git a/lending/loan_management/workspace/loans/loans.json b/lending/loan_management/workspace/loans/loans.json index c25f4d35..87360c61 100644 --- a/lending/loan_management/workspace/loans/loans.json +++ b/lending/loan_management/workspace/loans/loans.json @@ -1,6 +1,6 @@ { "charts": [], - "content": "[{\"id\":\"_38WStznya\",\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\",\"col\":12}},{\"id\":\"t7o_K__1jB\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan Application\",\"col\":3}},{\"id\":\"IRiNDC6w1p\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan\",\"col\":3}},{\"id\":\"xbbo0FYbq0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"id\":\"7ZL4Bro-Vi\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"yhyioTViZ3\",\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters\",\"col\":12}},{\"id\":\"oYFn4b1kSw\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan\",\"col\":4}},{\"id\":\"vZepJF5tl9\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Processes\",\"col\":4}},{\"id\":\"k-393Mjhqe\",\"type\":\"card\",\"data\":{\"card_name\":\"Disbursement and Repayment\",\"col\":4}},{\"id\":\"6crJ0DBiBJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Security\",\"col\":4}},{\"id\":\"Um5YwxVLRJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}}]", + "content": "[{\"id\":\"_38WStznya\",\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\",\"col\":12}},{\"id\":\"FnMXBOAVyS\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Company\",\"col\":3}},{\"id\":\"t7o_K__1jB\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan Application\",\"col\":3}},{\"id\":\"IRiNDC6w1p\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan\",\"col\":3}},{\"id\":\"xbbo0FYbq0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"id\":\"7ZL4Bro-Vi\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"yhyioTViZ3\",\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters\",\"col\":12}},{\"id\":\"oYFn4b1kSw\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan\",\"col\":4}},{\"id\":\"vZepJF5tl9\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Processes\",\"col\":4}},{\"id\":\"k-393Mjhqe\",\"type\":\"card\",\"data\":{\"card_name\":\"Disbursement and Repayment\",\"col\":4}},{\"id\":\"6crJ0DBiBJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Security\",\"col\":4}},{\"id\":\"Um5YwxVLRJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}}]", "creation": "2020-03-12 16:35:55.299820", "custom_blocks": [], "docstatus": 0, @@ -280,7 +280,7 @@ "type": "Link" } ], - "modified": "2023-05-24 14:47:24.109945", + "modified": "2023-09-21 16:15:47.565648", "modified_by": "Administrator", "module": "Loan Management", "name": "Loans", @@ -293,6 +293,13 @@ "roles": [], "sequence_id": 15.0, "shortcuts": [ + { + "color": "Grey", + "doc_view": "List", + "label": "Company", + "link_to": "Company", + "type": "DocType" + }, { "color": "Green", "format": "{} Open", diff --git a/lending/patches.txt b/lending/patches.txt index a7bd093c..1c1b12b9 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -10,4 +10,5 @@ lending.patches.v15_0.update_loan_types lending.patches.v15_0.create_custom_fields #6 lending.patches.v15_0.make_loan_type_non_submittable lending.patches.v15_0.update_custom_fields_for_company_tab -lending.patches.v15_0.create_custom_field_for_interest_day_count_convention \ No newline at end of file +lending.patches.v15_0.create_custom_field_for_interest_day_count_convention +lending.patches.v15_0.create_custom_field_for_bpi \ No newline at end of file diff --git a/lending/patches/v15_0/create_custom_field_for_bpi.py b/lending/patches/v15_0/create_custom_field_for_bpi.py new file mode 100644 index 00000000..1db55a20 --- /dev/null +++ b/lending/patches/v15_0/create_custom_field_for_bpi.py @@ -0,0 +1,21 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + create_custom_fields( + { + "Company": [ + { + "fieldname": "min_bpi_application_days", + "label": "Minimum Days for Broken Period Interest Application", + "fieldtype": "Int", + "insert_after": "interest_day_count_convention", + }, + ] + }, + ignore_validate=True, + ) From c3fd8f2d0fa9923635c4bcd5ad6b9255a5bca172 Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 22 Sep 2023 16:03:03 +0530 Subject: [PATCH 20/23] chore: Typo fixes --- lending/install.py | 2 +- .../workspace/loans/loans.json | 22 +++++++++++++++++-- lending/patches.txt | 6 ++--- ...ld_for_irac_provisioning_configuration.py} | 0 4 files changed, 24 insertions(+), 6 deletions(-) rename lending/patches/v15_0/{create_custom_field_for_irac_provisioning_configuraton.py => create_custom_field_for_irac_provisioning_configuration.py} (100%) diff --git a/lending/install.py b/lending/install.py index 08f631cf..64f6b5c0 100644 --- a/lending/install.py +++ b/lending/install.py @@ -55,7 +55,7 @@ { "fieldname": "loan_column_break", "fieldtype": "Column Break", - "insert_after": "interest_day_count_convention", + "insert_after": "min_bpi_application_days", }, { "fieldname": "collection_offset_logic_based_on", diff --git a/lending/loan_management/workspace/loans/loans.json b/lending/loan_management/workspace/loans/loans.json index 87360c61..e9cdbbf8 100644 --- a/lending/loan_management/workspace/loans/loans.json +++ b/lending/loan_management/workspace/loans/loans.json @@ -1,6 +1,6 @@ { "charts": [], - "content": "[{\"id\":\"_38WStznya\",\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\",\"col\":12}},{\"id\":\"FnMXBOAVyS\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Company\",\"col\":3}},{\"id\":\"t7o_K__1jB\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan Application\",\"col\":3}},{\"id\":\"IRiNDC6w1p\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan\",\"col\":3}},{\"id\":\"xbbo0FYbq0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"id\":\"7ZL4Bro-Vi\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"yhyioTViZ3\",\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters\",\"col\":12}},{\"id\":\"oYFn4b1kSw\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan\",\"col\":4}},{\"id\":\"vZepJF5tl9\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Processes\",\"col\":4}},{\"id\":\"k-393Mjhqe\",\"type\":\"card\",\"data\":{\"card_name\":\"Disbursement and Repayment\",\"col\":4}},{\"id\":\"6crJ0DBiBJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Security\",\"col\":4}},{\"id\":\"Um5YwxVLRJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}}]", + "content": "[{\"id\":\"_38WStznya\",\"type\":\"header\",\"data\":{\"text\":\"Your Shortcuts\",\"col\":12}},{\"id\":\"FnMXBOAVyS\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Company\",\"col\":3}},{\"id\":\"t7o_K__1jB\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan Application\",\"col\":3}},{\"id\":\"IRiNDC6w1p\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Loan\",\"col\":3}},{\"id\":\"xbbo0FYbq0\",\"type\":\"shortcut\",\"data\":{\"shortcut_name\":\"Dashboard\",\"col\":3}},{\"id\":\"7ZL4Bro-Vi\",\"type\":\"spacer\",\"data\":{\"col\":12}},{\"id\":\"yhyioTViZ3\",\"type\":\"header\",\"data\":{\"text\":\"Reports & Masters\",\"col\":12}},{\"id\":\"oYFn4b1kSw\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan\",\"col\":4}},{\"id\":\"vZepJF5tl9\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Processes\",\"col\":4}},{\"id\":\"k-393Mjhqe\",\"type\":\"card\",\"data\":{\"card_name\":\"Disbursement and Repayment\",\"col\":4}},{\"id\":\"6crJ0DBiBJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Security\",\"col\":4}},{\"id\":\"Um5YwxVLRJ\",\"type\":\"card\",\"data\":{\"card_name\":\"Reports\",\"col\":4}},{\"id\":\"cC9JraXgnP\",\"type\":\"card\",\"data\":{\"card_name\":\"Loan Classification\",\"col\":4}}]", "creation": "2020-03-12 16:35:55.299820", "custom_blocks": [], "docstatus": 0, @@ -278,9 +278,27 @@ "link_type": "Report", "onboard": 0, "type": "Link" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Loan Classification", + "link_count": 1, + "onboard": 0, + "type": "Card Break" + }, + { + "hidden": 0, + "is_query_report": 0, + "label": "Loan Classification", + "link_count": 0, + "link_to": "Loan Classification", + "link_type": "DocType", + "onboard": 0, + "type": "Link" } ], - "modified": "2023-09-21 16:15:47.565648", + "modified": "2023-09-22 09:04:39.751914", "modified_by": "Administrator", "module": "Loan Management", "name": "Loans", diff --git a/lending/patches.txt b/lending/patches.txt index 8b045f8f..e512fb71 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -9,12 +9,12 @@ lending.patches.v15_0.rename_process_asset_classification_doctype_2 # 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 #6 -lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuraton +lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuration #2 lending.patches.v15_0.update_loan_asset_classification_ranges lending.patches.v15_0.generate_loan_classifications_from_loan_asset_classification_ranges -lending.patches.v15_0.update_company_loan_asset_classification_ranges_table +lending.patches.v15_0.update_company_loan_asset_classification_ranges_table #2 lending.patches.v15_0.update_classification_fields_in_loan -lending.patches.v15_0.create_custom_field_for_collection_offset_sequence_for_written_off_asset +lending.patches.v15_0.create_custom_field_for_collection_offset_sequence_for_written_off_asset #2 lending.patches.v15_0.make_loan_type_non_submittable lending.patches.v15_0.update_custom_fields_for_company_tab lending.patches.v15_0.create_custom_field_for_interest_day_count_convention diff --git a/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py b/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py similarity index 100% rename from lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuraton.py rename to lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py From 4bd959acdc1e5852d386b836044fe3c709128f5a Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Fri, 22 Sep 2023 16:04:57 +0530 Subject: [PATCH 21/23] chore: don't rerun patches --- lending/patches.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lending/patches.txt b/lending/patches.txt index e512fb71..9bf08f7a 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -9,12 +9,12 @@ lending.patches.v15_0.rename_process_asset_classification_doctype_2 # 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 #6 -lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuration #2 +lending.patches.v15_0.create_custom_field_for_irac_provisioning_configuration lending.patches.v15_0.update_loan_asset_classification_ranges lending.patches.v15_0.generate_loan_classifications_from_loan_asset_classification_ranges -lending.patches.v15_0.update_company_loan_asset_classification_ranges_table #2 +lending.patches.v15_0.update_company_loan_asset_classification_ranges_table lending.patches.v15_0.update_classification_fields_in_loan -lending.patches.v15_0.create_custom_field_for_collection_offset_sequence_for_written_off_asset #2 +lending.patches.v15_0.create_custom_field_for_collection_offset_sequence_for_written_off_asset lending.patches.v15_0.make_loan_type_non_submittable lending.patches.v15_0.update_custom_fields_for_company_tab lending.patches.v15_0.create_custom_field_for_interest_day_count_convention From d7c42833b84ef621e61ab4a42291d38316c341aa Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Fri, 22 Sep 2023 17:09:17 +0530 Subject: [PATCH 22/23] fix: typo in irac_provisioning_configuraton and patch to update loan_column_break (#49) * chore: update_loan_column_break_due_to_bpi * chore: fix typo in irac_provisioning_configuraton --- lending/install.py | 6 +-- .../__init__.py | 0 ...loan_irac_provisioning_configuration.json} | 2 +- .../loan_irac_provisioning_configuration.py} | 2 +- lending/patches.txt | 2 + ...eld_for_irac_provisioning_configuration.py | 6 +-- ...typo_in_irac_provisioning_configuration.py | 40 +++++++++++++++++++ ..._loan_asset_classification_ranges_table.py | 2 +- .../update_loan_column_break_due_to_bpi.py | 11 +++++ .../templates/pages/__pycache__/__init__.py | 0 10 files changed, 62 insertions(+), 9 deletions(-) rename lending/loan_management/doctype/{loan_irac_provisioning_configuraton => loan_irac_provisioning_configuration}/__init__.py (100%) rename lending/loan_management/doctype/{loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json => loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.json} (96%) rename lending/loan_management/doctype/{loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py => loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.py} (78%) create mode 100644 lending/patches/v15_0/fix_typo_in_irac_provisioning_configuration.py create mode 100644 lending/patches/v15_0/update_loan_column_break_due_to_bpi.py create mode 100644 lending/templates/pages/__pycache__/__init__.py diff --git a/lending/install.py b/lending/install.py index 64f6b5c0..e94d19b5 100644 --- a/lending/install.py +++ b/lending/install.py @@ -104,10 +104,10 @@ "insert_after": "loan_section_break_2", }, { - "fieldname": "irac_provisioning_configuraton", - "label": "IRAC Provisioning Configuraton", + "fieldname": "irac_provisioning_configuration", + "label": "IRAC Provisioning Configuration", "fieldtype": "Table", - "options": "Loan IRAC Provisioning Configuraton", + "options": "Loan IRAC Provisioning Configuration", "insert_after": "loan_classification_ranges", }, ], diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/__init__.py b/lending/loan_management/doctype/loan_irac_provisioning_configuration/__init__.py similarity index 100% rename from lending/loan_management/doctype/loan_irac_provisioning_configuraton/__init__.py rename to lending/loan_management/doctype/loan_irac_provisioning_configuration/__init__.py diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json b/lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.json similarity index 96% rename from lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json rename to lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.json index acef8725..f5ce9181 100644 --- a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.json +++ b/lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.json @@ -67,7 +67,7 @@ "modified": "2023-09-13 21:39:55.163737", "modified_by": "Administrator", "module": "Loan Management", - "name": "Loan IRAC Provisioning Configuraton", + "name": "Loan IRAC Provisioning Configuration", "owner": "Administrator", "permissions": [], "sort_field": "modified", diff --git a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py b/lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.py similarity index 78% rename from lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py rename to lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.py index ef684409..fa5b2dce 100644 --- a/lending/loan_management/doctype/loan_irac_provisioning_configuraton/loan_irac_provisioning_configuraton.py +++ b/lending/loan_management/doctype/loan_irac_provisioning_configuration/loan_irac_provisioning_configuration.py @@ -5,5 +5,5 @@ from frappe.model.document import Document -class LoanIRACProvisioningConfiguraton(Document): +class LoanIRACProvisioningConfiguration(Document): pass diff --git a/lending/patches.txt b/lending/patches.txt index 9bf08f7a..61485c3e 100644 --- a/lending/patches.txt +++ b/lending/patches.txt @@ -19,3 +19,5 @@ lending.patches.v15_0.make_loan_type_non_submittable lending.patches.v15_0.update_custom_fields_for_company_tab lending.patches.v15_0.create_custom_field_for_interest_day_count_convention lending.patches.v15_0.create_custom_field_for_bpi +lending.patches.v15_0.update_loan_column_break_due_to_bpi +lending.patches.v15_0.fix_typo_in_irac_provisioning_configuration \ No newline at end of file diff --git a/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py b/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py index 68834c5c..66a3126b 100644 --- a/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py +++ b/lending/patches/v15_0/create_custom_field_for_irac_provisioning_configuration.py @@ -10,10 +10,10 @@ def execute(): { "Company": [ { - "fieldname": "irac_provisioning_configuraton", - "label": "IRAC Provisioning Configuraton", + "fieldname": "irac_provisioning_configuration", + "label": "IRAC Provisioning Configuration", "fieldtype": "Table", - "options": "Loan IRAC Provisioning Configuraton", + "options": "Loan IRAC Provisioning Configuration", "insert_after": "asset_classification_ranges", }, ] diff --git a/lending/patches/v15_0/fix_typo_in_irac_provisioning_configuration.py b/lending/patches/v15_0/fix_typo_in_irac_provisioning_configuration.py new file mode 100644 index 00000000..d3485dd1 --- /dev/null +++ b/lending/patches/v15_0/fix_typo_in_irac_provisioning_configuration.py @@ -0,0 +1,40 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + + +import frappe +from frappe.custom.doctype.custom_field.custom_field import create_custom_fields + + +def execute(): + if frappe.db.table_exists("Loan IRAC Provisioning Configuraton") and not frappe.db.table_exists( + "Loan IRAC Provisioning Configuration" + ): + frappe.rename_doc( + "DocType", + "Loan IRAC Provisioning Configuraton", + "Loan IRAC Provisioning Configuration", + force=True, + ) + frappe.reload_doc("loan_management", "doctype", "loan_irac_provisioning_configuration") + + if frappe.db.exists("Custom Field", "Company-irac_provisioning_configuraton"): + frappe.delete_doc("Custom Field", "Company-irac_provisioning_configuraton") + + create_custom_fields( + { + "Company": [ + { + "fieldname": "irac_provisioning_configuration", + "label": "IRAC Provisioning Configuration", + "fieldtype": "Table", + "options": "Loan IRAC Provisioning Configuration", + "insert_after": "loan_classification_ranges", + }, + ] + }, + ignore_validate=True, + ) + + ipc = frappe.qb.DocType("Loan IRAC Provisioning Configuration") + frappe.qb.update(ipc).set(ipc.parentfield, "irac_provisioning_configuration").run() diff --git a/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py b/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py index c590ed6b..5d29bcd7 100644 --- a/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py +++ b/lending/patches/v15_0/update_company_loan_asset_classification_ranges_table.py @@ -29,7 +29,7 @@ def execute(): frappe.db.set_value( "Custom Field", - {"name": "Company-irac_provisioning_configuraton"}, + {"name": "Company-irac_provisioning_configuration"}, "insert_after", "loan_classification_ranges", ) diff --git a/lending/patches/v15_0/update_loan_column_break_due_to_bpi.py b/lending/patches/v15_0/update_loan_column_break_due_to_bpi.py new file mode 100644 index 00000000..629c9de5 --- /dev/null +++ b/lending/patches/v15_0/update_loan_column_break_due_to_bpi.py @@ -0,0 +1,11 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# License: GNU General Public License v3. See license.txt + +import frappe + + +def execute(): + if frappe.db.exists("Custom Field", "Company-loan_column_break"): + frappe.db.set_value( + "Custom Field", "Company-loan_column_break", "insert_after", "min_bpi_application_days" + ) diff --git a/lending/templates/pages/__pycache__/__init__.py b/lending/templates/pages/__pycache__/__init__.py new file mode 100644 index 00000000..e69de29b From 14ea3e33c156b682ef96c55108796be2235bbbfa Mon Sep 17 00:00:00 2001 From: Anand Baburajan Date: Fri, 22 Sep 2023 19:41:43 +0530 Subject: [PATCH 23/23] feat: loan partner (#35) * feat: loan partner * chore: add addresses, loan types and motd charges * chore: single table for all charges, updated address and loan types * chore: rename partner_code and rename charges_shared table * chore: remove Loan Partner Address * chore: make loan partner beta --- .../doctype/loan_partner/__init__.py | 0 .../doctype/loan_partner/loan_partner.js | 23 +++ .../doctype/loan_partner/loan_partner.json | 168 ++++++++++++++++++ .../doctype/loan_partner/loan_partner.py | 13 ++ .../doctype/loan_partner/test_loan_partner.py | 9 + .../loan_partner_loan_type/__init__.py | 0 .../loan_partner_loan_type.json | 33 ++++ .../loan_partner_loan_type.py | 9 + .../__init__.py | 0 .../loan_partner_repayment_schedule_type.js | 8 + .../loan_partner_repayment_schedule_type.json | 48 +++++ .../loan_partner_repayment_schedule_type.py | 9 + ...st_loan_partner_repayment_schedule_type.py | 9 + .../loan_partner_shareable/__init__.py | 0 .../loan_partner_shareable.json | 71 ++++++++ .../loan_partner_shareable.py | 9 + 16 files changed, 409 insertions(+) create mode 100644 lending/loan_management/doctype/loan_partner/__init__.py create mode 100644 lending/loan_management/doctype/loan_partner/loan_partner.js create mode 100644 lending/loan_management/doctype/loan_partner/loan_partner.json create mode 100644 lending/loan_management/doctype/loan_partner/loan_partner.py create mode 100644 lending/loan_management/doctype/loan_partner/test_loan_partner.py create mode 100644 lending/loan_management/doctype/loan_partner_loan_type/__init__.py create mode 100644 lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.json create mode 100644 lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.py create mode 100644 lending/loan_management/doctype/loan_partner_repayment_schedule_type/__init__.py create mode 100644 lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.js create mode 100644 lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.json create mode 100644 lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.py create mode 100644 lending/loan_management/doctype/loan_partner_repayment_schedule_type/test_loan_partner_repayment_schedule_type.py create mode 100644 lending/loan_management/doctype/loan_partner_shareable/__init__.py create mode 100644 lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.json create mode 100644 lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.py diff --git a/lending/loan_management/doctype/loan_partner/__init__.py b/lending/loan_management/doctype/loan_partner/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_partner/loan_partner.js b/lending/loan_management/doctype/loan_partner/loan_partner.js new file mode 100644 index 00000000..fb46d8db --- /dev/null +++ b/lending/loan_management/doctype/loan_partner/loan_partner.js @@ -0,0 +1,23 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +frappe.ui.form.on("Loan Partner", { + setup: function(frm) { + frm.set_query('primary_address', function(doc) { + return { + filters: { + 'link_doctype': 'Loan Partner', + 'link_name': doc.name + } + } + }) + }, + + refresh: function(frm) { + if(!frm.doc.__islocal) { + frappe.contacts.render_address_and_contact(frm); + } else { + frappe.contacts.clear_address_and_contact(frm); + } + }, +}); diff --git a/lending/loan_management/doctype/loan_partner/loan_partner.json b/lending/loan_management/doctype/loan_partner/loan_partner.json new file mode 100644 index 00000000..7ddd83a4 --- /dev/null +++ b/lending/loan_management/doctype/loan_partner/loan_partner.json @@ -0,0 +1,168 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:partner_name", + "beta": 1, + "creation": "2023-09-18 19:55:37.996068", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "details_section", + "partner_name", + "effective_date", + "partner_loan_share_ratio", + "loan_partner_loan_type", + "column_break_yfag", + "repayment_schedule_type", + "company_loan_share_ratio", + "partner_interest_rate", + "section_break_mpap", + "column_break_gpwj", + "organization_type", + "primary_address", + "column_break_iwpj", + "address_html", + "section_break_lpnj", + "shareables" + ], + "fields": [ + { + "fieldname": "partner_loan_share_ratio", + "fieldtype": "Percent", + "label": "Partner Loan Share Ratio", + "reqd": 1 + }, + { + "fieldname": "column_break_yfag", + "fieldtype": "Column Break" + }, + { + "fieldname": "effective_date", + "fieldtype": "Date", + "label": "Effective Date", + "reqd": 1 + }, + { + "fieldname": "partner_interest_rate", + "fieldtype": "Percent", + "label": "Partner Interest Rate", + "reqd": 1 + }, + { + "fieldname": "repayment_schedule_type", + "fieldtype": "Link", + "label": "Repayment Schedule Type", + "options": "Loan Partner Repayment Schedule Type", + "reqd": 1 + }, + { + "fieldname": "section_break_lpnj", + "fieldtype": "Section Break", + "label": "Shareables" + }, + { + "fieldname": "company_loan_share_ratio", + "fieldtype": "Percent", + "label": "Company Loan Share Ratio" + }, + { + "fieldname": "organization_type", + "fieldtype": "Select", + "label": "Organization Type", + "options": "\nCentralized\nDecentralized" + }, + { + "depends_on": "eval:!doc.__islocal", + "fieldname": "section_break_mpap", + "fieldtype": "Section Break", + "label": "Organization" + }, + { + "fieldname": "loan_partner_loan_type", + "fieldtype": "Table MultiSelect", + "label": "Loan Types", + "options": "Loan Partner Loan Type", + "reqd": 1 + }, + { + "fieldname": "column_break_iwpj", + "fieldtype": "Column Break" + }, + { + "fieldname": "column_break_gpwj", + "fieldtype": "Column Break" + }, + { + "depends_on": "eval: !doc.__islocal", + "fieldname": "address_html", + "fieldtype": "HTML", + "label": "Address HTML", + "read_only": 1 + }, + { + "fieldname": "primary_address", + "fieldtype": "Link", + "label": "Primary Address", + "options": "Address" + }, + { + "fieldname": "details_section", + "fieldtype": "Section Break", + "label": "Details" + }, + { + "fieldname": "shareables", + "fieldtype": "Table", + "label": "Shareables", + "options": "Loan Partner Shareable" + }, + { + "fieldname": "partner_name", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Partner Name", + "reqd": 1, + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-09-22 19:23:46.967581", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Partner", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + }, + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "Loan Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [], + "track_changes": 1 +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_partner/loan_partner.py b/lending/loan_management/doctype/loan_partner/loan_partner.py new file mode 100644 index 00000000..32168e38 --- /dev/null +++ b/lending/loan_management/doctype/loan_partner/loan_partner.py @@ -0,0 +1,13 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +from frappe.contacts.address_and_contact import load_address_and_contact + +# import frappe +from frappe.model.document import Document + + +class LoanPartner(Document): + def onload(self): + """Load address and contacts in `__onload`""" + load_address_and_contact(self) diff --git a/lending/loan_management/doctype/loan_partner/test_loan_partner.py b/lending/loan_management/doctype/loan_partner/test_loan_partner.py new file mode 100644 index 00000000..e1263bf8 --- /dev/null +++ b/lending/loan_management/doctype/loan_partner/test_loan_partner.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestLoanPartner(FrappeTestCase): + pass diff --git a/lending/loan_management/doctype/loan_partner_loan_type/__init__.py b/lending/loan_management/doctype/loan_partner_loan_type/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.json b/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.json new file mode 100644 index 00000000..43d9ebee --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.json @@ -0,0 +1,33 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-09-19 17:42:23.096614", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "loan_type" + ], + "fields": [ + { + "fieldname": "loan_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Loan Type", + "options": "Loan Type", + "reqd": 1 + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-09-19 17:42:23.096614", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Partner Loan Type", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.py b/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.py new file mode 100644 index 00000000..41178feb --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_loan_type/loan_partner_loan_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LoanPartnerLoanType(Document): + pass diff --git a/lending/loan_management/doctype/loan_partner_repayment_schedule_type/__init__.py b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.js b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.js new file mode 100644 index 00000000..f6fdc0cc --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.js @@ -0,0 +1,8 @@ +// Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Loan Partner Repayment Schedule Type", { +// refresh(frm) { + +// }, +// }); diff --git a/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.json b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.json new file mode 100644 index 00000000..7a1cc18f --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.json @@ -0,0 +1,48 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "field:repayment_schedule_type", + "creation": "2023-09-20 23:46:13.366892", + "default_view": "List", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "repayment_schedule_type" + ], + "fields": [ + { + "fieldname": "repayment_schedule_type", + "fieldtype": "Data", + "in_list_view": 1, + "label": "Repayment Schedule Type", + "reqd": 1, + "unique": 1 + } + ], + "index_web_pages_for_search": 1, + "links": [], + "modified": "2023-09-20 23:46:35.197958", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Partner Repayment Schedule Type", + "naming_rule": "By fieldname", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.py b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.py new file mode 100644 index 00000000..de4735bf --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/loan_partner_repayment_schedule_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LoanPartnerRepaymentScheduleType(Document): + pass diff --git a/lending/loan_management/doctype/loan_partner_repayment_schedule_type/test_loan_partner_repayment_schedule_type.py b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/test_loan_partner_repayment_schedule_type.py new file mode 100644 index 00000000..4b46fac8 --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_repayment_schedule_type/test_loan_partner_repayment_schedule_type.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestLoanPartnerRepaymentScheduleType(FrappeTestCase): + pass diff --git a/lending/loan_management/doctype/loan_partner_shareable/__init__.py b/lending/loan_management/doctype/loan_partner_shareable/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.json b/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.json new file mode 100644 index 00000000..361d534a --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.json @@ -0,0 +1,71 @@ +{ + "actions": [], + "allow_rename": 1, + "creation": "2023-09-18 23:55:19.716182", + "doctype": "DocType", + "editable_grid": 1, + "engine": "InnoDB", + "field_order": [ + "charge_type", + "sharing_parameter", + "partner_ratio", + "company_ratio", + "partner_percentage", + "minimum_partner_percentage" + ], + "fields": [ + { + "fieldname": "charge_type", + "fieldtype": "Link", + "in_list_view": 1, + "label": "Charge Type", + "options": "Item" + }, + { + "fieldname": "sharing_parameter", + "fieldtype": "Select", + "in_list_view": 1, + "label": "Sharing Parameter", + "options": "\nRatio\nPercentage" + }, + { + "fieldname": "partner_ratio", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Partner Ratio", + "mandatory_depends_on": "eval:doc.sharing_parameter === \"Ratio\"" + }, + { + "fieldname": "partner_percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Partner Percentage", + "mandatory_depends_on": "eval:doc.sharing_parameter === \"Percentage\"" + }, + { + "fieldname": "company_ratio", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Company Ratio", + "mandatory_depends_on": "eval:doc.sharing_parameter === \"Ratio\"" + }, + { + "fieldname": "minimum_partner_percentage", + "fieldtype": "Percent", + "in_list_view": 1, + "label": "Minimum Partner Percentage" + } + ], + "index_web_pages_for_search": 1, + "istable": 1, + "links": [], + "modified": "2023-09-22 11:28:49.162023", + "modified_by": "Administrator", + "module": "Loan Management", + "name": "Loan Partner Shareable", + "owner": "Administrator", + "permissions": [], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.py b/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.py new file mode 100644 index 00000000..d90b9531 --- /dev/null +++ b/lending/loan_management/doctype/loan_partner_shareable/loan_partner_shareable.py @@ -0,0 +1,9 @@ +# Copyright (c) 2023, Frappe Technologies Pvt. Ltd. and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LoanPartnerShareable(Document): + pass