mirror of
https://github.com/frappe/erpnext.git
synced 2026-05-26 16:34:46 +00:00
[cleanup] Fixed title bars, toolbars in all pages, added default background
This commit is contained in:
@@ -81,7 +81,7 @@ cur_frm.cscript.account_type = function(doc, cdt, cdn) {
|
||||
// Hide/unhide group or ledger
|
||||
// -----------------------------------------
|
||||
cur_frm.cscript.add_toolbar_buttons = function(doc) {
|
||||
cur_frm.add_custom_button(wn._('Chart of Accounts'),
|
||||
cur_frm.appframe.add_button(wn._('Chart of Accounts'),
|
||||
function() { wn.set_route("Accounts Browser", "Account"); }, 'icon-sitemap')
|
||||
|
||||
if (cstr(doc.group_or_ledger) == 'Group') {
|
||||
@@ -91,14 +91,14 @@ cur_frm.cscript.add_toolbar_buttons = function(doc) {
|
||||
cur_frm.add_custom_button(wn._('Convert to Group'),
|
||||
function() { cur_frm.cscript.convert_to_group(); }, 'icon-retweet')
|
||||
|
||||
cur_frm.add_custom_button(wn._('View Ledger'), function() {
|
||||
cur_frm.appframe.add_button(wn._('View Ledger'), function() {
|
||||
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");
|
||||
});
|
||||
}, "icon-table");
|
||||
}
|
||||
}
|
||||
// Convert group to ledger
|
||||
|
||||
@@ -50,7 +50,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) {
|
||||
cur_frm.toggle_display('sb1', doc.group_or_ledger=='Ledger')
|
||||
cur_frm.set_intro(intro_txt);
|
||||
|
||||
cur_frm.add_custom_button(wn._('Chart of Cost Centers'),
|
||||
cur_frm.appframe.add_button(wn._('Chart of Cost Centers'),
|
||||
function() { wn.set_route("Accounts Browser", "Cost Center"); }, 'icon-sitemap')
|
||||
}
|
||||
|
||||
|
||||
@@ -115,14 +115,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(wn._('View Ledger'), function() {
|
||||
cur_frm.appframe.add_button(wn._('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");
|
||||
});
|
||||
}, "icon-table");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -30,14 +30,14 @@ erpnext.accounts.PurchaseInvoice = erpnext.buying.BuyingController.extend({
|
||||
this.frm.add_custom_button(wn._('Make Payment Entry'), this.make_bank_voucher);
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
cur_frm.add_custom_button(wn._('View Ledger'), function() {
|
||||
cur_frm.appframe.add_button(wn._('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");
|
||||
});
|
||||
}, "icon-table");
|
||||
}
|
||||
|
||||
if(doc.docstatus===0) {
|
||||
|
||||
@@ -49,19 +49,19 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
cur_frm.dashboard.reset();
|
||||
|
||||
if(doc.docstatus==1) {
|
||||
cur_frm.add_custom_button('View Ledger', function() {
|
||||
cur_frm.appframe.add_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");
|
||||
});
|
||||
}, "icon-table");
|
||||
|
||||
var percent_paid = cint(flt(doc.grand_total - doc.outstanding_amount) / flt(doc.grand_total) * 100);
|
||||
cur_frm.dashboard.add_progress(percent_paid + "% Paid", percent_paid);
|
||||
|
||||
cur_frm.add_custom_button(wn._('Send SMS'), cur_frm.cscript.send_sms);
|
||||
cur_frm.appframe.add_button(wn._('Send SMS'), cur_frm.cscript.send_sms, 'icon-mobile-phone');
|
||||
|
||||
if(cint(doc.update_stock)!=1) {
|
||||
// show Make Delivery Note button only if Sales Invoice is not created from Delivery Note
|
||||
@@ -72,11 +72,11 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
});
|
||||
|
||||
if(!from_delivery_note)
|
||||
cur_frm.add_custom_button(wn._('Make Delivery'), cur_frm.cscript['Make Delivery Note']);
|
||||
cur_frm.appframe.add_primary_action(wn._('Make Delivery'), cur_frm.cscript['Make Delivery Note'])
|
||||
}
|
||||
|
||||
if(doc.outstanding_amount!=0)
|
||||
cur_frm.add_custom_button(wn._('Make Payment Entry'), cur_frm.cscript.make_bank_voucher);
|
||||
cur_frm.appframe.add_primary_action(wn._('Make Payment Entry'), cur_frm.cscript.make_bank_voucher);
|
||||
}
|
||||
|
||||
// Show buttons only when pos view is active
|
||||
@@ -87,7 +87,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
},
|
||||
|
||||
sales_order_btn: function() {
|
||||
this.$sales_order_btn = cur_frm.add_custom_button(wn._('From Sales Order'),
|
||||
this.$sales_order_btn = cur_frm.appframe.add_primary_action(wn._('From Sales Order'),
|
||||
function() {
|
||||
wn.model.map_current_doc({
|
||||
method: "selling.doctype.sales_order.sales_order.make_sales_invoice",
|
||||
@@ -104,7 +104,7 @@ erpnext.accounts.SalesInvoiceController = erpnext.selling.SellingController.exte
|
||||
},
|
||||
|
||||
delivery_note_btn: function() {
|
||||
this.$delivery_note_btn = cur_frm.add_custom_button(wn._('From Delivery Note'),
|
||||
this.$delivery_note_btn = cur_frm.appframe.add_primary_action(wn._('From Delivery Note'),
|
||||
function() {
|
||||
wn.model.map_current_doc({
|
||||
method: "stock.doctype.delivery_note.delivery_note.make_sales_invoice",
|
||||
|
||||
Reference in New Issue
Block a user