diff --git a/build.json b/build.json index 95a38d6c57..499d594af4 100644 --- a/build.json +++ b/build.json @@ -9,6 +9,7 @@ "lib/js/wn/require.js", "lib/js/wn/dom.js", "lib/js/wn/page.js", + "lib/js/wn/misc/user.js", "lib/js/lib/json2.js", "lib/js/core.js" ] @@ -36,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", @@ -52,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", @@ -75,13 +74,12 @@ { "js/all-web.js": [ - "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", - "lib/js/legacy/utils/browser_detect.js", "lib/js/legacy/utils/datetime.js", "lib/js/legacy/utils/dom.js", "lib/js/legacy/utils/handler.js", @@ -116,15 +114,14 @@ { "js/all-app.js": [ - "lib/js/lib/jquery.min.js:concat", "lib/js/lib/history/history.min.js:concat", "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", - "lib/js/legacy/utils/browser_detect.js", "lib/js/legacy/utils/datetime.js", "lib/js/legacy/utils/dom.js", "lib/js/legacy/utils/handler.js", @@ -175,9 +172,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/css/all-app.css b/css/all-app.css index b2fd2e5732..0dea8b7316 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 */ @@ -1043,7 +1000,7 @@ div.dialog_head { } div.dialog_body { - padding: 8px 4px 16px 4px; + padding: 8px 8px 16px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; @@ -2809,10 +2766,11 @@ span, div, td, input, textarea, button, select { } body { + background: url(../images/stripedbg.png) repeat; } .erpnext-footer { - margin: 3px auto; + margin: 11px auto; text-align: center; } diff --git a/css/all-web.css b/css/all-web.css index 9359de898e..36d9cda882 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 */ @@ -362,7 +319,7 @@ div.dialog_head { } div.dialog_body { - padding: 8px 4px 16px 4px; + padding: 8px 8px 16px; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; @@ -1617,10 +1574,11 @@ span, div, td, input, textarea, button, select { } body { + background: url(../images/stripedbg.png) repeat; } .erpnext-footer { - margin: 3px auto; + margin: 11px auto; text-align: center; } diff --git a/data/master.sql.gz b/data/master.sql.gz index 9f2ed7f0d4..8b9fdb9889 100644 Binary files a/data/master.sql.gz and b/data/master.sql.gz differ diff --git a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt index c628e83013..510e92206f 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Classic/Sales Invoice Classic.txt @@ -3,26 +3,26 @@ # These values are common in all dictionaries { - 'creation': '2011-12-21 11:02:04', + 'creation': '2012-01-13 11:41:18', 'docstatus': 0, - 'modified': '2012-01-06 14:17:57', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-01 13:36:06', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Print Format { - 'doc_type': 'Receivable Voucher', + 'doc_type': u'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', - 'module': 'Accounts', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'module': u'Accounts', 'name': '__common__', - 'standard': 'Yes' + 'standard': u'Yes' }, # Print Format, Sales Invoice Classic { 'doctype': 'Print Format', - 'name': 'Sales Invoice Classic' + 'name': u'Sales Invoice Classic' } ] \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt index 0b4c15c747..3c44fc7eca 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Modern/Sales Invoice Modern.txt @@ -3,26 +3,26 @@ # These values are common in all dictionaries { - 'creation': '2011-12-21 11:02:04', + 'creation': '2012-01-13 11:41:18', 'docstatus': 0, - 'modified': '2012-01-06 14:18:11', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-01 13:36:24', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Print Format { - 'doc_type': 'Receivable Voucher', + 'doc_type': u'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice No.
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', - 'module': 'Accounts', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice No.
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'module': u'Accounts', 'name': '__common__', - 'standard': 'Yes' + 'standard': u'Yes' }, # Print Format, Sales Invoice Modern { 'doctype': 'Print Format', - 'name': 'Sales Invoice Modern' + 'name': u'Sales Invoice Modern' } ] \ No newline at end of file diff --git a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt index dc85a5f078..b91f5cd9a6 100644 --- a/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt +++ b/erpnext/accounts/Print Format/Sales Invoice Spartan/Sales Invoice Spartan.txt @@ -3,26 +3,26 @@ # These values are common in all dictionaries { - 'creation': '2011-12-21 11:02:04', + 'creation': '2012-01-13 11:41:18', 'docstatus': 0, - 'modified': '2012-01-06 14:18:25', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-01 13:36:52', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Print Format { - 'doc_type': 'Receivable Voucher', + 'doc_type': u'Receivable Voucher', 'doctype': 'Print Format', - 'html': '\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', - 'module': 'Accounts', + 'html': u'\n\n\n\n\n\n\n\n\n\n\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t

\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t
Name
Address
Contact
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\t\t\t\n\t\t\t\t
Invoice Date
Due Date
\n
\n
\n\t\n\t\n
\n
\n\t\n\t\n\t\t\n\t\t\t\n\t\t\n\t\t\n\t\t\t\n\t\t\t\t\n\t\t\t\t\n\t\t\t\t\t\n\t\t\n\t\t\n\t\t\n\t\t\n\t
\n\t\t\t\t\tTerms, Conditions & Other Information:
\n\t\t\t\t\t\n\t\t\t\t
\n\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\t\n\t\t\t\t\t\t\n\t\t\t\t\t
Net Total
Grand Total
Rounded Total
\n\t\t\t\t\t
In Words
\n\t\t\t\t\t\n\t\t\t\t
\n
\n', + 'module': u'Accounts', 'name': '__common__', - 'standard': 'Yes' + 'standard': u'Yes' }, # Print Format, Sales Invoice Spartan { 'doctype': 'Print Format', - 'name': 'Sales Invoice Spartan' + 'name': u'Sales Invoice Spartan' } ] \ No newline at end of file diff --git a/erpnext/accounts/doctype/gl_control/gl_control.py b/erpnext/accounts/doctype/gl_control/gl_control.py index c64d64e41f..93bef5de76 100644 --- a/erpnext/accounts/doctype/gl_control/gl_control.py +++ b/erpnext/accounts/doctype/gl_control/gl_control.py @@ -177,7 +177,7 @@ class DocType: #---------------------------------------------------------------------------- def make_single_entry(self,parent,d,le_map,cancel, merge_entries): if self.get_val(le_map['account'], d, parent) and (self.get_val(le_map['debit'], d, parent) or self.get_val(le_map['credit'], d, parent)): - flist = ['account','cost_center','against','debit','credit','remarks','voucher_type','voucher_no','transaction_date','posting_date','fiscal_year','against_voucher','against_voucher_type','company','is_opening', 'aging_date'] + flist = ['account','cost_center','against','debit','credit','remarks','voucher_type','voucher_no','posting_date','fiscal_year','against_voucher','against_voucher_type','company','is_opening', 'aging_date'] # Check budget before gl entry #check budget only if account is expense account @@ -536,7 +536,6 @@ def create_new_invoice(prev_rv): # update new rv - new_rv.doc.voucher_date = new_rv.doc.next_date new_rv.doc.posting_date = new_rv.doc.next_date new_rv.doc.aging_date = new_rv.doc.next_date new_rv.doc.due_date = add_days(new_rv.doc.next_date, cint(date_diff(prev_rv.doc.due_date, prev_rv.doc.posting_date))) diff --git a/erpnext/accounts/doctype/gl_entry/gl_entry.py b/erpnext/accounts/doctype/gl_entry/gl_entry.py index 00b6844272..49b0593cd6 100644 --- a/erpnext/accounts/doctype/gl_entry/gl_entry.py +++ b/erpnext/accounts/doctype/gl_entry/gl_entry.py @@ -52,10 +52,12 @@ class DocType: msgprint("GL Entry: Debit or Credit amount is mandatory for %s" % self.doc.account) raise Exception + + # COMMMENTED below to allow zero amount (+ and -) entry in tax table # Debit and credit can not done at the same time - if flt(self.doc.credit) != 0 and flt(self.doc.debit) != 0: - msgprint("Sorry you cannot credit and debit under same account head.") - raise Exception, "Validation Error." + #if flt(self.doc.credit) != 0 and flt(self.doc.debit) != 0: + # msgprint("Sorry you cannot credit and debit under same account head.") + # raise Exception, "Validation Error." # Cost center is required only if transaction made against pl account #-------------------------------------------------------------------- @@ -152,11 +154,15 @@ class DocType: amt = flt(self.doc.debit) - flt(self.doc.credit) if det[0][2] == 'Credit': amt = -amt - debit = cancel and -1 * flt(self.doc.credit) or flt(self.doc.debit) - credit = cancel and -1 * flt(self.doc.debit) or flt(self.doc.credit) - + if cancel: + debit = -1 * flt(self.doc.credit) + credit = -1 * flt(self.doc.debit) + else: + debit = flt(self.doc.debit) + credit = flt(self.doc.credit) + self.create_new_balances(det) - + # build dict p = { 'debit': self.doc.is_opening=='No' and flt(debit) or 0 @@ -197,7 +203,7 @@ class DocType: and ifnull(a.is_pl_account, 'No') = 'No' and ab.period = ab.fiscal_year and fy.name = ab.fiscal_year - and fy.year_start_date > %(posting_date)s""" % p) + and fy.year_start_date > '%(posting_date)s'""" % p) # Update balance for all period for future years sql("""update `tabAccount Balance` ab, `tabAccount` a, `tabFiscal Year` fy @@ -209,7 +215,7 @@ class DocType: and ab.account = a.name and ifnull(a.is_pl_account, 'No') = 'No' and fy.name = ab.fiscal_year - and fy.year_start_date > %(posting_date)s""" % p) + and fy.year_start_date > '%(posting_date)s'""" % p) diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js index a465ec07db..99bd24c6b8 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 fe733f7782..1a09a451c7 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/accounts/doctype/payable_voucher/payable_voucher.txt b/erpnext/accounts/doctype/payable_voucher/payable_voucher.txt index 53466e12e3..f7d66ea47f 100755 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.txt +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:11', 'docstatus': 0, - 'modified': '2012-02-27 18:25:38', + 'modified': '2012-03-02 12:28:23', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -24,7 +24,7 @@ 'server_code_error': u' ', 'show_in_menu': 0, 'subject': u'From %(supplier_name)s worth %(grand_total)s due on %(due_date)s | %(outstanding_amount)s outstanding', - 'version': 520 + 'version': 521 }, # These values are common for all DocField @@ -308,22 +308,6 @@ 'search_index': 1 }, - # DocField - { - 'default': u'Today', - 'doctype': u'DocField', - 'fieldname': u'voucher_date', - 'fieldtype': u'Date', - 'in_filter': 1, - 'label': u'Voucher Date', - 'no_copy': 0, - 'oldfieldname': u'voucher_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 1, - 'search_index': 1 - }, - # DocField { 'doctype': u'DocField', @@ -613,7 +597,7 @@ 'label': u'More Info', 'oldfieldtype': u'Section Break', 'permlevel': 0, - 'print_hide': 0 + 'print_hide': 1 }, # DocField @@ -622,7 +606,7 @@ 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, - 'print_hide': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -681,6 +665,7 @@ 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -750,7 +735,7 @@ 'label': u'Advances', 'oldfieldtype': u'Section Break', 'permlevel': 0, - 'print_hide': 0 + 'print_hide': 1 }, # DocField @@ -785,7 +770,8 @@ 'fieldtype': u'Section Break', 'label': u'TDS', 'oldfieldtype': u'Section Break', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -793,6 +779,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -839,6 +826,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -894,6 +882,7 @@ 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, diff --git a/erpnext/accounts/doctype/pv_detail/pv_detail.txt b/erpnext/accounts/doctype/pv_detail/pv_detail.txt index 826ad8e2db..54f77bdc88 100755 --- a/erpnext/accounts/doctype/pv_detail/pv_detail.txt +++ b/erpnext/accounts/doctype/pv_detail/pv_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:17', 'docstatus': 0, - 'modified': '2012-02-27 18:42:06', + 'modified': '2012-03-05 10:54:12', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 43 + 'version': 45 }, # These values are common for all DocField @@ -100,10 +100,11 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'import_ref_rate', + 'fieldname': u'purchase_ref_rate', 'fieldtype': u'Currency', - 'label': u'Ref Rate ', + 'label': u'Ref Rate *', 'permlevel': 0, + 'print_hide': 1, 'trigger': u'Client' }, @@ -114,42 +115,7 @@ 'fieldtype': u'Currency', 'label': u'Discount %', 'permlevel': 0, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'import_rate', - 'fieldtype': u'Currency', - 'label': u'Rate ', - 'oldfieldname': u'import_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 0, - 'reqd': 1, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'import_amount', - 'fieldtype': u'Currency', - 'label': u'Amount', - 'oldfieldname': u'import_amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'reqd': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'purchase_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Ref Rate *', - 'permlevel': 0, + 'print_hide': 1, 'trigger': u'Client' }, @@ -180,6 +146,43 @@ 'reqd': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_ref_rate', + 'fieldtype': u'Currency', + 'label': u'Ref Rate ', + 'permlevel': 0, + 'print_hide': 1, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_rate', + 'fieldtype': u'Currency', + 'label': u'Rate ', + 'oldfieldname': u'import_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 0, + 'reqd': 1, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_amount', + 'fieldtype': u'Currency', + 'label': u'Amount', + 'oldfieldname': u'import_amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1, + 'reqd': 1 + }, + # DocField { 'colour': u'White:FFF', diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js index bc0a145173..391bbcd8ae 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.js @@ -42,27 +42,31 @@ cur_frm.cscript.onload = function(doc,dt,dn) { } cur_frm.cscript.onload_post_render = function(doc, dt, dn) { - var callback2 = null; - if(doc.customer && doc.__islocal) { + var callback = function(doc, dt, dn) { // called from mapper, update the account names for items and customer - callback2 = function(doc, dt, dn) { - $c_obj(make_doclist(doc.doctype,doc.name), - 'load_default_accounts','', - function(r,rt) { - refresh_field('entries'); - cur_frm.cscript.customer(doc,dt,dn,onload=true); - } - ); + var callback2 = function(doc, dt, dn) { + if(doc.customer && doc.__islocal) { + $c_obj(make_doclist(doc.doctype,doc.name), + 'load_default_accounts','', + function(r,rt) { + refresh_field('entries'); + cur_frm.cscript.customer(doc,dt,dn,onload=true); + } + ); + } + } + // defined in sales_common.js + var callback1 = function(doc, dt, dn) { + //for previously created sales invoice, set required field related to pos + cur_frm.cscript.update_item_details(doc, dt, dn, callback2); } - } - // defined in sales_common.js - var callback1 = function(doc, dt, dn) { - //for previously created sales invoice, set required field related to pos - cur_frm.cscript.update_item_details(doc, dt, dn, callback2); - } - if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn,callback1); - else cur_frm.cscript.update_item_details(doc, dt, dn, callback2); + if(doc.is_pos ==1) cur_frm.cscript.is_pos(doc, dt, dn,callback1); + else cur_frm.cscript.update_item_details(doc, dt, dn, callback2); + } + + cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback); + } @@ -97,16 +101,11 @@ cur_frm.cscript.hide_fields = function(doc, cdt, cdn) { cur_frm.cscript.refresh = function(doc, dt, dn) { cur_frm.cscript.is_opening(doc, dt, dn); cur_frm.cscript.hide_fields(doc, dt, dn); - - var callback = function() { - cur_frm.cscript.dynamic_label(doc, dt, dn); - } - cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback); - - // Show / Hide button cur_frm.clear_custom_buttons(); + if (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(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('Send SMS', cur_frm.cscript['Send SMS']); diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py index 03fd7620ca..a3412dd515 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.py @@ -66,11 +66,11 @@ class DocType(TransactionBase): for i in lst: val = pos and pos[0][i] or '' - webnotes.conn.set(self.doc,i,val) + self.doc.fields[i] = val self.set_pos_item_values() val = pos and flt(pos[0]['conversion_rate']) or 0 - webnotes.conn.set(self.doc,'conversion_rate',val) + self.doc.conversion_rate = val #fetch terms if self.doc.tc_name: self.get_tc_details() @@ -167,16 +167,19 @@ class DocType(TransactionBase): # Item Details # ------------- def get_item_details(self, args=None): - args = eval(args) - if args['item_code']: + args = args and eval(args) or {} + if args.get('item_code'): ret = get_obj('Sales Common').get_item_details(args, self) return self.get_pos_details(args, ret) else: obj = get_obj('Sales Common') for doc in self.doclist: if doc.fields.get('item_code'): - ret = obj.get_item_details(doc.item_code, self) - ret = self.get_pos_details(doc.item_code, ret) + arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), + 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; + + ret = obj.get_item_details(arg, self) + ret = self.get_pos_details(arg, ret) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] @@ -205,14 +208,6 @@ class DocType(TransactionBase): get_obj('Sales Common').get_adj_percent(self) - def get_comp_base_currency(self): - return get_obj('Sales Common').get_comp_base_currency(self.doc.company) - - def get_price_list_currency(self): - return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company) - - - # Get tax rate if account type is tax # ------------------------------------ def get_rate(self,arg): @@ -538,7 +533,7 @@ class DocType(TransactionBase): self.values.append({ 'item_code' : d.item_code, 'warehouse' : wh, - 'transaction_date' : self.doc.voucher_date, + 'transaction_date' : getdate(self.doc.modified).strftime('%Y-%m-%d'), 'posting_date' : self.doc.posting_date, 'posting_time' : self.doc.posting_time, 'voucher_type' : 'Receivable Voucher', diff --git a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt index b2777e37f2..54794cfba6 100644 --- a/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt +++ b/erpnext/accounts/doctype/receivable_voucher/receivable_voucher.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:18', 'docstatus': 0, - 'modified': '2012-02-27 17:34:46', + 'modified': '2012-03-02 12:22:21', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -21,7 +21,7 @@ # These values are common for all DocType { - '_last_update': u'1330344021', + '_last_update': u'1330593645', 'change_log': u'1. Change in pull_details method dt.-26-06-2009', 'colour': u'White:FFF', 'default_print_format': u'Standard', @@ -34,7 +34,7 @@ 'server_code_error': u' ', 'show_in_menu': 0, 'subject': u'To %(customer_name)s worth %(currency)s %(grand_total_export)s due on %(due_date)s | %(outstanding_amount)s outstanding', - 'version': 414 + 'version': 415 }, # These values are common for all DocFormat @@ -176,6 +176,7 @@ # DocField { 'colour': u'White:FFF', + 'default': u'INV', 'depends_on': u'eval:doc.retail_transaction!="Yes"', 'description': u'To manage multiple series please go to Setup > Manage Series', 'doctype': u'DocField', @@ -185,7 +186,7 @@ 'no_copy': 1, 'oldfieldname': u'naming_series', 'oldfieldtype': u'Select', - 'options': u'\nINV\nINV/10-11/', + 'options': u'INV\nINV/10-11/', 'permlevel': 0, 'print_hide': 1, 'reqd': 1 @@ -643,17 +644,6 @@ 'reqd': 1 }, - # DocField - { - 'doctype': u'DocField', - 'fieldtype': u'HTML', - 'label': u'Rates HTML', - 'oldfieldtype': u'HTML', - 'options': u'* Rates in standard currency', - 'permlevel': 0, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -1072,24 +1062,6 @@ 'trigger': u'Client' }, - # DocField - { - 'colour': u'White:FFF', - 'default': u'Today', - 'description': u"This is the date on which this voucher is made in the system. Today's date comes by default.", - 'doctype': u'DocField', - 'fieldname': u'voucher_date', - 'fieldtype': u'Date', - 'in_filter': 1, - 'label': u'Voucher Date', - 'no_copy': 1, - 'oldfieldname': u'voucher_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 1, - 'search_index': 0 - }, - # DocField { 'doctype': u'DocField', @@ -1180,7 +1152,8 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -1390,7 +1363,8 @@ 'doctype': u'DocField', 'fieldtype': u'Section Break', 'options': u'Simple', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -1412,7 +1386,8 @@ 'doctype': u'DocField', 'fieldtype': u'Section Break', 'label': u'Recurring Invoice', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -1420,6 +1395,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1473,6 +1449,7 @@ 'fieldtype': u'Column Break', 'no_copy': 0, 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, diff --git a/erpnext/accounts/doctype/rv_detail/rv_detail.txt b/erpnext/accounts/doctype/rv_detail/rv_detail.txt index a4bf82428c..7c599d1442 100644 --- a/erpnext/accounts/doctype/rv_detail/rv_detail.txt +++ b/erpnext/accounts/doctype/rv_detail/rv_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:20', 'docstatus': 0, - 'modified': '2012-02-24 16:14:38', + 'modified': '2012-03-05 10:50:03', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 25 + 'version': 28 }, # These values are common for all DocField @@ -85,15 +85,6 @@ 'width': u'200px' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'stock_uom', - 'fieldtype': u'Data', - 'label': u'UOM', - 'permlevel': 1 - }, - # DocField { 'doctype': u'DocField', @@ -109,17 +100,23 @@ # DocField { - 'colour': u'White:FFF', 'doctype': u'DocField', - 'fieldname': u'ref_rate', + 'fieldname': u'stock_uom', + 'fieldtype': u'Data', + 'label': u'UOM', + 'permlevel': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'base_ref_rate', 'fieldtype': u'Currency', - 'label': u'Price List Rate', - 'oldfieldname': u'ref_rate', + 'label': u'Price List Rate*', + 'oldfieldname': u'base_ref_rate', 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 0, - 'trigger': u'Client' + 'permlevel': 1, + 'print_hide': 1 }, # DocField @@ -136,43 +133,6 @@ 'trigger': u'Client' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'export_rate', - 'fieldtype': u'Currency', - 'label': u'Basic Rate', - 'oldfieldname': u'export_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'reqd': 1, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'export_amount', - 'fieldtype': u'Currency', - 'label': u'Amount', - 'oldfieldname': u'export_amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'reqd': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'base_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Price List Rate*', - 'oldfieldname': u'base_ref_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -203,6 +163,46 @@ 'reqd': 1 }, + # DocField + { + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'ref_rate', + 'fieldtype': u'Currency', + 'label': u'Price List Rate', + 'oldfieldname': u'ref_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'export_rate', + 'fieldtype': u'Currency', + 'label': u'Basic Rate', + 'oldfieldname': u'export_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'reqd': 1, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'export_amount', + 'fieldtype': u'Currency', + 'label': u'Amount', + 'oldfieldname': u'export_amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1, + 'reqd': 1 + }, + # DocField { 'doctype': u'DocField', @@ -264,7 +264,7 @@ 'oldfieldname': u'serial_no', 'oldfieldtype': u'Small Text', 'permlevel': 0, - 'print_hide': 1 + 'print_hide': 0 }, # DocField diff --git a/erpnext/accounts/page/accounts_home/accounts_home.html b/erpnext/accounts/page/accounts_home/accounts_home.html index 12c80ebe8f..8282ae8eb1 100644 --- a/erpnext/accounts/page/accounts_home/accounts_home.html +++ b/erpnext/accounts/page/accounts_home/accounts_home.html @@ -62,6 +62,11 @@ title = "Analyze Sales and Purchase trends and slice them based on item, customer, groups etc" href="#!Report/Profile/Trend Analyzer">Trend Analyzer +
+ Financial Statements +
@@ -141,4 +146,4 @@
- \ No newline at end of file + diff --git a/erpnext/accounts/search_criteria/collection_report/collection_report.py b/erpnext/accounts/search_criteria/collection_report/collection_report.py index fe0cb57b0c..c0f6e6144c 100644 --- a/erpnext/accounts/search_criteria/collection_report/collection_report.py +++ b/erpnext/accounts/search_criteria/collection_report/collection_report.py @@ -66,7 +66,7 @@ for r in row_list: for r in res: if r[col_idx['Against Receivable']]: - dt=sql("select voucher_date, Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']]) + dt=sql("select date(modified), Aging_date from `tabReceivable Voucher` where name='%s'"%r[col_idx['Against Receivable']]) r.append('') r.append(dt and cstr(dt[0][0]) or '') r.append(dt and cstr(dt[0][1]) or '') @@ -103,4 +103,4 @@ for r in res: r.append(val_l2) r.append(val_l3) r.append(val_l4) - r.append(val_l5_above) \ No newline at end of file + r.append(val_l5_above) diff --git a/erpnext/accounts/search_criteria/payment_report/payment_report.py b/erpnext/accounts/search_criteria/payment_report/payment_report.py index 8252103c5a..cc025bacf3 100644 --- a/erpnext/accounts/search_criteria/payment_report/payment_report.py +++ b/erpnext/accounts/search_criteria/payment_report/payment_report.py @@ -66,7 +66,7 @@ for r in row_list: for r in res: if r[col_idx['Against Payable']]: - dt=sql("select voucher_date, aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']]) + dt=sql("select date(modified), aging_date from `tabPayable Voucher` where name='%s'"%r[col_idx['Against Payable']]) r.append('') r.append(dt and cstr(dt[0][0]) or '') r.append(dt and cstr(dt[0][1]) or '') @@ -102,4 +102,4 @@ for r in res: r.append(val_l2) r.append(val_l3) r.append(val_l4) - r.append(val_l5_above) \ No newline at end of file + r.append(val_l5_above) diff --git a/erpnext/analysis/doctype/mis_control/mis_control.py b/erpnext/analysis/doctype/mis_control/mis_control.py index 11e48f41ca..b2c85f89cb 100644 --- a/erpnext/analysis/doctype/mis_control/mis_control.py +++ b/erpnext/analysis/doctype/mis_control/mis_control.py @@ -61,7 +61,6 @@ class DocType: # ---- get companies --------- res = sql("select name from `tabCompany`") - comp.append('All') for r in res: comp.append(r[0]) #comp.append(r[0] for r in res) diff --git a/erpnext/buying/doctype/po_detail/po_detail.txt b/erpnext/buying/doctype/po_detail/po_detail.txt index 49bed15c22..d903ef1b52 100755 --- a/erpnext/buying/doctype/po_detail/po_detail.txt +++ b/erpnext/buying/doctype/po_detail/po_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:12', 'docstatus': 0, - 'modified': '2012-02-27 14:47:48', + 'modified': '2012-03-05 10:50:51', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 62 + 'version': 64 }, # These values are common for all DocField @@ -121,10 +121,11 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'import_ref_rate', + 'fieldname': u'purchase_ref_rate', 'fieldtype': u'Currency', - 'label': u'Ref Rate ', - 'permlevel': 0 + 'label': u'Ref Rate *', + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -134,43 +135,10 @@ 'fieldtype': u'Currency', 'label': u'Discount %', 'permlevel': 0, + 'print_hide': 1, 'trigger': u'Client' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'import_rate', - 'fieldtype': u'Currency', - 'hidden': 0, - 'label': u'Rate ', - 'oldfieldname': u'import_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 0, - 'trigger': u'Client' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'import_amount', - 'fieldtype': u'Currency', - 'label': u'Amount', - 'oldfieldname': u'import_amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'purchase_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Ref Rate *', - 'permlevel': 0 - }, - # DocField { 'default': u'0.00', @@ -201,6 +169,41 @@ 'reqd': 1 }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_ref_rate', + 'fieldtype': u'Currency', + 'label': u'Ref Rate ', + 'permlevel': 0, + 'print_hide': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_rate', + 'fieldtype': u'Currency', + 'hidden': 0, + 'label': u'Rate ', + 'oldfieldname': u'import_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 0, + 'trigger': u'Client' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_amount', + 'fieldtype': u'Currency', + 'label': u'Amount', + 'oldfieldname': u'import_amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1 + }, + # DocField { 'doctype': u'DocField', diff --git a/erpnext/buying/doctype/purchase_common/purchase_common.js b/erpnext/buying/doctype/purchase_common/purchase_common.js index 52f8e539fc..88fba5c6fa 100644 --- a/erpnext/buying/doctype/purchase_common/purchase_common.js +++ b/erpnext/buying/doctype/purchase_common/purchase_common.js @@ -92,39 +92,38 @@ 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_import) { + 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 +135,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 16afb02ccf..ca9181f154 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 0a6c547978..7af1204fa4 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 efa05244c0..794580724b 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/buying/doctype/purchase_order/purchase_order.txt b/erpnext/buying/doctype/purchase_order/purchase_order.txt index c73683ea9b..02393706d7 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order.txt +++ b/erpnext/buying/doctype/purchase_order/purchase_order.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:15', 'docstatus': 0, - 'modified': '2012-02-27 17:51:53', + 'modified': '2012-03-02 12:23:50', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -35,7 +35,7 @@ 'server_code_error': u' ', 'show_in_menu': 0, 'subject': u'To %(supplier_name)s on %(transaction_date)s | %(per_received)s% delivered', - 'version': 500 + 'version': 501 }, # These values are common for all DocFormat @@ -569,17 +569,6 @@ 'trigger': u'Client' }, - # DocField - { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldtype': u'HTML', - 'label': u'Note HTML', - 'options': u'
Note : * In Base Currency\n
', - 'permlevel': 1, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -665,17 +654,6 @@ 'print_hide': 1 }, - # DocField - { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldtype': u'HTML', - 'label': u'Note HTML', - 'options': u'
Note : * In Base Currency\n
', - 'permlevel': 1, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', @@ -1019,6 +997,7 @@ 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1073,7 +1052,8 @@ 'fieldtype': u'Section Break', 'label': u'Raw Material Details', 'oldfieldtype': u'Section Break', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField diff --git a/erpnext/home/page/activity/__init__.py b/erpnext/home/page/activity/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/home/page/activity/activity.css b/erpnext/home/page/activity/activity.css new file mode 100644 index 0000000000..f3988b275d --- /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 0000000000..b348d95cc6 --- /dev/null +++ b/erpnext/home/page/activity/activity.html @@ -0,0 +1,6 @@ +
+ × +

Activity

+
+
+
\ 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 0000000000..62604b79a8 --- /dev/null +++ b/erpnext/home/page/activity/activity.js @@ -0,0 +1,64 @@ +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(sprintf('
\ + \ + %(feed_type)s\ + %(link)s %(subject)s %(by)s
', data)); + }, + scrub_data: function(data) { + data.by = wn.user_info(data.owner).fullname; + data.imgsrc = wn.user_info(data.owner).image; + + // 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"; + } + + if(data.feed_type=='Assignment') { + data.add_class = "label-warning"; + } + + // link + if(data.doc_name && data.feed_type!='Login') { + data.link = repl('%(doc_name)s', data) + } + }, + add_date_separator: function(row, data) { + var date = dateutil.str_to_obj(data.modified); + var last = erpnext.last_feed_date; + + if((last && dateutil.obj_to_str(last) != dateutil.obj_to_str(date)) || (!last)) { + var diff = dateutil.get_day_diff(new Date(), date); + if(diff < 1) { + pdate = 'Today'; + } else if(diff < 2) { + pdate = 'Yesterday'; + } else { + pdate = dateutil.global_date_format(date); + } + $(row).html(repl('
%(date)s
', {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 0000000000..8b8faf3f5f --- /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 0000000000..e7f396389f --- /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/attributions/__init__.py b/erpnext/home/page/attributions/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/home/page/attributions/attributions.css b/erpnext/home/page/attributions/attributions.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/home/page/attributions/attributions.html b/erpnext/home/page/attributions/attributions.html new file mode 100644 index 0000000000..72703c85e6 --- /dev/null +++ b/erpnext/home/page/attributions/attributions.html @@ -0,0 +1,91 @@ +
+ × +

Attributions

+
+

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.

+ + +

Server

+ + +

Programming Languages & Libraries

+ + +

CSS Frameworks

+ + +

Icons

+ + +

Web Frameworks

+ + +

Web Browsers

+ +
+

ERPNext License

+

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

+
\ No newline at end of file diff --git a/erpnext/home/page/attributions/attributions.js b/erpnext/home/page/attributions/attributions.js new file mode 100644 index 0000000000..fc56784431 --- /dev/null +++ b/erpnext/home/page/attributions/attributions.js @@ -0,0 +1 @@ +wn.pages['attributions'].onload = function(wrapper) { } \ No newline at end of file diff --git a/erpnext/home/page/attributions/attributions.py b/erpnext/home/page/attributions/attributions.py new file mode 100644 index 0000000000..f807eb0a4d --- /dev/null +++ b/erpnext/home/page/attributions/attributions.py @@ -0,0 +1 @@ +import webnotes \ No newline at end of file diff --git a/erpnext/home/page/attributions/attributions.txt b/erpnext/home/page/attributions/attributions.txt new file mode 100644 index 0000000000..a15adb97b7 --- /dev/null +++ b/erpnext/home/page/attributions/attributions.txt @@ -0,0 +1,28 @@ +# Page, attributions +[ + + # These values are common in all dictionaries + { + 'creation': '2012-03-01 12:30:42', + 'docstatus': 0, + 'modified': '2012-03-01 12:30:42', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Home', + 'name': '__common__', + 'page_name': u'attributions', + 'standard': u'Yes', + 'title': u'Attributions' + }, + + # Page, attributions + { + 'doctype': 'Page', + 'name': u'attributions' + } +] \ No newline at end of file diff --git a/erpnext/home/page/desktop/desktop.css b/erpnext/home/page/desktop/desktop.css index 0aede60c67..e460c11607 100644 --- a/erpnext/home/page/desktop/desktop.css +++ b/erpnext/home/page/desktop/desktop.css @@ -41,10 +41,15 @@ .case-border { border-radius: 10px; + -moz-border-radius: 10px; + -webkit-border-radius: 10px; width: 56px; height: 56px; border: 4px solid white; box-shadow: 0 0 10px 1px black; + -moz-box-shadow: 0 0 10px 1px black; + -webkit-box-shadow: 0 0 10px 1px black; + -o-box-shadow: 0 0 10px 1px black; margin: auto; } @@ -66,6 +71,9 @@ /* Hover and click effects */ .case-border:hover, .circle:hover { box-shadow: 0 0 2px 0px black, 0 0 10px 1px white; + -moz-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white; + -webkit-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white; + -o-box-shadow: 0 0 2px 0px black, 0 0 10px 1px white; } .case-border:active, .case-border:focus, .circle:active, .circle:focus { @@ -77,8 +85,11 @@ } .circle { - border-radius: 100%; + border-radius: 30px; + -moz-border-radius: 30px; + -webkit-border-radius: 30px; height: 15px; + line-height: 12px; min-width: 15px; background: #B00D07; padding: 3px; @@ -88,6 +99,9 @@ margin-right: 10px; border: 2px solid white; box-shadow: 0 0 10px 1px black; + -moz-box-shadow: 0 0 10px 1px black; + -webkit-box-shadow: 0 0 10px 1px black; + -o-box-shadow: 0 0 10px 1px black; } .circle-text { diff --git a/erpnext/home/page/desktop/desktop.js b/erpnext/home/page/desktop/desktop.js index e2a8d5386e..dab1e761b0 100644 --- a/erpnext/home/page/desktop/desktop.js +++ b/erpnext/home/page/desktop/desktop.js @@ -43,36 +43,53 @@ erpnext.desktop.add_classes = function() { } erpnext.desktop.render = function() { - var icons = [ - { gradient: 'brown', sprite: 'feed', label: 'Activity', link: '#!Event Updates' }, - { gradient: 'blue', sprite: 'account', label: 'Accounts', link: '#!accounts-home' }, - { gradient: 'green', sprite: 'selling', label: 'Selling', link: '#!selling-home' }, - { gradient: 'yellow', sprite: 'stock', label: 'Stock', link: '#!stock-home' }, - { gradient: 'red', sprite: 'buying', label: 'Buying', link: '#!buying-home' }, - { gradient: 'purple', sprite: 'support', label: 'Support', link: '#!support-home' }, - { gradient: 'ocean', sprite: 'hr', label: 'Human
Resources', link: '#!hr-home' }, - { gradient: 'violet', sprite: 'project', label: 'Projects', link: '#!projects-home' }, - { gradient: 'dark-red', sprite: 'production', label: 'Production', link: '#!production-home' }, - { gradient: 'leaf-green', sprite: 'website', label: 'Website', link: '#!website-home' }, - { gradient: 'grey', sprite: 'setting', label: 'Settings', link: '#!Setup' }, - { gradient: 'bright-green', sprite: 'dashboard', label: 'Dashboard', link: '#!dashboard' }, - //{ gradient: 'dark-blue', sprite: 'report', label: 'Report' }, - { gradient: 'pink', sprite: 'messages', label: 'Messages', link: '#!messages' }, - { gradient: 'bright-yellow', sprite: 'todo', label: 'To Do', link: '#!todo' }, - { gradient: 'peacock', sprite: 'calendar', label: 'Calendar', link: '#!calendar' }, - { gradient: 'ultra-dark-green', sprite: 'kb', label: 'Knowledge
Base', link: '#!questions' }, - ] + var icons = { + 'Accounts': { gradient: 'blue', sprite: 'account', label: 'Accounts'}, + 'Selling': { gradient: 'green', sprite: 'selling', label: 'Selling'}, + 'Stock': { gradient: 'yellow', sprite: 'stock', label: 'Stock'}, + 'Buying': { gradient: 'red', sprite: 'buying', label: 'Buying'}, + 'Support': { gradient: 'purple', sprite: 'support', label: 'Support'}, + 'HR': { gradient: 'ocean', sprite: 'hr', label: 'Human
Resources'}, + 'Projects': { gradient: 'violet', sprite: 'project', label: 'Projects'}, + 'Production': { gradient: 'dark-red', sprite: 'production', label: 'Production'}, + 'Website': { gradient: 'leaf-green', sprite: 'website', label: 'Website'}, + 'Activity': { gradient: 'brown', sprite: 'feed', label: 'Activity'}, + 'Setup': { gradient: 'grey', sprite: 'setting', label: 'Setup'}, + 'Dashboard': { gradient: 'bright-green', sprite: 'dashboard', label: 'Dashboard'}, + 'To Do': { gradient: 'bright-yellow', sprite: 'todo', label: 'To Do'}, + 'Messages': { gradient: 'pink', sprite: 'messages', label: 'Messages'}, + 'Calendar': { gradient: 'peacock', sprite: 'calendar', label: 'Calendar'}, + 'Knowledge Base': { gradient: 'ultra-dark-green', sprite: 'kb', label: 'Knowledge
Base'} + } + - $.each(icons, function(i, v) { - var icon_case = $('#icon-grid').append(repl('\ -
\ + var add_icon = function(m) { + var icon = icons[m]; + icon.link = erpnext.modules[m]; + $('#icon-grid').append(repl('\ +
\
\
\
\
%(label)s
\ -
', v)); - }); +
', icon)); + } + + // setup + for(var i in wn.boot.modules_list) { + var m = wn.boot.modules_list[i]; + if(m!='Setup' && wn.boot.profile.allow_modules.indexOf(m)!=-1) + add_icon(m); + } + + if(user_roles.indexOf('Accounts Manager')!=-1) + add_icon('Dashboard') + + if(user_roles.indexOf('System Manager')!=-1) + add_icon('Setup') + + // apps erpnext.desktop.show_pending_notifications(); } 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 8f7eed32d4..0000000000 --- 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 . - -// 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', '

Your Profile Details

'], - ['Data', 'First Name'], - ['Data', 'Last Name'], - ['HTML', 'Company Details', '

Create your first company

'], - ['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 1){ - var c = confirm("You have unchecked the System Manager role.\nYou will lose administrative rights and will not be able to set roles.\n\nDo you want to continue anyway?"); - if(!c) return; - } - else{ - var c = "There should be atleast one user with System Manager role."; - me.roles_dict['System Manager'].checked = 1; - } - } - me.set_roles(id); - } - $c_obj('Company Control','get_sm_count','',callback); - } - else{ - me.set_roles(id); - } -} - -// set roles -RoleObj.prototype.set_roles = function(id){ - - var me = this; - var role_list = []; - - for(d in me.roles_dict){ - if(me.roles_dict[d].checked){ - role_list.push(d); - } - } - - var callback = function(r,rt){ - me.update_btn.done_working(); - me.dialog.hide(); - } - var arg = {'usr':id, 'role_list':role_list}; - me.update_btn.set_working(); - $c_obj('Company Control','update_roles',docstring(arg), callback); - -} - -// get permission -RoleObj.prototype.get_permissions = function(role){ - var me = this; - - var callback = function(r,rt){ - $(me.help_div).slideToggle('medium'); - $(me.role_div).slideToggle('medium'); - me.set_permissions(r.message, role); - } - $c_obj('Company Control','get_permission',role,callback); -} - - -// set permission -RoleObj.prototype.set_permissions = function(perm, role){ - var me = this; - me.help_div.body.innerHTML =''; - - if(perm){ - me.help_div.head.innerHTML = 'Permissions for ' + role + ':

'; - - perm_tbl = make_table(me.help_div.body,cint(perm.length)+2,7,'100%',['30%','10%','10%','10%','10%','10%','10%'],{padding:'4px'}); - - var head_lst = ['Document','Read','Write','Create','Submit','Cancel','Amend']; - - for(var i=0; i<(head_lst.length-1);i++){ - $td(perm_tbl,0,i).innerHTML= ""+head_lst[i]+""; - } - var accept_img1 = 'lib/images/icons/accept.gif'; - var cancel_img1 = 'lib/images/icons/cancel.gif'; - - for(i=1; i
'; -} diff --git a/erpnext/home/page/profile_settings/profile_settings.js b/erpnext/home/page/profile_settings/profile_settings.js index 9dac7f6f1d..f1ee6ffc6d 100644 --- a/erpnext/home/page/profile_settings/profile_settings.js +++ b/erpnext/home/page/profile_settings/profile_settings.js @@ -26,13 +26,15 @@ MyProfile = function(wrapper) { this.make = function() { this.head = new PageHeader(this.wrapper, 'My Profile Settings'); - this.head.add_button('Change Password', this.change_password) + this.head.add_button('Change Password', this.change_password); + this.head.add_button('Change Background', this.change_background); + this.tab = make_table($a(this.wrapper, 'div', '', {marginTop:'19px'}), 1, 2, '90%', ['50%', '50%'], {padding:'11px'}) - this.img = $a($td(this.tab, 0, 0), 'img'); - set_user_img(this.img, user); + this.img = $a($td(this.tab, 0, 0), 'img', '', {width: '120px', maxHeight:'200px'}); + this.img.src = wn.user_info(user).image; - $btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image) + $btn($a($td(this.tab, 0, 0), 'div', '', {marginTop:'11px'}), 'Change Image', this.change_image); this.make_form(); this.load_details(); @@ -105,32 +107,46 @@ MyProfile = function(wrapper) { // this.change_image = function() { - if(!me.change_dialog) { - - var d = new Dialog(400,200,'Set Your Profile Image'); - d.make_body([ - ['HTML','wrapper'] - ]); - - var w = d.widgets['wrapper']; - me.uploader = new Uploader(w, - { - modulename:'home.page.profile_settings.profile_settings', - method: 'set_user_image' - }, - pscript.user_image_upload, 1) - me.change_dialog = d; - } - me.change_dialog.show(); + var d = new wn.widgets.Dialog({ + title: 'Set your Profile' + }) + me.uploader = new Uploader(d.body, { + modulename:'home.page.profile_settings.profile_settings', + method: 'set_user_image' + }, + pscript.user_image_upload, 1) + d.show(); + pscript.open_dialog = d; + } + + this.change_background = function() { + var d = new wn.widgets.Dialog({ + title: 'Set Background Image' + }) + me.uploader = new Uploader(d.body, { + modulename:'home.page.profile_settings.profile_settings', + method: 'set_user_background' + }, + pscript.background_change, 1) + d.show(); + pscript.open_dialog = d; } this.make(); } -pscript.user_image_upload = function(fid) { +pscript.background_change = function(fid) { msgprint('File Uploaded'); - if(fid) { - pscript.myprofile.change_dialog.hide(); - set_user_img(pscript.myprofile.img, user, null, fid); + erpnext.set_user_background(fid); + pscript.open_dialog.hide(); + } +} + +pscript.user_image_upload = function(fid) { + msgprint('File Uploaded'); + if(fid) { + pscript.open_dialog.hide(); + wn.boot.user_info[user].image = 'files/' + fid; + pscript.myprofile.img.src = 'files/' + fid; } } diff --git a/erpnext/home/page/profile_settings/profile_settings.py b/erpnext/home/page/profile_settings/profile_settings.py index f614c75ff4..fb633fdb19 100644 --- a/erpnext/home/page/profile_settings/profile_settings.py +++ b/erpnext/home/page/profile_settings/profile_settings.py @@ -63,6 +63,31 @@ def set_user_image(fid, fname): """ Set uploaded image as user image """ - from webnotes.utils.file_manager import add_file_list, remove_all - remove_all('Profile', webnotes.session['user']) - add_file_list('Profile', webnotes.session['user'], fname, fid) + from webnotes.utils.file_manager import add_file_list, remove_file + user = webnotes.session['user'] + + # remove old file + old_image = webnotes.conn.get_value('Profile', user, 'user_image') + if old_image: + remove_file('Profile', user, old_image) + + # add new file + add_file_list('Profile', user, fname, fid) + webnotes.conn.set_value('Profile', user, 'user_image', fid) + +@webnotes.whitelist() +def set_user_background(fid, fname): + """ + Set uploaded image as user image + """ + from webnotes.utils.file_manager import add_file_list, remove_file + user = webnotes.session['user'] + + # remove old file + old_image = webnotes.conn.get_value('Profile', user, 'background_image') + if old_image: + remove_file('Profile', user, old_image) + + # add new file + add_file_list('Profile', user, fname, fid) + webnotes.conn.set_value('Profile', user, 'background_image', fid) diff --git a/erpnext/patches/jan_mar_2012/add_roles_to_admin.py b/erpnext/patches/jan_mar_2012/add_roles_to_admin.py new file mode 100644 index 0000000000..402675ae2c --- /dev/null +++ b/erpnext/patches/jan_mar_2012/add_roles_to_admin.py @@ -0,0 +1,10 @@ +def execute(): + """ + Adds various roles to Administrator. This patch is for making master db + ready for on premise installation + """ + import webnotes + from webnotes.model.code import get_obj + from webnotes.model.doc import Document + sc = get_obj('Setup Control', 'Setup Control') + sc.add_roles(Document('Profile', 'Administrator')) diff --git a/erpnext/patches/jan_mar_2012/clear_session_cache.py b/erpnext/patches/jan_mar_2012/clear_session_cache.py index 2071ae567c..5ba2104322 100644 --- a/erpnext/patches/jan_mar_2012/clear_session_cache.py +++ b/erpnext/patches/jan_mar_2012/clear_session_cache.py @@ -16,6 +16,4 @@ def execute(): import webnotes - webnotes.conn.sql(""" - delete from __SessionCache - """) + webnotes.clear_cache() diff --git a/erpnext/patches/jan_mar_2012/dt_map_fix.py b/erpnext/patches/jan_mar_2012/dt_map_fix.py new file mode 100644 index 0000000000..f669009786 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/dt_map_fix.py @@ -0,0 +1,7 @@ +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + webnotes.conn.sql("delete from `tabField Mapper Detail` where from_field = 'transaction_date' and parent in ('Sales Order-Delivery Note', 'Purchase Order-Purchase Receipt')") + + reload_doc('stock', 'DocType Mapper', 'Sales Order-Delivery Note') + reload_doc('stock', 'DocType Mapper', 'Purchase Order-Purchase Receipt') diff --git a/erpnext/patches/jan_mar_2012/label_cleanup.py b/erpnext/patches/jan_mar_2012/label_cleanup.py index 885c83f94b..b40f36f855 100644 --- a/erpnext/patches/jan_mar_2012/label_cleanup.py +++ b/erpnext/patches/jan_mar_2012/label_cleanup.py @@ -3,14 +3,14 @@ def execute(): from webnotes.model import delete_doc from webnotes.modules.module_manager import reload_doc - dt = [ + dt = { 'selling': ['quotation', 'sales_order', 'quotation_detail', 'sales_order_detail'], 'stock': ['delivery_note', 'delivery_note_detail', 'purchase_receipt', 'purchase_receipt_detail'], 'accounts': ['receivable_voucher', 'payable_voucher', 'rv_detail', 'pv_detail', 'rv_tax_detail', 'purchase_tax_detail'], 'buying': ['purchase_order', 'po_detail'] - ] + } for m in dt: - for d in m: + for d in dt[m]: reload_doc(m, 'doctype', d) @@ -21,7 +21,7 @@ def execute(): del_flds = { 'Sales Order Detail': "'delivery_date', 'confirmation_date'", - 'Delivery Note': "'supplier', 'supplier_address', 'purchase_receipt_no', 'purchase_order_no', 'transaction_date'" + 'Delivery Note': "'supplier', 'supplier_address', 'purchase_receipt_no', 'purchase_order_no', 'transaction_date'", 'Receivable Voucher': "'voucher_date'", 'Payable Voucher': "'voucher_date'", 'Purchase Receipt': "'transaction_date'" @@ -33,10 +33,15 @@ def execute(): } for d in del_flds: - webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = %s", (del_flds[d], d)) + webnotes.conn.sql("delete from `tabDocField` where fieldname in (%s) and parent = '%s'"% (del_flds[d], d)) for d in del_labels: - webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = %s", (del_labels[d], d)) + webnotes.conn.sql("delete from `tabDocField` where label in (%s) and parent = '%s'"% (del_labels[d], d)) delete_doc('DocType', 'Update Delivery Date Detail') - delete_doc('DocType', 'Update Delivery Date' + + # Reload print formats + reload_doc('accounts', 'Print Format', 'Sales Invoice Classic') + reload_doc('accounts', 'Print Format', 'Sales Invoice Modern') + reload_doc('accounts', 'Print Format', 'Sales Invoice Spartan') + diff --git a/erpnext/patches/jan_mar_2012/navupdate.py b/erpnext/patches/jan_mar_2012/navupdate.py index d29a2cf336..1cfa879ad3 100644 --- a/erpnext/patches/jan_mar_2012/navupdate.py +++ b/erpnext/patches/jan_mar_2012/navupdate.py @@ -32,6 +32,17 @@ def execute(): reload_doc('utilities', 'page', 'todo') reload_doc('utilities', 'page', 'calendar') reload_doc('utilities', 'page', 'messages') + reload_doc('setup', 'page', 'modules_setup') + reload_doc('utilities', 'page', 'users') + reload_doc('home', 'page', 'activity') + reload_doc('home', 'page', 'attributions') + reload_doc('core', 'doctype', 'profile') + + # update user_image in profile + for p in webnotes.conn.sql("""select name, file_list from tabProfile + where ifnull(file_list,'')!=''"""): + fid = p[1].split('\n')[0].split(',')[1] + webnotes.conn.set_value('Profile', p[0], 'user_image', fid) webnotes.conn.set_value('Control Panel', 'Control Panel', 'home_page', 'desktop') diff --git a/erpnext/patches/jan_mar_2012/reload_table.py b/erpnext/patches/jan_mar_2012/reload_table.py new file mode 100644 index 0000000000..14b8864ed0 --- /dev/null +++ b/erpnext/patches/jan_mar_2012/reload_table.py @@ -0,0 +1,9 @@ +def execute(): + import webnotes + from webnotes.modules.module_manager import reload_doc + reload_doc('selling', 'doctype', 'quotation_detail') + reload_doc('stock', 'doctype', 'delivery_note_detail') + reload_doc('stock', 'doctype', 'purchase_receipt_detail') + reload_doc('buying', 'doctype', 'po_detail') + reload_doc('accounts', 'doctype', 'rv_detail') + reload_doc('accounts', 'doctype', 'pv_detail') diff --git a/erpnext/patches/jan_mar_2012/website/file_data_rename.py b/erpnext/patches/jan_mar_2012/website/file_data_rename.py index 481a530aeb..dc4110bbc5 100644 --- a/erpnext/patches/jan_mar_2012/website/file_data_rename.py +++ b/erpnext/patches/jan_mar_2012/website/file_data_rename.py @@ -69,3 +69,12 @@ def replace_file_list_column_entries(): if file_list and "/" in file_list: webnotes.conn.sql("UPDATE `%s` SET file_list='%s' WHERE name='%s'" \ % (tab, file_list.replace('/', '-'), name)) + + singles = webnotes.conn.sql("""SELECT doctype, value FROM `tabSingles` + WHERE field='file_list'""") + for doctype, file_list in singles: + if file_list and "/" in file_list: + webnotes.conn.sql("""UPDATE `tabSingles` SET value='%s' + WHERE doctype='%s' AND field='file_list'""" + % (file_list.replace('/', '-'), doctype)) + diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index dc9f1dd7e4..7750962963 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -121,4 +121,61 @@ patch_list = [ 'patch_file': 'fix_packing_slip', 'description': 'Update Mapper Delivery Note-Packing Slip' }, + { + 'patch_module': 'patches.jan_mar_2012.apps', + 'patch_file': 'todo_item', + 'description': 'Reloads todo item' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'convert_tables_to_utf8', + 'description': 'Convert tables to UTF-8' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'pending_patches', + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'pos_setting_patch', + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'reload_doctype', + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'reload_po_pr_mapper', + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'delete_pur_of_service', + 'description': 'Deletes purpose of service' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'navupdate', + 'description': 'New Navigation Pages' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'label_cleanup', + 'description': 'Remove extra fields and new dynamic labels' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'add_roles_to_admin', + 'description': 'Add Roles to Administrator' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'dt_map_fix', + 'description': 'removed transaction date from dt_mapper' + }, + { + 'patch_module': 'patches.jan_mar_2012', + 'patch_file': 'reload_table', + 'description': 'Relaod all item table: fld order changes' + }, + ] diff --git a/erpnext/patches/print_formats/SalesInvoiceClassic.html b/erpnext/patches/print_formats/SalesInvoiceClassic.html index 78cb8155ff..d40f80152b 100644 --- a/erpnext/patches/print_formats/SalesInvoiceClassic.html +++ b/erpnext/patches/print_formats/SalesInvoiceClassic.html @@ -200,7 +200,7 @@ - + diff --git a/erpnext/patches/print_formats/SalesInvoiceModern.html b/erpnext/patches/print_formats/SalesInvoiceModern.html index cef84ac6a2..ac66423495 100644 --- a/erpnext/patches/print_formats/SalesInvoiceModern.html +++ b/erpnext/patches/print_formats/SalesInvoiceModern.html @@ -227,7 +227,7 @@ - + diff --git a/erpnext/patches/print_formats/SalesInvoiceSpartan.html b/erpnext/patches/print_formats/SalesInvoiceSpartan.html index 7d13674f9a..81e1c380fe 100644 --- a/erpnext/patches/print_formats/SalesInvoiceSpartan.html +++ b/erpnext/patches/print_formats/SalesInvoiceSpartan.html @@ -222,7 +222,7 @@ \ + \ + \ + \ + \ + \ + \ + \ + ', perm)) + } + + me.perm_dialog.show(); + } + }); + + }, + make_perm_dialog: function() { + this.perm_dialog = new wn.widgets.Dialog({ + title:'Role Permissions', + width: 500 + }); + } +}) diff --git a/erpnext/utilities/page/users/users.py b/erpnext/utilities/page/users/users.py new file mode 100644 index 0000000000..f2bb1a5f47 --- /dev/null +++ b/erpnext/utilities/page/users/users.py @@ -0,0 +1,193 @@ +# 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 . + +import webnotes +import json + +from webnotes.model.doc import Document +from webnotes.utils import cint + +@webnotes.whitelist() +def get(arg=None): + """return all users""" + return webnotes.conn.sql("""select name, file_list, enabled, gender, + restrict_ip, login_before, login_after from tabProfile + where docstatus<2 and name not in ('Administrator', 'Guest') order by + ifnull(enabled,0) desc, name""", as_dict=1) + +@webnotes.whitelist() +def get_roles(arg=None): + """return all roles""" + return [r[0] for r in webnotes.conn.sql("""select name from tabRole + where name not in ('Administrator', 'Guest', 'All') order by name""")] + +@webnotes.whitelist() +def get_user_roles(arg=None): + """get roles for a user""" + return [r[0] for r in webnotes.conn.sql("""select role from tabUserRole + where parent=%s""", webnotes.form_dict['uid'])] + +@webnotes.whitelist() +def get_perm_info(arg=None): + """get permission info""" + return webnotes.conn.sql("""select parent, permlevel, `read`, `write`, submit, + cancel, amend from tabDocPerm where role=%s + and docstatus<2 order by parent, permlevel""", + webnotes.form_dict['role'], as_dict=1) + +@webnotes.whitelist() +def update_roles(arg=None): + """update set and unset roles""" + # remove roles + unset = json.loads(webnotes.form_dict['unset_roles']) + webnotes.conn.sql("""delete from tabUserRole where parent='%s' + and role in ('%s')""" % (webnotes.form_dict['uid'], "','".join(unset))) + + # check for 1 system manager + if not webnotes.conn.sql("""select parent from tabUserRole where role='System Manager' + and docstatus<2"""): + webnotes.msgprint("Sorry there must be atleast one 'System Manager'") + raise webnotes.ValidationError + + # add roles + roles = get_user_roles() + toset = json.loads(webnotes.form_dict['set_roles']) + for role in toset: + if not role in roles: + d = Document('UserRole') + d.role = role + d.parent = webnotes.form_dict['uid'] + d.save() + + webnotes.msgprint('Roles Updated') + +@webnotes.whitelist() +def update_security(args=''): + args = json.loads(args) + webnotes.conn.set_value('Profile', args['user'], 'restrict_ip', args.get('restrict_ip')) + webnotes.conn.set_value('Profile', args['user'], 'login_after', args.get('login_after')) + webnotes.conn.set_value('Profile', args['user'], 'login_before', args.get('login_before')) + webnotes.conn.set_value('Profile', args['user'], 'enabled', int(args.get('enabled',0)) or 0) + + if args.get('new_password') and args.get('sys_admin_pwd'): + if cint(webnotes.conn.get_value('Control Panel',None,'sync_with_gateway')): + import server_tools.gateway_utils + res = server_tools.gateway_utils.change_password('', args['new_password'], + args['user'], args['sys_admin_pwd']) + if 'Traceback' not in res['message']: + webnotes.msgprint(res['message']) + webnotes.conn.sql("update tabProfile set password=password(%s) where name=%s", + (args['new_password'], args['user'])) + else: + webnotes.msgprint('Settings Updated') + + + +# +# user addition +# + +@webnotes.whitelist() +def add_user(args): + args = json.loads(args) + # erpnext-saas + if cint(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): + from server_tools.gateway_utils import add_user_gateway + add_user_gateway(args) + + add_profile(args) + +@webnotes.whitelist() +def add_profile(args): + from webnotes.utils import validate_email_add, now + email = args['user'] + + sql = webnotes.conn.sql + + if not email: + email = webnotes.form_dict.get('user') + if not validate_email_add(email): + raise Exception + return 'Invalid Email Id' + + if sql("select name from tabProfile where name = %s", email): + # exists, enable it + sql("update tabProfile set enabled = 1, docstatus=0 where name = %s", email) + webnotes.msgprint('Profile exists, enabled it with new password') + else: + # does not exist, create it! + pr = Document('Profile') + pr.name = email + pr.email = email + pr.first_name = args.get('first_name') + pr.last_name = args.get('last_name') + pr.enabled = 1 + pr.user_type = 'System User' + pr.save(1) + + if args.get('password'): + sql(""" + UPDATE tabProfile + SET password = PASSWORD(%s), modified = %s + WHERE name = %s""", (args.get('password'), now, email)) + + send_welcome_mail(email, args) + +@webnotes.whitelist() +def send_welcome_mail(email, args): + """send welcome mail to user with password and login url""" + pr = Document('Profile', email) + from webnotes.utils.email_lib import sendmail_md + args.update({ + 'company': webnotes.conn.get_default('company'), + 'password': args.get('password'), + 'account_url': webnotes.conn.get_value('Website Settings', + 'Website Settings', 'subdomain') or "" + }) + if not args.get('last_name'): args['last_name'] = '' + sendmail_md(pr.email, subject="Welcome to ERPNext", msg=welcome_txt % args, from_defs=1) + +# +# delete user +# +@webnotes.whitelist() +def delete(arg=None): + """delete user""" + webnotes.conn.sql("update tabProfile set enabled=0, docstatus=2 where name=%s", + webnotes.form_dict['uid']) + # erpnext-saas + if int(webnotes.conn.get_value('Control Panel', None, 'sync_with_gateway')): + from server_tools.gateway_utils import remove_user_gateway + remove_user_gateway(webnotes.form_dict['uid']) + + webnotes.login_manager.logout(user=webnotes.form_dict['uid']) + +welcome_txt = """ +## %(company)s + +Dear %(first_name)s %(last_name)s + +Welcome! + +A new account has been created for you, here are your details: + +login-id: %(user)s +password: %(password)s + +To login to your new ERPNext account, please go to: + +%(account_url)s +""" diff --git a/erpnext/utilities/page/users/users.txt b/erpnext/utilities/page/users/users.txt new file mode 100644 index 0000000000..165cc1695b --- /dev/null +++ b/erpnext/utilities/page/users/users.txt @@ -0,0 +1,28 @@ +# Page, users +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-28 10:29:39', + 'docstatus': 0, + 'modified': '2012-02-28 10:29:39', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Utilities', + 'name': '__common__', + 'page_name': u'users', + 'standard': u'Yes', + 'title': u'Users' + }, + + # Page, users + { + 'doctype': 'Page', + 'name': u'users' + } +] \ No newline at end of file diff --git a/erpnext/website/doctype/style_settings/custom_template.css b/erpnext/website/doctype/style_settings/custom_template.css index e6eeeb34fa..8eb3d6396f 100644 --- a/erpnext/website/doctype/style_settings/custom_template.css +++ b/erpnext/website/doctype/style_settings/custom_template.css @@ -1,6 +1,6 @@ body { {% if doc.background_image %} - background: url("files/{{ doc.background_image }}") repeat !important; + background: url("files/{{ doc.background_image }}") repeat; {% elif doc.background_color %} background-color: #{{ doc.background_color }}; {% endif %} diff --git a/erpnext/website/page/website_home/website_home.html b/erpnext/website/page/website_home/website_home.html index 747ca5aa03..f7bb208bea 100644 --- a/erpnext/website/page/website_home/website_home.html +++ b/erpnext/website/page/website_home/website_home.html @@ -1,10 +1,10 @@
× -

