[grid reports] now show by wn.route_options

This commit is contained in:
Rushabh Mehta
2013-07-01 14:35:57 +05:30
parent affba2fd99
commit 36af6a02ad
7 changed files with 40 additions and 26 deletions

View File

@@ -92,7 +92,12 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) {
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
cur_frm.add_custom_button('View Ledger', function() {
wn.set_route("general-ledger", "account=" + doc.name);
wn.route_options = {
"account": doc.name,
"from_date": sys_defaults.year_start_date,
"to_date": sys_defaults.year_end_date
};
wn.set_route("general-ledger");
});
}
}

View File

@@ -23,7 +23,14 @@ cur_frm.cscript.refresh = function(doc) {
erpnext.hide_naming_series();
cur_frm.cscript.voucher_type(doc);
if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
cur_frm.add_custom_button('View Ledger', function() {
wn.route_options = {
"voucher_no": doc.name,
"from_date": doc.posting_date,
"to_date": doc.posting_date,
};
wn.set_route("general-ledger");
});
}
}
@@ -131,11 +138,6 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
cur_frm.pformat.print_heading = "Journal Voucher";
}
cur_frm.cscript.view_ledger_entry = function(doc,cdt,cdn){
wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);
}
cur_frm.cscript.voucher_type = function(doc, cdt, cdn) {
cur_frm.set_df_property("cheque_no", "reqd", doc.voucher_type=="Bank Voucher");
cur_frm.set_df_property("cheque_date", "reqd", doc.voucher_type=="Bank Voucher");

View File

@@ -2,7 +2,7 @@
{
"creation": "2013-02-22 01:27:39",
"docstatus": 0,
"modified": "2013-04-17 14:05:18",
"modified": "2013-07-01 13:53:33",
"modified_by": "Administrator",
"owner": "Administrator"
},
@@ -74,11 +74,12 @@
{
"doctype": "DocField",
"fieldname": "balance",
"fieldtype": "Data",
"fieldtype": "Currency",
"label": "Account Balance",
"no_copy": 1,
"oldfieldname": "balance",
"oldfieldtype": "Data",
"options": "Company:company:default_currency",
"read_only": 1
},
{

View File

@@ -42,7 +42,14 @@ erpnext.accounts.PurchaseInvoiceController = erpnext.buying.BuyingController.ext
this.frm.add_custom_button('Make Payment Entry', this.make_bank_voucher);
if(doc.docstatus==1) {
this.frm.add_custom_button('View Ledger', this.view_ledger_entry);
cur_frm.add_custom_button('View Ledger', function() {
wn.route_options = {
"voucher_no": doc.name,
"from_date": doc.posting_date,
"to_date": doc.posting_date,
};
wn.set_route("general-ledger");
});
}
this.is_opening(doc);
@@ -226,8 +233,4 @@ cur_frm.cscript.select_print_heading = function(doc,cdt,cdn){
}
else
cur_frm.pformat.print_heading = "Purchase Invoice";
}
cur_frm.cscript.view_ledger_entry = function(){
wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);
}
}

View File

@@ -45,7 +45,15 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
cur_frm.cscript.is_opening(doc, dt, dn);
if(doc.docstatus==1) {
cur_frm.add_custom_button('View Ledger', cur_frm.cscript.view_ledger_entry);
cur_frm.add_custom_button('View Ledger', function() {
wn.route_options = {
"voucher_no": doc.name,
"from_date": doc.posting_date,
"to_date": doc.posting_date,
};
wn.set_route("general-ledger");
});
cur_frm.add_custom_button('Send SMS', cur_frm.cscript.send_sms);
if(doc.is_pos==1 && doc.update_stock!=1)
@@ -381,11 +389,6 @@ cur_frm.cscript.make_jv = function(doc, dt, dn, bank_account) {
}
/****************** Get Accounting Entry *****************/
cur_frm.cscript.view_ledger_entry = function(){
wn.set_route('Report', 'GL Entry', 'General Ledger', 'Voucher No='+cur_frm.doc.name);
}
cur_frm.cscript.on_submit = function(doc, cdt, cdn) {
if(cint(wn.boot.notification_settings.sales_invoice)) {
cur_frm.email_doc(wn.boot.notification_settings.sales_invoice_message);