diff --git a/build.json b/build.json index 17d38b31410..635e73d9dc4 100644 --- a/build.json +++ b/build.json @@ -37,7 +37,6 @@ { "css/all-web.css": [ "lib/css/legacy/body.css", - "lib/css/legacy/menus.css", "lib/css/legacy/messages.css", "lib/css/legacy/dialog.css", "lib/css/bootstrap/headings.css", @@ -53,7 +52,6 @@ { "css/all-app.css": [ "lib/css/legacy/body.css", - "lib/css/legacy/menus.css", "lib/css/legacy/messages.css", "lib/css/legacy/forms.css", "lib/css/legacy/grid.css", diff --git a/css/all-app.css b/css/all-app.css index b49caedee90..f3a07ec9da2 100644 --- a/css/all-app.css +++ b/css/all-app.css @@ -230,59 +230,16 @@ div.std-footer-item { box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } -/* - * lib/css/legacy/menus.css - */ -/******** Menus - menu.js ************/ - -ul.menu_toolbar { - z-index: 30; - padding: 0px; - margin: 0px; - margin-top: 1px; +.avatar-small { + display: inline-block; + min-width: 29px; +} +.avatar-small img { + height: 24px; + margin-bottom: -7px; + max-width: 24px; } -ul.menu_toolbar li { - list-style: none; - margin: 0px; - float: left; -} - -.top_menu { - margin: 0px; - padding: 4px; - cursor: pointer; - color: #FFF; - margin-right: 8px; -} - -.top_menu_mo { - background-color: #000; - - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -div.menu_toolbar_dropdown { - position: absolute; - margin-top: 4px; - margin-left: 8px; - width: 140px; - background-color: #FFF; - color: #000; - display: none; - border: 2px solid #333; - z-index: 31; - overflow-y: auto; - overflow-x: hidden; -} - -div.dd_item { - cursor: pointer; - padding: 4px; - background-color: #FFF; -} -div.dd_item_mo { background-color: #FE8; } /* * lib/css/legacy/messages.css */ @@ -2812,7 +2769,7 @@ body { } .erpnext-footer { - margin: 3px auto; + margin: 11px auto; text-align: center; } diff --git a/css/all-web.css b/css/all-web.css index bebfe9a3347..967c32b65c1 100644 --- a/css/all-web.css +++ b/css/all-web.css @@ -230,59 +230,16 @@ div.std-footer-item { box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.05); } -/* - * lib/css/legacy/menus.css - */ -/******** Menus - menu.js ************/ - -ul.menu_toolbar { - z-index: 30; - padding: 0px; - margin: 0px; - margin-top: 1px; +.avatar-small { + display: inline-block; + min-width: 29px; +} +.avatar-small img { + height: 24px; + margin-bottom: -7px; + max-width: 24px; } -ul.menu_toolbar li { - list-style: none; - margin: 0px; - float: left; -} - -.top_menu { - margin: 0px; - padding: 4px; - cursor: pointer; - color: #FFF; - margin-right: 8px; -} - -.top_menu_mo { - background-color: #000; - - -moz-border-radius: 5px; - -webkit-border-radius: 5px; -} - -div.menu_toolbar_dropdown { - position: absolute; - margin-top: 4px; - margin-left: 8px; - width: 140px; - background-color: #FFF; - color: #000; - display: none; - border: 2px solid #333; - z-index: 31; - overflow-y: auto; - overflow-x: hidden; -} - -div.dd_item { - cursor: pointer; - padding: 4px; - background-color: #FFF; -} -div.dd_item_mo { background-color: #FE8; } /* * lib/css/legacy/messages.css */ @@ -1620,7 +1577,7 @@ body { } .erpnext-footer { - margin: 3px auto; + margin: 11px auto; text-align: center; } diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js index a465ec07dbe..99bd24c6b89 100644 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js @@ -45,11 +45,14 @@ cur_frm.cscript.onload = function(doc,dt,dn) { //------------------------ cur_frm.cscript.onload_post_render = function(doc, dt, dn) { var callback = function(doc, dt, dn) { - if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); + var callback1 = function(doc, dt, dn) { + if(doc.__islocal && doc.supplier) cur_frm.cscript.supplier(doc,dt,dn); + } + + // defined in purchase_common.js + cur_frm.cscript.update_item_details(doc, dt, dn, callback1); } - - // defined in purchase_common.js - cur_frm.cscript.update_item_details(doc, cdt, cdn, callback); + cur_frm.cscript.dynamic_label(doc, dt, dn, callback); } // Refresh @@ -58,7 +61,7 @@ cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.clear_custom_buttons(); - cur_frm.cscript.dynamic_label(doc, cdt, cdn); + if (!cur_frm.cscript.is_onload) cur_frm.cscript.dynamic_label(doc, dt, dn); // Show / Hide button diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.py b/erpnext/accounts/doctype/payable_voucher/payable_voucher.py index fe733f77826..1a09a451c78 100644 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.py +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.py @@ -168,9 +168,6 @@ class DocType(TransactionBase): return ret - def get_comp_base_currency(self): - return get_obj('Purchase Common').get_comp_base_currency(self.doc.company) - # *************************** Server Utility Functions ***************************** # Get Company abbr diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 52f8e539fcc..317df513c24 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -92,39 +92,36 @@ var set_dynamic_label_par = function(doc, cdt, cdn, base_curr) { var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) { - // item table flds - item_cols_base = {'purchase_ref_rate': 'Ref Rate', 'amount': 'Amount'}; - item_cols_import = {'import_rate': 'Rate', 'import_ref_rate': 'Ref Rate', 'import_amount': 'Amount'}; + // item table flds + item_cols_base = {'purchase_ref_rate': 'Ref Rate', 'amount': 'Amount'}; + item_cols_import = {'import_rate': 'Rate', 'import_ref_rate': 'Ref Rate', 'import_amount': 'Amount'}; - for (d in item_cols_base) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_base[d]+' ('+base_curr+')'); - for (d in item_cols_import) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_import[d]+' ('+doc.currency+')'); + for (d in item_cols_base) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_base[d]+' ('+base_curr+')'); + for (d in item_cols_import) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_import[d]+' ('+doc.currency+')'); - var hide = (doc.currency == sys_defaults['currency']) ? false : true; - for (f in item_cols_base) cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide); - - if (doc.doctype == 'Payable Voucher') { - $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-rate"]').html('Rate ('+base_curr+')'); - cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp('rate', hide); - // advance table flds - adv_cols = {'advance_amount': 'Advance Amount', 'allocated_amount': 'Allocated Amount', 'tds_amount': 'TDS Amount', 'tds_allocated': 'TDS Allocated'} - for (d in adv_cols) $('[data-grid-fieldname="Advance Allocation Detail-'+d+'"]').html(adv_cols[d]+' ('+base_curr+')'); - } - else { - $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-purchase_rate"]').html('Rate ('+base_curr+')'); - cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp('purchase_rate', hide); - } - - //tax table flds - tax_cols = {'tax_amount': 'Amount', 'total': 'Aggregate Total'}; - for (d in tax_cols) $('[data-grid-fieldname="Purchase Tax Detail-'+d+'"]').html(tax_cols[d]+' ('+base_curr+')'); - + var hide = (doc.currency == sys_defaults['currency']) ? false : true; + for (f in item_cols_base) cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide); + if (doc.doctype == 'Payable Voucher') { + $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-rate"]').html('Rate ('+base_curr+')'); + cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp('rate', hide); + // advance table flds + adv_cols = {'advance_amount': 'Advance Amount', 'allocated_amount': 'Allocated Amount', 'tds_amount': 'TDS Amount', 'tds_allocated': 'TDS Allocated'} + for (d in adv_cols) $('[data-grid-fieldname="Advance Allocation Detail-'+d+'"]').html(adv_cols[d]+' ('+base_curr+')'); + } + else { + $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-purchase_rate"]').html('Rate ('+base_curr+')'); + cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp('purchase_rate', hide); + } + //tax table flds + tax_cols = {'tax_amount': 'Amount', 'total': 'Aggregate Total'}; + for (d in tax_cols) $('[data-grid-fieldname="Purchase Tax Detail-'+d+'"]').html(tax_cols[d]+' ('+base_curr+')'); } // Change label dynamically based on currency //------------------------------------------------------------------ -cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) { +cur_frm.cscript.dynamic_label = function(doc, cdt, cdn, callback1) { var callback = function(r, rt) { if (r.message) base_curr = r.message; else base_curr = sys_defaults['currency']; @@ -136,10 +133,16 @@ cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) { set_dynamic_label_par(doc, cdt, cdn, base_curr); set_dynamic_label_child(doc, cdt, cdn, base_curr); + + if(callback1) callback1(doc, cdt, cdn); } if (doc.company == sys_defaults['company']) callback('', ''); - else $c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback); + else wn.call({ + method: 'selling.doctype.sales_common.sales_common.get_comp_base_currency', + args: {company: doc.company}, + callback: callback + }); } cur_frm.cscript.currency = function(doc, cdt, cdn) { diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.py b/erpnext/buying/doctype/purchase_common/purchase_common.py index 16afb02ccf5..ca9181f1543 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.py +++ b/erpnext/buying/doctype/purchase_common/purchase_common.py @@ -197,11 +197,6 @@ class DocType(TransactionBase): msgprint("%s has no Last Purchase Rate."% d.item_code) - def get_comp_base_currency(self, comp): - """ get default currency of company""" - return webnotes.conn.sql("select default_currency from `tabCompany` where name = %s", comp)[0][0] - - # validation # ------------------------------------------------------------------------------------------------------- diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.js b/erpnext/buying/doctype/purchase_order/purchase_order.js index 0a6c5479782..7af1204fa42 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order.js @@ -41,9 +41,12 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { } cur_frm.cscript.onload_post_render = function(doc, cdt, cdn) { - if(doc.__islocal){ - cur_frm.cscript.get_default_schedule_date(doc); - } + var callback = function(doc, cdt, cdn) { + if(doc.__islocal){ + cur_frm.cscript.get_default_schedule_date(doc); + } + } + cur_frm.cscript.dynamic_label(doc, cdt, cdn, callback); } // ================================== Refresh ========================================== @@ -52,7 +55,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { // --------------------------------- cur_frm.clear_custom_buttons(); - cur_frm.cscript.dynamic_label(doc, cdt, cdn); + if (!cur_frm.cscript.is_onload) cur_frm.cscript.dynamic_label(doc, cdt, cdn); if(doc.docstatus == 1 && doc.status != 'Stopped'){ var ch = getchildren('PO Detail',doc.name,'po_details'); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order.py b/erpnext/buying/doctype/purchase_order/purchase_order.py index efa05244c08..794580724b7 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.py +++ b/erpnext/buying/doctype/purchase_order/purchase_order.py @@ -100,10 +100,6 @@ class DocType(TransactionBase): return get_obj('Purchase Common').get_tc_details(self) - def get_comp_base_currency(self): - return get_obj('Purchase Common').get_comp_base_currency(self.doc.company) - - # validate if indent has been pulled twice def validate_prev_docname(self): diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js index d8e22ce8096..9a323d3ec11 100644 --- a/erpnext/home/page/activity/activity.js +++ b/erpnext/home/page/activity/activity.js @@ -15,8 +15,7 @@ erpnext.ActivityFeed = Class.extend({ this.scrub_data(data); this.add_date_separator(row, data); $(row).append(sprintf('
Source Code: + https://github.com/webnotes/erpnext
+Website: + https://erpnext.com
+ERPNext is an Open Source project and is possible because of the work of + thousands of software developers, companies and designers who have contributed their + work to the community. We have tried to list as many projects as possible that are + used by ERPNext, but this list may not be exhaustive.
+ + +ERPNext - Open Source, web based ERP
+Copyright © 2008 onwards, Web Notes Technologies Pvt Ltd, India
+ +This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version.
+ +This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details.
+ +For complete license see http://www.gnu.org/licenses/
+For more information please write to us at support@erpnext.com
+