added activity page
diff --git a/build.json b/build.json
index 95a38d6..76f3da0 100644
--- a/build.json
+++ b/build.json
@@ -78,6 +78,7 @@
"lib/js/lib/jquery.min.js:concat",
"lib/js/lib/history/history.min.js:concat",
"lib/js/lib/bootstrap.min.js:concat",
+ "lib/js/lib/sprintf.js",
"lib/js/core.min.js:concat",
"lib/js/legacy/globals.js",
"lib/js/legacy/utils/datatype.js",
@@ -121,6 +122,7 @@
"lib/js/legacy/jquery/jquery-ui.min.js:concat",
"lib/js/legacy/tiny_mce_33/jquery.tinymce.js:concat",
"lib/js/lib/bootstrap.min.js:concat",
+ "lib/js/lib/sprintf.js",
"lib/js/core.min.js:concat",
"lib/js/legacy/globals.js",
"lib/js/legacy/utils/datatype.js",
@@ -175,9 +177,9 @@
"lib/js/legacy/app.js",
"js/app.js",
"erpnext/startup/startup.js",
- "erpnext/startup/modules.js",
- "erpnext/startup/toolbar.js",
- "erpnext/startup/feature_setup.js"
+ "erpnext/startup/js/modules.js",
+ "erpnext/startup/js/toolbar.js",
+ "erpnext/startup/js/feature_setup.js"
]
}
diff --git a/erpnext/home/page/activity/__init__.py b/erpnext/home/page/activity/__init__.py
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/erpnext/home/page/activity/__init__.py
diff --git a/erpnext/home/page/activity/activity.css b/erpnext/home/page/activity/activity.css
new file mode 100644
index 0000000..f3988b2
--- /dev/null
+++ b/erpnext/home/page/activity/activity.css
@@ -0,0 +1,23 @@
+#activity-list .label {
+ display: inline-block;
+ width: 100px;
+ margin-right: 7px;
+}
+
+#activity-list .label-info {
+ cursor: pointer;
+}
+
+#activity-list .user-info {
+ float: right;
+ color: #777;
+ font-size: 10px;
+}
+
+#activity-list .date-sep {
+ margin-bottom: 11px;
+ padding: 5px 0px;
+ border-bottom: 1px solid #aaa;
+ color: #555;
+ font-size: 10px;
+}
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.html b/erpnext/home/page/activity/activity.html
new file mode 100644
index 0000000..b348d95
--- /dev/null
+++ b/erpnext/home/page/activity/activity.html
@@ -0,0 +1,6 @@
+<div class="layout-wrapper">
+ <a class="close" onclick="window.history.back();">×</a>
+ <h1>Activity</h1>
+ <div id="activity-list">
+ </div>
+</div>
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.js b/erpnext/home/page/activity/activity.js
new file mode 100644
index 0000000..77e4ab9
--- /dev/null
+++ b/erpnext/home/page/activity/activity.js
@@ -0,0 +1,57 @@
+wn.pages['activity'].onload = function(wrapper) {
+ var list = new wn.widgets.Listing({
+ method: 'home.page.activity.activity.get_feed',
+ parent: $('#activity-list'),
+ render_row: function(row, data) {
+ new erpnext.ActivityFeed(row, data);
+ }
+ });
+ list.run();
+}
+
+erpnext.last_feed_date = false;
+erpnext.ActivityFeed = Class.extend({
+ init: function(row, data) {
+ this.scrub_data(data);
+ this.add_date_separator(row, data);
+ $(row).append(repl('<span %(onclick)s\
+ class="label %(add_class)s">%(feed_type)s</span>\
+ %(link)s %(subject)s <span class="user-info">%(by)s</span>', data));
+ },
+ scrub_data: function(data) {
+ data.by = wn.boot.user_fullnames[data.owner];
+
+ // feedtype
+ if(!data.feed_type) {
+ data.feed_type = get_doctype_label(data.doc_type);
+ data.add_class = "label-info";
+ data.onclick = repl('onclick="window.location.href=\'#!List/%(feed_type)s\';"', data)
+ }
+
+ // color for comment
+ if(data.feed_type=='Comment') {
+ data.add_class = "label-important";
+ }
+
+ // link
+ if(data.doc_name && data.feed_type!='Login') {
+ data.link = repl('<a href="#!Form/%(doc_type)s/%(doc_name)s">%(doc_name)s</a>', data)
+ }
+ },
+ add_date_separator: function(row, data) {
+ var date = dateutil.str_to_obj(data.modified);
+ var last = erpnext.last_feed_date;
+
+ if((last && dateutil.get_diff(last, date)>1) || (!last)) {
+ var pdate = dateutil.comment_when(date);
+ var diff = dateutil.get_diff(new Date(), date);
+ if(diff < 1) {
+ pdate = 'Today';
+ } else if(diff > 6) {
+ pdate = dateutil.global_date_format(date);
+ }
+ $(row).html(repl('<div class="date-sep">%(date)s</div>', {date: pdate}));
+ }
+ erpnext.last_feed_date = date;
+ }
+})
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.py b/erpnext/home/page/activity/activity.py
new file mode 100644
index 0000000..8b8faf3
--- /dev/null
+++ b/erpnext/home/page/activity/activity.py
@@ -0,0 +1,16 @@
+import webnotes
+
+@webnotes.whitelist()
+def get_feed(arg=None):
+ """get feed"""
+ return webnotes.conn.sql("""select
+ distinct t1.name, t1.feed_type, t1.doc_type, t1.doc_name, t1.subject, t1.owner,
+ t1.modified
+ from tabFeed t1, tabDocPerm t2
+ where t1.doc_type = t2.parent
+ and t2.role in ('%s')
+ and ifnull(t2.`read`,0) = 1
+ order by t1.modified desc
+ limit %s, %s""" % ("','".join(webnotes.get_roles()),
+ webnotes.form_dict['limit_start'], webnotes.form_dict['limit_page_length']),
+ as_dict=1)
\ No newline at end of file
diff --git a/erpnext/home/page/activity/activity.txt b/erpnext/home/page/activity/activity.txt
new file mode 100644
index 0000000..e7f3963
--- /dev/null
+++ b/erpnext/home/page/activity/activity.txt
@@ -0,0 +1,28 @@
+# Page, activity
+[
+
+ # These values are common in all dictionaries
+ {
+ 'creation': '2012-02-29 11:59:13',
+ 'docstatus': 0,
+ 'modified': '2012-02-29 12:11:46',
+ 'modified_by': u'Administrator',
+ 'owner': u'Administrator'
+ },
+
+ # These values are common for all Page
+ {
+ 'doctype': 'Page',
+ 'module': u'Home',
+ 'name': '__common__',
+ 'page_name': u'activity',
+ 'standard': u'Yes',
+ 'title': u'Activity'
+ },
+
+ # Page, activity
+ {
+ 'doctype': 'Page',
+ 'name': u'activity'
+ }
+]
\ No newline at end of file
diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js
index 63a075c..3aa9049 100644
--- a/erpnext/home/page/desktop/desktop.js
+++ b/erpnext/home/page/desktop/desktop.js
@@ -3,12 +3,12 @@
erpnext.desktop.gradient = "<style>\
.case-%(name)s {\
background: %(start)s; /* Old browsers */\
- background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%, %(middle)s 44%, %(end)s 100%); /* FF3.6+ */\
- background: -webkit-gradient(radial, center center, 0px, center center, 100%, color-stop(0%,%(start)s), color-stop(44%,%(middle)s), color-stop(100%,%(end)s)); /* Chrome,Safari4+ */\
- background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Chrome10+,Safari5.1+ */\
- background: -o-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* Opera 12+ */\
- background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* IE10+ */\
- background: radial-gradient(center, ellipse cover, %(start)s 0%,%(middle)s 44%,%(end)s 100%); /* W3C */\
+ background: -moz-radial-gradient(center, ellipse cover, %(start)s 0%%, %(middle)s 44%%, %(end)s 100%%); /* FF3.6+ */\
+ background: -webkit-gradient(radial, center center, 0px, center center, 100%%, color-stop(0%%,%(start)s), color-stop(44%%,%(middle)s), color-stop(100%%,%(end)s)); /* Chrome,Safari4+ */\
+ background: -webkit-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Chrome10+,Safari5.1+ */\
+ background: -o-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* Opera 12+ */\
+ background: -ms-radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* IE10+ */\
+ background: radial-gradient(center, ellipse cover, %(start)s 0%%,%(middle)s 44%%,%(end)s 100%%); /* W3C */\
}\
</style>"
@@ -79,7 +79,7 @@
for(var i in wn.boot.modules_list) {
var m = wn.boot.modules_list[i];
- if(m!='Setup');
+ if(m!='Setup')
add_icon(m);
}
diff --git a/erpnext/home/page/event_updates/complete_registration.js b/erpnext/home/page/event_updates/complete_registration.js
deleted file mode 100644
index 8f7eed3..0000000
--- a/erpnext/home/page/event_updates/complete_registration.js
+++ /dev/null
@@ -1,124 +0,0 @@
-// ERPNext - web based ERP (http://erpnext.com)
-// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
-//
-// 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.
-//
-// You should have received a copy of the GNU General Public License
-// along with this program. If not, see <http://www.gnu.org/licenses/>.
-
-// complete my company registration
-// --------------------------------
-pscript.complete_registration = function(is_complete, profile) {
- if(is_complete == 'No'){
- var d = new Dialog(400, 200, "Setup your Account");
- if(user != 'Administrator'){
- d.no_cancel(); // Hide close image
- $('header').toggle(false);
- }
-
- d.make_body([
- ['HTML', 'Your Profile Details', '<h4>Your Profile Details</h4>'],
- ['Data', 'First Name'],
- ['Data', 'Last Name'],
- ['HTML', 'Company Details', '<h4>Create your first company</h4>'],
- ['Data','Company Name','Example: Your Company LLC'],
- ['Data','Company Abbreviation', 'Example: YC (all your acconts will have this as a suffix)'],
- ['Select','Fiscal Year Start Date'],
- ['Select','Default Currency'],
- ['Button','Save'],
- ]);
-
- // if company name is set, set the input value
- // and disable it
- if(wn.control_panel.company_name) {
- d.widgets['Company Name'].value = wn.control_panel.company_name;
- d.widgets['Company Name'].disabled = 1;
- }
-
- if(profile && profile.length>0) {
- if(profile[0].first_name && profile[0].first_name!='None') {
- d.widgets['First Name'].value = profile[0].first_name;
- }
-
- if(profile[0].last_name && profile[0].last_name!='None') {
- d.widgets['Last Name'].value = profile[0].last_name;
- }
- }
-
-
- //d.widgets['Save'].disabled = true; // disable Save button
- pscript.make_dialog_field(d);
-
- // submit details
- d.widgets['Save'].onclick = function()
- {
- d.widgets['Save'].set_working();
-
- flag = pscript.validate_fields(d);
- if(flag)
- {
- var args = [
- d.widgets['Company Name'].value,
- d.widgets['Company Abbreviation'].value,
- d.widgets['Fiscal Year Start Date'].value,
- d.widgets['Default Currency'].value,
- d.widgets['First Name'].value,
- d.widgets['Last Name'].value
- ];
-
- $c_obj('Setup Control','setup_account',JSON.stringify(args),function(r, rt){
- sys_defaults = r.message;
- user_fullname = r.message.user_fullname;
- d.hide();
- $('header').toggle(true);
- page_body.wntoolbar.set_user_name();
- });
- } else {
- d.widgets['Save'].done_working();
- }
- }
- d.show();
- }
-}
-
-// make dialog fields
-// ------------------
-pscript.make_dialog_field = function(d)
-{
- // fiscal year format
- fisc_format = d.widgets['Fiscal Year Start Date'];
- add_sel_options(fisc_format, ['', '1st Jan', '1st Apr', '1st Jul', '1st Oct']);
-
- // default currency
- currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN', 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR', 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF', 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP', 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF', 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF', 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD', 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR', 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP', 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR', 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY', 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV', 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
- currency = d.widgets['Default Currency'];
- add_sel_options(currency, currency_list);
-}
-
-
-// validate fields
-// ---------------
-pscript.validate_fields = function(d)
-{
- var lst = ['First Name', 'Company Name', 'Company Abbreviation', 'Fiscal Year Start Date', 'Default Currency'];
- var msg = 'Please enter the following fields';
- var flag = 1;
- for(var i=0; i<lst.length; i++)
- {
- if(!d.widgets[lst[i]].value || d.widgets[lst[i]].value=='None'){
- flag = 0;
- msg = msg + NEWLINE + lst[i];
- }
- }
-
- if(!flag) alert(msg);
- return flag;
-}
diff --git a/erpnext/patches/jan_mar_2012/navupdate.py b/erpnext/patches/jan_mar_2012/navupdate.py
index d29a2cf..aa9c086 100644
--- a/erpnext/patches/jan_mar_2012/navupdate.py
+++ b/erpnext/patches/jan_mar_2012/navupdate.py
@@ -32,6 +32,9 @@
reload_doc('utilities', 'page', 'todo')
reload_doc('utilities', 'page', 'calendar')
reload_doc('utilities', 'page', 'messages')
+ reload_doc('utilities', 'page', 'modules_setup')
+ reload_doc('utilities', 'page', 'users')
+ reload_doc('utilities', 'page', 'activity')
webnotes.conn.set_value('Control Panel', 'Control Panel', 'home_page',
'desktop')
diff --git a/erpnext/setup/doctype/setup_control/setup_control.py b/erpnext/setup/doctype/setup_control/setup_control.py
index beb3cc6..75cc038 100644
--- a/erpnext/setup/doctype/setup_control/setup_control.py
+++ b/erpnext/setup/doctype/setup_control/setup_control.py
@@ -14,24 +14,14 @@
# You should have received a copy of the GNU General Public License
# along with this program. If not, see <http://www.gnu.org/licenses/>.
-# Please edit this list and import only required elements
import webnotes
-from webnotes.utils import add_days, add_months, add_years, cint, cstr, date_diff, default_fields, flt, fmt_money, formatdate, generate_hash, getTraceback, get_defaults, get_first_day, get_last_day, getdate, has_common, month_name, now, nowdate, replace_newlines, sendmail, set_default, str_esc_quote, user_format, validate_email_add
-from webnotes.model import db_exists
-from webnotes.model.doc import Document, addchild, removechild, getchildren, make_autoname, SuperDocType
-from webnotes.model.doclist import getlist, copy_doclist
-from webnotes.model.code import get_obj, get_server_obj, run_server_obj, updatedb, check_syntax
-from webnotes import session, form, is_testing, msgprint, errprint
+from webnotes.utils import cint, cstr, flt, getdate, now, nowdate
+from webnotes.model.doc import Document, addchild
+from webnotes.model.code import get_obj
+from webnotes import session, form, msgprint
-set = webnotes.conn.set
sql = webnotes.conn.sql
-get_value = webnotes.conn.get_value
-in_transaction = webnotes.conn.in_transaction
-convert_to_lists = webnotes.conn.convert_to_lists
-
-# -----------------------------------------------------------------------------------------
-
class DocType:
def __init__(self, d, dl):
@@ -74,9 +64,10 @@
# Account Setup
# ---------------
def setup_account(self, args):
- import webnotes
- company_name, comp_abbr, fy_start, currency, first_name, last_name = eval(args)
- curr_fiscal_year,fy_start_date = self.get_fy_details(fy_start)
+ import webnotes, json
+ locals().update(args)
+
+ curr_fiscal_year, fy_start_date = self.get_fy_details(fy_start)
self.currency = currency
# Update Profile
@@ -92,7 +83,7 @@
# Company
master_dict = {'Company':{'company_name':company_name,
- 'abbr':comp_abbr,
+ 'abbr':company_abbr,
'default_currency':currency
}}
self.create_records(master_dict)
@@ -117,15 +108,39 @@
# Set
self.set_defaults(def_args)
- # Set Registration Complete
- set_default('registration_complete','1')
+ self.create_feed_and_todo()
- msgprint("Great! Your company has now been created")
+ webnotes.clear_cache()
+ msgprint("Company setup is complete")
import webnotes.utils
user_fullname = (first_name or '') + (last_name and (" " + last_name) or '')
return {'sys_defaults': webnotes.utils.get_defaults(), 'user_fullname': user_fullname}
+ def create_feed_and_todo(self):
+ """update activty feed and create todo for creation of item, customer, vendor"""
+ import home
+ home.make_feed('Comment', '', '', webnotes.session['user'],
+ '<i>"' + doc.comment + '"</i>', '#6B24B3')
+
+ d = Document('ToDo Item')
+ d.description = 'Create your first <a href="#!List/Customer">Customer</a>'
+ d.priority = 'High'
+ d.date = nowdate()
+ d.save(1)
+
+ d = Document('ToDo Item')
+ d.description = 'Create your first <a href="#!List/Item">Item</a>'
+ d.priority = 'High'
+ d.date = nowdate()
+ d.save(1)
+
+ d = Document('ToDo Item')
+ d.description = 'Create your first <a href="#!List/Supplier">Supplier</a>'
+ d.priority = 'High'
+ d.date = nowdate()
+ d.save(1)
+
# Get Fiscal year Details
# ------------------------
@@ -207,14 +222,6 @@
d = addchild(pr,'userroles', 'UserRole', 1)
d.role = r
d.save(1)
-
-
- # Sync DB
- # -------
- def sync_db(arg=''):
- import webnotes.model.db_schema
- sql("delete from `tabDocType Update Register`")
- webnotes.model.db_schema.sync_all()
def is_setup_okay(self, args):
@@ -224,21 +231,14 @@
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))
-
+ args = eval(args)
cp_defaults = webnotes.conn.get_value('Control Panel', None, 'account_id')
-
user_profile = webnotes.conn.get_value('Profile', args['user'], 'name')
from webnotes.utils import cint
total_users = get_total_users()
-
- #webnotes.logger.error("setup_control.is_setup_okay: " + cp_defaults + " " + user_profile + " " + str(total_users))
-
- #webnotes.logger.error("setup_control.is_setup_okay: Passed Values:" + args['account_name'] + " " + args['user'] + " " + str(args['total_users']))
-
+
if (cp_defaults==args['account_name']) and user_profile and \
(total_users==cint(args['total_users'])):
return 'True'
diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py
index a1d805e..79fd603 100644
--- a/erpnext/startup/event_handlers.py
+++ b/erpnext/startup/event_handlers.py
@@ -89,6 +89,10 @@
bootinfo['docs'] += webnotes.model.doctype.get('Event')
bootinfo['modules_list'] = webnotes.conn.get_global('modules_list')
+
+ # if no company, show a dialog box to create a new company
+ bootinfo['setup_complete'] = webnotes.conn.sql("""select name from
+ tabCompany limit 1""") and 'Yes' or 'No'
def get_letter_heads():
"""load letter heads with startup"""
diff --git a/erpnext/startup/js/complete_setup.js b/erpnext/startup/js/complete_setup.js
new file mode 100644
index 0000000..663c7b9
--- /dev/null
+++ b/erpnext/startup/js/complete_setup.js
@@ -0,0 +1,93 @@
+// ERPNext - web based ERP (http://erpnext.com)
+// Copyright (C) 2012 Web Notes Technologies Pvt Ltd
+//
+// 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.
+//
+// You should have received a copy of the GNU General Public License
+// along with this program. If not, see <http://www.gnu.org/licenses/>.
+
+// complete my company registration
+// --------------------------------
+
+erpnext.complete_setup = function() {
+ var currency_list = ['', 'AED', 'AFN', 'ALL', 'AMD', 'ANG', 'AOA', 'ARS', 'AUD', 'AZN',
+ 'BAM', 'BBD', 'BDT', 'BGN', 'BHD', 'BIF', 'BMD', 'BND', 'BOB', 'BRL', 'BSD', 'BTN', 'BYR',
+ 'BZD', 'CAD', 'CDF', 'CFA', 'CFP', 'CHF', 'CLP', 'CNY', 'COP', 'CRC', 'CUC', 'CZK', 'DJF',
+ 'DKK', 'DOP', 'DZD', 'EEK', 'EGP', 'ERN', 'ETB', 'EUR', 'EURO', 'FJD', 'FKP', 'FMG', 'GBP',
+ 'GEL', 'GHS', 'GIP', 'GMD', 'GNF', 'GQE', 'GTQ', 'GYD', 'HKD', 'HNL', 'HRK', 'HTG', 'HUF',
+ 'IDR', 'ILS', 'INR', 'IQD', 'IRR', 'ISK', 'JMD', 'JOD', 'JPY', 'KES', 'KGS', 'KHR', 'KMF',
+ 'KPW', 'KRW', 'KWD', 'KYD', 'KZT', 'LAK', 'LBP', 'LKR', 'LRD', 'LSL', 'LTL', 'LVL', 'LYD',
+ 'MAD', 'MDL', 'MGA', 'MKD', 'MMK', 'MNT', 'MOP', 'MRO', 'MUR', 'MVR', 'MWK', 'MXN', 'MYR',
+ 'MZM', 'NAD', 'NGN', 'NIO', 'NOK', 'NPR', 'NRs', 'NZD', 'OMR', 'PAB', 'PEN', 'PGK', 'PHP',
+ 'PKR', 'PLN', 'PYG', 'QAR', 'RMB', 'RON', 'RSD', 'RUB', 'RWF', 'SAR', 'SCR', 'SDG', 'SDR',
+ 'SEK', 'SGD', 'SHP', 'SOS', 'SRD', 'STD', 'SYP', 'SZL', 'THB', 'TJS', 'TMT', 'TND', 'TRY',
+ 'TTD', 'TWD', 'TZS', 'UAE', 'UAH', 'UGX', 'USD', 'USh', 'UYU', 'UZS', 'VEB', 'VND', 'VUV',
+ 'WST', 'XAF', 'XCD', 'XDR', 'XOF', 'XPF', 'YEN', 'YER', 'YTL', 'ZAR', 'ZMK', 'ZWR'];
+
+ var d = new wn.widgets.Dialog({
+ title: "Setup",
+ fields: [
+ {fieldname:'first_name', label:'Your First Name', fieldtype:'Data'},
+ {fieldname:'last_name', label:'Your Last Name', fieldtype:'Data'},
+ {fieldname:'company_name', label:'Company Name', fieldtype:'Data', reqd:1,
+ description: 'e.g. "My Company LLC"'},
+ {fieldname:'company_abbr', label:'Company Abbreviation', fieldtype:'Data',
+ description:'e.g. "MC"',reqd:1},
+ {fieldname:'fy_start', label:'Financial Year Start Date', fieldtype:'Select',
+ description:'Your financial year begins on"', reqd:1,
+ options=['', '1st Jan', '1st Apr', '1st Jul', '1st Oct'].join('\n')},
+ {fieldname:'currency': label: 'Default Currency', reqd:1,
+ options=currency_list.join('\n')},
+ {fieldname:'update', label:'Setup',fieldtype:'Button'}
+ ]
+ })
+
+ // prepare
+ if(user != 'Administrator'){
+ d.no_cancel(); // Hide close image
+ $('header').toggle(false); // hide toolbar
+ }
+
+ // company name already set
+ if(wn.control_panel.company_name) {
+ var inp = d.fields_dict.company_name.input;
+ inp.value = wn.control_panel.company_name;
+ inp.disabled = true;
+ }
+
+ // set first name, last name
+ if(user_fullname) {
+ u = user_fullname.spilt(' ');
+ if(u[0]) {
+ d.fields_dict.first_name.input.value = u[0];
+ }
+ if(u[1]) {
+ d.fields_dict.last_name.input.value = u[1];
+ }
+ }
+
+ // setup
+ d.fields_dict.update.input.onclick = function() {
+ var data = d.get_values();
+ if(!data) return;
+ $(this).set_working();
+ $c_obj('Setup Control','setup_account',data,function(r, rt){
+ sys_defaults = r.message;
+ user_fullname = r.message.user_fullname;
+ wn.boot.user_fullnames[user] = user_fullname;
+ d.hide();
+ $('header').toggle(true);
+ page_body.wntoolbar.set_user_name();
+ });
+ }
+
+ d.show();
+}
\ No newline at end of file
diff --git a/erpnext/startup/feature_setup.js b/erpnext/startup/js/feature_setup.js
similarity index 100%
rename from erpnext/startup/feature_setup.js
rename to erpnext/startup/js/feature_setup.js
diff --git a/erpnext/startup/modules.js b/erpnext/startup/js/modules.js
similarity index 100%
rename from erpnext/startup/modules.js
rename to erpnext/startup/js/modules.js
diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/js/toolbar.js
similarity index 100%
rename from erpnext/startup/toolbar.js
rename to erpnext/startup/js/toolbar.js
diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js
index 30ab28d..aef298c 100644
--- a/erpnext/startup/startup.js
+++ b/erpnext/startup/startup.js
@@ -30,7 +30,7 @@
'Website': 'website-home',
'HR': 'hr-home',
'Setup': 'Setup',
- 'Activity': 'Event Updates',
+ 'Activity': 'activity',
'To Do': 'todo',
'Calendar': 'calendar',
'Messages': 'messages',
@@ -58,7 +58,7 @@
} else {
// setup toolbar
erpnext.toolbar.setup();
-
+
// set interval for updates
erpnext.startup.set_periodic_updates();
@@ -66,6 +66,13 @@
// ------------------
$('footer').html('<div class="web-footer erpnext-footer">\
Powered by <a href="https://erpnext.com">ERPNext</a></div>');
+
+ // complete registration
+ if(in_list(user_roles,'System Manager') && (wn.boot.setup_complete=='No')) {
+ wn.require("erpnext/startup/js/complete_setup.js");
+ erpnext.complete_setup();
+ }
+
}
$('#startup_div').toggle(false);
@@ -87,28 +94,6 @@
}
-// Module Page
-// ====================================================================
-
-ModulePage = function(parent, module_name, module_label, help_page, callback) {
- this.parent = parent;
-
- // add to current page
- page_body.cur_page.module_page = this;
-
- this.wrapper = $a(parent,'div');
- this.module_name = module_name;
- this.transactions = [];
- this.page_head = new PageHeader(this.wrapper, module_label);
-
- if(help_page) {
- var btn = this.page_head.add_button('Help', function() { loadpage(this.help_page) }, 1, 'ui-icon-help')
- btn.help_page = help_page;
- }
-
- if(callback) this.callback = function(){ callback(); }
-}
-
// ========== Update Messages ============
var update_messages = function() {
// Updates Team Messages
diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py
index 28eacce..d57f0de 100644
--- a/erpnext/utilities/__init__.py
+++ b/erpnext/utilities/__init__.py
@@ -23,6 +23,7 @@
distinct criteria_name, doc_type, parent_doc_type
from `tabSearch Criteria`
where module='%(module)s'
- and docstatus in (0, NULL)
+ and docstatus in (0, NULL)
+ and ifnull(disabled, 0) = 0
order by criteria_name
limit %(limit_start)s, %(limit_page_length)s""" % webnotes.form_dict, as_dict=True)
\ No newline at end of file
diff --git a/js/all-app.js b/js/all-app.js
index 62d63ce..09e92a5 100644
--- a/js/all-app.js
+++ b/js/all-app.js
Binary files differ
diff --git a/js/all-web.js b/js/all-web.js
index 07fae99..98e1a7a 100644
--- a/js/all-web.js
+++ b/js/all-web.js
@@ -38,6 +38,33 @@
* lib/js/lib/bootstrap.min.js
*/!function(a){a(function(){"use strict",a.support.transition=function(){var b=document.body||document.documentElement,c=b.style,d=c.transition!==undefined||c.WebkitTransition!==undefined||c.MozTransition!==undefined||c.MsTransition!==undefined||c.OTransition!==undefined;return d&&{end:function(){var b="TransitionEnd";return a.browser.webkit?b="webkitTransitionEnd":a.browser.mozilla?b="transitionend":a.browser.opera&&(b="oTransitionEnd"),b}()}}()})}(window.jQuery),!function(a){"use strict";var b='[data-dismiss="alert"]',c=function(c){a(c).on("click",b,this.close)};c.prototype={constructor:c,close:function(b){function f(){e.remove(),e.trigger("closed")}var c=a(this),d=c.attr("data-target"),e;d||(d=c.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,"")),e=a(d),e.trigger("close"),b&&b.preventDefault(),e.length||(e=c.hasClass("alert")?c:c.parent()),e.removeClass("in"),a.support.transition&&e.hasClass("fade")?e.on(a.support.transition.end,f):f()}},a.fn.alert=function(b){return this.each(function(){var d=a(this),e=d.data("alert");e||d.data("alert",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.alert.Constructor=c,a(function(){a("body").on("click.alert.data-api",b,c.prototype.close)})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.button.defaults,c)};b.prototype={constructor:b,setState:function(a){var b="disabled",c=this.$element,d=c.data(),e=c.is("input")?"val":"html";a+="Text",d.resetText||c.data("resetText",c[e]()),c[e](d[a]||this.options[a]),setTimeout(function(){a=="loadingText"?c.addClass(b).attr(b,b):c.removeClass(b).removeAttr(b)},0)},toggle:function(){var a=this.$element.parent('[data-toggle="buttons-radio"]');a&&a.find(".active").removeClass("active"),this.$element.toggleClass("active")}},a.fn.button=function(c){return this.each(function(){var d=a(this),e=d.data("button"),f=typeof c=="object"&&c;e||d.data("button",e=new b(this,f)),c=="toggle"?e.toggle():c&&e.setState(c)})},a.fn.button.defaults={loadingText:"loading..."},a.fn.button.Constructor=b,a(function(){a("body").on("click.button.data-api","[data-toggle^=button]",function(b){a(b.target).button("toggle")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.carousel.defaults,c),this.options.slide&&this.slide(this.options.slide)};b.prototype={cycle:function(){return this.interval=setInterval(a.proxy(this.next,this),this.options.interval),this},to:function(b){var c=this.$element.find(".active"),d=c.parent().children(),e=d.index(c),f=this;if(b>d.length-1||b<0)return;return this.sliding?this.$element.one("slid",function(){f.to(b)}):e==b?this.pause().cycle():this.slide(b>e?"next":"prev",a(d[b]))},pause:function(){return clearInterval(this.interval),this},next:function(){if(this.sliding)return;return this.slide("next")},prev:function(){if(this.sliding)return;return this.slide("prev")},slide:function(b,c){var d=this.$element.find(".active"),e=c||d[b](),f=this.interval,g=b=="next"?"left":"right",h=b=="next"?"first":"last",i=this;return this.sliding=!0,f&&this.pause(),e=e.length?e:this.$element.find(".item")[h](),!a.support.transition&&this.$element.hasClass("slide")?(this.$element.trigger("slide"),d.removeClass("active"),e.addClass("active"),this.sliding=!1,this.$element.trigger("slid")):(e.addClass(b),e[0].offsetWidth,d.addClass(g),e.addClass(g),this.$element.trigger("slide"),this.$element.one(a.support.transition.end,function(){e.removeClass([b,g].join(" ")).addClass("active"),d.removeClass(["active",g].join(" ")),i.sliding=!1,setTimeout(function(){i.$element.trigger("slid")},0)})),f&&this.cycle(),this}},a.fn.carousel=function(c){return this.each(function(){var d=a(this),e=d.data("carousel"),f=typeof c=="object"&&c;e||d.data("carousel",e=new b(this,f)),typeof c=="number"?e.to(c):typeof c=="string"||(c=f.slide)?e[c]():e.cycle()})},a.fn.carousel.defaults={interval:5e3},a.fn.carousel.Constructor=b,a(function(){a("body").on("click.carousel.data-api","[data-slide]",function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=!e.data("modal")&&a.extend({},e.data(),c.data());e.carousel(f),b.preventDefault()})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.collapse.defaults,c),this.options.parent&&(this.$parent=a(this.options.parent)),this.options.toggle&&this.toggle()};b.prototype={constructor:b,dimension:function(){var a=this.$element.hasClass("width");return a?"width":"height"},show:function(){var b=this.dimension(),c=a.camelCase(["scroll",b].join("-")),d=this.$parent&&this.$parent.find(".in"),e;d&&d.length&&(e=d.data("collapse"),d.collapse("hide"),e||d.data("collapse",null)),this.$element[b](0),this.transition("addClass","show","shown"),this.$element[b](this.$element[0][c])},hide:function(){var a=this.dimension();this.reset(this.$element[a]()),this.transition("removeClass","hide","hidden"),this.$element[a](0)},reset:function(a){var b=this.dimension();this.$element.removeClass("collapse")[b](a||"auto")[0].offsetWidth,this.$element.addClass("collapse")},transition:function(b,c,d){var e=this,f=function(){c=="show"&&e.reset(),e.$element.trigger(d)};this.$element.trigger(c)[b]("in"),a.support.transition&&this.$element.hasClass("collapse")?this.$element.one(a.support.transition.end,f):f()},toggle:function(){this[this.$element.hasClass("in")?"hide":"show"]()}},a.fn.collapse=function(c){return this.each(function(){var d=a(this),e=d.data("collapse"),f=typeof c=="object"&&c;e||d.data("collapse",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.collapse.defaults={toggle:!0},a.fn.collapse.Constructor=b,a(function(){a("body").on("click.collapse.data-api","[data-toggle=collapse]",function(b){var c=a(this),d,e=c.attr("data-target")||b.preventDefault()||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,""),f=a(e).data("collapse")?"toggle":c.data();a(e).collapse(f)})})}(window.jQuery),!function(a){function d(){a(b).parent().removeClass("open")}"use strict";var b='[data-toggle="dropdown"]',c=function(b){var c=a(b).on("click.dropdown.data-api",this.toggle);a("html").on("click.dropdown.data-api",function(){c.parent().removeClass("open")})};c.prototype={constructor:c,toggle:function(b){var c=a(this),e=c.attr("data-target"),f,g;return e||(e=c.attr("href"),e=e&&e.replace(/.*(?=#[^\s]*$)/,"")),f=a(e),f.length||(f=c.parent()),g=f.hasClass("open"),d(),!g&&f.toggleClass("open"),!1}},a.fn.dropdown=function(b){return this.each(function(){var d=a(this),e=d.data("dropdown");e||d.data("dropdown",e=new c(this)),typeof b=="string"&&e[b].call(d)})},a.fn.dropdown.Constructor=c,a(function(){a("html").on("click.dropdown.data-api",d),a("body").on("click.dropdown.data-api",b,c.prototype.toggle)})}(window.jQuery),!function(a){function c(){var b=this,c=setTimeout(function(){b.$element.off(a.support.transition.end),d.call(b)},500);this.$element.one(a.support.transition.end,function(){clearTimeout(c),d.call(b)})}function d(a){this.$element.hide().trigger("hidden"),e.call(this)}function e(b){var c=this,d=this.$element.hasClass("fade")?"fade":"";if(this.isShown&&this.options.backdrop){var e=a.support.transition&&d;this.$backdrop=a('<div class="modal-backdrop '+d+'" />').appendTo(document.body),this.options.backdrop!="static"&&this.$backdrop.click(a.proxy(this.hide,this)),e&&this.$backdrop[0].offsetWidth,this.$backdrop.addClass("in"),e?this.$backdrop.one(a.support.transition.end,b):b()}else!this.isShown&&this.$backdrop?(this.$backdrop.removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?this.$backdrop.one(a.support.transition.end,a.proxy(f,this)):f.call(this)):b&&b()}function f(){this.$backdrop.remove(),this.$backdrop=null}function g(){var b=this;this.isShown&&this.options.keyboard?a(document).on("keyup.dismiss.modal",function(a){a.which==27&&b.hide()}):this.isShown||a(document).off("keyup.dismiss.modal")}"use strict";var b=function(b,c){this.options=a.extend({},a.fn.modal.defaults,c),this.$element=a(b).delegate('[data-dismiss="modal"]',"click.dismiss.modal",a.proxy(this.hide,this))};b.prototype={constructor:b,toggle:function(){return this[this.isShown?"hide":"show"]()},show:function(){var b=this;if(this.isShown)return;a("body").addClass("modal-open"),this.isShown=!0,this.$element.trigger("show"),g.call(this),e.call(this,function(){var c=a.support.transition&&b.$element.hasClass("fade");!b.$element.parent().length&&b.$element.appendTo(document.body),b.$element.show(),c&&b.$element[0].offsetWidth,b.$element.addClass("in"),c?b.$element.one(a.support.transition.end,function(){b.$element.trigger("shown")}):b.$element.trigger("shown")})},hide:function(b){b&&b.preventDefault();if(!this.isShown)return;var e=this;this.isShown=!1,a("body").removeClass("modal-open"),g.call(this),this.$element.trigger("hide").removeClass("in"),a.support.transition&&this.$element.hasClass("fade")?c.call(this):d.call(this)}},a.fn.modal=function(c){return this.each(function(){var d=a(this),e=d.data("modal"),f=typeof c=="object"&&c;e||d.data("modal",e=new b(this,f)),typeof c=="string"?e[c]():e.show()})},a.fn.modal.defaults={backdrop:!0,keyboard:!0},a.fn.modal.Constructor=b,a(function(){a("body").on("click.modal.data-api",'[data-toggle="modal"]',function(b){var c=a(this),d,e=a(c.attr("data-target")||(d=c.attr("href"))&&d.replace(/.*(?=#[^\s]+$)/,"")),f=e.data("modal")?"toggle":a.extend({},e.data(),c.data());b.preventDefault(),e.modal(f)})})}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("tooltip",a,b)};b.prototype={constructor:b,init:function(b,c,d){var e,f;this.type=b,this.$element=a(c),this.options=this.getOptions(d),this.enabled=!0,this.options.trigger!="manual"&&(e=this.options.trigger=="hover"?"mouseenter":"focus",f=this.options.trigger=="hover"?"mouseleave":"blur",this.$element.on(e,this.options.selector,a.proxy(this.enter,this)),this.$element.on(f,this.options.selector,a.proxy(this.leave,this))),this.options.selector?this._options=a.extend({},this.options,{trigger:"manual",selector:""}):this.fixTitle()},getOptions:function(b){return b=a.extend({},a.fn[this.type].defaults,b,this.$element.data()),b.delay&&typeof b.delay=="number"&&(b.delay={show:b.delay,hide:b.delay}),b},enter:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.show?c.show():(c.hoverState="in",setTimeout(function(){c.hoverState=="in"&&c.show()},c.options.delay.show))},leave:function(b){var c=a(b.currentTarget)[this.type](this._options).data(this.type);!c.options.delay||!c.options.delay.hide?c.hide():(c.hoverState="out",setTimeout(function(){c.hoverState=="out"&&c.hide()},c.options.delay.hide))},show:function(){var a,b,c,d,e,f,g;if(this.hasContent()&&this.enabled){a=this.tip(),this.setContent(),this.options.animation&&a.addClass("fade"),f=typeof this.options.placement=="function"?this.options.placement.call(this,a[0],this.$element[0]):this.options.placement,b=/in/.test(f),a.remove().css({top:0,left:0,display:"block"}).appendTo(b?this.$element:document.body),c=this.getPosition(b),d=a[0].offsetWidth,e=a[0].offsetHeight;switch(b?f.split(" ")[1]:f){case"bottom":g={top:c.top+c.height,left:c.left+c.width/2-d/2};break;case"top":g={top:c.top-e,left:c.left+c.width/2-d/2};break;case"left":g={top:c.top+c.height/2-e/2,left:c.left-d};break;case"right":g={top:c.top+c.height/2-e/2,left:c.left+c.width}}a.css(g).addClass(f).addClass("in")}},setContent:function(){var a=this.tip();a.find(".tooltip-inner").html(this.getTitle()),a.removeClass("fade in top bottom left right")},hide:function(){function d(){var b=setTimeout(function(){c.off(a.support.transition.end).remove()},500);c.one(a.support.transition.end,function(){clearTimeout(b),c.remove()})}var b=this,c=this.tip();c.removeClass("in"),a.support.transition&&this.$tip.hasClass("fade")?d():c.remove()},fixTitle:function(){var a=this.$element;(a.attr("title")||typeof a.attr("data-original-title")!="string")&&a.attr("data-original-title",a.attr("title")||"").removeAttr("title")},hasContent:function(){return this.getTitle()},getPosition:function(b){return a.extend({},b?{top:0,left:0}:this.$element.offset(),{width:this.$element[0].offsetWidth,height:this.$element[0].offsetHeight})},getTitle:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-original-title")||(typeof c.title=="function"?c.title.call(b[0]):c.title),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip=this.$tip||a(this.options.template)},validate:function(){this.$element[0].parentNode||(this.hide(),this.$element=null,this.options=null)},enable:function(){this.enabled=!0},disable:function(){this.enabled=!1},toggleEnabled:function(){this.enabled=!this.enabled},toggle:function(){this[this.tip().hasClass("in")?"hide":"show"]()}},a.fn.tooltip=function(c){return this.each(function(){var d=a(this),e=d.data("tooltip"),f=typeof c=="object"&&c;e||d.data("tooltip",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.tooltip.Constructor=b,a.fn.tooltip.defaults={animation:!0,delay:0,selector:!1,placement:"top",trigger:"hover",title:"",template:'<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>'}}(window.jQuery),!function(a){"use strict";var b=function(a,b){this.init("popover",a,b)};b.prototype=a.extend({},a.fn.tooltip.Constructor.prototype,{constructor:b,setContent:function(){var b=this.tip(),c=this.getTitle(),d=this.getContent();b.find(".popover-title")[a.type(c)=="object"?"append":"html"](c),b.find(".popover-content > *")[a.type(d)=="object"?"append":"html"](d),b.removeClass("fade top bottom left right in")},hasContent:function(){return this.getTitle()||this.getContent()},getContent:function(){var a,b=this.$element,c=this.options;return a=b.attr("data-content")||(typeof c.content=="function"?c.content.call(b[0]):c.content),a=a.toString().replace(/(^\s*|\s*$)/,""),a},tip:function(){return this.$tip||(this.$tip=a(this.options.template)),this.$tip}}),a.fn.popover=function(c){return this.each(function(){var d=a(this),e=d.data("popover"),f=typeof c=="object"&&c;e||d.data("popover",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.popover.Constructor=b,a.fn.popover.defaults=a.extend({},a.fn.tooltip.defaults,{placement:"right",content:"",template:'<div class="popover"><div class="arrow"></div><div class="popover-inner"><h3 class="popover-title"></h3><div class="popover-content"><p></p></div></div></div>'})}(window.jQuery),!function(a){function b(b,c){var d=a.proxy(this.process,this),e=a(b).is("body")?a(window):a(b),f;this.options=a.extend({},a.fn.scrollspy.defaults,c),this.$scrollElement=e.on("scroll.scroll.data-api",d),this.selector=(this.options.target||(f=a(b).attr("href"))&&f.replace(/.*(?=#[^\s]+$)/,"")||"")+" .nav li > a",this.$body=a("body").on("click.scroll.data-api",this.selector,d),this.refresh(),this.process()}"use strict",b.prototype={constructor:b,refresh:function(){this.targets=this.$body.find(this.selector).map(function(){var b=a(this).attr("href");return/^#\w/.test(b)&&a(b).length?b:null}),this.offsets=a.map(this.targets,function(b){return a(b).position().top})},process:function(){var a=this.$scrollElement.scrollTop()+this.options.offset,b=this.offsets,c=this.targets,d=this.activeTarget,e;for(e=b.length;e--;)d!=c[e]&&a>=b[e]&&(!b[e+1]||a<=b[e+1])&&this.activate(c[e])},activate:function(a){var b;this.activeTarget=a,this.$body.find(this.selector).parent(".active").removeClass("active"),b=this.$body.find(this.selector+'[href="'+a+'"]').parent("li").addClass("active"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active")}},a.fn.scrollspy=function(c){return this.each(function(){var d=a(this),e=d.data("scrollspy"),f=typeof c=="object"&&c;e||d.data("scrollspy",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.scrollspy.Constructor=b,a.fn.scrollspy.defaults={offset:10},a(function(){a('[data-spy="scroll"]').each(function(){var b=a(this);b.scrollspy(b.data())})})}(window.jQuery),!function(a){"use strict";var b=function(b){this.element=a(b)};b.prototype={constructor:b,show:function(){var b=this.element,c=b.closest("ul:not(.dropdown-menu)"),d=b.attr("data-target"),e,f;d||(d=b.attr("href"),d=d&&d.replace(/.*(?=#[^\s]*$)/,""));if(b.parent("li").hasClass("active"))return;e=c.find(".active a").last()[0],b.trigger({type:"show",relatedTarget:e}),f=a(d),this.activate(b.parent("li"),c),this.activate(f,f.parent(),function(){b.trigger({type:"shown",relatedTarget:e})})},activate:function(b,c,d){function g(){e.removeClass("active").find("> .dropdown-menu > .active").removeClass("active"),b.addClass("active"),f?(b[0].offsetWidth,b.addClass("in")):b.removeClass("fade"),b.parent(".dropdown-menu")&&b.closest("li.dropdown").addClass("active"),d&&d()}var e=c.find("> .active"),f=d&&a.support.transition&&e.hasClass("fade");f?e.one(a.support.transition.end,g):g(),e.removeClass("in")}},a.fn.tab=function(c){return this.each(function(){var d=a(this),e=d.data("tab");e||d.data("tab",e=new b(this)),typeof c=="string"&&e[c]()})},a.fn.tab.Constructor=b,a(function(){a("body").on("click.tab.data-api",'[data-toggle="tab"], [data-toggle="pill"]',function(b){b.preventDefault(),a(this).tab("show")})})}(window.jQuery),!function(a){"use strict";var b=function(b,c){this.$element=a(b),this.options=a.extend({},a.fn.typeahead.defaults,c),this.matcher=this.options.matcher||this.matcher,this.sorter=this.options.sorter||this.sorter,this.highlighter=this.options.highlighter||this.highlighter,this.$menu=a(this.options.menu).appendTo("body"),this.source=this.options.source,this.shown=!1,this.listen()};b.prototype={constructor:b,select:function(){var a=this.$menu.find(".active").attr("data-value");return this.$element.val(a),this.hide()},show:function(){var b=a.extend({},this.$element.offset(),{height:this.$element[0].offsetHeight});return this.$menu.css({top:b.top+b.height,left:b.left}),this.$menu.show(),this.shown=!0,this},hide:function(){return this.$menu.hide(),this.shown=!1,this},lookup:function(b){var c=this,d,e;return this.query=this.$element.val(),this.query?(d=a.grep(this.source,function(a){if(c.matcher(a))return a}),d=this.sorter(d),d.length?this.render(d.slice(0,this.options.items)).show():this.shown?this.hide():this):this.shown?this.hide():this},matcher:function(a){return~a.toLowerCase().indexOf(this.query.toLowerCase())},sorter:function(a){var b=[],c=[],d=[],e;while(e=a.shift())e.toLowerCase().indexOf(this.query.toLowerCase())?~e.indexOf(this.query)?c.push(e):d.push(e):b.push(e);return b.concat(c,d)},highlighter:function(a){return a.replace(new RegExp("("+this.query+")","ig"),function(a,b){return"<strong>"+b+"</strong>"})},render:function(b){var c=this;return b=a(b).map(function(b,d){return b=a(c.options.item).attr("data-value",d),b.find("a").html(c.highlighter(d)),b[0]}),b.first().addClass("active"),this.$menu.html(b),this},next:function(b){var c=this.$menu.find(".active").removeClass("active"),d=c.next();d.length||(d=a(this.$menu.find("li")[0])),d.addClass("active")},prev:function(a){var b=this.$menu.find(".active").removeClass("active"),c=b.prev();c.length||(c=this.$menu.find("li").last()),c.addClass("active")},listen:function(){this.$element.on("blur",a.proxy(this.blur,this)).on("keypress",a.proxy(this.keypress,this)).on("keyup",a.proxy(this.keyup,this)),(a.browser.webkit||a.browser.msie)&&this.$element.on("keydown",a.proxy(this.keypress,this)),this.$menu.on("click",a.proxy(this.click,this)).on("mouseenter","li",a.proxy(this.mouseenter,this))},keyup:function(a){a.stopPropagation(),a.preventDefault();switch(a.keyCode){case 40:case 38:break;case 9:case 13:if(!this.shown)return;this.select();break;case 27:this.hide();break;default:this.lookup()}},keypress:function(a){a.stopPropagation();if(!this.shown)return;switch(a.keyCode){case 9:case 13:case 27:a.preventDefault();break;case 38:a.preventDefault(),this.prev();break;case 40:a.preventDefault(),this.next()}},blur:function(a){var b=this;a.stopPropagation(),a.preventDefault(),setTimeout(function(){b.hide()},150)},click:function(a){a.stopPropagation(),a.preventDefault(),this.select()},mouseenter:function(b){this.$menu.find(".active").removeClass("active"),a(b.currentTarget).addClass("active")}},a.fn.typeahead=function(c){return this.each(function(){var d=a(this),e=d.data("typeahead"),f=typeof c=="object"&&c;e||d.data("typeahead",e=new b(this,f)),typeof c=="string"&&e[c]()})},a.fn.typeahead.defaults={source:[],items:8,menu:'<ul class="typeahead dropdown-menu"></ul>',item:'<li><a href="#"></a></li>'},a.fn.typeahead.Constructor=b,a(function(){a("body").on("focus.typeahead.data-api",'[data-provide="typeahead"]',function(b){var c=a(this);if(c.data("typeahead"))return;b.preventDefault(),c.typeahead(c.data())})})}(window.jQuery);
/*
+ * lib/js/lib/sprintf.js
+ */
+var sprintf=(function(){function get_type(variable){return Object.prototype.toString.call(variable).slice(8,-1).toLowerCase();}
+function str_repeat(input,multiplier){for(var output=[];multiplier>0;output[--multiplier]=input){}
+return output.join('');}
+var str_format=function(){if(!str_format.cache.hasOwnProperty(arguments[0])){str_format.cache[arguments[0]]=str_format.parse(arguments[0]);}
+return str_format.format.call(null,str_format.cache[arguments[0]],arguments);};str_format.format=function(parse_tree,argv){var cursor=1,tree_length=parse_tree.length,node_type='',arg,output=[],i,k,match,pad,pad_character,pad_length;for(i=0;i<tree_length;i++){node_type=get_type(parse_tree[i]);if(node_type==='string'){output.push(parse_tree[i]);}
+else if(node_type==='array'){match=parse_tree[i];if(match[2]){arg=argv[cursor];for(k=0;k<match[2].length;k++){if(!arg.hasOwnProperty(match[2][k])){arg='';}else{arg=arg[match[2][k]];}}}
+else if(match[1]){arg=argv[match[1]];}
+else{arg=argv[cursor++];}
+if(/[^s]/.test(match[8])&&(get_type(arg)!='number')){throw(sprintf('[sprintf] expecting number but found %s',get_type(arg)));}
+switch(match[8]){case'b':arg=arg.toString(2);break;case'c':arg=String.fromCharCode(arg);break;case'd':arg=parseInt(arg,10);break;case'e':arg=match[7]?arg.toExponential(match[7]):arg.toExponential();break;case'f':arg=match[7]?parseFloat(arg).toFixed(match[7]):parseFloat(arg);break;case'o':arg=arg.toString(8);break;case's':arg=((arg=String(arg))&&match[7]?arg.substring(0,match[7]):arg);break;case'u':arg=Math.abs(arg);break;case'x':arg=arg.toString(16);break;case'X':arg=arg.toString(16).toUpperCase();break;}
+arg=(/[def]/.test(match[8])&&match[3]&&arg>=0?'+'+arg:arg);pad_character=match[4]?match[4]=='0'?'0':match[4].charAt(1):' ';pad_length=match[6]-String(arg).length;pad=match[6]?str_repeat(pad_character,pad_length):'';output.push(match[5]?arg+pad:pad+arg);}}
+return output.join('');};str_format.cache={};str_format.parse=function(fmt){var _fmt=fmt,match=[],parse_tree=[],arg_names=0;while(_fmt){if((match=/^[^\x25]+/.exec(_fmt))!==null){parse_tree.push(match[0]);}
+else if((match=/^\x25{2}/.exec(_fmt))!==null){parse_tree.push('%');}
+else if((match=/^\x25(?:([1-9]\d*)\$|\(([^\)]+)\))?(\+)?(0|'[^$])?(-)?(\d+)?(?:\.(\d+))?([b-fosuxX])/.exec(_fmt))!==null){if(match[2]){arg_names|=1;var field_list=[],replacement_field=match[2],field_match=[];if((field_match=/^([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);while((replacement_field=replacement_field.substring(field_match[0].length))!==''){if((field_match=/^\.([a-z_][a-z_\d]*)/i.exec(replacement_field))!==null){field_list.push(field_match[1]);}
+else if((field_match=/^\[(\d+)\]/.exec(replacement_field))!==null){field_list.push(field_match[1]);}
+else{}}}
+else{}
+match[2]=field_list;}
+else{arg_names|=2;}
+if(arg_names===3){throw('[sprintf] mixing positional and named placeholders is not (yet) supported');}
+parse_tree.push(match);}
+else{}
+_fmt=_fmt.substring(match[0].length);}
+return parse_tree;};return str_format;})();var vsprintf=function(fmt,argv){argv.unshift(fmt);return sprintf.apply(null,argv);};
+/*
* lib/js/core.min.js
*/
/*
@@ -165,6 +192,7 @@
function $p(ele,top,left){ele.style.position='absolute';ele.style.top=top+'px';ele.style.left=left+'px';}
function replace_newlines(t){return t?t.replace(/\n/g,'<br>'):'';}
function cstr(s){if(s==null)return'';return s+'';}
+function nth(number){number=cint(number);var s='th';if((number+'').substr(-1)=='1')s='st';if((number+'').substr(-1)=='2')s='nd';if((number+'').substr(-1)=='3')s='rd';return number+s;}
function flt(v,decimals){if(v==null||v=='')return 0;v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v))
v=0;if(decimals!=null)
return v.toFixed(decimals);return v;}
@@ -178,9 +206,7 @@
return s;}
var rstrip=function(s,chars){if(!chars)chars=['\n','\t',' '];var last_char=s.substr(s.length-1);while(in_list(chars,last_char)){var s=s.substr(0,this.length-1);last_char=s.substr(this.length-1);}
return s;}
-function repl_all(s,s1,s2){var idx=s.indexOf(s1);while(idx!=-1){s=s.replace(s1,s2);idx=s.indexOf(s1);}
-return s;}
-function repl(s,dict){if(s==null)return'';for(key in dict)s=repl_all(s,'%('+key+')s',dict[key]);return s;}
+function repl(s,dict){return sprintf(s,dict);}
function keys(obj){var mykeys=[];for(key in obj)mykeys[mykeys.length]=key;return mykeys;}
function values(obj){var myvalues=[];for(key in obj)myvalues[myvalues.length]=obj[key];return myvalues;}
function in_list(list,item){for(var i=0;i<list.length;i++)
@@ -188,8 +214,7 @@
function has_common(list1,list2){if(!list1||!list2)return false;for(var i=0;i<list1.length;i++){if(in_list(list2,list1[i]))return true;}
return false;}
var inList=in_list;function add_lists(l1,l2){var l=[];for(var k in l1)l.push(l1[k]);for(var k in l2)l.push(l2[k]);return l;}
-function docstring(obj){var l=[];for(key in obj){var v=obj[key];if(v!=null){if(typeof(v)==typeof(1)){l[l.length]="'"+key+"':"+(v+'');}else{v=v+'';l[l.length]="'"+key+"':'"+v.replace(/'/g,"\\'").replace(/\n/g,"\\n")+"'";}}}
-return"{"+l.join(',')+'}';}
+function docstring(obj){return JSON.stringify(obj);}
function DocLink(p,doctype,name,onload){var a=$a(p,'span','link_type');a.innerHTML=a.dn=name;a.dt=doctype;a.onclick=function(){loaddoc(this.dt,this.dn,onload)};return a;}
var doc_link=DocLink;var known_numbers={0:'zero',1:'one',2:'two',3:'three',4:'four',5:'five',6:'six',7:'seven',8:'eight',9:'nine',10:'ten',11:'eleven',12:'twelve',13:'thirteen',14:'fourteen',15:'fifteen',16:'sixteen',17:'seventeen',18:'eighteen',19:'nineteen',20:'twenty',30:'thirty',40:'forty',50:'fifty',60:'sixty',70:'seventy',80:'eighty',90:'ninety'}
function in_words(n){var is_million=wn.control_panel.currency_format=='Millions'?1:0;n=cint(n)
@@ -234,7 +259,7 @@
else if(user_fmt=='dd/mm/yyyy'){var d=d.split('/');return d[2]+'-'+d[1]+'-'+d[0];}
else if(user_fmt=='yyyy-mm-dd'){return d;}
else if(user_fmt=='mm/dd/yyyy'){var d=d.split('/');return d[2]+'-'+d[0]+'-'+d[1];}
-else if(user_fmt=='mm-dd-yyyy'){var d=d.split('-');return d[2]+'-'+d[0]+'-'+d[1];}},global_date_format:function(d){if(d.substr)d=this.str_to_obj(d);return d.getDate()+' '+month_list_full[d.getMonth()]+' '+d.getFullYear();},get_today:function(){var today=new Date();var m=(today.getMonth()+1)+'';if(m.length==1)m='0'+m;var d=today.getDate()+'';if(d.length==1)d='0'+d;return today.getFullYear()+'-'+m+'-'+d;},get_cur_time:function(){var d=new Date();var hh=d.getHours()+''
+else if(user_fmt=='mm-dd-yyyy'){var d=d.split('-');return d[2]+'-'+d[0]+'-'+d[1];}},global_date_format:function(d){if(d.substr)d=this.str_to_obj(d);return nth(d.getDate())+' '+month_list_full[d.getMonth()]+' '+d.getFullYear();},get_today:function(){var today=new Date();var m=(today.getMonth()+1)+'';if(m.length==1)m='0'+m;var d=today.getDate()+'';if(d.length==1)d='0'+d;return today.getFullYear()+'-'+m+'-'+d;},get_cur_time:function(){var d=new Date();var hh=d.getHours()+''
var mm=cint(d.getMinutes()/5)*5+''
return(hh.length==1?'0'+hh:hh)+':'+(mm.length==1?'0'+mm:mm);}}
wn.datetime.only_date=function(val){if(val==null||val=='')return null;if(val.search(':')!=-1){var tmp=val.split(' ');var d=tmp[0].split('-');}else{var d=val.split('-');}
@@ -246,7 +271,8 @@
wn.datetime.time_to_hhmm=function(hh,mm,am){if(am=='AM'&&hh=='12'){hh='00';}else if(am=='PM'&&hh!='12'){hh=cint(hh)+12;}
return hh+':'+mm;}
function prettyDate(time){if(!time)return''
-var date=new Date((time||"").replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\.[0-9]*/,"")),diff=(((new Date()).getTime()-date.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0)
+var date=time;if(typeof(time)=="string")
+date=new Date((time||"").replace(/-/g,"/").replace(/[TZ]/g," ").replace(/\.[0-9]*/,""));var diff=(((new Date()).getTime()-date.getTime())/1000),day_diff=Math.floor(diff/86400);if(isNaN(day_diff)||day_diff<0)
return'';return day_diff==0&&(diff<60&&"just now"||diff<120&&"1 minute ago"||diff<3600&&Math.floor(diff/60)+" minutes ago"||diff<7200&&"1 hour ago"||diff<86400&&Math.floor(diff/3600)+" hours ago")||day_diff==1&&"Yesterday"||day_diff<7&&day_diff+" days ago"||day_diff<31&&Math.ceil(day_diff/7)+" weeks ago"||day_diff<365&&Math.ceil(day_diff/30)+" months ago"||"more than "+Math.floor(day_diff/365)+" year(s) ago";}
if(typeof jQuery!="undefined")
jQuery.fn.prettyDate=function(){return this.each(function(){var date=prettyDate(this.title);if(date)
@@ -678,7 +704,7 @@
this.clear=function(){this.results_area.innerHTML='';this.table=null;$ds(this.results_area);$dh(this.no_results_area);}
this.make_results=function(r,rt){if(this.start==0)this.clear();$dh(this.more_button_area);if(this.loading_img)$dh(this.loading_img)
if(r.message)r.values=r.message;if(r.values&&r.values.length){this.values=r.values;var m=Math.min(r.values.length,this.page_length);for(var i=0;i<m;i++){var row=this.add_row();this.opts.render_row(row,r.values[i],this,i);}
-this.start+=m;if(r.values.length>this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
+this.start+=m;if(r.values.length>=this.page_length)$ds(this.more_button_area);}else{if(this.start==0){$dh(this.results_area);$ds(this.no_results_area);}}
if(this.onrun)this.onrun();if(this.opts.onrun)this.opts.onrun();}
this.add_row=function(){return $a(this.results_area,'div','',(opts.cell_style?opts.cell_style:{padding:'3px 0px'}));}
this.run=function(callback,append){if(callback)
@@ -1040,20 +1066,17 @@
/*
* erpnext/startup/startup.js
*/
-var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'Event Updates','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
+var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions'}
erpnext.startup.set_globals=function(){pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway)
if(inList(user_roles,'System Manager'))is_system_manager=1;}
erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.custom_css){set_style(wn.boot.custom_css);}
if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('<div class="web-footer erpnext-footer">\
- Powered by <a href="https://erpnext.com">ERPNext</a></div>');}
+ Powered by <a href="https://erpnext.com">ERPNext</a></div>');if(in_list(user_roles,'System Manager')&&(wn.boot.setup_complete=='No')){wn.require("erpnext/startup/js/complete_setup.js");erpnext.complete_setup();}}
$('#startup_div').toggle(false);}
show_chart_browser=function(nm,chart_type){var call_back=function(){if(nm=='Sales Browser'){var sb_obj=new SalesBrowser();sb_obj.set_val(chart_type);}
else if(nm=='Accounts Browser')
pscript.make_chart(chart_type);}
loadpage(nm,call_back);}
-ModulePage=function(parent,module_name,module_label,help_page,callback){this.parent=parent;page_body.cur_page.module_page=this;this.wrapper=$a(parent,'div');this.module_name=module_name;this.transactions=[];this.page_head=new PageHeader(this.wrapper,module_label);if(help_page){var btn=this.page_head.add_button('Help',function(){loadpage(this.help_page)},1,'ui-icon-help')
-btn.help_page=help_page;}
-if(callback)this.callback=function(){callback();}}
var update_messages=function(){if(inList(['Guest'],user)){return;}
$c_page('home','event_updates','get_unread_messages',null,function(r,rt){if(!r.exc){page_body.wntoolbar.set_new_comments(r.message);var circle=$('#msg_count')
if(circle){if(r.message.length){circle.find('span:first').text(r.message.length);circle.toggle(true);}else{circle.toggle(false);}}}else{clearInterval(wn.updates.id);}});}
diff --git a/version.num b/version.num
index 3879e48..d6ee760 100644
--- a/version.num
+++ b/version.num
@@ -1 +1 @@
-753
\ No newline at end of file
+762
\ No newline at end of file