[fix] [minor] show stock ledger, general ledger, fixes post changes in script manager trigger [issue] webnotes/wnframework#228

This commit is contained in:
Anand Doshi
2013-07-30 14:42:15 +05:30
parent 7180eb6f20
commit a648f46d4e
16 changed files with 106 additions and 103 deletions

View File

@@ -54,7 +54,7 @@ $.extend(erpnext.complete_setup, {
$('header').toggle(false); // hide toolbar
}
return wn.call({
wn.call({
method:"webnotes.country_info.get_country_timezone_info",
callback: function(data) {
erpnext.country_info = data.message.country_info;

View File

@@ -19,22 +19,26 @@ wn.provide("erpnext.stock");
erpnext.stock.StockController = wn.ui.form.Controller.extend({
show_stock_ledger: function() {
var me = this;
this.frm.add_custom_button("Stock Ledger", function() {
wn.route_options = {
voucher_no: me.frm.doc.name,
from_date: cur_frm.doc.posting_date,
to_date: cur_frm.doc.posting_date
};
wn.set_route('stock-ledger');
}, "icon-bar-chart");
if(this.frm.doc.docstatus===1) {
this.frm.add_custom_button("Stock Ledger", function() {
wn.route_options = {
voucher_no: me.frm.doc.name,
from_date: me.frm.doc.posting_date,
to_date: me.frm.doc.posting_date
};
wn.set_route('stock-ledger');
}, "icon-bar-chart");
}
},
show_general_ledger: function() {
if(doc.docstatus==1) {
var me = this;
if(this.frm.doc.docstatus===1 && cint(wn.defaults.get_default("auto_inventory_accounting"))) {
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,
"voucher_no": me.frm.doc.name,
"from_date": me.frm.doc.posting_date,
"to_date": me.frm.doc.posting_date,
};
wn.set_route("general-ledger");
});

View File

@@ -15,8 +15,9 @@
// along with this program. If not, see <http://www.gnu.org/licenses/>.
wn.provide("erpnext");
wn.require("app/js/controllers/stock_controller.js");
erpnext.TransactionController = wn.ui.form.Controller.extend({
erpnext.TransactionController = erpnext.stock.StockController.extend({
onload: function() {
if(this.frm.doc.__islocal) {
var me = this,