mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-22 22:49:19 +00:00
added more features to loan
This commit is contained in:
@@ -8,11 +8,39 @@ $.extend(cur_frm.cscript, {
|
|||||||
}
|
}
|
||||||
cur_frm.refresh();
|
cur_frm.refresh();
|
||||||
},
|
},
|
||||||
|
refresh: function(doc) {
|
||||||
|
cur_frm.cscript.hide_show_buttons(doc);
|
||||||
|
},
|
||||||
|
hide_show_buttons: function(doc) {
|
||||||
|
if(doc.docstatus==0) {
|
||||||
|
hide_field('Installment Reciept'); show_field('Generate');
|
||||||
|
} else if (doc.docstatus==1) {
|
||||||
|
show_field('Installment Reciept'); hide_field('Generate');
|
||||||
|
}
|
||||||
|
},
|
||||||
clear_installments: function(doc) {
|
clear_installments: function(doc) {
|
||||||
$.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'),
|
$.each(getchildren('Loan Installment', doc.name, 'installments', 'Loan'),
|
||||||
function(i, d) {
|
function(i, d) {
|
||||||
LocalDB.delete_doc('Loan Installment', d.name);
|
LocalDB.delete_doc('Loan Installment', d.name);
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
},
|
||||||
|
'Installment Reciept': function(doc, dt, dn) {
|
||||||
|
var d = new wn.widgets.Dialog({
|
||||||
|
width: 500,
|
||||||
|
title: 'Add a new payment installment',
|
||||||
|
fields: [
|
||||||
|
{fieldtype:'Data', label:'Check Number', fieldname:'check_number', reqd:1},
|
||||||
|
{fieldtype:'Date', label:'Check Date', fieldname:'check_date', reqd:1},
|
||||||
|
{fieldtype:'Button', label:'Update',fieldname:'update'}
|
||||||
|
]
|
||||||
|
})
|
||||||
|
d.show();
|
||||||
|
d.fields_dict.update.input.onclick = function() {
|
||||||
|
var data = d.get_values();
|
||||||
|
if(data) {
|
||||||
|
$c_obj()
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
Reference in New Issue
Block a user