Support

+

Website


-

Web Page

+

Web Page

Static (content) web page

Product

Product listed in catolog

diff --git a/images/stripedbg.png b/images/stripedbg.png new file mode 100755 index 0000000000..64ece5707d Binary files /dev/null and b/images/stripedbg.png differ diff --git a/index.cgi b/index.cgi index e7a1d57661..ed766eb11f 100755 --- a/index.cgi +++ b/index.cgi @@ -38,10 +38,25 @@ def init(): # init request try: webnotes.http_request = webnotes.auth.HTTPRequest() + return True except webnotes.AuthenticationError, e: - pass + return True except webnotes.UnknownDomainError, e: print "Location: " + (webnotes.defs.redirect_404) + except webnotes.SessionStopped, e: + if 'cmd' in webnotes.form_dict: + webnotes.handler.print_json() + else: + print "Content-Type: text/html" + print + print """ + +

+ Updating. + We will be back in a few moments... +

+ + """ def respond(): import webnotes @@ -55,5 +70,5 @@ def respond(): print webnotes.cms.index.get() if __name__=="__main__": - init() - respond() + if init(): + respond() diff --git a/js/all-app.js b/js/all-app.js index 952f24815a..aa2677859b 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -1,10 +1,4 @@ -/* - * lib/js/lib/jquery.min.js - *//*! jQuery v1.7.1 jquery.com | jquery.org/license */ -(function(a,b){function cy(a){return f.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:!1}function cv(a){if(!ck[a]){var b=c.body,d=f("<"+a+">").appendTo(b),e=d.css("display");d.remove();if(e==="none"||e===""){cl||(cl=c.createElement("iframe"),cl.frameBorder=cl.width=cl.height=0),b.appendChild(cl);if(!cm||!cl.createElement)cm=(cl.contentWindow||cl.contentDocument).document,cm.write((c.compatMode==="CSS1Compat"?"":"")+""),cm.close();d=cm.createElement(a),cm.body.appendChild(d),e=f.css(d,"display"),b.removeChild(cl)}ck[a]=e}return ck[a]}function cu(a,b){var c={};f.each(cq.concat.apply([],cq.slice(0,b)),function(){c[this]=a});return c}function ct(){cr=b}function cs(){setTimeout(ct,0);return cr=f.now()}function cj(){try{return new a.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}}function ci(){try{return new a.XMLHttpRequest}catch(b){}}function cc(a,c){a.dataFilter&&(c=a.dataFilter(c,a.dataType));var d=a.dataTypes,e={},g,h,i=d.length,j,k=d[0],l,m,n,o,p;for(g=1;g0){if(c!=="border")for(;g=0===c})}function S(a){return!a||!a.parentNode||a.parentNode.nodeType===11}function K(){return!0}function J(){return!1}function n(a,b,c){var d=b+"defer",e=b+"queue",g=b+"mark",h=f._data(a,d);h&&(c==="queue"||!f._data(a,e))&&(c==="mark"||!f._data(a,g))&&setTimeout(function(){!f._data(a,e)&&!f._data(a,g)&&(f.removeData(a,d,!0),h.fire())},0)}function m(a){for(var b in a){if(b==="data"&&f.isEmptyObject(a[b]))continue;if(b!=="toJSON")return!1}return!0}function l(a,c,d){if(d===b&&a.nodeType===1){var e="data-"+c.replace(k,"-$1").toLowerCase();d=a.getAttribute(e);if(typeof d=="string"){try{d=d==="true"?!0:d==="false"?!1:d==="null"?null:f.isNumeric(d)?parseFloat(d):j.test(d)?f.parseJSON(d):d}catch(g){}f.data(a,c,d)}else d=b}return d}function h(a){var b=g[a]={},c,d;a=a.split(/\s+/);for(c=0,d=a.length;c)[^>]*$|#([\w\-]*)$)/,j=/\S/,k=/^\s+/,l=/\s+$/,m=/^<(\w+)\s*\/?>(?:<\/\1>)?$/,n=/^[\],:{}\s]*$/,o=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,p=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,q=/(?:^|:|,)(?:\s*\[)+/g,r=/(webkit)[ \/]([\w.]+)/,s=/(opera)(?:.*version)?[ \/]([\w.]+)/,t=/(msie) ([\w.]+)/,u=/(mozilla)(?:.*? rv:([\w.]+))?/,v=/-([a-z]|[0-9])/ig,w=/^-ms-/,x=function(a,b){return(b+"").toUpperCase()},y=d.userAgent,z,A,B,C=Object.prototype.toString,D=Object.prototype.hasOwnProperty,E=Array.prototype.push,F=Array.prototype.slice,G=String.prototype.trim,H=Array.prototype.indexOf,I={};e.fn=e.prototype={constructor:e,init:function(a,d,f){var g,h,j,k;if(!a)return this;if(a.nodeType){this.context=this[0]=a,this.length=1;return this}if(a==="body"&&!d&&c.body){this.context=c,this[0]=c.body,this.selector=a,this.length=1;return this}if(typeof a=="string"){a.charAt(0)!=="<"||a.charAt(a.length-1)!==">"||a.length<3?g=i.exec(a):g=[null,a,null];if(g&&(g[1]||!d)){if(g[1]){d=d instanceof e?d[0]:d,k=d?d.ownerDocument||d:c,j=m.exec(a),j?e.isPlainObject(d)?(a=[c.createElement(j[1])],e.fn.attr.call(a,d,!0)):a=[k.createElement(j[1])]:(j=e.buildFragment([g[1]],[k]),a=(j.cacheable?e.clone(j.fragment):j.fragment).childNodes);return e.merge(this,a)}h=c.getElementById(g[2]);if(h&&h.parentNode){if(h.id!==g[2])return f.find(a);this.length=1,this[0]=h}this.context=c,this.selector=a;return this}return!d||d.jquery?(d||f).find(a):this.constructor(d).find(a)}if(e.isFunction(a))return f.ready(a);a.selector!==b&&(this.selector=a.selector,this.context=a.context);return e.makeArray(a,this)},selector:"",jquery:"1.7.1",length:0,size:function(){return this.length},toArray:function(){return F.call(this,0)},get:function(a){return a==null?this.toArray():a<0?this[this.length+a]:this[a]},pushStack:function(a,b,c){var d=this.constructor();e.isArray(a)?E.apply(d,a):e.merge(d,a),d.prevObject=this,d.context=this.context,b==="find"?d.selector=this.selector+(this.selector?" ":"")+c:b&&(d.selector=this.selector+"."+b+"("+c+")");return d},each:function(a,b){return e.each(this,a,b)},ready:function(a){e.bindReady(),A.add(a);return this},eq:function(a){a=+a;return a===-1?this.slice(a):this.slice(a,a+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(F.apply(this,arguments),"slice",F.call(arguments).join(","))},map:function(a){return this.pushStack(e.map(this,function(b,c){return a.call(b,c,b)}))},end:function(){return this.prevObject||this.constructor(null)},push:E,sort:[].sort,splice:[].splice},e.fn.init.prototype=e.fn,e.extend=e.fn.extend=function(){var a,c,d,f,g,h,i=arguments[0]||{},j=1,k=arguments.length,l=!1;typeof i=="boolean"&&(l=i,i=arguments[1]||{},j=2),typeof i!="object"&&!e.isFunction(i)&&(i={}),k===j&&(i=this,--j);for(;j0)return;A.fireWith(c,[e]),e.fn.trigger&&e(c).trigger("ready").off("ready")}},bindReady:function(){if(!A){A=e.Callbacks("once memory");if(c.readyState==="complete")return setTimeout(e.ready,1);if(c.addEventListener)c.addEventListener("DOMContentLoaded",B,!1),a.addEventListener("load",e.ready,!1);else if(c.attachEvent){c.attachEvent("onreadystatechange",B),a.attachEvent("onload",e.ready);var b=!1;try{b=a.frameElement==null}catch(d){}c.documentElement.doScroll&&b&&J()}}},isFunction:function(a){return e.type(a)==="function"},isArray:Array.isArray||function(a){return e.type(a)==="array"},isWindow:function(a){return a&&typeof a=="object"&&"setInterval"in a},isNumeric:function(a){return!isNaN(parseFloat(a))&&isFinite(a)},type:function(a){return a==null?String(a):I[C.call(a)]||"object"},isPlainObject:function(a){if(!a||e.type(a)!=="object"||a.nodeType||e.isWindow(a))return!1;try{if(a.constructor&&!D.call(a,"constructor")&&!D.call(a.constructor.prototype,"isPrototypeOf"))return!1}catch(c){return!1}var d;for(d in a);return d===b||D.call(a,d)},isEmptyObject:function(a){for(var b in a)return!1;return!0},error:function(a){throw new Error(a)},parseJSON:function(b){if(typeof b!="string"||!b)return null;b=e.trim(b);if(a.JSON&&a.JSON.parse)return a.JSON.parse(b);if(n.test(b.replace(o,"@").replace(p,"]").replace(q,"")))return(new Function("return "+b))();e.error("Invalid JSON: "+b)},parseXML:function(c){var d,f;try{a.DOMParser?(f=new DOMParser,d=f.parseFromString(c,"text/xml")):(d=new ActiveXObject("Microsoft.XMLDOM"),d.async="false",d.loadXML(c))}catch(g){d=b}(!d||!d.documentElement||d.getElementsByTagName("parsererror").length)&&e.error("Invalid XML: "+c);return d},noop:function(){},globalEval:function(b){b&&j.test(b)&&(a.execScript||function(b){a.eval.call(a,b)})(b)},camelCase:function(a){return a.replace(w,"ms-").replace(v,x)},nodeName:function(a,b){return a.nodeName&&a.nodeName.toUpperCase()===b.toUpperCase()},each:function(a,c,d){var f,g=0,h=a.length,i=h===b||e.isFunction(a);if(d){if(i){for(f in a)if(c.apply(a[f],d)===!1)break}else for(;g0&&a[0]&&a[j-1]||j===0||e.isArray(a));if(k)for(;i1?i.call(arguments,0):b,j.notifyWith(k,e)}}function l(a){return function(c){b[a]=arguments.length>1?i.call(arguments,0):c,--g||j.resolveWith(j,b)}}var b=i.call(arguments,0),c=0,d=b.length,e=Array(d),g=d,h=d,j=d<=1&&a&&f.isFunction(a.promise)?a:f.Deferred(),k=j.promise();if(d>1){for(;c
Invoice Date
Due Date
Invoice Date
Due Date - + diff --git a/erpnext/selling/doctype/customer/customer.txt b/erpnext/selling/doctype/customer/customer.txt index 24271ee688..346b4d1029 100644 --- a/erpnext/selling/doctype/customer/customer.txt +++ b/erpnext/selling/doctype/customer/customer.txt @@ -5,47 +5,48 @@ { 'creation': '2010-08-08 17:08:56', 'docstatus': 0, - 'modified': '2011-07-20 10:42:05', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-02-29 13:24:31', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all DocType { - '_last_update': '1309508837', + '_last_update': u'1330501485', 'allow_print': 0, 'allow_trash': 1, - 'colour': 'White:FFF', + 'colour': u'White:FFF', + 'default_print_format': u'Standard', 'doctype': 'DocType', - 'document_type': 'Master', - 'module': 'Selling', + 'document_type': u'Master', + 'module': u'Selling', 'name': '__common__', - 'search_fields': 'customer_name,customer_group,country,territory', - 'section_style': 'Tabbed', - 'server_code_error': ' ', + 'search_fields': u'customer_name,customer_group,country,territory', + 'section_style': u'Tabbed', + 'server_code_error': u' ', 'show_in_menu': 0, - 'subject': "eval:'%(customer_name)s'=='%(name)s' ? ' ' : '%(customer_name)s'", - 'tag_fields': 'customer_group,customer_type', - 'version': 433 + 'subject': u'eval:"%(customer_name)s"=="%(name)s" ? "" : "%(customer_name)s"', + 'tag_fields': u'customer_group,customer_type', + 'version': 434 }, # These values are common for all DocField { - 'doctype': 'DocField', + 'doctype': u'DocField', 'name': '__common__', - 'parent': 'Customer', - 'parentfield': 'fields', - 'parenttype': 'DocType' + 'parent': u'Customer', + 'parentfield': u'fields', + 'parenttype': u'DocType' }, # These values are common for all DocPerm { 'amend': 0, - 'doctype': 'DocPerm', + 'doctype': u'DocPerm', 'name': '__common__', - 'parent': 'Customer', - 'parentfield': 'permissions', - 'parenttype': 'DocType', + 'parent': u'Customer', + 'parentfield': u'permissions', + 'parenttype': u'DocType', 'read': 1, 'submit': 0 }, @@ -53,17 +54,16 @@ # DocType, Customer { 'doctype': 'DocType', - 'name': 'Customer' + 'name': u'Customer' }, # DocPerm { 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', - 'idx': 1, + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Sales Manager', + 'role': u'Sales Manager', 'write': 0 }, @@ -71,10 +71,9 @@ { 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', - 'idx': 2, + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Sales Manager', + 'role': u'Sales Manager', 'write': 0 }, @@ -82,10 +81,9 @@ { 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', - 'idx': 3, + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Sales User', + 'role': u'Sales User', 'write': 0 }, @@ -93,10 +91,9 @@ { 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', - 'idx': 4, + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Sales User', + 'role': u'Sales User', 'write': 0 }, @@ -104,10 +101,9 @@ { 'cancel': 1, 'create': 1, - 'doctype': 'DocPerm', - 'idx': 5, + 'doctype': u'DocPerm', 'permlevel': 0, - 'role': 'Sales Master Manager', + 'role': u'Sales Master Manager', 'write': 1 }, @@ -115,38 +111,35 @@ { 'cancel': 0, 'create': 0, - 'doctype': 'DocPerm', - 'idx': 6, + 'doctype': u'DocPerm', 'permlevel': 1, - 'role': 'Sales Master Manager', + 'role': u'Sales Master Manager', 'write': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts', - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 1, - 'label': 'Basic Info', - 'oldfieldtype': 'Section Break', + 'colour': u'White:FFF', + 'description': u'Note: You Can Manage Multiple Address or Contacts via Addresses & Contacts', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Basic Info', + 'oldfieldtype': u'Section Break', 'permlevel': 0, 'reqd': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'customer_name', - 'fieldtype': 'Data', + 'doctype': u'DocField', + 'fieldname': u'customer_name', + 'fieldtype': u'Data', 'hidden': 0, - 'idx': 2, 'in_filter': 1, - 'label': 'Customer Name', + 'label': u'Customer Name', 'no_copy': 1, - 'oldfieldname': 'customer_name', - 'oldfieldtype': 'Data', + 'oldfieldname': u'customer_name', + 'oldfieldtype': u'Data', 'permlevel': 0, 'print_hide': 0, 'report_hide': 0, @@ -156,330 +149,312 @@ # DocField { - 'doctype': 'DocField', - 'fieldname': 'customer_type', - 'fieldtype': 'Select', - 'idx': 3, - 'label': 'Customer Type', - 'oldfieldname': 'customer_type', - 'oldfieldtype': 'Select', - 'options': '\nCompany\nIndividual', + 'doctype': u'DocField', + 'fieldname': u'customer_type', + 'fieldtype': u'Select', + 'label': u'Customer Type', + 'oldfieldname': u'customer_type', + 'oldfieldtype': u'Select', + 'options': u'\nCompany\nIndividual', 'permlevel': 0, 'reqd': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'naming_series', - 'fieldtype': 'Select', - 'idx': 4, - 'label': 'Series', + 'doctype': u'DocField', + 'fieldname': u'naming_series', + 'fieldtype': u'Select', + 'label': u'Series', 'no_copy': 1, - 'options': '\nCUST\nCUSTMUM\nCUSTOM', + 'options': u'\nCUST\nCUSTMUM', 'permlevel': 0, 'print_hide': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'Fetch lead which will be converted into customer.', - 'doctype': 'DocField', - 'fieldname': 'lead_name', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'description': u'Fetch lead which will be converted into customer.', + 'doctype': u'DocField', + 'fieldname': u'lead_name', + 'fieldtype': u'Link', 'hidden': 0, - 'idx': 5, 'in_filter': 1, - 'label': 'Lead Ref', + 'label': u'Lead Ref', 'no_copy': 1, - 'oldfieldname': 'lead_name', - 'oldfieldtype': 'Link', - 'options': 'Lead', + 'oldfieldname': u'lead_name', + 'oldfieldtype': u'Link', + 'options': u'Lead', 'permlevel': 0, 'print_hide': 1, 'report_hide': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 6, + 'doctype': u'DocField', + 'fieldtype': u'Column Break', 'permlevel': 0, - 'width': '50%' + 'width': u'50%' }, # DocField { - 'colour': 'White:FFF', - 'description': 'To manage Customer Groups, click here', - 'doctype': 'DocField', - 'fieldname': 'customer_group', - 'fieldtype': 'Link', + 'colour': u'White:FFF', + 'description': u'To manage Customer Groups, click here', + 'doctype': u'DocField', + 'fieldname': u'customer_group', + 'fieldtype': u'Link', 'hidden': 0, - 'idx': 7, 'in_filter': 1, - 'label': 'Customer Group', - 'oldfieldname': 'customer_group', - 'oldfieldtype': 'Link', - 'options': 'Customer Group', + 'label': u'Customer Group', + 'oldfieldname': u'customer_group', + 'oldfieldtype': u'Link', + 'options': u'Customer Group', 'permlevel': 0, 'print_hide': 0, 'reqd': 1, 'search_index': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { - 'colour': 'White:FFF', - 'description': 'To manage Territory, click here', - 'doctype': 'DocField', - 'fieldname': 'territory', - 'fieldtype': 'Link', - 'idx': 8, - 'label': 'Territory', - 'oldfieldname': 'territory', - 'oldfieldtype': 'Link', - 'options': 'Territory', + 'colour': u'White:FFF', + 'description': u'To manage Territory, click here', + 'doctype': u'DocField', + 'fieldname': u'territory', + 'fieldtype': u'Link', + 'label': u'Territory', + 'oldfieldname': u'territory', + 'oldfieldtype': u'Link', + 'options': u'Territory', 'permlevel': 0, 'print_hide': 1, 'reqd': 1, - 'trigger': 'Client' + 'trigger': u'Client' }, # DocField { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 9, - 'label': 'Address & Contacts', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Address & Contacts', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'depends_on': 'eval:doc.__islocal', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 10, - 'label': 'Address Desc', - 'options': 'Addresses will appear only when you save the customer', + 'colour': u'White:FFF', + 'depends_on': u'eval:doc.__islocal', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'Address Desc', + 'options': u'Addresses will appear only when you save the customer', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 11, - 'label': 'Address HTML', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'Address HTML', 'permlevel': 1 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 12, + 'doctype': u'DocField', + 'fieldtype': u'Column Break', 'permlevel': 0, - 'width': '50%' + 'width': u'50%' }, # DocField { - 'colour': 'White:FFF', - 'depends_on': 'eval:doc.__islocal', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 13, - 'label': 'Contact Desc', - 'options': 'Contact Details will appear only when you save the customer', + 'colour': u'White:FFF', + 'depends_on': u'eval:doc.__islocal', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'Contact Desc', + 'options': u'Contact Details will appear only when you save the customer', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 14, - 'label': 'Contact HTML', - 'oldfieldtype': 'HTML', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'Contact HTML', + 'oldfieldtype': u'HTML', 'permlevel': 1 }, # DocField { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 15, - 'label': 'More Info', - 'oldfieldtype': 'Section Break', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'More Info', + 'oldfieldtype': u'Section Break', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'description': 'To create an Account Head under a different company, then set the company and click the button below.', - 'doctype': 'DocField', - 'fieldname': 'company', - 'fieldtype': 'Link', - 'idx': 16, + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'permlevel': 0, + 'width': u'50%' + }, + + # DocField + { + 'colour': u'White:FFF', + 'description': u'To create an Account Head under a different company, select the company and save customer.', + 'doctype': u'DocField', + 'fieldname': u'company', + 'fieldtype': u'Link', 'in_filter': 1, - 'label': 'Company', - 'oldfieldname': 'company', - 'oldfieldtype': 'Link', - 'options': 'Company', + 'label': u'Company', + 'oldfieldname': u'company', + 'oldfieldtype': u'Link', + 'options': u'Company', 'permlevel': 0, 'reqd': 1, - 'search_index': 0 + 'search_index': 1 }, # DocField { - 'colour': 'White:FFF', - 'description': "Your Customer's TAX registration numbers (if applicable) or any general information", - 'doctype': 'DocField', - 'fieldname': 'customer_details', - 'fieldtype': 'Text', - 'idx': 17, - 'label': 'Customer Details', - 'oldfieldname': 'customer_details', - 'oldfieldtype': 'Code', + 'colour': u'White:FFF', + 'description': u"Your Customer's TAX registration numbers (if applicable) or any general information", + 'doctype': u'DocField', + 'fieldname': u'customer_details', + 'fieldtype': u'Text', + 'label': u'Customer Details', + 'oldfieldname': u'customer_details', + 'oldfieldtype': u'Code', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Column Break', - 'idx': 18, + 'doctype': u'DocField', + 'fieldtype': u'Column Break', 'permlevel': 0, - 'width': '50%' + 'width': u'50%' }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'credit_days', - 'fieldtype': 'Int', - 'idx': 19, - 'label': 'Credit Days', - 'oldfieldname': 'credit_days', - 'oldfieldtype': 'Int', + 'doctype': u'DocField', + 'fieldname': u'credit_days', + 'fieldtype': u'Int', + 'label': u'Credit Days', + 'oldfieldname': u'credit_days', + 'oldfieldtype': u'Int', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'credit_limit', - 'fieldtype': 'Currency', - 'idx': 20, - 'label': 'Credit Limit', - 'oldfieldname': 'credit_limit', - 'oldfieldtype': 'Currency', + 'doctype': u'DocField', + 'fieldname': u'credit_limit', + 'fieldtype': u'Currency', + 'label': u'Credit Limit', + 'oldfieldname': u'credit_limit', + 'oldfieldtype': u'Currency', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'website', - 'fieldtype': 'Data', - 'idx': 21, - 'label': 'Website', + 'doctype': u'DocField', + 'fieldname': u'website', + 'fieldtype': u'Data', + 'label': u'Website', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 22, - 'label': 'Sales Team', - 'oldfieldtype': 'Section Break', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Sales Team', + 'oldfieldtype': u'Section Break', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'default_sales_partner', - 'fieldtype': 'Link', - 'idx': 23, - 'label': 'Default Sales Partner', - 'oldfieldname': 'default_sales_partner', - 'oldfieldtype': 'Link', - 'options': 'Sales Partner', + 'doctype': u'DocField', + 'fieldname': u'default_sales_partner', + 'fieldtype': u'Link', + 'label': u'Default Sales Partner', + 'oldfieldname': u'default_sales_partner', + 'oldfieldtype': u'Link', + 'options': u'Sales Partner', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'default_commission_rate', - 'fieldtype': 'Currency', - 'idx': 24, - 'label': 'Default Commission Rate', - 'oldfieldname': 'default_commission_rate', - 'oldfieldtype': 'Currency', + 'doctype': u'DocField', + 'fieldname': u'default_commission_rate', + 'fieldtype': u'Currency', + 'label': u'Default Commission Rate', + 'oldfieldname': u'default_commission_rate', + 'oldfieldtype': u'Currency', 'permlevel': 0 }, # DocField { - 'doctype': 'DocField', - 'fieldname': 'sales_team', - 'fieldtype': 'Table', - 'idx': 25, - 'label': 'Sales Team Details', - 'oldfieldname': 'sales_team', - 'oldfieldtype': 'Table', - 'options': 'Sales Team', + 'doctype': u'DocField', + 'fieldname': u'sales_team', + 'fieldtype': u'Table', + 'label': u'Sales Team Details', + 'oldfieldname': u'sales_team', + 'oldfieldtype': u'Table', + 'options': u'Sales Team', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'depends_on': 'eval:!doc.__islocal', - 'doctype': 'DocField', - 'fieldtype': 'Section Break', - 'idx': 26, - 'label': 'Transaction History', + 'colour': u'White:FFF', + 'depends_on': u'eval:!doc.__islocal', + 'doctype': u'DocField', + 'fieldtype': u'Section Break', + 'label': u'Transaction History', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'depends_on': 'eval:!doc.__islocal', - 'doctype': 'DocField', - 'fieldtype': 'HTML', - 'idx': 27, - 'label': 'History HTML', + 'colour': u'White:FFF', + 'depends_on': u'eval:!doc.__islocal', + 'doctype': u'DocField', + 'fieldtype': u'HTML', + 'label': u'History HTML', 'permlevel': 0 }, # DocField { - 'colour': 'White:FFF', - 'doctype': 'DocField', - 'fieldname': 'trash_reason', - 'fieldtype': 'Small Text', - 'idx': 28, - 'label': 'Trash Reason', - 'oldfieldname': 'trash_reason', - 'oldfieldtype': 'Small Text', + 'colour': u'White:FFF', + 'doctype': u'DocField', + 'fieldname': u'trash_reason', + 'fieldtype': u'Small Text', + 'label': u'Trash Reason', + 'oldfieldname': u'trash_reason', + 'oldfieldtype': u'Small Text', 'permlevel': 1 } ] \ No newline at end of file diff --git a/erpnext/selling/doctype/quotation/quotation.js b/erpnext/selling/doctype/quotation/quotation.js index 2a130a59cb..7f40782d0c 100644 --- a/erpnext/selling/doctype/quotation/quotation.js +++ b/erpnext/selling/doctype/quotation/quotation.js @@ -50,8 +50,11 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { } cur_frm.cscript.onload_post_render = function(doc, dt, dn) { - // defined in sales_common.js - cur_frm.cscript.update_item_details(doc, cdt, cdn); + var callback = function(doc, dt, dn) { + // defined in sales_common.js + cur_frm.cscript.update_item_details(doc, dt, dn); + } + cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback); } // hide - unhide fields based on lead or customer.. @@ -83,10 +86,7 @@ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.clear_custom_buttons(); - var callback = function() { - cur_frm.cscript.dynamic_label(doc, cdt, cdn); - } - cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback); + if (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn); if(doc.docstatus == 1 && doc.status!='Order Lost') { diff --git a/erpnext/selling/doctype/quotation/quotation.py b/erpnext/selling/doctype/quotation/quotation.py index 531de21ed4..de4056d2d6 100644 --- a/erpnext/selling/doctype/quotation/quotation.py +++ b/erpnext/selling/doctype/quotation/quotation.py @@ -77,14 +77,16 @@ class DocType(TransactionBase): # Get Item Details # ----------------- def get_item_details(self, args=None): - args = eval(args) - if args['item_code']: + args = args and eval(args) or {} + if args.get('item_code'): return get_obj('Sales Common').get_item_details(args, self) else: obj = get_obj('Sales Common') for doc in self.doclist: if doc.fields.get('item_code'): - ret = obj.get_item_details(doc.item_code, self) + arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), + 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; + ret = obj.get_item_details(arg, self) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] @@ -96,11 +98,6 @@ class DocType(TransactionBase): get_obj('Sales Common').get_adj_percent(self) - def get_comp_base_currency(self): - return get_obj('Sales Common').get_comp_base_currency(self.doc.company) - - def get_price_list_currency(self): - return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company) # OTHER CHARGES TRIGGER FUNCTIONS diff --git a/erpnext/selling/doctype/quotation/quotation.txt b/erpnext/selling/doctype/quotation/quotation.txt index 07642e8a23..32784a8dcb 100644 --- a/erpnext/selling/doctype/quotation/quotation.txt +++ b/erpnext/selling/doctype/quotation/quotation.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:17', 'docstatus': 0, - 'modified': '2012-02-27 17:14:54', + 'modified': '2012-03-02 12:20:40', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -41,7 +41,7 @@ 'show_in_menu': 0, 'subject': u'To %(customer_name)s on %(transaction_date)s worth %(currency)s %(grand_total_export)s', 'tag_fields': u'status', - 'version': 617 + 'version': 618 }, # These values are common for all DocFormat @@ -675,18 +675,6 @@ 'width': u'100px' }, - # DocField - { - 'colour': u'White:FFF', - 'doctype': u'DocField', - 'fieldtype': u'HTML', - 'label': u'Note HTML', - 'oldfieldtype': u'HTML', - 'options': u'
Note : * In Base Currency\n
', - 'permlevel': 0, - 'print_hide': 1 - }, - # DocField { 'colour': u'White:FFF', diff --git a/erpnext/selling/doctype/quotation_detail/quotation_detail.txt b/erpnext/selling/doctype/quotation_detail/quotation_detail.txt index 8c78f48e43..81bf64de9f 100644 --- a/erpnext/selling/doctype/quotation_detail/quotation_detail.txt +++ b/erpnext/selling/doctype/quotation_detail/quotation_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:18', 'docstatus': 0, - 'modified': '2012-02-24 13:21:21', + 'modified': '2012-03-05 10:48:27', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,7 +23,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 30 + 'version': 32 }, # These values are common for all DocField @@ -94,18 +94,33 @@ { 'default': u'0.00', 'doctype': u'DocField', - 'fieldname': u'ref_rate', + 'fieldname': u'qty', 'fieldtype': u'Currency', - 'label': u'Price List Rate', - 'oldfieldname': u'ref_rate', + 'in_filter': 0, + 'label': u'Quantity', + 'oldfieldname': u'qty', 'oldfieldtype': u'Currency', 'permlevel': 0, - 'print_hide': 1, - 'reqd': 0, + 'print_hide': 0, + 'reqd': 1, + 'search_index': 0, 'trigger': u'Client', 'width': u'100px' }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'base_ref_rate', + 'fieldtype': u'Currency', + 'label': u'Price List Rate*', + 'oldfieldname': u'base_ref_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 1, + 'print_hide': 1, + 'width': u'100px' + }, + # DocField { 'default': u'0.00', @@ -116,7 +131,59 @@ 'oldfieldname': u'adj_rate', 'oldfieldtype': u'Float', 'permlevel': 0, - 'print_hide': 0, + 'print_hide': 1, + 'trigger': u'Client', + 'width': u'100px' + }, + + # DocField + { + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'basic_rate', + 'fieldtype': u'Currency', + 'in_filter': 0, + 'label': u'Basic Rate*', + 'oldfieldname': u'basic_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, + 'search_index': 0, + 'trigger': u'Client', + 'width': u'100px' + }, + + # DocField + { + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'amount', + 'fieldtype': u'Currency', + 'in_filter': 0, + 'label': u'Amount*', + 'oldfieldname': u'amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1, + 'print_hide': 1, + 'reqd': 0, + 'search_index': 0, + 'trigger': u'Client', + 'width': u'100px' + }, + + # DocField + { + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'ref_rate', + 'fieldtype': u'Currency', + 'label': u'Price List Rate', + 'oldfieldname': u'ref_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, 'trigger': u'Client', 'width': u'100px' }, @@ -139,24 +206,6 @@ 'width': u'100px' }, - # DocField - { - 'default': u'0.00', - 'doctype': u'DocField', - 'fieldname': u'qty', - 'fieldtype': u'Currency', - 'in_filter': 0, - 'label': u'Quantity', - 'oldfieldname': u'qty', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 0, - 'reqd': 1, - 'search_index': 0, - 'trigger': u'Client', - 'width': u'100px' - }, - # DocField { 'default': u'0.00', @@ -174,37 +223,6 @@ 'width': u'100px' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'base_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Price List Rate*', - 'oldfieldname': u'base_ref_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'print_hide': 1, - 'width': u'100px' - }, - - # DocField - { - 'default': u'0.00', - 'doctype': u'DocField', - 'fieldname': u'basic_rate', - 'fieldtype': u'Currency', - 'in_filter': 0, - 'label': u'Basic Rate*', - 'oldfieldname': u'basic_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 0, - 'search_index': 0, - 'trigger': u'Client', - 'width': u'100px' - }, - # DocField { 'colour': u'White:FFF', @@ -220,24 +238,6 @@ 'width': u'100px' }, - # DocField - { - 'default': u'0.00', - 'doctype': u'DocField', - 'fieldname': u'amount', - 'fieldtype': u'Currency', - 'in_filter': 0, - 'label': u'Amount*', - 'oldfieldname': u'amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'print_hide': 1, - 'reqd': 0, - 'search_index': 0, - 'trigger': u'Client', - 'width': u'100px' - }, - # DocField { 'doctype': u'DocField', diff --git a/erpnext/selling/doctype/sales_common/sales_common.js b/erpnext/selling/doctype/sales_common/sales_common.js index 5d88c3034b..97b20eb702 100644 --- a/erpnext/selling/doctype/sales_common/sales_common.js +++ b/erpnext/selling/doctype/sales_common/sales_common.js @@ -26,13 +26,15 @@ cur_frm.cscript.load_taxes = function(doc, cdt, cdn, callback) { // run if this is not executed from dt_map... doc = locals[doc.doctype][doc.name]; if(doc.customer || getchildren('RV Tax Detail', doc.name, 'other_charges', doc.doctype).length) { - if(callback) callback(doc, cdt, cdn); - return; + if(callback) { + callback(doc, cdt, cdn); + } + } else { + $c_obj([doc],'load_default_taxes','',function(r,rt){ + refresh_field('other_charges'); + if(callback) callback(doc, cdt, cdn); + }); } - $c_obj([doc],'load_default_taxes','',function(r,rt){ - refresh_field('other_charges'); - if(callback) callback(doc, cdt, cdn); - }); } @@ -75,7 +77,6 @@ cur_frm.cscript.update_item_details = function(doc, dt, dn, callback) { - // ============== Customer and its primary contact Details ============================ cur_frm.cscript.customer = function(doc, cdt, cdn) { if(doc.customer){ @@ -120,7 +121,9 @@ var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) { for (d in item_cols_export) $('[data-grid-fieldname="'+cur_frm.cscript.tname+'-'+d+'"]').html(item_cols_export[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); + for (f in item_cols_export) { + cur_frm.fields_dict[cur_frm.cscript.fname].grid.set_column_disp(f, hide); + } //tax table flds tax_cols = {'tax_amount': 'Amount', 'total': 'Total'}; @@ -136,17 +139,11 @@ var set_dynamic_label_child = function(doc, cdt, cdn, base_curr) { // Change label dynamically based on currency //------------------------------------------------------------------ -cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) { - var callback = function(r, rt) { - if (r.message) base_curr = r.message; - else base_curr = sys_defaults['currency']; +cur_frm.cscript.dynamic_label = function(doc, cdt, cdn, base_curr, callback) { + set_dynamic_label_par(doc, cdt, cdn, base_curr); + set_dynamic_label_child(doc, cdt, cdn, base_curr); - set_dynamic_label_par(doc, cdt, cdn, base_curr); - set_dynamic_label_child(doc, cdt, cdn, base_curr); - } - - if (doc.company == sys_defaults['company']) callback('', ''); - else $c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback); + if (callback) callback(doc, cdt, cdn); } @@ -155,27 +152,30 @@ cur_frm.cscript.dynamic_label = function(doc, cdt, cdn) { cur_frm.cscript.hide_price_list_currency = function(doc, cdt, cdn, callback1) { if (doc.price_list_name && doc.currency) { - var callback = function(r, rt) { - pl_currency = r.message[0]?r.message[0]:[]; - if (pl_currency.length==1) { - if (pl_currency[0] == doc.currency) set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); - else if (pl_currency[0] = r.message[1]) set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) - hide_field(['price_list_currency', 'plc_conversion_rate']); - } else unhide_field(['price_list_currency', 'plc_conversion_rate']); + wn.call({ + method: 'selling.doctype.sales_common.sales_common.get_price_list_currency', + args: {'price_list':doc.price_list_name, 'company': doc.company}, + callback: function(r, rt) { + pl_currency = r.message[0]?r.message[0]:[]; + if (pl_currency.length==1) { + if (pl_currency[0] == doc.currency) set_multiple(cdt, cdn, {price_list_currency:doc.currency, plc_conversion_rate:doc.conversion_rate}); + else if (pl_currency[0] = r.message[1]) set_multiple(cdt, cdn, {price_list_currency:pl_currency[0], plc_conversion_rate:1}) + hide_field(['price_list_currency', 'plc_conversion_rate']); + } else unhide_field(['price_list_currency', 'plc_conversion_rate']); - if (r.message[1] == doc.currency) { - set_multiple(cdt, cdn, {conversion_rate:1}); - hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); - } else unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); + if (r.message[1] == doc.currency) { + set_multiple(cdt, cdn, {conversion_rate:1}); + hide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); + } else unhide_field(['conversion_rate', 'grand_total_export', 'in_words_export', 'rounded_total_export']); - if (r.message[1] == doc.price_list_currency) { - set_multiple(cdt, cdn, {plc_conversion_rate:1}); - hide_field('plc_conversion_rate'); - } else unhide_field('plc_conversion_rate'); - - callback1() - } - $c_obj(make_doclist(doc.doctype, doc.name), 'get_price_list_currency', '', callback); + if (r.message[1] == doc.price_list_currency) { + set_multiple(cdt, cdn, {plc_conversion_rate:1}); + hide_field('plc_conversion_rate'); + } else unhide_field('plc_conversion_rate'); + + cur_frm.cscript.dynamic_label(doc, cdt, cdn, r.message[1], callback1); + } + }) } } @@ -213,12 +213,15 @@ cur_frm.cscript.conversion_rate = cur_frm.cscript.currency; cur_frm.cscript.plc_conversion_rate = cur_frm.cscript.currency; cur_frm.cscript.company = function(doc, dt, dn) { - var callback = function(r, rt) { - var doc = locals[dt][dn]; - set_multiple(doc.doctype, doc.name, {currency:r.message,price_list_currency:r.message}); - cur_frm.cscript.currency(doc, cdt, cdn); - } - $c_obj(make_doclist(doc.doctype, doc.name), 'get_comp_base_currency', '', callback); + wn.call({ + method: 'selling.doctype.sales_common.sales_common.get_comp_base_currency', + args: {company:doc.company}, + callback: function(r, rt) { + var doc = locals[dt][dn]; + set_multiple(doc.doctype, doc.name, {currency:r.message, price_list_currency:r.message}); + cur_frm.cscript.currency(doc, cdt, cdn); + } + }); } @@ -234,7 +237,6 @@ cur_frm.cscript.price_list_name = function(doc, cdt, cdn) { refresh_field(fname); var doc = locals[cdt][cdn]; cur_frm.cscript.recalc(doc,3); //this is to re-calculate BASIC RATE and AMOUNT on basis of changed REF RATE - cur_frm.cscript.dynamic_label(doc, cdt, cdn); } ); } @@ -557,11 +559,9 @@ cur_frm.cscript.consider_incl_rate = function(doc, other_fname) { var tax_list = getchildren('RV Tax Detail', doc.name, other_fname, doc.doctype); for(var i=0; i. +# along with this program. If not, see . # Please edit this list and import only required elements import webnotes @@ -34,30 +34,36 @@ convert_to_lists = webnotes.conn.convert_to_lists class DocType: - def __init__(self,d,dl): - self.doc, self.doclist = d,dl - self.nsm_parent_field = 'parent_item_group'; + def __init__(self,d,dl): + self.doc, self.doclist = d,dl + self.nsm_parent_field = 'parent_item_group'; - # update Node Set Model - def update_nsm_model(self): - import webnotes - import webnotes.utils.nestedset - webnotes.utils.nestedset.update_nsm(self) + # update Node Set Model + def update_nsm_model(self): + import webnotes + import webnotes.utils.nestedset + webnotes.utils.nestedset.update_nsm(self) - # ON UPDATE - #-------------------------------------- - def on_update(self): - # update nsm - self.update_nsm_model() + # ON UPDATE + #-------------------------------------- + def on_update(self): + # update nsm + self.update_nsm_model() - def validate(self): - if self.doc.lft and self.doc.rgt: - res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name)) - if not res: - msgprint("Please enter proper parent item group.") - raise Exception - - r = sql("select name from `tabItem Group` where name = '%s' and docstatus = 2"%(self.doc.item_group_name)) - if r: - msgprint("'%s' record is trashed. To untrash please go to Setup & click on Trash."%(self.doc.item_group_name)) - raise Exception \ No newline at end of file + def validate(self): + if self.doc.lft and self.doc.rgt: + res = sql("select name from `tabItem Group` where is_group = 'Yes' and docstatus!= 2 and (rgt > %s or lft < %s) and name ='%s' and name !='%s'"%(self.doc.rgt,self.doc.lft,self.doc.parent_item_group,self.doc.item_group_name)) + if not res: + msgprint("Please enter proper parent item group.") + raise Exception + + r = sql("select name from `tabItem Group` where name = '%s' and docstatus = 2"%(self.doc.item_group_name)) + if r: + msgprint("'%s' record is trashed. To untrash please go to Setup & click on Trash."%(self.doc.item_group_name)) + raise Exception + + def on_trash(self): + ig = sql("select name from `tabItem` where ifnull(item_group, '') = %s", self.doc.name) + if ig: + msgprint("""Item Group: %s can not be trashed/deleted because it is used in item: %s. + To trash/delete this, remove/change item group in item master""" % (self.doc.name, ig[0][0] or ''), raise_exception=1) diff --git a/erpnext/setup/doctype/setup_control/setup_control.py b/erpnext/setup/doctype/setup_control/setup_control.py index beb3cc66f1..50b9bb03cb 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 . -# 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): @@ -58,8 +48,8 @@ class DocType: args = json.loads(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'], args.get('pwd')) - + self.create_profile(args['user'], args['first_name'], args['last_name'], args.get('pwd')) + # Domain related updates try: from server_tools.gateway_utils import add_domain_map @@ -68,38 +58,48 @@ class DocType: pass # add record in domain_list of Website Settings - webnotes.conn.set_value('Website Settings', 'Website Settings', 'subdomain', args['url_name'] + ".erpnext.com") + account_url = args['url_name'] + '.erpnext.com' + webnotes.conn.set_value('Website Settings', 'Website Settings', + 'subdomain', account_url) # 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) - self.currency = currency + import webnotes, json + args = json.loads(args) + + curr_fiscal_year, fy_start_date, fy_abbr = self.get_fy_details(args.get('fy_start')) + + args['name'] = webnotes.session.get('user') # Update Profile - if last_name=='None': last_name = None + if not args.get('last_name') or args.get('last_name')=='None': args['last_name'] = None webnotes.conn.sql("""\ - UPDATE `tabProfile` SET first_name=%s, last_name=%s - WHERE name=%s AND docstatus<2""", (first_name, last_name, webnotes.user.name)) + UPDATE `tabProfile` SET first_name=%(first_name)s, + last_name=%(last_name)s + WHERE name=%(name)s AND docstatus<2""", args) # Fiscal Year - master_dict = {'Fiscal Year':{'year':curr_fiscal_year, 'year_start_date':fy_start_date}} + master_dict = {'Fiscal Year':{ + 'year': curr_fiscal_year, + 'year_start_date': fy_start_date, + 'abbreviation': fy_abbr, + 'company': args.get('company_name'), + 'is_fiscal_year_closed': 'No'}} self.create_records(master_dict) # Company - master_dict = {'Company':{'company_name':company_name, - 'abbr':comp_abbr, - 'default_currency':currency - }} + master_dict = {'Company':{'company_name':args.get('company_name'), + 'abbr':args.get('company_abbr'), + 'default_currency':args.get('currency') + }} self.create_records(master_dict) def_args = {'current_fiscal_year':curr_fiscal_year, - 'default_currency': currency, - 'default_company':company_name, + 'default_currency': args.get('currency'), + 'default_company':args.get('company_name'), 'default_valuation_method':'FIFO', 'default_stock_uom':'Nos', 'date_format':'dd-mm-yyyy', @@ -111,21 +111,51 @@ class DocType: 'emp_created_by':'Naming Series', 'cust_master_name':'Customer Name', 'supp_master_name':'Supplier Name', - 'default_currency_format': (currency=='INR') and 'Lacs' or 'Millions' + 'default_currency_format': \ + (args.get('currency')=='INR') and 'Lacs' or 'Millions' } # 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 '') + user_fullname = (args.get('first_name') or '') + (args.get('last_name') + and (" " + args.get('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', 'ToDo Item', '', webnotes.session['user'], + '"' + 'Setup Complete. Please check your \ + To Do List' + '"', '#6B24B3') + + d = Document('ToDo Item') + d.description = 'Create your first Customer' + d.priority = 'High' + d.date = nowdate() + d.reference_type = 'Customer' + d.save(1) + + d = Document('ToDo Item') + d.description = 'Create your first Item' + d.priority = 'High' + d.date = nowdate() + d.reference_type = 'Item' + d.save(1) + + d = Document('ToDo Item') + d.description = 'Create your first Supplier' + d.priority = 'High' + d.date = nowdate() + d.reference_type = 'Supplier' + d.save(1) + # Get Fiscal year Details # ------------------------ @@ -138,9 +168,11 @@ class DocType: #eddt = sql("select DATE_FORMAT(DATE_SUB(DATE_ADD('%s', INTERVAL 1 YEAR), INTERVAL 1 DAY),'%%d-%%m-%%Y')" % (stdt.split('-')[2]+ '-' + stdt.split('-')[1] + '-' + stdt.split('-')[0])) if(fy_start == '1st Jan'): fy = cstr(getdate(nowdate()).year) + abbr = cstr(fy)[-2:] else: fy = cstr(curr_year) + '-' + cstr(curr_year+1) - return fy,stdt + abbr = cstr(curr_year)[-2:] + '-' + cstr(curr_year+1)[-2:] + return fy, stdt, abbr # Create Company and Fiscal Year @@ -207,14 +239,6 @@ class DocType: 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 +248,14 @@ class DocType: 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/setup/doctype/territory/territory.py b/erpnext/setup/doctype/territory/territory.py index 461b447aa7..8017ad5757 100644 --- a/erpnext/setup/doctype/territory/territory.py +++ b/erpnext/setup/doctype/territory/territory.py @@ -74,4 +74,11 @@ class DocType: for d in getlist(self.doclist, 'target_details'): if not flt(d.target_qty) and not flt(d.target_amount): msgprint("Either target qty or target amount is mandatory.") - raise Exception \ No newline at end of file + raise Exception + + + def on_trash(self): + terr = sql("select name from `tabCustomer` where ifnull(territory, '') = %s", self.doc.name) + if terr: + msgprint("""Territory: %s can not be trashed/deleted because it is used in territory: %s. + To trash/delete this, remove/change territory in customer master""" % (self.doc.name, terr[0][0] or ''), raise_exception=1) diff --git a/erpnext/setup/page/modules_setup/__init__.py b/erpnext/setup/page/modules_setup/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/setup/page/modules_setup/modules_setup.css b/erpnext/setup/page/modules_setup/modules_setup.css new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/setup/page/modules_setup/modules_setup.html b/erpnext/setup/page/modules_setup/modules_setup.html new file mode 100644 index 0000000000..ea136ffcae --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.html @@ -0,0 +1,14 @@ +
+ × +

