fix: Description for various fields

This commit is contained in:
Deepesh Garg 2020-05-17 23:26:37 +05:30
parent 58f02e7c10
commit 513099d624
7 changed files with 72 additions and 58 deletions

View File

@ -3,7 +3,7 @@
{
"hidden": 0,
"label": "Loan",
"links": "[\n {\n \"description\": \"Loan Type for interest and penalty rates\",\n \"label\": \"Loan Type\",\n \"name\": \"Loan Type\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Loan Applications from customers and employees.\",\n \"label\": \"Loan Application\",\n \"name\": \"Loan Application\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Loans provided to customers and employees.\",\n \"label\": \"Loan\",\n \"name\": \"Loan\",\n \"type\": \"doctype\"\n }\n]"
"links": "[\n {\n \"description\": \"Loan Type for interest and penalty rates\",\n \"label\": \"Loan Type\",\n \"name\": \"Loan Type\",\n \"type\": \"doctype\"\n },\n {\n \"description\": \"Loan Applications from customers and employees.\",\n \"label\": \"Loan Application\",\n \"name\": \"Loan Application\",\n \"type\": \"doctype\"\n },\n { \"dependencies\": [\n \"Loan Type\"\n ],\n \"description\": \"Loans provided to customers and employees.\",\n \"label\": \"Loan\",\n \"name\": \"Loan\",\n \"type\": \"doctype\"\n }\n]"
},
{
"hidden": 0,
@ -37,7 +37,7 @@
"idx": 0,
"is_standard": 1,
"label": "Loan Management",
"modified": "2020-04-02 11:28:51.380509",
"modified": "2020-05-16 08:01:27.784621",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Management",

View File

@ -112,16 +112,19 @@ frappe.ui.form.on('Loan Application', {
frappe.ui.form.on("Proposed Pledge", {
loan_security: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
frappe.call({
method: "erpnext.loan_management.doctype.loan_security_price.loan_security_price.get_loan_security_price",
args: {
loan_security: row.loan_security
},
callback: function(r) {
frappe.model.set_value(cdt, cdn, 'loan_security_price', r.message);
frm.events.calculate_amounts(frm, cdt, cdn);
}
})
if (row.loan_security) {
frappe.call({
method: "erpnext.loan_management.doctype.loan_security_price.loan_security_price.get_loan_security_price",
args: {
loan_security: row.loan_security
},
callback: function(r) {
frappe.model.set_value(cdt, cdn, 'loan_security_price', r.message);
frm.events.calculate_amounts(frm, cdt, cdn);
}
})
}
},
amount: function(frm, cdt, cdn) {

View File

@ -19,8 +19,8 @@ class LoanInterestAccrual(AccountsController):
if not self.posting_date:
self.posting_date = nowdate()
if not self.interest_amount:
frappe.throw(_("Interest Amount is mandatory"))
if not self.interest_amount and not self.payable_principal_amount:
frappe.throw(_("Interest Amount or Principal Amount is mandatory"))
def on_submit(self):
@ -38,37 +38,38 @@ class LoanInterestAccrual(AccountsController):
def make_gl_entries(self, cancel=0, adv_adj=0):
gle_map = []
gle_map.append(
self.get_gl_dict({
"account": self.loan_account,
"party_type": self.applicant_type,
"party": self.applicant,
"against": self.interest_income_account,
"debit": self.interest_amount,
"debit_in_account_currency": self.interest_amount,
"against_voucher_type": "Loan",
"against_voucher": self.loan,
"remarks": _("Against Loan:") + self.loan,
"cost_center": erpnext.get_default_cost_center(self.company),
"posting_date": self.posting_date
})
)
if self.interest_amount:
gle_map.append(
self.get_gl_dict({
"account": self.loan_account,
"party_type": self.applicant_type,
"party": self.applicant,
"against": self.interest_income_account,
"debit": self.interest_amount,
"debit_in_account_currency": self.interest_amount,
"against_voucher_type": "Loan",
"against_voucher": self.loan,
"remarks": _("Against Loan:") + self.loan,
"cost_center": erpnext.get_default_cost_center(self.company),
"posting_date": self.posting_date
})
)
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,
"against_voucher_type": "Loan",
"against_voucher": self.loan,
"remarks": _("Against Loan:") + self.loan,
"cost_center": erpnext.get_default_cost_center(self.company),
"posting_date": self.posting_date
})
)
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,
"against_voucher_type": "Loan",
"against_voucher": self.loan,
"remarks": _("Against Loan:") + self.loan,
"cost_center": erpnext.get_default_cost_center(self.company),
"posting_date": self.posting_date
})
)
if gle_map:
make_gl_entries(gle_map, cancel=cancel, adv_adj=adv_adj)

