From b8660fb51cac5408a10e203fed97f22fa7aa4779 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 20 Apr 2012 11:21:47 +0530 Subject: [PATCH] fixes in production, porjects, packing slip --- erpnext/patches/jan_mar_2012/sync_ref_db.py | 2 +- .../page/bill_of_materials/__init__.py | 0 .../bill_of_materials/bill_of_materials.html | 44 -- .../bill_of_materials/bill_of_materials.js | 524 ------------------ .../bill_of_materials/bill_of_materials.txt | 58 -- .../page/production_home/production_home.html | 15 - erpnext/projects/page/projects/projects.js | 2 +- erpnext/startup/event_handlers.py | 6 +- erpnext/startup/js/toolbar.js | 5 - erpnext/startup/startup.js | 7 +- .../doctype/packing_slip/packing_slip.js | 7 +- js/all-app.js | 6 +- js/all-web.js | 4 +- 13 files changed, 18 insertions(+), 662 deletions(-) delete mode 100644 erpnext/production/page/bill_of_materials/__init__.py delete mode 100644 erpnext/production/page/bill_of_materials/bill_of_materials.html delete mode 100644 erpnext/production/page/bill_of_materials/bill_of_materials.js delete mode 100644 erpnext/production/page/bill_of_materials/bill_of_materials.txt diff --git a/erpnext/patches/jan_mar_2012/sync_ref_db.py b/erpnext/patches/jan_mar_2012/sync_ref_db.py index a86bb3f806..efdacf2157 100644 --- a/erpnext/patches/jan_mar_2012/sync_ref_db.py +++ b/erpnext/patches/jan_mar_2012/sync_ref_db.py @@ -20,7 +20,7 @@ def execute(): 'Invest 80 Declaration Detail', 'IT Checklist', 'Chapter VI A Detail', 'Declaration Detail', 'Personalize', 'Salary Slip Control Panel', ], - 'Page' : ['File Browser'], + 'Page' : ['File Browser', 'Bill of Materials'], 'DocType Mapper': ['Production Forecast-Production Planning Tool', 'Production Forecast-Production Plan', 'Sales Order-Production Plan'] } diff --git a/erpnext/production/page/bill_of_materials/__init__.py b/erpnext/production/page/bill_of_materials/__init__.py deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/erpnext/production/page/bill_of_materials/bill_of_materials.html b/erpnext/production/page/bill_of_materials/bill_of_materials.html deleted file mode 100644 index 55b4e70339..0000000000 --- a/erpnext/production/page/bill_of_materials/bill_of_materials.html +++ /dev/null @@ -1,44 +0,0 @@ -
-
 
