diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index dea87f3f46..83ecc9fac1 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.cscript.refresh = function(doc, cdt, cdn) { 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 402ff116ec..1ec8029725 100644 --- a/erpnext/selling/sales_common.js +++ b/erpnext/selling/sales_common.js @@ -80,7 +80,7 @@ erpnext.selling.SellingController = erpnext.TransactionController.extend({ } 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