diff --git a/public/js/controllers/stock_controller.js b/public/js/controllers/stock_controller.js index 3021d756b97..ccbca4e9c07 100644 --- a/public/js/controllers/stock_controller.js +++ b/public/js/controllers/stock_controller.js @@ -19,7 +19,7 @@ wn.provide("erpnext.stock"); erpnext.stock.StockController = wn.ui.form.Controller.extend({ show_stock_ledger: function() { var me = this; - this.frm.add_custom_button("Show Stock Ledger", function() { + this.frm.add_custom_button("Stock Ledger", function() { wn.route_options = { voucher_no: me.frm.doc.name, from_date: cur_frm.doc.posting_date, @@ -27,5 +27,17 @@ erpnext.stock.StockController = wn.ui.form.Controller.extend({ }; wn.set_route('stock-ledger'); }, "icon-bar-chart"); + }, + show_general_ledger: function() { + if(doc.docstatus==1) { + cur_frm.add_custom_button('Accounting Ledger', function() { + wn.route_options = { + "voucher_no": doc.name, + "from_date": doc.posting_date, + "to_date": doc.posting_date, + }; + wn.set_route("general-ledger"); + }); + } } }); \ No newline at end of file diff --git a/stock/doctype/delivery_note/delivery_note.js b/stock/doctype/delivery_note/delivery_note.js index 117e77eacb2..936ca9eb5e1 100644 --- a/stock/doctype/delivery_note/delivery_note.js +++ b/stock/doctype/delivery_note/delivery_note.js @@ -34,7 +34,9 @@ erpnext.stock.DeliveryNoteController = erpnext.selling.SellingController.extend( if(flt(doc.per_installed, 2) < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Installation Note', this.make_installation_note); - if (doc.docstatus==1) cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); + if (doc.docstatus==1) { + cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms); + } if(doc.docstatus==0 && !doc.__islocal) { cur_frm.add_custom_button('Make Packing Slip', cur_frm.cscript['Make Packing Slip']); diff --git a/stock/doctype/stock_entry/stock_entry.js b/stock/doctype/stock_entry/stock_entry.js index 1f4aafa9e51..468d3d7a960 100644 --- a/stock/doctype/stock_entry/stock_entry.js +++ b/stock/doctype/stock_entry/stock_entry.js @@ -103,6 +103,8 @@ erpnext.stock.StockEntry = erpnext.stock.StockController.extend({ this.toggle_enable_bom(); if (this.frm.doc.docstatus==1) { this.show_stock_ledger(); + if(wn.boot.auto_inventory_accounting) + this.show_general_ledger(); } if(this.frm.doc.docstatus === 1 &&