[minor] budget link in cost center, fixes #6093
diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js
index dea87f3..83ecc9f 100644
--- a/erpnext/accounts/doctype/cost_center/cost_center.js
+++ b/erpnext/accounts/doctype/cost_center/cost_center.js
@@ -32,8 +32,13 @@
cur_frm.toggle_display('sb1', doc.is_group==0)
cur_frm.set_intro(intro_txt);
- cur_frm.add_custom_button(__('Chart of Cost Centers'),
- function() { frappe.set_route("Tree", "Cost Center"); }, __("View"))
+ if(!cur_frm.doc.__islocal) {
+ cur_frm.add_custom_button(__('Chart of Cost Centers'),
+ function() { frappe.set_route("Tree", "Cost Center"); });
+
+ cur_frm.add_custom_button(__('Budget'),
+ function() { frappe.set_route("List", "Budget", {'cost_center': cur_frm.doc.name}); });
+ }
}
cur_frm.cscript.parent_cost_center = function(doc, cdt, cdn) {
diff --git a/erpnext/selling/sales_common.js b/erpnext/selling/sales_common.js
index 402ff11..1ec8029 100644
--- a/erpnext/selling/sales_common.js
+++ b/erpnext/selling/sales_common.js
@@ -80,7 +80,7 @@
} else {
filters = {
'item_code': item.item_code,
- 'posting_date': me.frm.doc.posting_date || nowdate(),
+ 'posting_date': me.frm.doc.posting_date || frappe.datetime.nowdate(),
}
if(item.warehouse) filters["warehouse"] = item.warehouse