diff --git a/home/page/my_company/my_company.js b/home/page/my_company/my_company.js index 8b1b44ff9ad..08506076440 100644 --- a/home/page/my_company/my_company.js +++ b/home/page/my_company/my_company.js @@ -143,7 +143,10 @@ MemberList.prototype.make_list = function() { var c1 = repl(' AND (first_name LIKE "%(txt)s" OR last_name LIKE "%(txt)s" OR name LIKE "%(txt)s")', {txt:'%' + me.search_inp.value + '%'}); } - this.query = repl("SELECT distinct ifnull(name,''), ifnull(concat_ws(' ', first_name, last_name),''), ifnull(messanger_status,''), ifnull(gender,''), ifnull(file_list,''), 0, enabled from tabProfile where docstatus != 2 AND name not in ('Guest','Administrator') %(cond)s ORDER BY name asc",{cond:c1}); + this.query = repl("SELECT distinct ifnull(name,''), ifnull(concat_ws(' ', first_name, last_name),''), \ + ifnull(messanger_status,''), ifnull(gender,''), ifnull(file_list,''), 0, enabled, last_login \ + from tabProfile where docstatus != 2 AND name not in ('Guest','Administrator') %(cond)s \ + ORDER BY name asc",{cond:c1}); } this.lst.make(this.lst_area); this.lst.show_cell= function(cell, ri, ci, d) { diff --git a/master.sql.gz b/master.sql.gz index 05fc390e8e5..273277e05be 100644 Binary files a/master.sql.gz and b/master.sql.gz differ diff --git a/patches/patch.py b/patches/patch.py index f1841971c83..384ee2a0032 100644 --- a/patches/patch.py +++ b/patches/patch.py @@ -1,7 +1,7 @@ # REMEMBER to update this # ======================== -last_patch = 325 +last_patch = 326 #------------------------------------------- @@ -1294,3 +1294,7 @@ def execute(patch_no): elif patch_no == 325: sql("update `tabDocField` set fieldtype = 'Data' where parent = 'Salary Slip' and fieldname = 'total_days_in_month'") reload_doc('hr', 'doctype', 'salary_slip') + elif patch_no == 326: + # load the new billing page + if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')): + reload_doc('server_tools','page','billing') diff --git a/setup/doctype/company/company.js b/setup/doctype/company/company.js index e27052ca863..c82b95c66a2 100644 --- a/setup/doctype/company/company.js +++ b/setup/doctype/company/company.js @@ -2,6 +2,32 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { if(doc.abbr && !doc.__islocal) set_field_permlevel('abbr',1); } +cur_frm.cscript.has_special_chars = function(t) { + var iChars = "!@#$%^*+=-[]\\\';,/{}|\":<>?"; + for (var i = 0; i < t.length; i++) { + if (iChars.indexOf(t.charAt(i)) != -1) { + return true; + } + } + return false; +} + +cur_frm.cscript.company_name = function(doc){ + if(doc.company_name && cur_frm.cscript.has_special_chars(doc.company_name)){ + msgprint("Special Characters ! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ? are not allowed for\nCompany Name " + doc.company_name +"") + doc.company_name = ''; + refresh_field('company_name'); + } +} + +cur_frm.cscript.abbr = function(doc){ + if(doc.abbr && cur_frm.cscript.has_special_chars(doc.abbr)){ + msgprint("Special Characters ! @ # $ % ^ * + = - [ ] ' ; , / { } | : < > ? are not allowed for\nAbbr " + doc.abbr +"") + doc.abbr = ''; + refresh_field('abbr'); + } +} + cur_frm.fields_dict.default_bank_account.get_query = function(doc) { return 'SELECT `tabAccount`.name, `tabAccount`.debit_or_credit, `tabAccount`.group_or_ledger FROM `tabAccount` WHERE `tabAccount`.company = "'+doc.name+'" AND `tabAccount`.group_or_ledger = "Ledger" AND `tabAccount`.docstatus != 2 AND `tabAccount`.account_type = "Bank or Cash" AND `tabAccount`.%(key)s LIKE "%s" ORDER BY `tabAccount`.name LIMIT 50'; } diff --git a/setup/doctype/setup_control/setup_control.py b/setup/doctype/setup_control/setup_control.py index e01e60ae58e..61e3a82cb3c 100644 --- a/setup/doctype/setup_control/setup_control.py +++ b/setup/doctype/setup_control/setup_control.py @@ -13,7 +13,6 @@ sql = webnotes.conn.sql get_value = webnotes.conn.get_value in_transaction = webnotes.conn.in_transaction convert_to_lists = webnotes.conn.convert_to_lists - # ----------------------------------------------------------------------------------------- @@ -37,9 +36,11 @@ class DocType: #----------------------- def set_account_details(self, args): args = eval(args) - #webnotes.logger.error("args in set_account_details of setup_control: " + str(args)) + self.set_cp_defaults(args['company'], args['industry'], args['time_zone'], args['country'], args['account_name']) self.create_profile(args['user'], args['first_name'], args['last_name']) + + from server_tools.gateway_utils import update_client_control update_client_control(args['total_users']) @@ -182,7 +183,7 @@ class DocType: Validates if setup has been performed after database allocation """ - from server_tools.gateway_utils import update_client_control, get_total_users + from server_tools.gateway_utils import get_total_users args = eval(args) #webnotes.logger.error("args in set_account_details of setup_control: " + str(args)) diff --git a/startup/event_handlers.py b/startup/event_handlers.py index 2bd8faee62d..53b979e066e 100644 --- a/startup/event_handlers.py +++ b/startup/event_handlers.py @@ -33,7 +33,7 @@ def update_account_details(): webnotes.conn.set_global('days_to_expiry', webnotes.form_dict.get('days_to_expiry')) if webnotes.form_dict.get('first_name'): - from server_tools.server_tools.gateway_utils import update_user_details + from server_tools.gateway_utils import update_user_details update_user_details() # @@ -43,6 +43,7 @@ def on_login_post_session(login_manager): # login from if webnotes.form_dict.get('login_from'): webnotes.session['data']['login_from'] = webnotes.form.getvalue('login_from') + webnotes.session_obj.update() update_account_details() @@ -51,7 +52,7 @@ def on_login_post_session(login_manager): # def on_logout(login_manager): if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): - from server_tools.server_tools.gateway_utils import logout_sso + from server_tools.gateway_utils import logout_sso logout_sso() # diff --git a/startup/startup.css b/startup/startup.css index f4fd39e6ca3..67393aac08e 100644 --- a/startup/startup.css +++ b/startup/startup.css @@ -2,7 +2,7 @@ body { background-color: #e2e2e2; } -div.layout_wrapper { +.layout_wrapper { padding: 13px; margin: 7px; -moz-box-shadow: 1px 1px 6px #AAA; diff --git a/startup/startup.js b/startup/startup.js index a93906c3be0..1280e0f22ec 100644 --- a/startup/startup.js +++ b/startup/startup.js @@ -46,11 +46,11 @@ function startup_setup() { // for logout and payment var callback = function(r,rt) { if(r.message){ - login_file = r.message; + login_file = 'http://' + r.message; } else { - login_file = 'https://www.erpnext.com'; + login_file = 'http://www.erpnext.com'; } // setup toolbar pscript.startup_setup_toolbar(); diff --git a/utilities/doctype/sms_control/sms_control.py b/utilities/doctype/sms_control/sms_control.py index de11e903109..a1edf83bf36 100644 --- a/utilities/doctype/sms_control/sms_control.py +++ b/utilities/doctype/sms_control/sms_control.py @@ -58,7 +58,7 @@ class DocType: def connect_gateway(self): "login to gateway" from webnotes.utils.webservice import FrameworkServer - fw = FrameworkServer('www.erpnext.com','/','__system@webnotestech.com','password',https=1) + fw = FrameworkServer('www.erpnext.com', '/', '__system@webnotestech.com', 'password', https=1) return fw def get_sender_name(self):