View File

@ -173,7 +173,7 @@
{
"fieldname": "references_section",
"fieldtype": "Section Break",
"label": "References"
"label": "Payment References"
},
{
"fieldname": "reference_number",
@ -221,7 +221,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-04-16 18:14:45.166754",
"modified": "2020-05-16 09:40:15.581165",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Repayment",

View File

@ -22,16 +22,19 @@ frappe.ui.form.on('Loan Security Pledge', {
frappe.ui.form.on("Pledge", {
loan_security: function(frm, cdt, cdn) {
let row = locals[cdt][cdn];
frappe.call({
method: "erpnext.loan_management.doctype.loan_security_price.loan_security_price.get_loan_security_price",
args: {
loan_security: row.loan_security
},
callback: function(r) {
frappe.model.set_value(cdt, cdn, 'loan_security_price', r.message);
frm.events.calculate_amounts(frm, cdt, cdn);
}
});
if (row.loan_security) {
frappe.call({
method: "erpnext.loan_management.doctype.loan_security_price.loan_security_price.get_loan_security_price",
args: {
loan_security: row.loan_security
},
callback: function(r) {
frappe.model.set_value(cdt, cdn, 'loan_security_price', r.message);
frm.events.calculate_amounts(frm, cdt, cdn);
}
});
}
},
qty: function(frm, cdt, cdn) {

View File

@ -29,6 +29,7 @@
"unique": 1
},
{
"description": "Haircut percentage is the percentage difference between market value of the Loan Security and the value ascribed to that Loan Security when used as collateral for that loan.",
"fieldname": "haircut",
"fieldtype": "Percent",
"label": "Haircut %"
@ -46,13 +47,14 @@
"fieldtype": "Column Break"
},
{
"description": "Loan To Value Ratio expresses the ratio of the loan amount to the value of the security pledged. A loan security shortfall will be triggered if this falls below the specified value for any loan ",
"fieldname": "loan_to_value_ratio",
"fieldtype": "Percent",
"label": "Loan To Value Ratio"
}
],
"links": [],
"modified": "2020-04-28 14:06:49.046177",
"modified": "2020-05-16 09:38:45.988080",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Security Type",

View File

@ -75,6 +75,7 @@
"reqd": 1
},
{
"description": "This account is used for booking loan repayments from the borrower and also disbursing loans to the borrower",
"fieldname": "payment_account",
"fieldtype": "Link",
"label": "Payment Account",
@ -82,6 +83,7 @@
"reqd": 1
},
{
"description": "This account is capital account which is used to allocate capital for loan disbursal account ",
"fieldname": "loan_account",
"fieldtype": "Link",
"label": "Loan Account",
@ -93,6 +95,7 @@
"fieldtype": "Column Break"
},
{
"description": "This account will be used for booking loan interest accruals",
"fieldname": "interest_income_account",
"fieldtype": "Link",
"label": "Interest Income Account",
@ -100,6 +103,7 @@
"reqd": 1
},
{
"description": "This account will be used for booking penalties levied due to delayed repayments",
"fieldname": "penalty_income_account",
"fieldtype": "Link",
"label": "Penalty Income Account",
@ -108,6 +112,7 @@
},
{
"default": "0",
"description": "If this is not checked the loan by default will be considered as a Demand Loan",
"fieldname": "is_term_loan",
"fieldtype": "Check",
"label": "Is Term Loan"
@ -143,7 +148,7 @@
],
"is_submittable": 1,
"links": [],
"modified": "2020-04-15 00:24:43.259963",
"modified": "2020-05-16 09:08:09.029921",
"modified_by": "Administrator",
"module": "Loan Management",
"name": "Loan Type",