mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-15 19:19:17 +00:00
Bootstrap documents for closing (js)
This commit is contained in:
@@ -2,7 +2,23 @@
|
|||||||
// For license information, please see license.txt
|
// For license information, please see license.txt
|
||||||
|
|
||||||
frappe.ui.form.on('Accounting Period', {
|
frappe.ui.form.on('Accounting Period', {
|
||||||
refresh: function(frm) {
|
onload: function(frm) {
|
||||||
|
if(frm.doc.closed_documents.length === 0 || (frm.doc.closed_documents.length === 1 && frm.doc.closed_documents[0].document_type == undefined)) {
|
||||||
|
frappe.call({
|
||||||
|
method: "get_doctypes_for_closing",
|
||||||
|
doc:frm.doc,
|
||||||
|
callback: function(r) {
|
||||||
|
if(r.message) {
|
||||||
|
cur_frm.clear_table("closed_documents");
|
||||||
|
r.message.forEach(function(element) {
|
||||||
|
var c = frm.add_child("closed_documents");
|
||||||
|
c.document_type = element.document_type;
|
||||||
|
c.closed = element.closed;
|
||||||
|
});
|
||||||
|
refresh_field("closed_documents");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in New Issue
Block a user