Modules Setup

+
+
+ Select checkbox to show / hide module. Drag around to move order. +
+
+
+
+ +
+
\ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.js b/erpnext/setup/page/modules_setup/modules_setup.js new file mode 100644 index 0000000000..af7522f4ae --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.js @@ -0,0 +1,50 @@ +wn.require('lib/js/lib/jquery-ui-sortable.min.js'); + +$.extend(wn.pages.modules_setup, { + modules: ['Activity', 'Accounts', 'Selling', 'Buying', 'Stock', 'Production', 'Projects', + 'Support', 'HR', 'Website', 'To Do', 'Messages', 'Calendar', 'Knowledge Base'], + onload: function(wrapper) { + wn.pages.modules_setup.refresh(wn.boot.modules_list); + }, + refresh: function(ml) { + $('#modules-list').empty(); + + // checked modules + for(i in ml) { + $('#modules-list').append(repl('

\ + \ + %(m)s

', {m:ml[i]})); + } + $('#modules-list [data-module]').attr('checked', true); + + // unchecked modules + var all = wn.pages.modules_setup.modules; + for(i in all) { + if(!$('#modules-list [data-module="'+all[i]+'"]').length) { + $('#modules-list').append(repl('

\ + \ + %(m)s

', {m:all[i]})); + } + } + + $('#modules-list').sortable(); + + }, + update: function() { + var ml = []; + $('#modules-list [data-module]').each(function() { + if($(this).attr('checked')) + ml.push($(this).attr('data-module')); + }); + + wn.call({ + method: 'setup.page.modules_setup.modules_setup.update', + args: { + ml: JSON.stringify(ml) + }, + callback: function(r) { + }, + btn: $('#modules-update').get(0) + }); + } +}); \ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.py b/erpnext/setup/page/modules_setup/modules_setup.py new file mode 100644 index 0000000000..ee36dfaeaa --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.py @@ -0,0 +1,8 @@ +import webnotes + +@webnotes.whitelist() +def update(arg=None): + """update modules""" + webnotes.conn.set_global('modules_list', webnotes.form_dict['ml']) + webnotes.msgprint('Updated') + webnotes.clear_cache() \ No newline at end of file diff --git a/erpnext/setup/page/modules_setup/modules_setup.txt b/erpnext/setup/page/modules_setup/modules_setup.txt new file mode 100644 index 0000000000..70c6a90cc2 --- /dev/null +++ b/erpnext/setup/page/modules_setup/modules_setup.txt @@ -0,0 +1,28 @@ +# Page, modules_setup +[ + + # These values are common in all dictionaries + { + 'creation': '2012-02-28 17:48:39', + 'docstatus': 0, + 'modified': '2012-02-28 17:48:39', + 'modified_by': u'Administrator', + 'owner': u'Administrator' + }, + + # These values are common for all Page + { + 'doctype': 'Page', + 'module': u'Setup', + 'name': '__common__', + 'page_name': u'modules_setup', + 'standard': u'Yes', + 'title': u'Modules Setup' + }, + + # Page, modules_setup + { + 'doctype': 'Page', + 'name': u'modules_setup' + } +] \ No newline at end of file diff --git a/erpnext/setup/page/setup/setup.html b/erpnext/setup/page/setup/setup.html index 7963cb9d9a..50ef112bbb 100644 --- a/erpnext/setup/page/setup/setup.html +++ b/erpnext/setup/page/setup/setup.html @@ -20,7 +20,7 @@

Users and Permissions

- Users
+ Users
Add/remove users, set roles, passwords etc

@@ -31,6 +31,10 @@ Amount based Authorization Rules
Restrict submission rights based on amount

+

+ Modules Setup
+ Show, hide modules +

Data

diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index 5f0cc2334c..7db56bdb53 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -48,7 +48,7 @@ def on_login_post_session(login_manager): sid!=%s""", \ (webnotes.session['user'], webnotes.session['sid']), as_list=1) - if webnotes.session['user'] not in ('Guest') and webnotes.conn.cur_db_name!='accounts': + if webnotes.session['user'] not in ('Guest', 'demo@webnotestech.com') and webnotes.conn.cur_db_name!='accounts': # create feed from webnotes.utils import nowtime home.make_feed('Login', 'Profile', login_manager.user, login_manager.user, @@ -87,6 +87,14 @@ def boot_session(bootinfo): import webnotes.model.doctype 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' + + bootinfo['user_background'] = webnotes.conn.get_value("Profile", webnotes.session['user'], 'background_image') or '' 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 0000000000..ac89affa5c --- /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 . + +// 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', reqd: 1}, + {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'), fieldtype: 'Select'}, + {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.split(' '); + 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_info[user].fullname = user_fullname; + d.hide(); + $('header').toggle(true); + page_body.wntoolbar.set_user_name(); + }); + } + + d.show(); +} diff --git a/erpnext/startup/feature_setup.js b/erpnext/startup/js/feature_setup.js similarity index 95% rename from erpnext/startup/feature_setup.js rename to erpnext/startup/js/feature_setup.js index 8644c1dd84..c5518ab751 100644 --- a/erpnext/startup/feature_setup.js +++ b/erpnext/startup/js/feature_setup.js @@ -122,13 +122,13 @@ pscript.feature_dict = { 'Sales Order': {'sales_order_details':['page_break']} }, 'fs_exports': { - 'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['base_ref_rate','export_amount','export_rate']}, + 'Delivery Note': {'fields':['Note','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'delivery_note_details':['ref_rate','export_amount','export_rate']}, 'POS Setting': {'fields':['conversion_rate','currency']}, - 'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['base_ref_rate','export_amount','export_rate']}, - 'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['base_ref_rate','export_amount','export_rate']}, + 'Quotation': {'fields':['Note HTML','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'quotation_details':['ref_rate','export_amount','export_rate']}, + 'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['ref_rate','export_amount','export_rate']}, 'Item': {'ref_rate_details':['ref_currency']}, 'Sales BOM': {'fields':['currency']}, - 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']} + 'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['ref_rate','export_amount','export_rate']} }, 'fs_imports': { 'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']}, @@ -149,7 +149,6 @@ pscript.feature_dict = { 'Sales Order': {'fields':['sales_team','Packing List']} }, 'fs_more_info': { - 'Customer': {'fields':['More Info']}, 'Delivery Note': {'fields':['More Info']}, 'Enquiry': {'fields':['More Info']}, 'Indent': {'fields':['More Info']}, @@ -160,8 +159,6 @@ pscript.feature_dict = { 'Quotation': {'fields':['More Info']}, 'Receivable Voucher': {'fields':['More Info']}, 'Sales Order': {'fields':['More Info']}, - 'Serial No': {'fields':['More Info']}, - 'Supplier': {'fields':['More Info']} }, 'fs_quality': { 'Item': {'fields':['Item Inspection Criteria','inspection_required']}, diff --git a/erpnext/startup/modules.js b/erpnext/startup/js/modules.js similarity index 89% rename from erpnext/startup/modules.js rename to erpnext/startup/js/modules.js index dbd11b0b39..d43b0210b3 100644 --- a/erpnext/startup/modules.js +++ b/erpnext/startup/js/modules.js @@ -32,7 +32,7 @@ erpnext.module_page.hide_links = function(wrapper) { $(wrapper).find('[href*="List/"]').each(function() { var href = $(this).attr('href'); var dt = href.split('/')[1]; - if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) { + if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } @@ -41,7 +41,7 @@ erpnext.module_page.hide_links = function(wrapper) { // reports $(wrapper).find('[data-doctype]').each(function() { var dt = $(this).attr('data-doctype'); - if(wn.boot.profile.can_read.indexOf(dt)==-1) { + if(wn.boot.profile.all_read.indexOf(dt)==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } @@ -51,7 +51,7 @@ erpnext.module_page.hide_links = function(wrapper) { $(wrapper).find('[href*="Form/"]').each(function() { var href = $(this).attr('href'); var dt = href.split('/')[1]; - if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1) { + if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1) { var txt = $(this).text(); $(this).parent().css('color', '#999').html(txt); } @@ -73,7 +73,10 @@ erpnext.module_page.make_list = function(module, wrapper) { args: { module: module }, - no_refresh: true + no_refresh: true, + callback: function(r) { + erpnext.module_page.hide_links(wrapper) + } }); wrapper.list.run(); } \ No newline at end of file diff --git a/erpnext/startup/toolbar.js b/erpnext/startup/js/toolbar.js similarity index 72% rename from erpnext/startup/toolbar.js rename to erpnext/startup/js/toolbar.js index 7eda49361c..7bf9c6a04e 100644 --- a/erpnext/startup/toolbar.js +++ b/erpnext/startup/js/toolbar.js @@ -73,20 +73,43 @@ erpnext.toolbar.add_modules = function() { $('
'); + + // 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); @@ -69,53 +103,36 @@ show_chart_browser = function(nm, chart_type){ } -// 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() { +var update_messages = function(reset) { // Updates Team Messages if(inList(['Guest'], user)) { return; } - - $c_page('home', 'event_updates', 'get_unread_messages', null, - function(r,rt) { - if(!r.exc) { - // This function is defined in toolbar.js - 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); + + if(!reset) { + $c_page('home', 'event_updates', 'get_unread_messages', null, + function(r,rt) { + if(!r.exc) { + // This function is defined in toolbar.js + 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); } - } else { - clearInterval(wn.updates.id); } - } - ); + ); + } else { + page_body.wntoolbar.set_new_comments(0); + $('#msg_count').toggle(false); + } } erpnext.startup.set_periodic_updates = function() { @@ -129,7 +146,9 @@ erpnext.startup.set_periodic_updates = function() { wn.updates.id = setInterval(update_messages, 60000); } -// ======================================= +erpnext.set_user_background = function(src) { + set_style(repl('body { background: url("files/%(src)s") repeat;}', {src:src})) +} // start $(document).bind('startup', function() { diff --git a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt index 3c50836af5..e3f0dc9adf 100644 --- a/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt +++ b/erpnext/stock/DocType Mapper/Purchase Order-Purchase Receipt/Purchase Order-Purchase Receipt.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2012-02-07 13:28:20', + 'modified': '2012-03-01 17:58:16', 'modified_by': u'Administrator', 'owner': u'Administrator' }, diff --git a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt index 561019b4d7..fcadcd4245 100644 --- a/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt +++ b/erpnext/stock/DocType Mapper/Sales Order-Delivery Note/Sales Order-Delivery Note.txt @@ -5,273 +5,263 @@ { 'creation': '2010-08-08 17:09:35', 'docstatus': 0, - 'modified': '2011-09-14 12:36:25', - 'modified_by': 'Administrator', - 'owner': 'Administrator' + 'modified': '2012-03-01 17:58:16', + 'modified_by': u'Administrator', + 'owner': u'Administrator' }, # These values are common for all Table Mapper Detail { - 'doctype': 'Table Mapper Detail', + 'doctype': u'Table Mapper Detail', 'name': '__common__', - 'parent': 'Sales Order-Delivery Note', - 'parentfield': 'table_mapper_details', - 'parenttype': 'DocType Mapper' + 'parent': u'Sales Order-Delivery Note', + 'parentfield': u'table_mapper_details', + 'parenttype': u'DocType Mapper' }, # These values are common for all Field Mapper Detail { - 'doctype': 'Field Mapper Detail', + 'doctype': u'Field Mapper Detail', 'name': '__common__', - 'parent': 'Sales Order-Delivery Note', - 'parentfield': 'field_mapper_details', - 'parenttype': 'DocType Mapper' + 'parent': u'Sales Order-Delivery Note', + 'parentfield': u'field_mapper_details', + 'parenttype': u'DocType Mapper' }, # These values are common for all DocType Mapper { 'doctype': u'DocType Mapper', - 'from_doctype': 'Sales Order', - 'module': 'Stock', + 'from_doctype': u'Sales Order', + 'module': u'Stock', 'name': '__common__', 'ref_doc_submitted': 1, - 'to_doctype': 'Delivery Note' + 'to_doctype': u'Delivery Note' }, # DocType Mapper, Sales Order-Delivery Note { 'doctype': u'DocType Mapper', - 'name': 'Sales Order-Delivery Note' + 'name': u'Sales Order-Delivery Note' }, # Field Mapper Detail { - 'checking_operator': '>=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'transaction_date', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'name', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'transaction_date' + 'to_field': u'sales_order_no' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'name', - 'map': 'Yes', + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'company', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'sales_order_no' + 'to_field': u'company' }, # Field Mapper Detail { - 'checking_operator': '=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'company', - 'map': 'Yes', + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'currency', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'company' + 'to_field': u'currency' }, # Field Mapper Detail { - 'checking_operator': '=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'currency', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'shipping_address_name', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'currency' + 'to_field': u'customer_address' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'shipping_address_name', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'shipping_address', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'customer_address' + 'to_field': u'address_display' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'shipping_address', - 'map': 'Yes', - 'match_id': 0, - 'to_field': 'address_display' - }, - - # Field Mapper Detail - { - 'doctype': 'Field Mapper Detail', - 'from_field': 'parent', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'parent', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'prevdoc_docname' + 'to_field': u'prevdoc_docname' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'parenttype', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'parenttype', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'prevdoc_doctype' + 'to_field': u'prevdoc_doctype' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'name', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'name', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'prevdoc_detail_docname' + 'to_field': u'prevdoc_detail_docname' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.export_rate)', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'export_amount' + 'to_field': u'export_amount' }, # Field Mapper Detail { - 'checking_operator': '=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'basic_rate', - 'map': 'Yes', + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'basic_rate', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'basic_rate' + 'to_field': u'basic_rate' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'eval: flt(obj.qty) - flt(obj.delivered_qty)', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'eval: flt(obj.qty) - flt(obj.delivered_qty)', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'qty' + 'to_field': u'qty' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'eval: (flt(obj.qty) - flt(obj.delivered_qty)) * flt(obj.basic_rate)', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'amount' + 'to_field': u'amount' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'reserved_warehouse', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'reserved_warehouse', + 'map': u'Yes', 'match_id': 1, - 'to_field': 'warehouse' + 'to_field': u'warehouse' }, # Field Mapper Detail { - 'checking_operator': '=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'project_name', - 'map': 'Yes', + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'project_name', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'project_name' + 'to_field': u'project_name' }, # Field Mapper Detail { - 'checking_operator': '=', - 'doctype': 'Field Mapper Detail', - 'from_field': 'customer', - 'map': 'Yes', + 'checking_operator': u'=', + 'doctype': u'Field Mapper Detail', + 'from_field': u'customer', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'customer' + 'to_field': u'customer' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'naming_series', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'naming_series', + 'map': u'No', 'match_id': 0, - 'to_field': 'naming_series' + 'to_field': u'naming_series' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'status', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'status', + 'map': u'No', 'match_id': 0, - 'to_field': 'status' + 'to_field': u'status' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'incentives', - 'map': 'No', + 'doctype': u'Field Mapper Detail', + 'from_field': u'incentives', + 'map': u'No', 'match_id': 3, - 'to_field': 'incentives' + 'to_field': u'incentives' }, # Field Mapper Detail { - 'doctype': 'Field Mapper Detail', - 'from_field': 'allocated_amount', - 'map': 'Yes', + 'doctype': u'Field Mapper Detail', + 'from_field': u'allocated_amount', + 'map': u'Yes', 'match_id': 0, - 'to_field': 'customer_mobile_no' + 'to_field': u'customer_mobile_no' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_field': 'sales_team', - 'from_table': 'Sales Team', + 'doctype': u'Table Mapper Detail', + 'from_field': u'sales_team', + 'from_table': u'Sales Team', 'match_id': 3, - 'to_field': 'sales_team', - 'to_table': 'Sales Team', - 'validation_logic': 'name is not null' + 'to_field': u'sales_team', + 'to_table': u'Sales Team', + 'validation_logic': u'name is not null' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_field': 'other_charges', - 'from_table': 'RV Tax Detail', + 'doctype': u'Table Mapper Detail', + 'from_field': u'other_charges', + 'from_table': u'RV Tax Detail', 'match_id': 2, - 'to_field': 'other_charges', - 'to_table': 'RV Tax Detail', - 'validation_logic': 'name is not null' + 'to_field': u'other_charges', + 'to_table': u'RV Tax Detail', + 'validation_logic': u'name is not null' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_field': 'sales_order_details', - 'from_table': 'Sales Order Detail', + 'doctype': u'Table Mapper Detail', + 'from_field': u'sales_order_details', + 'from_table': u'Sales Order Detail', 'match_id': 1, - 'reference_doctype_key': 'prevdoc_doctype', - 'reference_key': 'prevdoc_detail_docname', - 'to_field': 'delivery_note_details', - 'to_table': 'Delivery Note Detail', - 'validation_logic': 'qty > ifnull(delivered_qty,0) and docstatus = 1' + 'reference_doctype_key': u'prevdoc_doctype', + 'reference_key': u'prevdoc_detail_docname', + 'to_field': u'delivery_note_details', + 'to_table': u'Delivery Note Detail', + 'validation_logic': u'qty > ifnull(delivered_qty,0) and docstatus = 1' }, # Table Mapper Detail { - 'doctype': 'Table Mapper Detail', - 'from_table': 'Sales Order', + 'doctype': u'Table Mapper Detail', + 'from_table': u'Sales Order', 'match_id': 0, - 'reference_key': 'prevdoc_docname', - 'to_table': 'Delivery Note', - 'validation_logic': 'docstatus = 1' + 'reference_key': u'prevdoc_docname', + 'to_table': u'Delivery Note', + 'validation_logic': u'docstatus = 1' } ] \ No newline at end of file diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.js b/erpnext/stock/doctype/delivery_note/delivery_note.js index 3a8931e1e7..1f5170be96 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note.js @@ -30,7 +30,7 @@ cur_frm.cscript.onload = function(doc, dt, dn) { if(!doc.status) set_multiple(dt,dn,{status:'Draft'}); if(!doc.transaction_date) set_multiple(dt,dn,{transaction_date:get_today()}); if(!doc.posting_date) set_multiple(dt,dn,{posting_date:get_today()}); - if(doc.__islocal && doc.customer) cur_frm.cscript.pull_item_details_onload(doc,dt,dn); + if(doc.__islocal && doc.customer) cur_frm.cscript.customer(doc,dt,dn,onload=true); if(!doc.price_list_currency) { set_multiple(dt, dn, {price_list_currency: doc.currency, plc_conversion_rate:1}); } @@ -43,17 +43,19 @@ cur_frm.cscript.onload = function(doc, dt, dn) { cur_frm.cscript.onload_post_render = function(doc, dt, dn) { // defined in sales_common.js - if(doc.__islocal) cur_frm.cscript.update_item_details(doc, dt, dn); + var callback = function(doc, dt, dn) { + if(doc.__islocal) cur_frm.cscript.update_item_details(doc, dt, dn); + } + + cur_frm.cscript.hide_price_list_currency(doc, dt, dn, callback); } // REFRESH // ================================================================================================ cur_frm.cscript.refresh = function(doc, cdt, cdn) { cur_frm.clear_custom_buttons(); - var callback = function() { - cur_frm.cscript.dynamic_label(doc, cdt, cdn); - } - cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn, callback); + + if (!cur_frm.cscript.is_onload) cur_frm.cscript.hide_price_list_currency(doc, cdt, cdn); if(doc.per_billed < 100 && doc.docstatus==1) cur_frm.add_custom_button('Make Invoice', cur_frm.cscript['Make Sales Invoice']); @@ -123,16 +125,6 @@ cur_frm.cscript['Get Items'] = function(doc,dt,dn) { } -//RV-DN : Pull Item details - UOM, Item Group as it was not in Sales Invoice -//--------------------------------------------------------------------- -cur_frm.cscript.pull_item_details_onload = function(doc,dt,dn){ - var callback = function(r,rt){ - refresh_field('delivery_note_details'); - cur_frm.cscript.customer(doc,dt,dn,onload=true); - } - $c_obj(make_doclist(dt,dn),'set_item_details','',callback); -} - //================ create new contact ============================================================================ cur_frm.cscript.new_contact = function(){ tn = createLocal('Contact'); diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.py b/erpnext/stock/doctype/delivery_note/delivery_note.py index a94531b555..3d8a1011fc 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.py +++ b/erpnext/stock/doctype/delivery_note/delivery_note.py @@ -74,16 +74,6 @@ class DocType(TransactionBase): return cstr(self.doc.sales_order_no) - - - #-------------------set item details -uom and item group---------------- - def set_item_details(self): - for d in getlist(self.doclist,'delivery_note_details'): - res = sql("select stock_uom, item_group from `tabItem` where name ='%s'"%d.item_code) - if not d.stock_uom: d.stock_uom = res and cstr(res[0][0]) or '' - if not d.item_group: d.item_group = res and cstr(res[0][1]) or '' - d.save() - # ::::: Validates that Sales Order is not pulled twice ::::::: def validate_prev_docname(self): for d in getlist(self.doclist, 'delivery_note_details'): @@ -117,14 +107,16 @@ class DocType(TransactionBase): # ***************** Get Item Details ****************************** def get_item_details(self, args=None): - args = eval(args) - if args['item_code']: + args = args and eval(args) or {} + if args.get('item_code'): return get_obj('Sales Common').get_item_details(args, self) else: obj = get_obj('Sales Common') for doc in self.doclist: if doc.fields.get('item_code'): - ret = obj.get_item_details(doc.item_code, self) + arg = {'item_code':doc.fields.get('item_code'), 'income_account':doc.fields.get('income_account'), + 'cost_center': doc.fields.get('cost_center'), 'warehouse': doc.fields.get('warehouse')}; + ret = obj.get_item_details(arg, self) for r in ret: if not doc.fields.get(r): doc.fields[r] = ret[r] @@ -135,13 +127,6 @@ class DocType(TransactionBase): get_obj('Sales Common').get_adj_percent(self) - def get_comp_base_currency(self): - return get_obj('Sales Common').get_comp_base_currency(self.doc.company) - - def get_price_list_currency(self): - return get_obj('Sales Common').get_price_list_currency(self.doc.price_list_name, self.doc.company) - - # ********** Get Actual Qty of item in warehouse selected ************* def get_actual_qty(self,args): args = eval(args) @@ -245,9 +230,9 @@ class DocType(TransactionBase): if prevdoc_docname and prevdoc: # ::::::::::: Validates Transaction Date of DN and previous doc (i.e. SO , PO, PR) ********* - trans_date = sql("select transaction_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0] - if trans_date and getdate(self.doc.transaction_date) < (trans_date): - msgprint("Your Voucher Date cannot be before "+cstr(prevdoc)+" Date.") + trans_date = sql("select posting_date from `tab%s` where name = '%s'" %(prevdoc,prevdoc_docname))[0][0] + if trans_date and getdate(self.doc.posting_date) < (trans_date): + msgprint("Your Posting Date cannot be before "+cstr(prevdoc)+" Date.") raise Exception # ::::::::: Validates DN and previous doc details :::::::::::::::::: get_name = sql("select name from `tab%s` where name = '%s'" % (prevdoc, prevdoc_docname)) @@ -356,16 +341,17 @@ class DocType(TransactionBase): """ Validate that if packed qty exists, it should be equal to qty """ - if not any([d.fields.get('packed_qty') for d in self.doclist]): + if not any([flt(d.fields.get('packed_qty')) for d in self.doclist if + d.doctype=='Delivery Note Detail']): return packing_error_list = [] for d in self.doclist: if d.doctype != 'Delivery Note Detail': continue - if d.fields.get('qty') != d.fields.get('packed_qty'): + if flt(d.fields.get('qty')) != flt(d.fields.get('packed_qty')): packing_error_list.append([ d.fields.get('item_code', ''), - d.fields.get('qty', ''), - d.fields.get('packed_qty', '') + d.fields.get('qty', 0), + d.fields.get('packed_qty', 0) ]) if packing_error_list: from webnotes.utils import cstr @@ -457,7 +443,7 @@ class DocType(TransactionBase): self.values.append({ 'item_code' : d[1], 'warehouse' : wh, - 'transaction_date' : self.doc.transaction_date, + 'transaction_date' : getdate(self.doc.modified).strftime('%Y-%m-%d'), 'posting_date' : self.doc.posting_date, 'posting_time' : self.doc.posting_time, 'voucher_type' : 'Delivery Note', diff --git a/erpnext/stock/doctype/delivery_note/delivery_note.txt b/erpnext/stock/doctype/delivery_note/delivery_note.txt index 6570b0c80d..314d0d9481 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note.txt +++ b/erpnext/stock/doctype/delivery_note/delivery_note.txt @@ -5,7 +5,7 @@ { 'creation': '2011-04-18 15:58:20', 'docstatus': 0, - 'modified': '2012-02-27 17:35:31', + 'modified': '2012-03-02 12:15:44', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -21,7 +21,7 @@ # These values are common for all DocType { - '_last_update': u'1330343754', + '_last_update': u'1330593645', 'colour': u'White:FFF', 'default_print_format': u'Standard', 'doctype': 'DocType', @@ -37,7 +37,7 @@ 'show_in_menu': 0, 'subject': u'To %(customer_name)s on %(transaction_date)s | %(per_billed)s% billed', 'tag_fields': u'billing_status', - 'version': 474 + 'version': 475 }, # These values are common for all DocFormat @@ -285,29 +285,37 @@ # DocField { 'doctype': u'DocField', - 'fieldtype': u'Column Break', - 'oldfieldtype': u'Column Break', - 'permlevel': 0 + 'fieldname': u'territory', + 'fieldtype': u'Link', + 'hidden': 0, + 'in_filter': 1, + 'label': u'Territory', + 'options': u'Territory', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 1, + 'search_index': 1 }, # DocField { - 'colour': u'White:FFF', - 'default': u'Today', - 'description': u'The date at which current entry is made in system.', 'doctype': u'DocField', - 'fieldname': u'transaction_date', - 'fieldtype': u'Date', + 'fieldname': u'customer_group', + 'fieldtype': u'Link', 'in_filter': 1, - 'label': u'Voucher Date', - 'no_copy': 1, - 'oldfieldname': u'transaction_date', - 'oldfieldtype': u'Date', + 'label': u'Customer Group', + 'options': u'Customer Group', 'permlevel': 0, 'print_hide': 1, - 'reqd': 1, - 'search_index': 1, - 'width': u'100px' + 'search_index': 1 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldtype': u'Column Break', + 'oldfieldtype': u'Column Break', + 'permlevel': 0 }, # DocField @@ -467,30 +475,41 @@ # DocField { + 'colour': u'White:FFF', + 'description': u'Track this Delivery Note against any Project', 'doctype': u'DocField', - 'fieldname': u'territory', + 'fieldname': u'project_name', 'fieldtype': u'Link', - 'hidden': 0, 'in_filter': 1, - 'label': u'Territory', - 'options': u'Territory', + 'label': u'Project Name', + 'oldfieldname': u'project_name', + 'oldfieldtype': u'Link', + 'options': u'Project', 'permlevel': 0, - 'print_hide': 1, - 'reqd': 1, - 'search_index': 1 + 'search_index': 1, + 'trigger': u'Client' }, # DocField { 'doctype': u'DocField', - 'fieldname': u'customer_group', - 'fieldtype': u'Link', - 'in_filter': 1, - 'label': u'Customer Group', - 'options': u'Customer Group', - 'permlevel': 0, - 'print_hide': 1, - 'search_index': 1 + 'fieldname': u'challan_no', + 'fieldtype': u'Data', + 'label': u'Challan No', + 'oldfieldname': u'challan_no', + 'oldfieldtype': u'Data', + 'permlevel': 0 + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'challan_date', + 'fieldtype': u'Date', + 'label': u'Challan Date', + 'oldfieldname': u'challan_date', + 'oldfieldtype': u'Date', + 'permlevel': 0 }, # DocField @@ -885,6 +904,7 @@ 'oldfieldtype': u'Button', 'options': u'get_tc_details', 'permlevel': 0, + 'print_hide': 1, 'trigger': u'Server' }, @@ -917,7 +937,8 @@ 'doctype': u'DocField', 'fieldtype': u'Section Break', 'label': u'Transporter Info', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -925,6 +946,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -979,36 +1001,6 @@ 'width': u'100px' }, - # DocField - { - 'doctype': u'DocField', - 'fieldtype': u'Column Break', - 'permlevel': 0, - 'width': u'50%' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'challan_no', - 'fieldtype': u'Data', - 'label': u'Challan No', - 'oldfieldname': u'challan_no', - 'oldfieldtype': u'Data', - 'permlevel': 0 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'challan_date', - 'fieldtype': u'Date', - 'label': u'Challan Date', - 'oldfieldname': u'challan_date', - 'oldfieldtype': u'Date', - 'permlevel': 0 - }, - # DocField { 'colour': u'White:FFF', @@ -1017,7 +1009,8 @@ 'fieldtype': u'Section Break', 'label': u'More Info', 'oldfieldtype': u'Section Break', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -1056,29 +1049,13 @@ 'width': u'150px' }, - # DocField - { - 'colour': u'White:FFF', - 'description': u'Track this Delivery Note against any Project', - 'doctype': u'DocField', - 'fieldname': u'project_name', - 'fieldtype': u'Link', - 'in_filter': 1, - 'label': u'Project Name', - 'oldfieldname': u'project_name', - 'oldfieldtype': u'Link', - 'options': u'Project', - 'permlevel': 0, - 'search_index': 1, - 'trigger': u'Client' - }, - # DocField { 'doctype': u'DocField', 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1244,7 +1221,8 @@ 'fieldtype': u'Section Break', 'label': u'Packing List', 'oldfieldtype': u'Section Break', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -1268,7 +1246,7 @@ 'label': u'Sales Team', 'oldfieldtype': u'Section Break', 'permlevel': 0, - 'print_hide': 0 + 'print_hide': 1 }, # DocField @@ -1276,6 +1254,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1300,6 +1279,7 @@ 'doctype': u'DocField', 'fieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1338,7 +1318,8 @@ 'doctype': u'DocField', 'fieldtype': u'Section Break', 'options': u'Simple', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField diff --git a/erpnext/stock/doctype/delivery_note_detail/delivery_note_detail.txt b/erpnext/stock/doctype/delivery_note_detail/delivery_note_detail.txt index 78fea52a48..a5f82f4bf8 100644 --- a/erpnext/stock/doctype/delivery_note_detail/delivery_note_detail.txt +++ b/erpnext/stock/doctype/delivery_note_detail/delivery_note_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:08:58', 'docstatus': 0, - 'modified': '2012-02-24 11:33:58', + 'modified': '2012-03-05 10:49:39', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -23,7 +23,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 53 + 'version': 55 }, # These values are common for all DocField @@ -117,18 +117,14 @@ # DocField { - 'default': u'0.00', 'doctype': u'DocField', - 'fieldname': u'ref_rate', + 'fieldname': u'base_ref_rate', 'fieldtype': u'Currency', - 'label': u'Price List Rate', - 'no_copy': 0, - 'oldfieldname': u'ref_rate', + 'label': u'Price List Rate*', + 'oldfieldname': u'base_ref_rate', 'oldfieldtype': u'Currency', - 'permlevel': 0, + 'permlevel': 1, 'print_hide': 1, - 'reqd': 0, - 'trigger': u'Client', 'width': u'100px' }, @@ -147,6 +143,53 @@ 'width': u'100px' }, + # DocField + { + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'basic_rate', + 'fieldtype': u'Currency', + 'label': u'Rate*', + 'oldfieldname': u'basic_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, + 'trigger': u'Client', + 'width': u'150px' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'amount', + 'fieldtype': u'Currency', + 'label': u'Amount*', + 'oldfieldname': u'amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1, + 'print_hide': 1, + 'reqd': 0, + 'width': u'100px' + }, + + # DocField + { + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'ref_rate', + 'fieldtype': u'Currency', + 'label': u'Price List Rate', + 'no_copy': 0, + 'oldfieldname': u'ref_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 1, + 'reqd': 0, + 'trigger': u'Client', + 'width': u'100px' + }, + # DocField { 'doctype': u'DocField', @@ -176,49 +219,6 @@ 'width': u'100px' }, - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'base_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Price List Rate*', - 'oldfieldname': u'base_ref_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'print_hide': 1, - 'width': u'100px' - }, - - # DocField - { - 'default': u'0.00', - 'doctype': u'DocField', - 'fieldname': u'basic_rate', - 'fieldtype': u'Currency', - 'label': u'Rate*', - 'oldfieldname': u'basic_rate', - 'oldfieldtype': u'Currency', - 'permlevel': 0, - 'print_hide': 1, - 'reqd': 0, - 'trigger': u'Client', - 'width': u'150px' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'amount', - 'fieldtype': u'Currency', - 'label': u'Amount*', - 'oldfieldname': u'amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1, - 'print_hide': 1, - 'reqd': 0, - 'width': u'100px' - }, - # DocField { 'doctype': u'DocField', @@ -245,7 +245,7 @@ 'oldfieldname': u'serial_no', 'oldfieldtype': u'Text', 'permlevel': 0, - 'print_hide': 1, + 'print_hide': 0, 'trigger': u'Client' }, diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js index 0f6d1a8a80..7ad9d91928 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.js @@ -40,12 +40,15 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { cur_frm.cscript.onload_post_render = function(doc, dt, dn) { var callback = function(doc, dt, dn) { - if(doc.__islocal){ - cur_frm.cscript.get_default_schedule_date(doc); + var callback1 = function(doc, dt, dn) { + if(doc.__islocal){ + cur_frm.cscript.get_default_schedule_date(doc); + } } + // 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 =============================================================== @@ -55,7 +58,8 @@ 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){ var ch = getchildren('Purchase Receipt Detail',doc.name,'purchase_receipt_details'); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py index 530afcf09d..88cfbe3db5 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.py @@ -57,7 +57,7 @@ class DocType(TransactionBase): #-----------------Validation For Fiscal Year------------------------ def validate_fiscal_year(self): - get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.transaction_date,'Transaction Date') + get_obj(dt = 'Purchase Common').validate_fiscal_year(self.doc.fiscal_year,self.doc.posting_date,'Transaction Date') # Get Item Details @@ -88,10 +88,6 @@ class DocType(TransactionBase): def get_tc_details(self): 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) - - # get available qty at warehouse def get_bin_details(self, arg = ''): @@ -230,7 +226,7 @@ class DocType(TransactionBase): ord_qty = -flt(curr_qty) # update order qty in bin - bin = get_obj('Warehouse', d.warehouse).update_bin(0, 0, (is_submit and 1 or -1) * flt(ord_qty), 0, 0, d.item_code, self.doc.transaction_date) + bin = get_obj('Warehouse', d.warehouse).update_bin(0, 0, (is_submit and 1 or -1) * flt(ord_qty), 0, 0, d.item_code, self.doc.posting_date) # UPDATE actual qty to warehouse by pr_qty self.make_sl_entry(d, d.warehouse, flt(pr_qty), d.valuation_rate, is_submit) @@ -249,7 +245,7 @@ class DocType(TransactionBase): self.values.append({ 'item_code' : d.fields.has_key('item_code') and d.item_code or d.rm_item_code, 'warehouse' : wh, - 'transaction_date' : self.doc.transaction_date, + 'transaction_date' : getdate(self.doc.modified).strftime('%Y-%m-%d'), 'posting_date' : self.doc.posting_date, 'posting_time' : self.doc.posting_time, 'voucher_type' : 'Purchase Receipt', diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt index 2666f086c2..525bcfcef2 100755 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt.txt @@ -5,14 +5,14 @@ { 'creation': '2010-08-08 17:09:15', 'docstatus': 0, - 'modified': '2012-02-27 17:54:59', + 'modified': '2012-03-02 12:26:39', 'modified_by': u'Administrator', 'owner': u'Administrator' }, # These values are common for all DocType { - '_last_update': u'1330345245', + '_last_update': u'1330593645', 'colour': u'White:FFF', 'default_print_format': u'Standard', 'doctype': 'DocType', @@ -26,7 +26,7 @@ 'server_code_error': u' ', 'show_in_menu': 0, 'subject': u'From %(supplier_name)s against %(purchase_order)s on %(transaction_date)s', - 'version': 324 + 'version': 325 }, # These values are common for all DocField @@ -302,25 +302,6 @@ 'width': u'50%' }, - # DocField - { - 'colour': u'White:FFF', - 'description': u'The date at which current entry is made in system.', - 'doctype': u'DocField', - 'fieldname': u'transaction_date', - 'fieldtype': u'Date', - 'in_filter': 1, - 'label': u'Transaction Date', - 'no_copy': 1, - 'oldfieldname': u'transaction_date', - 'oldfieldtype': u'Date', - 'permlevel': 0, - 'reqd': 1, - 'search_index': 1, - 'trigger': u'Client', - 'width': u'100px' - }, - # DocField { 'colour': u'White:FFF', @@ -948,6 +929,7 @@ 'fieldtype': u'Column Break', 'oldfieldtype': u'Column Break', 'permlevel': 0, + 'print_hide': 1, 'width': u'50%' }, @@ -1120,7 +1102,8 @@ 'fieldtype': u'Section Break', 'label': u'Raw Material Details', 'oldfieldtype': u'Section Break', - 'permlevel': 1 + 'permlevel': 1, + 'print_hide': 1 }, # DocField @@ -1130,7 +1113,8 @@ 'label': u'Get Current Stock', 'oldfieldtype': u'Button', 'options': u'get_current_stock', - 'permlevel': 0 + 'permlevel': 0, + 'print_hide': 1 }, # DocField diff --git a/erpnext/stock/doctype/purchase_receipt_detail/purchase_receipt_detail.txt b/erpnext/stock/doctype/purchase_receipt_detail/purchase_receipt_detail.txt index 7f636442ea..4ebd28c7c9 100755 --- a/erpnext/stock/doctype/purchase_receipt_detail/purchase_receipt_detail.txt +++ b/erpnext/stock/doctype/purchase_receipt_detail/purchase_receipt_detail.txt @@ -5,7 +5,7 @@ { 'creation': '2010-08-08 17:09:16', 'docstatus': 0, - 'modified': '2012-02-27 18:43:39', + 'modified': '2012-03-05 10:51:18', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -22,7 +22,7 @@ 'section_style': u'Tray', 'server_code_error': u' ', 'show_in_menu': 0, - 'version': 74 + 'version': 76 }, # These values are common for all DocField @@ -95,6 +95,7 @@ 'oldfieldname': u'received_qty', 'oldfieldtype': u'Currency', 'permlevel': 0, + 'print_hide': 1, 'reqd': 1, 'trigger': u'Client', 'width': u'100px' @@ -125,6 +126,7 @@ 'oldfieldname': u'rejected_qty', 'oldfieldtype': u'Currency', 'permlevel': 0, + 'print_hide': 1, 'search_index': 0, 'trigger': u'Client', 'width': u'100px' @@ -133,10 +135,11 @@ # DocField { 'doctype': u'DocField', - 'fieldname': u'import_ref_rate', + 'fieldname': u'purchase_ref_rate', 'fieldtype': u'Currency', - 'label': u'Ref Rate ', - 'permlevel': 0 + 'label': u'Ref Rate *', + 'permlevel': 0, + 'print_hide': 1 }, # DocField @@ -145,43 +148,8 @@ 'fieldname': u'discount_rate', 'fieldtype': u'Currency', 'label': u'Discount %', - 'permlevel': 0 - }, - - # DocField - { - 'colour': u'White:FFF', - 'default': u'0.00', - 'doctype': u'DocField', - 'fieldname': u'import_rate', - 'fieldtype': u'Currency', - 'label': u'Rate', - 'oldfieldname': u'import_rate', - 'oldfieldtype': u'Currency', 'permlevel': 0, - 'print_hide': 0, - 'trigger': u'Client', - 'width': u'100px' - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'import_amount', - 'fieldtype': u'Currency', - 'label': u'Amount', - 'oldfieldname': u'import_amount', - 'oldfieldtype': u'Currency', - 'permlevel': 1 - }, - - # DocField - { - 'doctype': u'DocField', - 'fieldname': u'purchase_ref_rate', - 'fieldtype': u'Currency', - 'label': u'Ref Rate *', - 'permlevel': 0 + 'print_hide': 1 }, # DocField @@ -217,6 +185,43 @@ 'width': u'100px' }, + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_ref_rate', + 'fieldtype': u'Currency', + 'label': u'Ref Rate ', + 'permlevel': 0, + 'print_hide': 1 + }, + + # DocField + { + 'colour': u'White:FFF', + 'default': u'0.00', + 'doctype': u'DocField', + 'fieldname': u'import_rate', + 'fieldtype': u'Currency', + 'label': u'Rate', + 'oldfieldname': u'import_rate', + 'oldfieldtype': u'Currency', + 'permlevel': 0, + 'print_hide': 0, + 'trigger': u'Client', + 'width': u'100px' + }, + + # DocField + { + 'doctype': u'DocField', + 'fieldname': u'import_amount', + 'fieldtype': u'Currency', + 'label': u'Amount', + 'oldfieldname': u'import_amount', + 'oldfieldtype': u'Currency', + 'permlevel': 1 + }, + # DocField { 'doctype': u'DocField', @@ -228,7 +233,7 @@ 'oldfieldtype': u'Link', 'options': u'Warehouse', 'permlevel': 0, - 'print_hide': 0, + 'print_hide': 1, 'width': u'100px' }, @@ -243,6 +248,7 @@ 'oldfieldtype': u'Link', 'options': u'UOM', 'permlevel': 0, + 'print_hide': 1, 'reqd': 1, 'trigger': u'Client', 'width': u'100px' @@ -441,7 +447,7 @@ 'oldfieldtype': u'Link', 'options': u'Purchase Order', 'permlevel': 1, - 'print_hide': 0, + 'print_hide': 1, 'reqd': 0, 'search_index': 1, 'width': u'150px' diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 0eb78dfdce..1e558c9441 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -51,7 +51,7 @@ var cfn_set_fields = function(doc, cdt, cdn) { hide_field(lst); unhide_field(['supplier','supplier_name','supplier_address','purchase_receipt_no']); } - if(doc.purpose == 'Sales Return'){ + else if(doc.purpose == 'Sales Return'){ doc.supplier=doc.supplier_name = doc.supplier_address=doc.purchase_receipt_no=''; hide_field(lst); unhide_field(['customer','customer_name','customer_address','delivery_note_no', 'sales_invoice_no']); diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.py b/erpnext/stock/doctype/stock_entry/stock_entry.py index 6d080a8c56..530c5e615e 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.py +++ b/erpnext/stock/doctype/stock_entry/stock_entry.py @@ -453,8 +453,8 @@ class DocType: if self.doc.purpose == 'Purchase Return': #delete_doc("Serial No", serial_no) serial_doc = Document("Serial No", serial_no) - serial_doc.status = 'Purchase Returned' - serial_doc.docstatus = 2 + serial_doc.status = is_submit and 'Purchase Returned' or 'In Store' + serial_doc.docstatus = is_submit and 2 or 0 serial_doc.save() diff --git a/erpnext/stock/page/stock_home/stock_home.html b/erpnext/stock/page/stock_home/stock_home.html index 9ba21a43dd..bab93dcfbd 100644 --- a/erpnext/stock/page/stock_home/stock_home.html +++ b/erpnext/stock/page/stock_home/stock_home.html @@ -4,7 +4,7 @@

Stock


-

Stock Entry

+

Stock Entry

Transfer stock from one warehouse to another

Delivery Note

Delivery (shipment) to customers

diff --git a/erpnext/support/doctype/customer_issue/customer_issue.py b/erpnext/support/doctype/customer_issue/customer_issue.py index b00a6a03c8..af839cf09f 100644 --- a/erpnext/support/doctype/customer_issue/customer_issue.py +++ b/erpnext/support/doctype/customer_issue/customer_issue.py @@ -15,6 +15,7 @@ # along with this program. If not, see . # 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 diff --git a/erpnext/support/doctype/support_ticket/__init__.py b/erpnext/support/doctype/support_ticket/__init__.py index c9d1958af8..ca27a61f9f 100644 --- a/erpnext/support/doctype/support_ticket/__init__.py +++ b/erpnext/support/doctype/support_ticket/__init__.py @@ -29,6 +29,7 @@ class SupportMailbox(POP3Mailbox): # extract email settings self.email_settings = Document('Email Settings','Email Settings') + if not self.email_settings.fields.get('sync_support_mails'): return s = Document('Support Email Settings') s.use_ssl = self.email_settings.support_use_ssl diff --git a/erpnext/support/doctype/support_ticket/support_ticket.js b/erpnext/support/doctype/support_ticket/support_ticket.js index 02c9a5d082..86264a6433 100644 --- a/erpnext/support/doctype/support_ticket/support_ticket.js +++ b/erpnext/support/doctype/support_ticket/support_ticket.js @@ -178,7 +178,8 @@ EmailMessage = function(parent, args, list, idx) { // email text this.message = $a(w, 'div', '', // style - {lineHeight:'1.7em', display:'none', padding: '7px'}, + {lineHeight:'1.7em', display:'none', padding: '7px', width: '575px', + wordWrap: 'break-word', textWrap: 'normal', overflowX: 'auto'}, // newlines for text email (this.content_type=='text/plain' ? this.mail diff --git a/erpnext/utilities/__init__.py b/erpnext/utilities/__init__.py index 28eaccecdc..d57f0def05 100644 --- a/erpnext/utilities/__init__.py +++ b/erpnext/utilities/__init__.py @@ -23,6 +23,7 @@ def get_report_list(arg=None): 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/erpnext/utilities/page/messages/messages.js b/erpnext/utilities/page/messages/messages.js index 39f7974870..6937796168 100644 --- a/erpnext/utilities/page/messages/messages.js +++ b/erpnext/utilities/page/messages/messages.js @@ -1,8 +1,25 @@ +// 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 . + wn.provide('erpnext.messages'); wn.pages.messages.onload = function(wrapper) { erpnext.messages.show_active_users(); erpnext.messages.make_list(); + update_messages('reset'); //Resets notification icons // post message $('#message-post').click(function() { @@ -49,7 +66,7 @@ erpnext.messages = { $(wn.pages.messages).find('.well').toggle(contact==user ? false : true); $(wn.pages.messages).find('h1:first').html('Messages: ' - + (user==contact ? 'From everyone' : wn.boot.user_fullnames[contact])) + + (user==contact ? 'From everyone' : wn.user_info(contact).fullname)); erpnext.messages.contact = contact; erpnext.messages.list.opts.args.contact = contact; @@ -82,7 +99,7 @@ erpnext.messages = { }, render_row: function(wrapper, data) { data.creation = dateutil.comment_when(data.creation); - data.comment_by_fullname = wn.boot.user_fullnames[data.owner]; + data.comment_by_fullname = wn.user_info(data.owner).fullname; data.reply_html = ''; if(data.owner==user) { @@ -127,7 +144,7 @@ erpnext.messages = { var $body = $(wn.pages.messages).find('.section-body'); for(var i in r.message) { var p = r.message[i]; - p.fullname = wn.boot.user_fullnames[p.name]; + p.fullname = wn.user_info(p.name).fullname; p.name = p.name.replace('@', '__at__'); $body.append(repl('', p)) diff --git a/erpnext/utilities/page/messages/messages.py b/erpnext/utilities/page/messages/messages.py index d7c60267ed..b28299164c 100644 --- a/erpnext/utilities/page/messages/messages.py +++ b/erpnext/utilities/page/messages/messages.py @@ -1,3 +1,19 @@ +# 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 . + import webnotes @webnotes.whitelist() @@ -32,7 +48,8 @@ def get_list(arg=None): @webnotes.whitelist() def get_active_users(arg=None): return webnotes.conn.sql("""select name from tabProfile - where enabled=1 and + where ifnull(enabled,0)=1 and + docstatus < 2 and name not in ('Administrator', 'Guest') order by first_name""", as_dict=1) diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js index 77e4625fae..dfaa7cdecf 100644 --- a/erpnext/utilities/page/todo/todo.js +++ b/erpnext/utilities/page/todo/todo.js @@ -1,3 +1,19 @@ +// 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 . + wn.provide('erpnext.todo'); erpnext.todo.refresh = function() { @@ -30,14 +46,22 @@ erpnext.todo.ToDoItem = Class.extend({ } todo.labelclass = label_map[todo.priority]; todo.userdate = dateutil.str_to_user(todo.date); + if(todo.reference_name && todo.reference_type) { + todo.link = repl('\ + %(reference_name)s', todo); + } else if(todo.reference_type) { + todo.link = repl('\ + %(reference_type)s', todo); + } else { + todo.link = ''; + } $('#todo-list').append(repl('
\ \ %(priority)s\ %(userdate)s\ %(description)s\ →\ - \ - [%(reference_name)s]\ + %(link)s\ ×\
', todo)); $todo = $('div.todoitem:last'); @@ -46,7 +70,7 @@ erpnext.todo.ToDoItem = Class.extend({ $todo.find('.description').css('text-decoration', 'line-through'); } - if(!todo.reference_name) + if(!todo.reference_type) $todo.find('.ref_link').toggle(false); $todo.find('.description') @@ -129,4 +153,4 @@ erpnext.todo.save = function(btn) { wn.pages.todo.onload = function() { // load todos erpnext.todo.refresh(); -} \ No newline at end of file +} diff --git a/erpnext/utilities/page/todo/todo.py b/erpnext/utilities/page/todo/todo.py index c10809e8bf..05d55fe4a8 100644 --- a/erpnext/utilities/page/todo/todo.py +++ b/erpnext/utilities/page/todo/todo.py @@ -1,3 +1,19 @@ +# 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 . + import webnotes from webnotes.model.doc import Document diff --git a/erpnext/utilities/page/users/__init__.py b/erpnext/utilities/page/users/__init__.py new file mode 100644 index 0000000000..e69de29bb2 diff --git a/erpnext/utilities/page/users/users.css b/erpnext/utilities/page/users/users.css new file mode 100644 index 0000000000..1a85d153c0 --- /dev/null +++ b/erpnext/utilities/page/users/users.css @@ -0,0 +1,35 @@ +.user-card { + border-radius: 5px; + width: 200px; + margin: 11px; + padding: 11px; + background-color: #FFEDBD; + box-shadow: 3px 3px 5px #888; + float: left; + overflow: hidden; +} + +.user-card.disabled { + background-color: #eee; +} + +.user-card img { + height: 60px; +} + +.user-role { + padding: 5px; + width: 45%; + float: left; +} + +table.user-perm { + border-collapse: collapse; +} + +table.user-perm td, table.user-perm th { + padding: 5px; + text-align: center; + border-bottom: 1px solid #aaa; + min-width: 30px; +} \ No newline at end of file diff --git a/erpnext/utilities/page/users/users.html b/erpnext/utilities/page/users/users.html new file mode 100644 index 0000000000..fe2f000413 --- /dev/null +++ b/erpnext/utilities/page/users/users.html @@ -0,0 +1,13 @@ +
+ × +

Users

+
+
Add, disable, delete users and change their roles, passwords and security settings
+
+ +
+
+
+
+
\ No newline at end of file diff --git a/erpnext/utilities/page/users/users.js b/erpnext/utilities/page/users/users.js new file mode 100644 index 0000000000..130e5385d1 --- /dev/null +++ b/erpnext/utilities/page/users/users.js @@ -0,0 +1,378 @@ +// 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 . + +$.extend(wn.pages.users, { + onload: function(wrapper) { + wn.pages.users.profiles = {}; + wn.pages.users.refresh(); + wn.pages.users.setup(); + wn.pages.users.role_editor = new erpnext.RoleEditor(); + }, + setup: function() { + // set roles + $('.users-area').on('click', '.btn.user-roles', function() { + var uid = $(this).parent().parent().attr('data-name'); + wn.pages.users.role_editor.show(uid); + }); + + // settings + $('.users-area').on('click', '.btn.user-settings', function() { + var uid = $(this).parent().parent().attr('data-name'); + wn.pages.users.show_settings(uid); + }); + + // delete + $('.users-area').on('click', 'a.close', function() { + $card = $(this).parent(); + var uid = $card.attr('data-name'); + $card.css('opacity', 0.6); + wn.call({ + method: 'utilities.page.users.users.delete', + args: {'uid': uid}, + callback: function(r,rt) { + if(!r.exc) + $card.fadeOut() + } + }); + }) + + }, + refresh: function() { + // make the list + wn.call({ + method:'utilities.page.users.users.get', + callback: function(r, rt) { + $('.users-area').empty(); + for(var i in r.message) { + var p = r.message[i]; + wn.pages.users.profiles[p.name] = p; + wn.pages.users.render(p); + } + } + }); + }, + render: function(data) { + if(data.file_list) { + data.imgsrc = 'files/' + data.file_list.split('\n')[0].split(',')[1]; + } else { + data.imgsrc = 'lib/images/ui/no_img_' + (data.gender=='Female' ? 'f' : 'm') + '.gif'; + } + data.fullname = wn.user_info(data.name).fullname; + data.delete_html = ''; + if(!data.enabled) + data.delete_html = '×'; + + $('.users-area').append(repl('
\ + %(delete_html)s\ + \ + \ +
', data)); + + if(!data.enabled) { + $('.users-area .user-card:last') + .addClass('disabled') + .find('.user-fullname').html('Disabled'); + } + }, + show_settings: function(uid) { + var me = wn.pages.users; + if(!me.settings_dialog) + me.make_settings_dialog(); + + var p = me.profiles[uid]; + me.uid = uid; + + me.settings_dialog.set_values({ + restrict_ip: p.restrict_ip || '', + login_before: p.login_before || '', + login_after: p.login_after || '', + enabled: p.enabled || 0, + new_password: '' + }); + + me.settings_dialog.show(); + + }, + make_settings_dialog: function() { + var me = wn.pages.users; + me.settings_dialog = new wn.widgets.Dialog({ + title: 'Set User Security', + width: 500, + fields: [ + { + label:'Enabled', + description: 'Uncheck to disable', + fieldtype: 'Check', fieldname: 'enabled' + }, + { + label:'IP Address', + description: 'Restrict user login by IP address, partial ips (111.111.111), \ + multiple addresses (separated by commas) allowed', + fieldname:'restrict_ip', fieldtype:'Data' + }, + { + label:'Login After', + description: 'User can only login after this hour (0-24)', + fieldtype: 'Int', fieldname: 'login_after' + }, + { + label:'Login Before', + description: 'User can only login before this hour (0-24)', + fieldtype: 'Int', fieldname: 'login_before' + }, + { + label:'New Password', + description: 'Update the current user password', + fieldtype: 'Data', fieldname: 'new_password' + }, + { + label:'Update', fieldtype:'Button', fieldname:'update' + } + ] + }); + + this.settings_dialog.fields_dict.update.input.onclick = function() { + var btn = this; + var args = me.settings_dialog.get_values(); + args.user = me.uid; + + if (args.new_password) { + me.get_password(btn, args); + } else { + me.update_security(btn, args); + } + }; + + }, + update_security: function(btn, args) { + var me = wn.pages.users; + $(btn).set_working(); + $c_page('utilities', 'users', 'update_security', JSON.stringify(args), function(r,rt) { + $(btn).done_working(); + if(r.exc) { + msgprint(r.exc); + return; + } + me.settings_dialog.hide(); + $.extend(me.profiles[me.uid], me.settings_dialog.get_values()); + me.refresh(); + }); + }, + get_password: function(btn, args) { + var me = wn.pages.users; + var pass_d = new wn.widgets.Dialog({ + title: 'Your Password', + width: 300, + fields: [ + { + label: 'Please Enter Your Password', + description: "Your password is required to update the user's password", + fieldtype: 'Password', fieldname: 'sys_admin_pwd', reqd: 1 + }, + { + label: 'Continue', fieldtype: 'Button', fieldname: 'continue' + } + ] + }); + + pass_d.fields_dict.continue.input.onclick = function() { + btn.pwd_dialog.hide(); + args.sys_admin_pwd = btn.pwd_dialog.get_values().sys_admin_pwd; + btn.set_working(); + me.update_security(btn, args); + btn.done_working(); + } + + pass_d.show(); + btn.pwd_dialog = pass_d; + btn.done_working(); + }, + add_user: function() { + var me = wn.pages.users; + var d = new wn.widgets.Dialog({ + title: 'Add User', + width: 400, + fields: [{ + fieldtype: 'Data', fieldname: 'user', reqd: 1, + label: 'Email Id of the user to add' + }, { + fieldtype: 'Data', fieldname: 'first_name', reqd: 1, label: 'First Name' + }, { + fieldtype: 'Data', fieldname: 'last_name', label: 'Last Name' + }, { + fieldtype: 'Data', fieldname: 'password', reqd: 1, label: 'Password' + }, { + fieldtype: 'Button', label: 'Add', fieldname: 'add' + }] + }); + + d.make(); + d.fields_dict.add.input.onclick = function() { + v = d.get_values(); + if(v) { + d.fields_dict.add.input.set_working(); + $c_page('utilities', 'users', 'add_user', v, function(r,rt) { + if(r.exc) { msgprint(r.exc); return; } + else { + wn.boot.user_info[v.user] = {fullname:v.first_name + ' ' + v.last_name}; + d.hide(); + me.refresh(); + } + }) + } + } + d.show(); + } +}); + +erpnext.RoleEditor = Class.extend({ + init: function() { + this.dialog = new wn.widgets.Dialog({ + title: 'Set Roles' + }); + var me = this; + $(this.dialog.body).html('
Loading...
') + wn.call({ + method:'utilities.page.users.users.get_roles', + callback: function(r) { + me.roles = r.message; + me.show_roles(); + } + }); + }, + show_roles: function() { + var me = this; + $(this.dialog.body).empty(); + for(var i in this.roles) { + $(this.dialog.body).append(repl('
\ + \ + %(role)s\ +
', {role: this.roles[i]})); + } + $(this.dialog.body).append('
\ +
'); + $(this.dialog.body).find('button.btn-primary').click(function() { + me.save(); + }); + $(this.dialog.body).find('.user-role a').click(function() { + me.show_permissions($(this).parent().attr('data-user-role')) + return false; + }) + }, + show: function(uid) { + var me = this; + this.uid = uid; + this.dialog.show(); + // set user roles + wn.call({ + method:'utilities.page.users.users.get_user_roles', + args: {uid:uid}, + callback: function(r, rt) { + $(me.dialog.body).find('input[type="checkbox"]').attr('checked', false); + for(var i in r.message) { + $(me.dialog.body) + .find('[data-user-role="'+r.message[i] + +'"] input[type="checkbox"]').attr('checked',true); + } + } + }) + }, + save: function() { + var set_roles = []; + var unset_roles = []; + $(this.dialog.body).find('[data-user-role]').each(function() { + var $check = $(this).find('input[type="checkbox"]'); + if($check.attr('checked')) { + set_roles.push($(this).attr('data-user-role')); + } else { + unset_roles.push($(this).attr('data-user-role')); + } + }) + wn.call({ + method:'utilities.page.users.users.update_roles', + args: { + set_roles: JSON.stringify(set_roles), + unset_roles: JSON.stringify(unset_roles), + uid: this.uid + }, + btn: $(this.dialog.body).find('.btn-primary').get(0), + callback: function() { + + } + }) + }, + show_permissions: function(role) { + // show permissions for a role + var me = this; + if(!this.perm_dialog) + this.make_perm_dialog() + $(this.perm_dialog.body).empty(); + wn.call({ + method:'utilities.page.users.users.get_perm_info', + args: {role: role}, + callback: function(r) { + var $body = $(me.perm_dialog.body); + $body.append('
Invoice Date
Due Date
\ + \ + \ + \ + \ + \ + \ +
Document TypeLevelReadWriteSubmitCancelAmend
'); + for(var i in r.message) { + var perm = r.message[i]; + + // if permission -> icon + for(key in perm) { + if(key!='parent' && key!='permlevel') { + if(perm[key]) { + perm[key] = ''; + } else { + perm[key] = ''; + } + } + } + + $body.find('tbody').append(repl('
%(parent)s%(permlevel)s%(read)s%(write)s%(submit)s%(cancel)s%(amend)s
a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
"+""+"
",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
t
",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
","
"]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); /* * lib/js/lib/history/history.min.js *//* @@ -111,6 +105,33 @@ $(document).bind('ready', function() { /* * 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('');} +if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);} +if(user=='Guest'){if(wn.boot.website_settings.title_prefix){wn.title_prefix=wn.boot.website_settings.title_prefix;}}else{wn.boot.profile.allow_modules=wn.boot.profile.allow_modules.concat(['To Do','Knowledge Base','Calendar','Activity','Messages']) +erpnext.toolbar.setup();erpnext.startup.set_periodic_updates();$('footer').html('');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);}});} +var update_messages=function(reset){if(inList(['Guest'],user)){return;} +if(!reset){$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);}});}else{page_body.wntoolbar.set_new_comments(0);$('#msg_count').toggle(false);}} erpnext.startup.set_periodic_updates=function(){wn.updates={};if(wn.updates.id){clearInterval(wn.updates.id);} wn.updates.id=setInterval(update_messages,60000);} +erpnext.set_user_background=function(src){set_style(repl('body { background: url("files/%(src)s") repeat;}',{src:src}))} $(document).bind('startup',function(){erpnext.startup.start();}); /* - * erpnext/startup/modules.js + * erpnext/startup/js/modules.js */ wn.provide('erpnext.module_page');erpnext.module_page.setup_page=function(module,wrapper){erpnext.module_page.hide_links(wrapper);erpnext.module_page.make_list(module,wrapper);$(wrapper).find("a[title]").tooltip({delay:{show:500,hide:100}});} -erpnext.module_page.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[data-doctype]').each(function(){var dt=$(this).attr('data-doctype');if(wn.boot.profile.can_read.indexOf(dt)==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[href*="Form/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.can_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});} +erpnext.module_page.hide_links=function(wrapper){$(wrapper).find('[href*="List/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[data-doctype]').each(function(){var dt=$(this).attr('data-doctype');if(wn.boot.profile.all_read.indexOf(dt)==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});$(wrapper).find('[href*="Form/"]').each(function(){var href=$(this).attr('href');var dt=href.split('/')[1];if(wn.boot.profile.all_read.indexOf(get_label_doctype(dt))==-1){var txt=$(this).text();$(this).parent().css('color','#999').html(txt);}});} erpnext.module_page.make_list=function(module,wrapper){wrapper.list=new wn.widgets.Listing({parent:$(wrapper).find('.reports-list').get(0),method:'utilities.get_report_list',render_row:function(row,data){if(!data.parent_doc_type)data.parent_doc_type=data.doc_type;$(row).html(repl('\ - %(criteria_name)s',data))},args:{module:module},no_refresh:true});wrapper.list.run();} + %(criteria_name)s',data))},args:{module:module},no_refresh:true,callback:function(r){erpnext.module_page.hide_links(wrapper)}});wrapper.list.run();} /* - * erpnext/startup/toolbar.js + * erpnext/startup/js/toolbar.js */ wn.provide('erpnext.toolbar');erpnext.toolbar.setup=function(){erpnext.toolbar.add_modules();$('#toolbar-user').append('
  • Profile Settings
  • ');$('.navbar .pull-right').append('\
  • ');$('.navbar .pull-right').prepend('
    a",d=q.getElementsByTagName("*"),e=q.getElementsByTagName("a")[0];if(!d||!d.length||!e)return{};g=c.createElement("select"),h=g.appendChild(c.createElement("option")),i=q.getElementsByTagName("input")[0],b={leadingWhitespace:q.firstChild.nodeType===3,tbody:!q.getElementsByTagName("tbody").length,htmlSerialize:!!q.getElementsByTagName("link").length,style:/top/.test(e.getAttribute("style")),hrefNormalized:e.getAttribute("href")==="/a",opacity:/^0.55/.test(e.style.opacity),cssFloat:!!e.style.cssFloat,checkOn:i.value==="on",optSelected:h.selected,getSetAttribute:q.className!=="t",enctype:!!c.createElement("form").enctype,html5Clone:c.createElement("nav").cloneNode(!0).outerHTML!=="<:nav>",submitBubbles:!0,changeBubbles:!0,focusinBubbles:!1,deleteExpando:!0,noCloneEvent:!0,inlineBlockNeedsLayout:!1,shrinkWrapBlocks:!1,reliableMarginRight:!0},i.checked=!0,b.noCloneChecked=i.cloneNode(!0).checked,g.disabled=!0,b.optDisabled=!h.disabled;try{delete q.test}catch(s){b.deleteExpando=!1}!q.addEventListener&&q.attachEvent&&q.fireEvent&&(q.attachEvent("onclick",function(){b.noCloneEvent=!1}),q.cloneNode(!0).fireEvent("onclick")),i=c.createElement("input"),i.value="t",i.setAttribute("type","radio"),b.radioValue=i.value==="t",i.setAttribute("checked","checked"),q.appendChild(i),k=c.createDocumentFragment(),k.appendChild(q.lastChild),b.checkClone=k.cloneNode(!0).cloneNode(!0).lastChild.checked,b.appendChecked=i.checked,k.removeChild(i),k.appendChild(q),q.innerHTML="",a.getComputedStyle&&(j=c.createElement("div"),j.style.width="0",j.style.marginRight="0",q.style.width="2px",q.appendChild(j),b.reliableMarginRight=(parseInt((a.getComputedStyle(j,null)||{marginRight:0}).marginRight,10)||0)===0);if(q.attachEvent)for(o in{submit:1,change:1,focusin:1})n="on"+o,p=n in q,p||(q.setAttribute(n,"return;"),p=typeof q[n]=="function"),b[o+"Bubbles"]=p;k.removeChild(q),k=g=h=j=q=i=null,f(function(){var a,d,e,g,h,i,j,k,m,n,o,r=c.getElementsByTagName("body")[0];!r||(j=1,k="position:absolute;top:0;left:0;width:1px;height:1px;margin:0;",m="visibility:hidden;border:0;",n="style='"+k+"border:5px solid #000;padding:0;'",o="
    "+""+"
    ",a=c.createElement("div"),a.style.cssText=m+"width:0;height:0;position:static;top:0;margin-top:"+j+"px",r.insertBefore(a,r.firstChild),q=c.createElement("div"),a.appendChild(q),q.innerHTML="
    t
    ",l=q.getElementsByTagName("td"),p=l[0].offsetHeight===0,l[0].style.display="",l[1].style.display="none",b.reliableHiddenOffsets=p&&l[0].offsetHeight===0,q.innerHTML="",q.style.width=q.style.paddingLeft="1px",f.boxModel=b.boxModel=q.offsetWidth===2,typeof q.style.zoom!="undefined"&&(q.style.display="inline",q.style.zoom=1,b.inlineBlockNeedsLayout=q.offsetWidth===2,q.style.display="",q.innerHTML="
    ",b.shrinkWrapBlocks=q.offsetWidth!==2),q.style.cssText=k+m,q.innerHTML=o,d=q.firstChild,e=d.firstChild,h=d.nextSibling.firstChild.firstChild,i={doesNotAddBorder:e.offsetTop!==5,doesAddBorderForTableAndCells:h.offsetTop===5},e.style.position="fixed",e.style.top="20px",i.fixedPosition=e.offsetTop===20||e.offsetTop===15,e.style.position=e.style.top="",d.style.overflow="hidden",d.style.position="relative",i.subtractsBorderForOverflowNotVisible=e.offsetTop===-5,i.doesNotIncludeMarginInBodyOffset=r.offsetTop!==j,r.removeChild(a),q=a=null,f.extend(b,i))});return b}();var j=/^(?:\{.*\}|\[.*\])$/,k=/([A-Z])/g;f.extend({cache:{},uuid:0,expando:"jQuery"+(f.fn.jquery+Math.random()).replace(/\D/g,""),noData:{embed:!0,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:!0},hasData:function(a){a=a.nodeType?f.cache[a[f.expando]]:a[f.expando];return!!a&&!m(a)},data:function(a,c,d,e){if(!!f.acceptData(a)){var g,h,i,j=f.expando,k=typeof c=="string",l=a.nodeType,m=l?f.cache:a,n=l?a[j]:a[j]&&j,o=c==="events";if((!n||!m[n]||!o&&!e&&!m[n].data)&&k&&d===b)return;n||(l?a[j]=n=++f.uuid:n=j),m[n]||(m[n]={},l||(m[n].toJSON=f.noop));if(typeof c=="object"||typeof c=="function")e?m[n]=f.extend(m[n],c):m[n].data=f.extend(m[n].data,c);g=h=m[n],e||(h.data||(h.data={}),h=h.data),d!==b&&(h[f.camelCase(c)]=d);if(o&&!h[c])return g.events;k?(i=h[c],i==null&&(i=h[f.camelCase(c)])):i=h;return i}},removeData:function(a,b,c){if(!!f.acceptData(a)){var d,e,g,h=f.expando,i=a.nodeType,j=i?f.cache:a,k=i?a[h]:h;if(!j[k])return;if(b){d=c?j[k]:j[k].data;if(d){f.isArray(b)||(b in d?b=[b]:(b=f.camelCase(b),b in d?b=[b]:b=b.split(" ")));for(e=0,g=b.length;e-1)return!0;return!1},val:function(a){var c,d,e,g=this[0];{if(!!arguments.length){e=f.isFunction(a);return this.each(function(d){var g=f(this),h;if(this.nodeType===1){e?h=a.call(this,d,g.val()):h=a,h==null?h="":typeof h=="number"?h+="":f.isArray(h)&&(h=f.map(h,function(a){return a==null?"":a+""})),c=f.valHooks[this.nodeName.toLowerCase()]||f.valHooks[this.type];if(!c||!("set"in c)||c.set(this,h,"value")===b)this.value=h}})}if(g){c=f.valHooks[g.nodeName.toLowerCase()]||f.valHooks[g.type];if(c&&"get"in c&&(d=c.get(g,"value"))!==b)return d;d=g.value;return typeof d=="string"?d.replace(q,""):d==null?"":d}}}}),f.extend({valHooks:{option:{get:function(a){var b=a.attributes.value;return!b||b.specified?a.value:a.text}},select:{get:function(a){var b,c,d,e,g=a.selectedIndex,h=[],i=a.options,j=a.type==="select-one";if(g<0)return null;c=j?g:0,d=j?g+1:i.length;for(;c=0}),c.length||(a.selectedIndex=-1);return c}}},attrFn:{val:!0,css:!0,html:!0,text:!0,data:!0,width:!0,height:!0,offset:!0},attr:function(a,c,d,e){var g,h,i,j=a.nodeType;if(!!a&&j!==3&&j!==8&&j!==2){if(e&&c in f.attrFn)return f(a)[c](d);if(typeof a.getAttribute=="undefined")return f.prop(a,c,d);i=j!==1||!f.isXMLDoc(a),i&&(c=c.toLowerCase(),h=f.attrHooks[c]||(u.test(c)?x:w));if(d!==b){if(d===null){f.removeAttr(a,c);return}if(h&&"set"in h&&i&&(g=h.set(a,d,c))!==b)return g;a.setAttribute(c,""+d);return d}if(h&&"get"in h&&i&&(g=h.get(a,c))!==null)return g;g=a.getAttribute(c);return g===null?b:g}},removeAttr:function(a,b){var c,d,e,g,h=0;if(b&&a.nodeType===1){d=b.toLowerCase().split(p),g=d.length;for(;h=0}})});var z=/^(?:textarea|input|select)$/i,A=/^([^\.]*)?(?:\.(.+))?$/,B=/\bhover(\.\S+)?\b/,C=/^key/,D=/^(?:mouse|contextmenu)|click/,E=/^(?:focusinfocus|focusoutblur)$/,F=/^(\w*)(?:#([\w\-]+))?(?:\.([\w\-]+))?$/,G=function(a){var b=F.exec(a);b&&(b[1]=(b[1]||"").toLowerCase(),b[3]=b[3]&&new RegExp("(?:^|\\s)"+b[3]+"(?:\\s|$)"));return b},H=function(a,b){var c=a.attributes||{};return(!b[1]||a.nodeName.toLowerCase()===b[1])&&(!b[2]||(c.id||{}).value===b[2])&&(!b[3]||b[3].test((c["class"]||{}).value))},I=function(a){return f.event.special.hover?a:a.replace(B,"mouseenter$1 mouseleave$1")}; -f.event={add:function(a,c,d,e,g){var h,i,j,k,l,m,n,o,p,q,r,s;if(!(a.nodeType===3||a.nodeType===8||!c||!d||!(h=f._data(a)))){d.handler&&(p=d,d=p.handler),d.guid||(d.guid=f.guid++),j=h.events,j||(h.events=j={}),i=h.handle,i||(h.handle=i=function(a){return typeof f!="undefined"&&(!a||f.event.triggered!==a.type)?f.event.dispatch.apply(i.elem,arguments):b},i.elem=a),c=f.trim(I(c)).split(" ");for(k=0;k=0&&(h=h.slice(0,-1),k=!0),h.indexOf(".")>=0&&(i=h.split("."),h=i.shift(),i.sort());if((!e||f.event.customEvent[h])&&!f.event.global[h])return;c=typeof c=="object"?c[f.expando]?c:new f.Event(h,c):new f.Event(h),c.type=h,c.isTrigger=!0,c.exclusive=k,c.namespace=i.join("."),c.namespace_re=c.namespace?new RegExp("(^|\\.)"+i.join("\\.(?:.*\\.)?")+"(\\.|$)"):null,o=h.indexOf(":")<0?"on"+h:"";if(!e){j=f.cache;for(l in j)j[l].events&&j[l].events[h]&&f.event.trigger(c,d,j[l].handle.elem,!0);return}c.result=b,c.target||(c.target=e),d=d!=null?f.makeArray(d):[],d.unshift(c),p=f.event.special[h]||{};if(p.trigger&&p.trigger.apply(e,d)===!1)return;r=[[e,p.bindType||h]];if(!g&&!p.noBubble&&!f.isWindow(e)){s=p.delegateType||h,m=E.test(s+h)?e:e.parentNode,n=null;for(;m;m=m.parentNode)r.push([m,s]),n=m;n&&n===e.ownerDocument&&r.push([n.defaultView||n.parentWindow||a,s])}for(l=0;le&&i.push({elem:this,matches:d.slice(e)});for(j=0;j0?this.on(b,null,a,c):this.trigger(b)},f.attrFn&&(f.attrFn[b]=!0),C.test(b)&&(f.event.fixHooks[b]=f.event.keyHooks),D.test(b)&&(f.event.fixHooks[b]=f.event.mouseHooks)}),function(){function x(a,b,c,e,f,g){for(var h=0,i=e.length;h0){k=j;break}}j=j[a]}e[h]=k}}}function w(a,b,c,e,f,g){for(var h=0,i=e.length;h+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,d="sizcache"+(Math.random()+"").replace(".",""),e=0,g=Object.prototype.toString,h=!1,i=!0,j=/\\/g,k=/\r\n/g,l=/\W/;[0,0].sort(function(){i=!1;return 0});var m=function(b,d,e,f){e=e||[],d=d||c;var h=d;if(d.nodeType!==1&&d.nodeType!==9)return[];if(!b||typeof b!="string")return e;var i,j,k,l,n,q,r,t,u=!0,v=m.isXML(d),w=[],x=b;do{a.exec(""),i=a.exec(x);if(i){x=i[3],w.push(i[1]);if(i[2]){l=i[3];break}}}while(i);if(w.length>1&&p.exec(b))if(w.length===2&&o.relative[w[0]])j=y(w[0]+w[1],d,f);else{j=o.relative[w[0]]?[d]:m(w.shift(),d);while(w.length)b=w.shift(),o.relative[b]&&(b+=w.shift()),j=y(b,j,f)}else{!f&&w.length>1&&d.nodeType===9&&!v&&o.match.ID.test(w[0])&&!o.match.ID.test(w[w.length-1])&&(n=m.find(w.shift(),d,v),d=n.expr?m.filter(n.expr,n.set)[0]:n.set[0]);if(d){n=f?{expr:w.pop(),set:s(f)}:m.find(w.pop(),w.length===1&&(w[0]==="~"||w[0]==="+")&&d.parentNode?d.parentNode:d,v),j=n.expr?m.filter(n.expr,n.set):n.set,w.length>0?k=s(j):u=!1;while(w.length)q=w.pop(),r=q,o.relative[q]?r=w.pop():q="",r==null&&(r=d),o.relative[q](k,r,v)}else k=w=[]}k||(k=j),k||m.error(q||b);if(g.call(k)==="[object Array]")if(!u)e.push.apply(e,k);else if(d&&d.nodeType===1)for(t=0;k[t]!=null;t++)k[t]&&(k[t]===!0||k[t].nodeType===1&&m.contains(d,k[t]))&&e.push(j[t]);else for(t=0;k[t]!=null;t++)k[t]&&k[t].nodeType===1&&e.push(j[t]);else s(k,e);l&&(m(l,h,e,f),m.uniqueSort(e));return e};m.uniqueSort=function(a){if(u){h=i,a.sort(u);if(h)for(var b=1;b0},m.find=function(a,b,c){var d,e,f,g,h,i;if(!a)return[];for(e=0,f=o.order.length;e":function(a,b){var c,d=typeof b=="string",e=0,f=a.length;if(d&&!l.test(b)){b=b.toLowerCase();for(;e=0)?c||d.push(h):c&&(b[g]=!1));return!1},ID:function(a){return a[1].replace(j,"")},TAG:function(a,b){return a[1].replace(j,"").toLowerCase()},CHILD:function(a){if(a[1]==="nth"){a[2]||m.error(a[0]),a[2]=a[2].replace(/^\+|\s*/g,"");var b=/(-?)(\d*)(?:n([+\-]?\d*))?/.exec(a[2]==="even"&&"2n"||a[2]==="odd"&&"2n+1"||!/\D/.test(a[2])&&"0n+"+a[2]||a[2]);a[2]=b[1]+(b[2]||1)-0,a[3]=b[3]-0}else a[2]&&m.error(a[0]);a[0]=e++;return a},ATTR:function(a,b,c,d,e,f){var g=a[1]=a[1].replace(j,"");!f&&o.attrMap[g]&&(a[1]=o.attrMap[g]),a[4]=(a[4]||a[5]||"").replace(j,""),a[2]==="~="&&(a[4]=" "+a[4]+" ");return a},PSEUDO:function(b,c,d,e,f){if(b[1]==="not")if((a.exec(b[3])||"").length>1||/^\w/.test(b[3]))b[3]=m(b[3],null,null,c);else{var g=m.filter(b[3],c,d,!0^f);d||e.push.apply(e,g);return!1}else if(o.match.POS.test(b[0])||o.match.CHILD.test(b[0]))return!0;return b},POS:function(a){a.unshift(!0);return a}},filters:{enabled:function(a){return a.disabled===!1&&a.type!=="hidden"},disabled:function(a){return a.disabled===!0},checked:function(a){return a.checked===!0},selected:function(a){a.parentNode&&a.parentNode.selectedIndex;return a.selected===!0},parent:function(a){return!!a.firstChild},empty:function(a){return!a.firstChild},has:function(a,b,c){return!!m(c[3],a).length},header:function(a){return/h\d/i.test(a.nodeName)},text:function(a){var b=a.getAttribute("type"),c=a.type;return a.nodeName.toLowerCase()==="input"&&"text"===c&&(b===c||b===null)},radio:function(a){return a.nodeName.toLowerCase()==="input"&&"radio"===a.type},checkbox:function(a){return a.nodeName.toLowerCase()==="input"&&"checkbox"===a.type},file:function(a){return a.nodeName.toLowerCase()==="input"&&"file"===a.type},password:function(a){return a.nodeName.toLowerCase()==="input"&&"password"===a.type},submit:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"submit"===a.type},image:function(a){return a.nodeName.toLowerCase()==="input"&&"image"===a.type},reset:function(a){var b=a.nodeName.toLowerCase();return(b==="input"||b==="button")&&"reset"===a.type},button:function(a){var b=a.nodeName.toLowerCase();return b==="input"&&"button"===a.type||b==="button"},input:function(a){return/input|select|textarea|button/i.test(a.nodeName)},focus:function(a){return a===a.ownerDocument.activeElement}},setFilters:{first:function(a,b){return b===0},last:function(a,b,c,d){return b===d.length-1},even:function(a,b){return b%2===0},odd:function(a,b){return b%2===1},lt:function(a,b,c){return bc[3]-0},nth:function(a,b,c){return c[3]-0===b},eq:function(a,b,c){return c[3]-0===b}},filter:{PSEUDO:function(a,b,c,d){var e=b[1],f=o.filters[e];if(f)return f(a,c,b,d);if(e==="contains")return(a.textContent||a.innerText||n([a])||"").indexOf(b[3])>=0;if(e==="not"){var g=b[3];for(var h=0,i=g.length;h=0}},ID:function(a,b){return a.nodeType===1&&a.getAttribute("id")===b},TAG:function(a,b){return b==="*"&&a.nodeType===1||!!a.nodeName&&a.nodeName.toLowerCase()===b},CLASS:function(a,b){return(" "+(a.className||a.getAttribute("class"))+" ").indexOf(b)>-1},ATTR:function(a,b){var c=b[1],d=m.attr?m.attr(a,c):o.attrHandle[c]?o.attrHandle[c](a):a[c]!=null?a[c]:a.getAttribute(c),e=d+"",f=b[2],g=b[4];return d==null?f==="!=":!f&&m.attr?d!=null:f==="="?e===g:f==="*="?e.indexOf(g)>=0:f==="~="?(" "+e+" ").indexOf(g)>=0:g?f==="!="?e!==g:f==="^="?e.indexOf(g)===0:f==="$="?e.substr(e.length-g.length)===g:f==="|="?e===g||e.substr(0,g.length+1)===g+"-":!1:e&&d!==!1},POS:function(a,b,c,d){var e=b[2],f=o.setFilters[e];if(f)return f(a,c,b,d)}}},p=o.match.POS,q=function(a,b){return"\\"+(b-0+1)};for(var r in o.match)o.match[r]=new RegExp(o.match[r].source+/(?![^\[]*\])(?![^\(]*\))/.source),o.leftMatch[r]=new RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[r].source.replace(/\\(\d+)/g,q));var s=function(a,b){a=Array.prototype.slice.call(a,0);if(b){b.push.apply(b,a);return b}return a};try{Array.prototype.slice.call(c.documentElement.childNodes,0)[0].nodeType}catch(t){s=function(a,b){var c=0,d=b||[];if(g.call(a)==="[object Array]")Array.prototype.push.apply(d,a);else if(typeof a.length=="number")for(var e=a.length;c",e.insertBefore(a,e.firstChild),c.getElementById(d)&&(o.find.ID=function(a,c,d){if(typeof c.getElementById!="undefined"&&!d){var e=c.getElementById(a[1]);return e?e.id===a[1]||typeof e.getAttributeNode!="undefined"&&e.getAttributeNode("id").nodeValue===a[1]?[e]:b:[]}},o.filter.ID=function(a,b){var c=typeof a.getAttributeNode!="undefined"&&a.getAttributeNode("id");return a.nodeType===1&&c&&c.nodeValue===b}),e.removeChild(a),e=a=null}(),function(){var a=c.createElement("div");a.appendChild(c.createComment("")),a.getElementsByTagName("*").length>0&&(o.find.TAG=function(a,b){var c=b.getElementsByTagName(a[1]);if(a[1]==="*"){var d=[];for(var e=0;c[e];e++)c[e].nodeType===1&&d.push(c[e]);c=d}return c}),a.innerHTML="",a.firstChild&&typeof a.firstChild.getAttribute!="undefined"&&a.firstChild.getAttribute("href")!=="#"&&(o.attrHandle.href=function(a){return a.getAttribute("href",2)}),a=null}(),c.querySelectorAll&&function(){var a=m,b=c.createElement("div"),d="__sizzle__";b.innerHTML="

    ";if(!b.querySelectorAll||b.querySelectorAll(".TEST").length!==0){m=function(b,e,f,g){e=e||c;if(!g&&!m.isXML(e)){var h=/^(\w+$)|^\.([\w\-]+$)|^#([\w\-]+$)/.exec(b);if(h&&(e.nodeType===1||e.nodeType===9)){if(h[1])return s(e.getElementsByTagName(b),f);if(h[2]&&o.find.CLASS&&e.getElementsByClassName)return s(e.getElementsByClassName(h[2]),f)}if(e.nodeType===9){if(b==="body"&&e.body)return s([e.body],f);if(h&&h[3]){var i=e.getElementById(h[3]);if(!i||!i.parentNode)return s([],f);if(i.id===h[3])return s([i],f)}try{return s(e.querySelectorAll(b),f)}catch(j){}}else if(e.nodeType===1&&e.nodeName.toLowerCase()!=="object"){var k=e,l=e.getAttribute("id"),n=l||d,p=e.parentNode,q=/^\s*[+~]/.test(b);l?n=n.replace(/'/g,"\\$&"):e.setAttribute("id",n),q&&p&&(e=e.parentNode);try{if(!q||p)return s(e.querySelectorAll("[id='"+n+"'] "+b),f)}catch(r){}finally{l||k.removeAttribute("id")}}}return a(b,e,f,g)};for(var e in a)m[e]=a[e];b=null}}(),function(){var a=c.documentElement,b=a.matchesSelector||a.mozMatchesSelector||a.webkitMatchesSelector||a.msMatchesSelector;if(b){var d=!b.call(c.createElement("div"),"div"),e=!1;try{b.call(c.documentElement,"[test!='']:sizzle")}catch(f){e=!0}m.matchesSelector=function(a,c){c=c.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!m.isXML(a))try{if(e||!o.match.PSEUDO.test(c)&&!/!=/.test(c)){var f=b.call(a,c);if(f||!d||a.document&&a.document.nodeType!==11)return f}}catch(g){}return m(c,null,null,[a]).length>0}}}(),function(){var a=c.createElement("div");a.innerHTML="
    ";if(!!a.getElementsByClassName&&a.getElementsByClassName("e").length!==0){a.lastChild.className="e";if(a.getElementsByClassName("e").length===1)return;o.order.splice(1,0,"CLASS"),o.find.CLASS=function(a,b,c){if(typeof b.getElementsByClassName!="undefined"&&!c)return b.getElementsByClassName(a[1])},a=null}}(),c.documentElement.contains?m.contains=function(a,b){return a!==b&&(a.contains?a.contains(b):!0)}:c.documentElement.compareDocumentPosition?m.contains=function(a,b){return!!(a.compareDocumentPosition(b)&16)}:m.contains=function(){return!1},m.isXML=function(a){var b=(a?a.ownerDocument||a:0).documentElement;return b?b.nodeName!=="HTML":!1};var y=function(a,b,c){var d,e=[],f="",g=b.nodeType?[b]:b;while(d=o.match.PSEUDO.exec(a))f+=d[0],a=a.replace(o.match.PSEUDO,"");a=o.relative[a]?a+"*":a;for(var h=0,i=g.length;h0)for(h=g;h=0:f.filter(a,this).length>0:this.filter(a).length>0)},closest:function(a,b){var c=[],d,e,g=this[0];if(f.isArray(a)){var h=1;while(g&&g.ownerDocument&&g!==b){for(d=0;d-1:f.find.matchesSelector(g,a)){c.push(g);break}g=g.parentNode;if(!g||!g.ownerDocument||g===b||g.nodeType===11)break}}c=c.length>1?f.unique(c):c;return this.pushStack(c,"closest",a)},index:function(a){if(!a)return this[0]&&this[0].parentNode?this.prevAll().length:-1;if(typeof a=="string")return f.inArray(this[0],f(a));return f.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var c=typeof a=="string"?f(a,b):f.makeArray(a&&a.nodeType?[a]:a),d=f.merge(this.get(),c);return this.pushStack(S(c[0])||S(d[0])?d:f.unique(d))},andSelf:function(){return this.add(this.prevObject)}}),f.each({parent:function(a){var b=a.parentNode;return b&&b.nodeType!==11?b:null},parents:function(a){return f.dir(a,"parentNode")},parentsUntil:function(a,b,c){return f.dir(a,"parentNode",c)},next:function(a){return f.nth(a,2,"nextSibling")},prev:function(a){return f.nth(a,2,"previousSibling")},nextAll:function(a){return f.dir(a,"nextSibling")},prevAll:function(a){return f.dir(a,"previousSibling")},nextUntil:function(a,b,c){return f.dir(a,"nextSibling",c)},prevUntil:function(a,b,c){return f.dir(a,"previousSibling",c)},siblings:function(a){return f.sibling(a.parentNode.firstChild,a)},children:function(a){return f.sibling(a.firstChild)},contents:function(a){return f.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:f.makeArray(a.childNodes)}},function(a,b){f.fn[a]=function(c,d){var e=f.map(this,b,c);L.test(a)||(d=c),d&&typeof d=="string"&&(e=f.filter(d,e)),e=this.length>1&&!R[a]?f.unique(e):e,(this.length>1||N.test(d))&&M.test(a)&&(e=e.reverse());return this.pushStack(e,a,P.call(arguments).join(","))}}),f.extend({filter:function(a,b,c){c&&(a=":not("+a+")");return b.length===1?f.find.matchesSelector(b[0],a)?[b[0]]:[]:f.find.matches(a,b)},dir:function(a,c,d){var e=[],g=a[c];while(g&&g.nodeType!==9&&(d===b||g.nodeType!==1||!f(g).is(d)))g.nodeType===1&&e.push(g),g=g[c];return e},nth:function(a,b,c,d){b=b||1;var e=0;for(;a;a=a[c])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){var c=[];for(;a;a=a.nextSibling)a.nodeType===1&&a!==b&&c.push(a);return c}});var V="abbr|article|aside|audio|canvas|datalist|details|figcaption|figure|footer|header|hgroup|mark|meter|nav|output|progress|section|summary|time|video",W=/ jQuery\d+="(?:\d+|null)"/g,X=/^\s+/,Y=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Z=/<([\w:]+)/,$=/",""],legend:[1,"
    ","
    "],thead:[1,"","
    "],tr:[2,"","
    "],td:[3,"","
    "],col:[2,"","
    "],area:[1,"",""],_default:[0,"",""]},bh=U(c);bg.optgroup=bg.option,bg.tbody=bg.tfoot=bg.colgroup=bg.caption=bg.thead,bg.th=bg.td,f.support.htmlSerialize||(bg._default=[1,"div
    ","
    "]),f.fn.extend({text:function(a){if(f.isFunction(a))return this.each(function(b){var c=f(this);c.text(a.call(this,b,c.text()))});if(typeof a!="object"&&a!==b)return this.empty().append((this[0]&&this[0].ownerDocument||c).createTextNode(a));return f.text(this)},wrapAll:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapAll(a.call(this,b))});if(this[0]){var b=f(a,this[0].ownerDocument).eq(0).clone(!0);this[0].parentNode&&b.insertBefore(this[0]),b.map(function(){var a=this;while(a.firstChild&&a.firstChild.nodeType===1)a=a.firstChild;return a}).append(this)}return this},wrapInner:function(a){if(f.isFunction(a))return this.each(function(b){f(this).wrapInner(a.call(this,b))});return this.each(function(){var b=f(this),c=b.contents();c.length?c.wrapAll(a):b.append(a)})},wrap:function(a){var b=f.isFunction(a);return this.each(function(c){f(this).wrapAll(b?a.call(this,c):a)})},unwrap:function(){return this.parent().each(function(){f.nodeName(this,"body")||f(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.appendChild(a)})},prepend:function(){return this.domManip(arguments,!0,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this)});if(arguments.length){var a=f.clean(arguments);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,!1,function(a){this.parentNode.insertBefore(a,this.nextSibling)});if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,f.clean(arguments));return a}},remove:function(a,b){for(var c=0,d;(d=this[c])!=null;c++)if(!a||f.filter(a,[d]).length)!b&&d.nodeType===1&&(f.cleanData(d.getElementsByTagName("*")),f.cleanData([d])),d.parentNode&&d.parentNode.removeChild(d);return this},empty:function() -{for(var a=0,b;(b=this[a])!=null;a++){b.nodeType===1&&f.cleanData(b.getElementsByTagName("*"));while(b.firstChild)b.removeChild(b.firstChild)}return this},clone:function(a,b){a=a==null?!1:a,b=b==null?a:b;return this.map(function(){return f.clone(this,a,b)})},html:function(a){if(a===b)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(W,""):null;if(typeof a=="string"&&!ba.test(a)&&(f.support.leadingWhitespace||!X.test(a))&&!bg[(Z.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Y,"<$1>");try{for(var c=0,d=this.length;c1&&l0?this.clone(!0):this).get();f(e[h])[b](j),d=d.concat(j)}return this.pushStack(d,a,e.selector)}}),f.extend({clone:function(a,b,c){var d,e,g,h=f.support.html5Clone||!bc.test("<"+a.nodeName)?a.cloneNode(!0):bo(a);if((!f.support.noCloneEvent||!f.support.noCloneChecked)&&(a.nodeType===1||a.nodeType===11)&&!f.isXMLDoc(a)){bk(a,h),d=bl(a),e=bl(h);for(g=0;d[g];++g)e[g]&&bk(d[g],e[g])}if(b){bj(a,h);if(c){d=bl(a),e=bl(h);for(g=0;d[g];++g)bj(d[g],e[g])}}d=e=null;return h},clean:function(a,b,d,e){var g;b=b||c,typeof b.createElement=="undefined"&&(b=b.ownerDocument||b[0]&&b[0].ownerDocument||c);var h=[],i;for(var j=0,k;(k=a[j])!=null;j++){typeof k=="number"&&(k+="");if(!k)continue;if(typeof k=="string")if(!_.test(k))k=b.createTextNode(k);else{k=k.replace(Y,"<$1>");var l=(Z.exec(k)||["",""])[1].toLowerCase(),m=bg[l]||bg._default,n=m[0],o=b.createElement("div");b===c?bh.appendChild(o):U(b).appendChild(o),o.innerHTML=m[1]+k+m[2];while(n--)o=o.lastChild;if(!f.support.tbody){var p=$.test(k),q=l==="table"&&!p?o.firstChild&&o.firstChild.childNodes:m[1]===""&&!p?o.childNodes:[];for(i=q.length-1;i>=0;--i)f.nodeName(q[i],"tbody")&&!q[i].childNodes.length&&q[i].parentNode.removeChild(q[i])}!f.support.leadingWhitespace&&X.test(k)&&o.insertBefore(b.createTextNode(X.exec(k)[0]),o.firstChild),k=o.childNodes}var r;if(!f.support.appendChecked)if(k[0]&&typeof (r=k.length)=="number")for(i=0;i=0)return b+"px"}}}),f.support.opacity||(f.cssHooks.opacity={get:function(a,b){return br.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var c=a.style,d=a.currentStyle,e=f.isNumeric(b)?"alpha(opacity="+b*100+")":"",g=d&&d.filter||c.filter||"";c.zoom=1;if(b>=1&&f.trim(g.replace(bq,""))===""){c.removeAttribute("filter");if(d&&!d.filter)return}c.filter=bq.test(g)?g.replace(bq,e):g+" "+e}}),f(function(){f.support.reliableMarginRight||(f.cssHooks.marginRight={get:function(a,b){var c;f.swap(a,{display:"inline-block"},function(){b?c=bz(a,"margin-right","marginRight"):c=a.style.marginRight});return c}})}),c.defaultView&&c.defaultView.getComputedStyle&&(bA=function(a,b){var c,d,e;b=b.replace(bs,"-$1").toLowerCase(),(d=a.ownerDocument.defaultView)&&(e=d.getComputedStyle(a,null))&&(c=e.getPropertyValue(b),c===""&&!f.contains(a.ownerDocument.documentElement,a)&&(c=f.style(a,b)));return c}),c.documentElement.currentStyle&&(bB=function(a,b){var c,d,e,f=a.currentStyle&&a.currentStyle[b],g=a.style;f===null&&g&&(e=g[b])&&(f=e),!bt.test(f)&&bu.test(f)&&(c=g.left,d=a.runtimeStyle&&a.runtimeStyle.left,d&&(a.runtimeStyle.left=a.currentStyle.left),g.left=b==="fontSize"?"1em":f||0,f=g.pixelLeft+"px",g.left=c,d&&(a.runtimeStyle.left=d));return f===""?"auto":f}),bz=bA||bB,f.expr&&f.expr.filters&&(f.expr.filters.hidden=function(a){var b=a.offsetWidth,c=a.offsetHeight;return b===0&&c===0||!f.support.reliableHiddenOffsets&&(a.style&&a.style.display||f.css(a,"display"))==="none"},f.expr.filters.visible=function(a){return!f.expr.filters.hidden(a)});var bD=/%20/g,bE=/\[\]$/,bF=/\r?\n/g,bG=/#.*$/,bH=/^(.*?):[ \t]*([^\r\n]*)\r?$/mg,bI=/^(?:color|date|datetime|datetime-local|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,bJ=/^(?:about|app|app\-storage|.+\-extension|file|res|widget):$/,bK=/^(?:GET|HEAD)$/,bL=/^\/\//,bM=/\?/,bN=/)<[^<]*)*<\/script>/gi,bO=/^(?:select|textarea)/i,bP=/\s+/,bQ=/([?&])_=[^&]*/,bR=/^([\w\+\.\-]+:)(?:\/\/([^\/?#:]*)(?::(\d+))?)?/,bS=f.fn.load,bT={},bU={},bV,bW,bX=["*/"]+["*"];try{bV=e.href}catch(bY){bV=c.createElement("a"),bV.href="",bV=bV.href}bW=bR.exec(bV.toLowerCase())||[],f.fn.extend({load:function(a,c,d){if(typeof a!="string"&&bS)return bS.apply(this,arguments);if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var g=a.slice(e,a.length);a=a.slice(0,e)}var h="GET";c&&(f.isFunction(c)?(d=c,c=b):typeof c=="object"&&(c=f.param(c,f.ajaxSettings.traditional),h="POST"));var i=this;f.ajax({url:a,type:h,dataType:"html",data:c,complete:function(a,b,c){c=a.responseText,a.isResolved()&&(a.done(function(a){c=a}),i.html(g?f("
    ").append(c.replace(bN,"")).find(g):c)),d&&i.each(d,[c,b,a])}});return this},serialize:function(){return f.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?f.makeArray(this.elements):this}).filter(function(){return this.name&&!this.disabled&&(this.checked||bO.test(this.nodeName)||bI.test(this.type))}).map(function(a,b){var c=f(this).val();return c==null?null:f.isArray(c)?f.map(c,function(a,c){return{name:b.name,value:a.replace(bF,"\r\n")}}):{name:b.name,value:c.replace(bF,"\r\n")}}).get()}}),f.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){f.fn[b]=function(a){return this.on(b,a)}}),f.each(["get","post"],function(a,c){f[c]=function(a,d,e,g){f.isFunction(d)&&(g=g||e,e=d,d=b);return f.ajax({type:c,url:a,data:d,success:e,dataType:g})}}),f.extend({getScript:function(a,c){return f.get(a,b,c,"script")},getJSON:function(a,b,c){return f.get(a,b,c,"json")},ajaxSetup:function(a,b){b?b_(a,f.ajaxSettings):(b=a,a=f.ajaxSettings),b_(a,b);return a},ajaxSettings:{url:bV,isLocal:bJ.test(bW[1]),global:!0,type:"GET",contentType:"application/x-www-form-urlencoded",processData:!0,async:!0,accepts:{xml:"application/xml, text/xml",html:"text/html",text:"text/plain",json:"application/json, text/javascript","*":bX},contents:{xml:/xml/,html:/html/,json:/json/},responseFields:{xml:"responseXML",text:"responseText"},converters:{"* text":a.String,"text html":!0,"text json":f.parseJSON,"text xml":f.parseXML},flatOptions:{context:!0,url:!0}},ajaxPrefilter:bZ(bT),ajaxTransport:bZ(bU),ajax:function(a,c){function w(a,c,l,m){if(s!==2){s=2,q&&clearTimeout(q),p=b,n=m||"",v.readyState=a>0?4:0;var o,r,u,w=c,x=l?cb(d,v,l):b,y,z;if(a>=200&&a<300||a===304){if(d.ifModified){if(y=v.getResponseHeader("Last-Modified"))f.lastModified[k]=y;if(z=v.getResponseHeader("Etag"))f.etag[k]=z}if(a===304)w="notmodified",o=!0;else try{r=cc(d,x),w="success",o=!0}catch(A){w="parsererror",u=A}}else{u=w;if(!w||a)w="error",a<0&&(a=0)}v.status=a,v.statusText=""+(c||w),o?h.resolveWith(e,[r,w,v]):h.rejectWith(e,[v,w,u]),v.statusCode(j),j=b,t&&g.trigger("ajax"+(o?"Success":"Error"),[v,d,o?r:u]),i.fireWith(e,[v,w]),t&&(g.trigger("ajaxComplete",[v,d]),--f.active||f.event.trigger("ajaxStop"))}}typeof a=="object"&&(c=a,a=b),c=c||{};var d=f.ajaxSetup({},c),e=d.context||d,g=e!==d&&(e.nodeType||e instanceof f)?f(e):f.event,h=f.Deferred(),i=f.Callbacks("once memory"),j=d.statusCode||{},k,l={},m={},n,o,p,q,r,s=0,t,u,v={readyState:0,setRequestHeader:function(a,b){if(!s){var c=a.toLowerCase();a=m[c]=m[c]||a,l[a]=b}return this},getAllResponseHeaders:function(){return s===2?n:null},getResponseHeader:function(a){var c;if(s===2){if(!o){o={};while(c=bH.exec(n))o[c[1].toLowerCase()]=c[2]}c=o[a.toLowerCase()]}return c===b?null:c},overrideMimeType:function(a){s||(d.mimeType=a);return this},abort:function(a){a=a||"abort",p&&p.abort(a),w(0,a);return this}};h.promise(v),v.success=v.done,v.error=v.fail,v.complete=i.add,v.statusCode=function(a){if(a){var b;if(s<2)for(b in a)j[b]=[j[b],a[b]];else b=a[v.status],v.then(b,b)}return this},d.url=((a||d.url)+"").replace(bG,"").replace(bL,bW[1]+"//"),d.dataTypes=f.trim(d.dataType||"*").toLowerCase().split(bP),d.crossDomain==null&&(r=bR.exec(d.url.toLowerCase()),d.crossDomain=!(!r||r[1]==bW[1]&&r[2]==bW[2]&&(r[3]||(r[1]==="http:"?80:443))==(bW[3]||(bW[1]==="http:"?80:443)))),d.data&&d.processData&&typeof d.data!="string"&&(d.data=f.param(d.data,d.traditional)),b$(bT,d,c,v);if(s===2)return!1;t=d.global,d.type=d.type.toUpperCase(),d.hasContent=!bK.test(d.type),t&&f.active++===0&&f.event.trigger("ajaxStart");if(!d.hasContent){d.data&&(d.url+=(bM.test(d.url)?"&":"?")+d.data,delete d.data),k=d.url;if(d.cache===!1){var x=f.now(),y=d.url.replace(bQ,"$1_="+x);d.url=y+(y===d.url?(bM.test(d.url)?"&":"?")+"_="+x:"")}}(d.data&&d.hasContent&&d.contentType!==!1||c.contentType)&&v.setRequestHeader("Content-Type",d.contentType),d.ifModified&&(k=k||d.url,f.lastModified[k]&&v.setRequestHeader("If-Modified-Since",f.lastModified[k]),f.etag[k]&&v.setRequestHeader("If-None-Match",f.etag[k])),v.setRequestHeader("Accept",d.dataTypes[0]&&d.accepts[d.dataTypes[0]]?d.accepts[d.dataTypes[0]]+(d.dataTypes[0]!=="*"?", "+bX+"; q=0.01":""):d.accepts["*"]);for(u in d.headers)v.setRequestHeader(u,d.headers[u]);if(d.beforeSend&&(d.beforeSend.call(e,v,d)===!1||s===2)){v.abort();return!1}for(u in{success:1,error:1,complete:1})v[u](d[u]);p=b$(bU,d,c,v);if(!p)w(-1,"No Transport");else{v.readyState=1,t&&g.trigger("ajaxSend",[v,d]),d.async&&d.timeout>0&&(q=setTimeout(function(){v.abort("timeout")},d.timeout));try{s=1,p.send(l,w)}catch(z){if(s<2)w(-1,z);else throw z}}return v},param:function(a,c){var d=[],e=function(a,b){b=f.isFunction(b)?b():b,d[d.length]=encodeURIComponent(a)+"="+encodeURIComponent(b)};c===b&&(c=f.ajaxSettings.traditional);if(f.isArray(a)||a.jquery&&!f.isPlainObject(a))f.each(a,function(){e(this.name,this.value)});else for(var g in a)ca(g,a[g],c,e);return d.join("&").replace(bD,"+")}}),f.extend({active:0,lastModified:{},etag:{}});var cd=f.now(),ce=/(\=)\?(&|$)|\?\?/i;f.ajaxSetup({jsonp:"callback",jsonpCallback:function(){return f.expando+"_"+cd++}}),f.ajaxPrefilter("json jsonp",function(b,c,d){var e=b.contentType==="application/x-www-form-urlencoded"&&typeof b.data=="string";if(b.dataTypes[0]==="jsonp"||b.jsonp!==!1&&(ce.test(b.url)||e&&ce.test(b.data))){var g,h=b.jsonpCallback=f.isFunction(b.jsonpCallback)?b.jsonpCallback():b.jsonpCallback,i=a[h],j=b.url,k=b.data,l="$1"+h+"$2";b.jsonp!==!1&&(j=j.replace(ce,l),b.url===j&&(e&&(k=k.replace(ce,l)),b.data===k&&(j+=(/\?/.test(j)?"&":"?")+b.jsonp+"="+h))),b.url=j,b.data=k,a[h]=function(a){g=[a]},d.always(function(){a[h]=i,g&&f.isFunction(i)&&a[h](g[0])}),b.converters["script json"]=function(){g||f.error(h+" was not called");return g[0]},b.dataTypes[0]="json";return"script"}}),f.ajaxSetup({accepts:{script:"text/javascript, application/javascript, application/ecmascript, application/x-ecmascript"},contents:{script:/javascript|ecmascript/},converters:{"text script":function(a){f.globalEval(a);return a}}}),f.ajaxPrefilter("script",function(a){a.cache===b&&(a.cache=!1),a.crossDomain&&(a.type="GET",a.global=!1)}),f.ajaxTransport("script",function(a){if(a.crossDomain){var d,e=c.head||c.getElementsByTagName("head")[0]||c.documentElement;return{send:function(f,g){d=c.createElement("script"),d.async="async",a.scriptCharset&&(d.charset=a.scriptCharset),d.src=a.url,d.onload=d.onreadystatechange=function(a,c){if(c||!d.readyState||/loaded|complete/.test(d.readyState))d.onload=d.onreadystatechange=null,e&&d.parentNode&&e.removeChild(d),d=b,c||g(200,"success")},e.insertBefore(d,e.firstChild)},abort:function(){d&&d.onload(0,1)}}}});var cf=a.ActiveXObject?function(){for(var a in ch)ch[a](0,1)}:!1,cg=0,ch;f.ajaxSettings.xhr=a.ActiveXObject?function(){return!this.isLocal&&ci()||cj()}:ci,function(a){f.extend(f.support,{ajax:!!a,cors:!!a&&"withCredentials"in a})}(f.ajaxSettings.xhr()),f.support.ajax&&f.ajaxTransport(function(c){if(!c.crossDomain||f.support.cors){var d;return{send:function(e,g){var h=c.xhr(),i,j;c.username?h.open(c.type,c.url,c.async,c.username,c.password):h.open(c.type,c.url,c.async);if(c.xhrFields)for(j in c.xhrFields)h[j]=c.xhrFields[j];c.mimeType&&h.overrideMimeType&&h.overrideMimeType(c.mimeType),!c.crossDomain&&!e["X-Requested-With"]&&(e["X-Requested-With"]="XMLHttpRequest");try{for(j in e)h.setRequestHeader(j,e[j])}catch(k){}h.send(c.hasContent&&c.data||null),d=function(a,e){var j,k,l,m,n;try{if(d&&(e||h.readyState===4)){d=b,i&&(h.onreadystatechange=f.noop,cf&&delete ch[i]);if(e)h.readyState!==4&&h.abort();else{j=h.status,l=h.getAllResponseHeaders(),m={},n=h.responseXML,n&&n.documentElement&&(m.xml=n),m.text=h.responseText;try{k=h.statusText}catch(o){k=""}!j&&c.isLocal&&!c.crossDomain?j=m.text?200:404:j===1223&&(j=204)}}}catch(p){e||g(-1,p)}m&&g(j,k,m,l)},!c.async||h.readyState===4?d():(i=++cg,cf&&(ch||(ch={},f(a).unload(cf)),ch[i]=d),h.onreadystatechange=d)},abort:function(){d&&d(0,1)}}}});var ck={},cl,cm,cn=/^(?:toggle|show|hide)$/,co=/^([+\-]=)?([\d+.\-]+)([a-z%]*)$/i,cp,cq=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]],cr;f.fn.extend({show:function(a,b,c){var d,e;if(a||a===0)return this.animate(cu("show",3),a,b,c);for(var g=0,h=this.length;g=i.duration+this.startTime){this.now=this.end,this.pos=this.state=1,this.update(),i.animatedProperties[this.prop]=!0;for(b in i.animatedProperties)i.animatedProperties[b]!==!0&&(g=!1);if(g){i.overflow!=null&&!f.support.shrinkWrapBlocks&&f.each(["","X","Y"],function(a,b){h.style["overflow"+b]=i.overflow[a]}),i.hide&&f(h).hide();if(i.hide||i.show)for(b in i.animatedProperties)f.style(h,b,i.orig[b]),f.removeData(h,"fxshow"+b,!0),f.removeData(h,"toggle"+b,!0);d=i.complete,d&&(i.complete=!1,d.call(h))}return!1}i.duration==Infinity?this.now=e:(c=e-this.startTime,this.state=c/i.duration,this.pos=f.easing[i.animatedProperties[this.prop]](this.state,c,0,1,i.duration),this.now=this.start+(this.end-this.start)*this.pos),this.update();return!0}},f.extend(f.fx,{tick:function(){var a,b=f.timers,c=0;for(;c-1,k={},l={},m,n;j?(l=e.position(),m=l.top,n=l.left):(m=parseFloat(h)||0,n=parseFloat(i)||0),f.isFunction(b)&&(b=b.call(a,c,g)),b.top!=null&&(k.top=b.top-g.top+m),b.left!=null&&(k.left=b.left-g.left+n),"using"in b?b.using.call(a,k):e.css(k)}},f.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),c=this.offset(),d=cx.test(b[0].nodeName)?{top:0,left:0}:b.offset();c.top-=parseFloat(f.css(a,"marginTop"))||0,c.left-=parseFloat(f.css(a,"marginLeft"))||0,d.top+=parseFloat(f.css(b[0],"borderTopWidth"))||0,d.left+=parseFloat(f.css(b[0],"borderLeftWidth"))||0;return{top:c.top-d.top,left:c.left-d.left}},offsetParent:function(){return this.map(function(){var a=this.offsetParent||c.body;while(a&&!cx.test(a.nodeName)&&f.css(a,"position")==="static")a=a.offsetParent;return a})}}),f.each(["Left","Top"],function(a,c){var d="scroll"+c;f.fn[d]=function(c){var e,g;if(c===b){e=this[0];if(!e)return null;g=cy(e);return g?"pageXOffset"in g?g[a?"pageYOffset":"pageXOffset"]:f.support.boxModel&&g.document.documentElement[d]||g.document.body[d]:e[d]}return this.each(function(){g=cy(this),g?g.scrollTo(a?f(g).scrollLeft():c,a?c:f(g).scrollTop()):this[d]=c})}}),f.each(["Height","Width"],function(a,c){var d=c.toLowerCase();f.fn["inner"+c]=function(){var a=this[0];return a?a.style?parseFloat(f.css(a,d,"padding")):this[d]():null},f.fn["outer"+c]=function(a){var b=this[0];return b?b.style?parseFloat(f.css(b,d,a?"margin":"border")):this[d]():null},f.fn[d]=function(a){var e=this[0];if(!e)return a==null?null:this;if(f.isFunction(a))return this.each(function(b){var c=f(this);c[d](a.call(this,b,c[d]()))});if(f.isWindow(e)){var g=e.document.documentElement["client"+c],h=e.document.body;return e.document.compatMode==="CSS1Compat"&&g||h&&h["client"+c]||g}if(e.nodeType===9)return Math.max(e.documentElement["client"+c],e.body["scroll"+c],e.documentElement["scroll"+c],e.body["offset"+c],e.documentElement["offset"+c]);if(a===b){var i=f.css(e,d),j=parseFloat(i);return f.isNumeric(j)?j:i}return this.css(d,typeof a=="string"?a:a+"px")}}),a.jQuery=a.$=f,typeof define=="function"&&define.amd&&define.amd.jQuery&&define("jquery",[],function(){return f})})(window); /* * lib/js/lib/history/history.min.js *//* @@ -37,6 +31,33 @@ $(document).bind('ready', function() { /* * 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('