From b969c2cb60d553323cd49abfac9abf8fb3c739b9 Mon Sep 17 00:00:00 2001 From: Rushabh Mehta Date: Thu, 18 Aug 2016 12:35:58 +0530 Subject: [PATCH] [minor] budget link in cost center, fixes #6093 --- erpnext/accounts/doctype/cost_center/cost_center.js | 9 +++++++-- erpnext/selling/sales_common.js | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/erpnext/accounts/doctype/cost_center/cost_center.js b/erpnext/accounts/doctype/cost_center/cost_center.js index dea87f3f464..83ecc9fac1b 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 402ff116ecc..1ec8029725b 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