- -
-
- - -
-
-
-
\ No newline at end of file diff --git a/erpnext/production/page/bill_of_materials/bill_of_materials.js b/erpnext/production/page/bill_of_materials/bill_of_materials.js deleted file mode 100644 index 7fcd6aac86..0000000000 --- a/erpnext/production/page/bill_of_materials/bill_of_materials.js +++ /dev/null @@ -1,524 +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 . - -pscript['onload_Bill of Materials'] = function() { - wn.require('lib/js/legacy/widgets/tree.js'); - - // header and toolbar - var h = new PageHeader('bom_header','Bill of Materials','BOM gives the breakdown of cost for product'); - - var dv = $a(h.toolbar_area,'div','',{margin:'4px 0px'}); - - var tbl = make_table(dv, 1,3,'480px',[],{padding:'4px', width:'160px'}); - - var sel = $a($td(tbl,0,0),'select','',{width:'160px'}); - sel.id = 'bom_item_group'; - - var sel = $a($td(tbl,0,1),'select','',{width:'160px'}); - sel.id = 'bom_item_code'; sel.innerHTML = 'Select Item Code...'; sel.disabled = 1; - - var sel = $a($td(tbl,0,2),'select','',{width:'160px'}); - sel.id = 'bom_bom_no'; sel.innerHTML = 'Select Bom No...'; sel.disabled = 1; - - h.add_button('Calculate Cost', function(){ pscript.bom_calculate_cost(pscript.bom_no); },1,'ui-icon-calculator'); - h.add_button('Refresh', function(){ pscript.bom_refresh(); },0,'ui-icon-refresh'); - h.add_button('Collapse All', function(){pscript.collapse_all();},0,''); - - // select for Item Group - //$i('bom_item_group').style.width = '180px'; - // $i('bom_item_code').style.width = '110px'; - // $i('bom_bom_no').style.width = '150px'; - $i('bom_tree').innerHTML = 'Please Select Item Group'; - add_sel_options($i('bom_item_group'), ['Loading ... ']); - - $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'get_item_group'}, function(r,rt) { - pscript.item_group = r.message.split('~~~'); - empty_select($i('bom_item_group')); -// add_sel_options($i('bom_item_group'), add_lists([' '], pscript.item_group), ' '); - add_sel_options($i('bom_item_group'), add_lists(['Select Item Group...'], pscript.item_group), 'Select Item Group...'); - $i('bom_item_group').onchange = function() { - - //$i('bom_item_code').innerHTML = ''; - // $i('bom_bom_no').innerHTML = ''; - $i('bom_head_op').innerHTML = ''; - $i('bom_head_it').innerHTML = ''; - $i('bom_tree').innerHTML = 'Please Select Item Code'; - pscript.bom_select_item_code(sel_val(this)); - } - }); -} - -pscript.bom_select_item_code = function(item_group) { - - //select for Item Code - - add_sel_options($i('bom_item_code'), ['Loading ... ']); - - $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'get_item_code', 'arg':item_group}, function(r,rt) { - pscript.item_code = r.message.split('~~~'); - empty_select($i('bom_item_code')); - add_sel_options($i('bom_item_code'), add_lists(['Select Item Code...'], pscript.item_code), 'Select Item Code...'); - if(sel_val($i('bom_item_code')) == 'Select Item Group...'){ - $i('bom_item_code').disabled = 1; - $i('bom_bom_no').disabled = 1; - } - else{ $i('bom_item_code').disabled = 0; } - - $i('bom_item_code').onchange = function() { - // $i('bom_bom_no').innerHTML = ''; - $i('bom_head_op').innerHTML = ''; - $i('bom_head_it').innerHTML = ''; - $i('bom_tree').innerHTML = 'Please Select BOM NO.'; - pscript.bom_select_bom_no(sel_val(this)); - } - }); - -} - -pscript.bom_select_bom_no = function(item_code) { - - //select for BOM NO - - add_sel_options($i('bom_bom_no'), ['Loading ... ']); - - $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'get_bom_no', 'arg':item_code}, function(r,rt) { - var bom_list = r.message.split('~~~'); - empty_select($i('bom_bom_no')); - empty_select($i('bom_bom_no')); - add_sel_options($i('bom_bom_no'), add_lists(['Select Bom No...'], bom_list), 'Select Bom No...'); - if(sel_val($i('bom_item_code')) == 'Select Item Code...'){ - $i('bom_bom_no').disabled = 1; - } - else{ - $i('bom_bom_no').disabled = 0; - } - - $i('bom_bom_no').onchange = function() { - $i('bom_head_op').innerHTML = ''; - $i('bom_head_it').innerHTML = ''; - $i('bom_tree').innerHTML = 'Loading...'; - pscript.show_bom(); } - }); -} - -// Refresh Function -pscript.bom_refresh = function() { - $i('bom_head_op').innerHTML = ''; - $i('bom_head_it').innerHTML = ''; - $i('bom_tree').innerHTML = 'Refreshing....'; - pscript.show_bom(); -} - -//Calculate Cost Function -pscript.bom_calculate_cost = function() { - $i('bom_head_op').innerHTML = ''; - $i('bom_head_it').innerHTML = ''; - $i('bom_tree').innerHTML = ' Calculating Cost...'; - $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'calculate_cost', 'arg':pscript.bom_no}, function(r,rt) { - var calculated = r.message; - if (calculated == 'calculated') {pscript.show_bom();} - else {$i('bom_tree').innerHTML = "Not available";} - }); -} - -pscript.collapse_all = function(){ - pscript.bom_tree.collapseall() -} - -pscript.show_bom = function () { - pscript.item_code = $i('bom_item_code').value; - pscript.bom_no = $i('bom_bom_no').value; - // $i('bom_refresh').innerHTML = ''; - //$i('bom_refresh').innerHTML = ""; - //$i('bom_calculate_cost').innerHTML = ""; - if (pscript.item_code == "") { - alert("Please Enter Item Code"); - return; - } - if (pscript.bom_no == "") { - alert("Please Enter BOM No"); - return; - } - $ds('bom_head_op'); - $ds('bom_head_it'); - $ds('bom_tree'); - pscript.bom_onexp = function(node) { - //alert("Server Call") - if(!node.expanded_once) { - $ds(node.loading_div); - if (!node.is_item){ - // We will get List Of Items and BOM for particular Operation - data = "{'op_no':'" + node.text[1] +"','bom_no':'" + node.text[3] +"'}"; - $c('runserverobj', args={'doctype':'BOM Control', 'docname':'BOM Control', 'method':'get_item_bom', 'arg':data}, - function(r,rt) { - $dh(node.loading_div); - var nl = r.message; - for(var i=0; i 0 && this.col_details[i][1] != 'Refresh') c.innerHTML = this.col_details[i][1]; - } - this.hopbody_label = $a(r0.cells[0], 'div'); - var hopbody_nodetab = $a(this.hopbody_label, 'table'); - $y(hopbody_nodetab, {borderCollapse:'collapse', tableLayout:'fixed'}) - - var r0 = hopbody_nodetab.insertRow(0); - var c = r0.insertCell(0); c.style.width = '16px'; - var c = r0.insertCell(1); c.style.width = '20px'; c.innerHTML = ""; - var c = r0.insertCell(2); c.style.width = '80px'; c.innerHTML = this.col_details[0][1]; - l=340-116; - var c = r0.insertCell(3); c.style.width = l+'px'; c.innerHTML = this.col_details[0][2]; - - // Item Header - this.hitbody_tab = $a(this.hitbody, 'table'); - $y(this.hitbody_tab, {borderCollapse:'collapse', tableLayout:'fixed'}) - - var r0 = this.hitbody_tab.insertRow(0); - for(var i=0; i 0 && this.col_details[i][1] != 'Refresh') c.innerHTML = this.col_details[i][2]; - } - this.hitbody_label = $a(r0.cells[0], 'div'); - var hitbody_nodetab = $a(this.hitbody_label, 'table'); - $y(hitbody_nodetab, {borderCollapse:'collapse', tableLayout:'fixed'}) - - var r0 = hitbody_nodetab.insertRow(0); - var c = r0.insertCell(0); c.style.width = '16px'; - var c = r0.insertCell(1); c.style.width = '20px'; c.innerHTML = ""; - var c = r0.insertCell(2); c.style.width = '100px'; c.innerHTML = this.col_details[0][3]; - l=350-136; - var c = r0.insertCell(3); c.style.width = l+'px'; c.innerHTML = this.col_details[0][4]; - - this.addNode = function(parent, head_op, label, imagesrc, onclick, onexpand) { - var t = new TreeNode(me, parent, head_op, label, imagesrc, onclick, onexpand); - if(!parent) { - me.nodes[label]=t; // add to roots - } else { - parent.nodes[label] = t; // add to the node - } - - this.all_nodes.push(t); - - // note: this will only be for groups - if(onexpand)t.create_expimage(); - t.expanded_once = false; - - return t; - - } - - this.deleteNode = function(node) { - node.container.remove(node); - - } - var me = this; - - this.collapseall = function() { - //alert("collapseall") - for(n in me.nodes) { - if (me.nodes[n].expimage){ - l = me.nodes[n].get_list_of_child_nodes() - for (var i=0; i < l.length; i++ ) l[i].collapse(l[i]); - } - } - } -} - -function TreeNode(tree, parent, head_op, label, imagesrc, onclick, onexpand) { - - var me = this; - this.parent = parent; - this.head = head_op; - this.nodes = {}; - this.onclick = onclick; - this.onexpand = onexpand; - this.text = label; - - if(!parent) { - var container = tree.body; - } - else { - var container = parent.body; - } - var h_container = tree.hopbody; - - var t = $a(container, "div"); - var ht = $a(h_container, "div"); - - t.style.display = "none"; - ht.style.display = "none"; - - this.node_area = $a(t, "div"); - this.node_area.style.cursor = 'pointer'; - - this.loading_div = $a(container, "div"); - this.loading_div.innerHTML = 'Loading...'; - $dh(this.loading_div); - - // main table - this.tab = $a(this.node_area, 'table'); - $y(this.tab, {borderCollapse:'collapse', tableLayout:'fixed'}) - - var r0 = this.tab.insertRow(0); - for(var i=0; i 1 && i < 6) { - var c = this.tab.rows[0].cells[i]; - c.innerHTML = label[tree.col_details[i][3]]; - } - if(this.is_item == 0 && i > 1 && tree.col_details[i][1] != 'Refresh') { - var c = this.tab.rows[0].cells[i]; - c.innerHTML = label[tree.col_details[i][3]]; - } - if(tree.col_details[i][1] == 'Refresh') { - this.refresh = $a(this.tab.rows[0].cells[i], 'span', 'link_type'); - this.refresh.onclick = function() { - me.node = me - if(me.node.expanded_once){ - me.node.body.innerHTML = ''; - me.node.expanded_once = 0 - me.expanded = 0 - me.toggle(); - } - else {me.toggle()} - } - this.refresh.innerHTML = "" - $dh(this.refresh); - } - } - - this.tab.onclick= function(e) { me.select(); } - this.tab.ondblclick = function(e) { me.select(); if(me.ondblclick)me.ondblclick(me); } - t.style.display = "block"; - ht.style.display = "block"; -} \ No newline at end of file diff --git a/erpnext/production/page/bill_of_materials/bill_of_materials.txt b/erpnext/production/page/bill_of_materials/bill_of_materials.txt deleted file mode 100644 index b66f706262..0000000000 --- a/erpnext/production/page/bill_of_materials/bill_of_materials.txt +++ /dev/null @@ -1,58 +0,0 @@ -# Page, Bill of Materials -[ - - # These values are common in all dictionaries - { - 'creation': '2010-10-12 15:19:31', - 'docstatus': 0, - 'modified': '2010-12-23 12:58:19', - 'modified_by': 'Administrator', - 'owner': 'Administrator' - }, - - # These values are common for all Page - { - 'doctype': 'Page', - 'module': 'Production', - 'name': '__common__', - 'page_name': 'Bill of Materials', - 'show_in_menu': 1, - 'standard': 'Yes' - }, - - # These values are common for all Page Role - { - 'doctype': 'Page Role', - 'name': '__common__', - 'parent': 'Bill of Materials', - 'parentfield': 'roles', - 'parenttype': 'Page' - }, - - # Page, Bill of Materials - { - 'doctype': 'Page', - 'name': 'Bill of Materials' - }, - - # Page Role - { - 'doctype': 'Page Role', - 'idx': 1, - 'role': 'Administrator' - }, - - # Page Role - { - 'doctype': 'Page Role', - 'idx': 2, - 'role': 'Production User' - }, - - # Page Role - { - 'doctype': 'Page Role', - 'idx': 3, - 'role': 'Production Manager' - } -] \ No newline at end of file diff --git a/erpnext/production/page/production_home/production_home.html b/erpnext/production/page/production_home/production_home.html index 77d80193e2..6cb2182938 100644 --- a/erpnext/production/page/production_home/production_home.html +++ b/erpnext/production/page/production_home/production_home.html @@ -34,21 +34,6 @@ -
-
Tools
- -
diff --git a/erpnext/projects/page/projects/projects.js b/erpnext/projects/page/projects/projects.js index cda9ec5643..59b039a8c3 100644 --- a/erpnext/projects/page/projects/projects.js +++ b/erpnext/projects/page/projects/projects.js @@ -74,7 +74,7 @@ GanttChart.prototype.make_date = function(label,idx) { var w = this.make_filter(label,idx); var i = $a(w, 'input'); - var user_fmt = wn.control_panel.date_format; + var user_fmt = wn.boot.sysdefaults.date_format; if(!this.user_fmt)this.user_fmt = 'dd-mm-yy'; $(i).datepicker({ diff --git a/erpnext/startup/event_handlers.py b/erpnext/startup/event_handlers.py index 27c34a1b4a..052704551c 100644 --- a/erpnext/startup/event_handlers.py +++ b/erpnext/startup/event_handlers.py @@ -83,10 +83,6 @@ def boot_session(bootinfo): bootinfo['user_background'] = webnotes.conn.get_value("Profile", webnotes.session['user'], 'background_image') or '' - import conf - bootinfo['sync_with_gateway'] = hasattr(conf, 'sync_with_gateway') and \ - cint(conf.sync_with_gateway) or 0 - def get_letter_heads(): """load letter heads with startup""" @@ -117,4 +113,4 @@ def login_as(login_manager): # throw execption webnotes.msgprint("Authentication Failed", raise_exception=1) - return login_manager \ No newline at end of file + return login_manager diff --git a/erpnext/startup/js/toolbar.js b/erpnext/startup/js/toolbar.js index eb3bff80a3..891d60f770 100644 --- a/erpnext/startup/js/toolbar.js +++ b/erpnext/startup/js/toolbar.js @@ -43,11 +43,6 @@ erpnext.toolbar.setup = function() { $('#toolbar-help').append('
  • \ Live Chat (Office Hours)
  • ') - // billing - if(pscript.is_erpnext_saas && is_system_manager) { - $('#toolbar-user').append('
  • Billing
  • ') - } - $.extend(wn.container.wntoolbar, { set_new_comments: function(new_comments) { var navbar_nc = $('.navbar-new-comments'); diff --git a/erpnext/startup/startup.js b/erpnext/startup/startup.js index 456b1cf579..442e7be090 100644 --- a/erpnext/startup/startup.js +++ b/erpnext/startup/startup.js @@ -38,9 +38,12 @@ erpnext.modules = { 'Dashboard': 'dashboard' } +// wn.modules is used in breadcrumbs for getting module home page +wn.provide('wn.modules'); +$.extend(wn.modules, erpnext.modules); +wn.modules['Core'] = 'Setup'; + erpnext.startup.set_globals = function() { - wn.control_panel.sync_with_gateway = wn.boot.sync_with_gateway - pscript.is_erpnext_saas = cint(wn.control_panel.sync_with_gateway) if(inList(user_roles,'System Manager')) is_system_manager = 1; } diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js index 559f027d21..aea22fff68 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.js +++ b/erpnext/stock/doctype/packing_slip/packing_slip.js @@ -20,9 +20,12 @@ cur_frm.fields_dict['delivery_note'].get_query = function(doc, cdt, cdn) { cur_frm.fields_dict['item_details'].grid.get_field('item_code').get_query = function(doc, cdt, cdn) { - return 'SELECT name, description FROM `tabItem` WHERE name IN ( \ + console.log(doc.delivery_note); + var query = 'SELECT name, description FROM `tabItem` WHERE name IN ( \ SELECT item_code FROM `tabDelivery Note Item` dnd \ - WHERE parent="' + doc.delivery_note + '" AND qty > packed_qty) AND %(key)s LIKE "%s" LIMIT 50'; + WHERE parent="' + doc.delivery_note + '" AND IFNULL(qty, 0) > IFNULL(packed_qty, 0)) AND %(key)s LIKE "%s" LIMIT 50'; + console.log(query); + return query; } diff --git a/js/all-app.js b/js/all-app.js index fe0efa9162..4a7cdfe797 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -486,7 +486,7 @@ wn.settings.no_history=1;var NEWLINE='\n';var profile=null;var user=null;var use * lib/js/legacy/utils/datatype.js */ wn.utils.full_name=function(fn,ln){return fn+(ln?' ':'')+(ln?ln:'')} -function fmt_money(v){if(v==null||v=='')return'0.00';v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v)){return'';}else{var cp=wn.control_panel;var val=2;if(cp.currency_format=='Millions')val=3;v=v.toFixed(2);var delimiter=",";amount=v+'';var a=amount.split('.',2) +function fmt_money(v){if(v==null||v=='')return'0.00';v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v)){return'';}else{var val=2;if(wn.boot.sysdefaults.currency_format=='Millions')val=3;v=v.toFixed(2);var delimiter=",";amount=v+'';var a=amount.split('.',2) var d=a[1];var i=parseInt(a[0]);if(isNaN(i)){return'';} var minus='';if(v<0){minus='-';} i=Math.abs(i);var n=new String(i);var a=[];if(n.length>3) @@ -1388,7 +1388,7 @@ return false;} * lib/js/wn/views/breadcrumbs.js */ wn.provide('wn.views');wn.views.breadcrumbs=function(parent,module,doctype,name){$(parent).empty();var $bspan=$(repl('\ - Home',{home_page:wn.boot.home_page}));if(module){$bspan.append(repl(' / %(module)s Home',{module:module,module_page:erpnext.modules[module]}))} + Home',{home_page:wn.boot.home_page}));if(module&&wn.modules[module]){$bspan.append(repl(' / %(module)s Home',{module:module,module_page:wn.modules[module]}))} if(doctype&&(locals.DocType[doctype]&&!locals.DocType[doctype].issingle)){$bspan.append(repl(' / %(doctype)s',{doctype:doctype}))} if(name){$bspan.append(' / '+name.bold())} $bspan.appendTo(parent);} @@ -2165,7 +2165,7 @@ wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand' * erpnext/startup/startup.js */ var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'} -erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway +wn.provide('wn.modules');$.extend(wn.modules,erpnext.modules);wn.modules['Core']='Setup';erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway) if(inList(user_roles,'System Manager'))is_system_manager=1;} erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);} diff --git a/js/all-web.js b/js/all-web.js index 1363d15949..9991b87fd7 100644 --- a/js/all-web.js +++ b/js/all-web.js @@ -373,7 +373,7 @@ wn.settings.no_history=1;var NEWLINE='\n';var profile=null;var user=null;var use * lib/js/legacy/utils/datatype.js */ wn.utils.full_name=function(fn,ln){return fn+(ln?' ':'')+(ln?ln:'')} -function fmt_money(v){if(v==null||v=='')return'0.00';v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v)){return'';}else{var cp=wn.control_panel;var val=2;if(cp.currency_format=='Millions')val=3;v=v.toFixed(2);var delimiter=",";amount=v+'';var a=amount.split('.',2) +function fmt_money(v){if(v==null||v=='')return'0.00';v=(v+'').replace(/,/g,'');v=parseFloat(v);if(isNaN(v)){return'';}else{var val=2;if(wn.boot.sysdefaults.currency_format=='Millions')val=3;v=v.toFixed(2);var delimiter=",";amount=v+'';var a=amount.split('.',2) var d=a[1];var i=parseInt(a[0]);if(isNaN(i)){return'';} var minus='';if(v<0){minus='-';} i=Math.abs(i);var n=new String(i);var a=[];if(n.length>3) @@ -864,7 +864,7 @@ wn.modules_path='erpnext';$(document).bind('toolbar_setup',function(){$('.brand' * erpnext/startup/startup.js */ var current_module;var is_system_manager=0;wn.provide('erpnext.startup');erpnext.modules={'Selling':'selling-home','Accounts':'accounts-home','Stock':'stock-home','Buying':'buying-home','Support':'support-home','Projects':'projects-home','Production':'production-home','Website':'website-home','HR':'hr-home','Setup':'Setup','Activity':'activity','To Do':'todo','Calendar':'calendar','Messages':'messages','Knowledge Base':'questions','Dashboard':'dashboard'} -erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway +wn.provide('wn.modules');$.extend(wn.modules,erpnext.modules);wn.modules['Core']='Setup';erpnext.startup.set_globals=function(){wn.control_panel.sync_with_gateway=wn.boot.sync_with_gateway pscript.is_erpnext_saas=cint(wn.control_panel.sync_with_gateway) if(inList(user_roles,'System Manager'))is_system_manager=1;} erpnext.startup.start=function(){$('#startup_div').html('Starting up...').toggle(true);erpnext.startup.set_globals();if(wn.boot.user_background){erpnext.set_user_background(wn.boot.user_background);}