From d53abf194e900aa36d96d9793a889923fbd1901c Mon Sep 17 00:00:00 2001 From: Deepesh Garg Date: Mon, 9 Nov 2020 18:34:38 +0530 Subject: [PATCH] fix: Party for loan ledger entries --- .../loan_management/doctype/loan/loan_list.js | 16 ++++++++++++++++ .../loan_disbursement/loan_disbursement.py | 2 -- .../loan_interest_accrual.py | 2 -- .../doctype/loan_repayment/loan_repayment.py | 4 ---- .../doctype/loan_write_off/loan_write_off.py | 2 -- 5 files changed, 16 insertions(+), 10 deletions(-) create mode 100644 erpnext/loan_management/doctype/loan/loan_list.js diff --git a/erpnext/loan_management/doctype/loan/loan_list.js b/erpnext/loan_management/doctype/loan/loan_list.js new file mode 100644 index 0000000000..6591b72996 --- /dev/null +++ b/erpnext/loan_management/doctype/loan/loan_list.js @@ -0,0 +1,16 @@ +// Copyright (c) 2020, Frappe Technologies Pvt. Ltd. and Contributors +// License: GNU General Public License v3. See license.txt + +frappe.listview_settings['Loan'] = { + get_indicator: function(doc) { + var status_color = { + "Draft": "red", + "Sanctioned": "blue", + "Disbursed": "orange", + "Partially Disbursed": "yellow", + "Loan Closure Requested": "green", + "Closed": "green" + }; + return [__(doc.status), status_color[doc.status], "status,=,"+doc.status]; + }, +}; diff --git a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py index bda439fb7c..233862bcfe 100644 --- a/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py +++ b/erpnext/loan_management/doctype/loan_disbursement/loan_disbursement.py @@ -141,8 +141,6 @@ class LoanDisbursement(AccountsController): "against_voucher": self.against_loan, "remarks": _("Disbursement against loan:") + self.against_loan, "cost_center": self.cost_center, - "party_type": self.applicant_type, - "party": self.applicant, "posting_date": self.disbursement_date }) ) diff --git a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py index d642400cdc..d17f5af490 100644 --- a/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py +++ b/erpnext/loan_management/doctype/loan_interest_accrual/loan_interest_accrual.py @@ -62,8 +62,6 @@ class LoanInterestAccrual(AccountsController): gle_map.append( self.get_gl_dict({ "account": self.interest_income_account, - "party_type": self.applicant_type, - "party": self.applicant, "against": self.loan_account, "credit": self.interest_amount, "credit_in_account_currency": self.interest_amount, diff --git a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py index bb91abd628..a8887d7b24 100644 --- a/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py +++ b/erpnext/loan_management/doctype/loan_repayment/loan_repayment.py @@ -234,8 +234,6 @@ class LoanRepayment(AccountsController): "against_voucher": self.against_loan, "remarks": _("Repayment against loan:") + self.against_loan, "cost_center": self.cost_center, - "party_type": self.applicant_type, - "party": self.applicant, "posting_date": getdate(self.posting_date) }) ) @@ -251,8 +249,6 @@ class LoanRepayment(AccountsController): "against_voucher": self.against_loan, "remarks": _("Against Loan:") + self.against_loan, "cost_center": self.cost_center, - "party_type": self.applicant_type, - "party": self.applicant, "posting_date": getdate(self.posting_date) }) ) diff --git a/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py b/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py index 6e402edcd2..54a3f2cbb1 100644 --- a/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py +++ b/erpnext/loan_management/doctype/loan_write_off/loan_write_off.py @@ -63,8 +63,6 @@ class LoanWriteOff(AccountsController): "against_voucher": self.loan, "remarks": _("Against Loan:") + self.loan, "cost_center": self.cost_center, - "party_type": self.applicant_type, - "party": self.applicant, "posting_date": getdate(self.posting_date) }) )