mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-13 10:11:20 +00:00
toggle required fields on select of repayment option in loan application
This commit is contained in:
@@ -11,11 +11,16 @@ frappe.ui.form.on('Loan Application', {
|
|||||||
repayment_method: function(frm) {
|
repayment_method: function(frm) {
|
||||||
frm.doc.repayment_amount = frm.doc.repayment_periods = ""
|
frm.doc.repayment_amount = frm.doc.repayment_periods = ""
|
||||||
frm.trigger("toggle_fields")
|
frm.trigger("toggle_fields")
|
||||||
|
frm.trigger("toogle_required")
|
||||||
},
|
},
|
||||||
toggle_fields: function(frm) {
|
toggle_fields: function(frm) {
|
||||||
frm.toggle_enable("repayment_amount", frm.doc.repayment_method=="Repay Fixed Amount per Period")
|
frm.toggle_enable("repayment_amount", frm.doc.repayment_method=="Repay Fixed Amount per Period")
|
||||||
frm.toggle_enable("repayment_periods", frm.doc.repayment_method=="Repay Over Number of Periods")
|
frm.toggle_enable("repayment_periods", frm.doc.repayment_method=="Repay Over Number of Periods")
|
||||||
},
|
},
|
||||||
|
toogle_required: function(frm){
|
||||||
|
frm.toggle_reqd("repayment_amount", cint(frm.doc.repayment_method=='Repay Fixed Amount per Period'))
|
||||||
|
frm.toggle_reqd("repayment_periods", cint(frm.doc.repayment_method=='Repay Over Number of Periods'))
|
||||||
|
},
|
||||||
add_toolbar_buttons: function(frm) {
|
add_toolbar_buttons: function(frm) {
|
||||||
if (frm.doc.status == "Approved") {
|
if (frm.doc.status == "Approved") {
|
||||||
frm.add_custom_button(__('Loan'), function() {
|
frm.add_custom_button(__('Loan'), function() {
|
||||||
|
|||||||
Reference in New Issue
Block a user