From cbf181c390fbc2c70506ad11c39b28cfbc5f7c8b Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 Jun 2012 18:38:38 +0530 Subject: [PATCH 1/6] employee list -- show status --- erpnext/hr/doctype/employee/listview.js | 15 ++++++++++++--- .../support/doctype/support_ticket/listview.js | 5 +---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/erpnext/hr/doctype/employee/listview.js b/erpnext/hr/doctype/employee/listview.js index 4f92bbff29..fbd338e99a 100644 --- a/erpnext/hr/doctype/employee/listview.js +++ b/erpnext/hr/doctype/employee/listview.js @@ -12,8 +12,9 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({ "`tabEmployee`.company", "`tabEmployee`.reports_to", "`tabEmployee`.date_of_joining", + "`tabEmployee`.status", ]); - this.stats = this.stats.concat(['company']); + this.stats = this.stats.concat(['status', 'company']); }, prepare_data: function(data) { @@ -32,14 +33,22 @@ wn.doclistviews['Employee'] = wn.views.ListView.extend({ data.company && concat_list.push(data.company); data.branch && concat_list.push(data.branch); data.description = concat_list.join(", "); + + if(data.status=='Left') { + data.label_type = 'important'; + } else if(data.status=='Active') { + data.label_type = 'success'; + } + data.status_html = repl('%(status)s', data); }, columns: [ {width: '3%', content: 'check'}, - {width: '3%', content: 'docstatus'}, {width: '12%', content: 'name'}, {width: '25%', content: 'employee_name'}, - {width: '45%', content: 'description+tags', + {width: '10%', content: 'status_html'}, + {width: '38%', content: 'description+tags', css: {'color': '#aaa'}}, {width: '12%', content:'date_of_joining', css: {'text-align': 'right', 'color': '#777'}}, diff --git a/erpnext/support/doctype/support_ticket/listview.js b/erpnext/support/doctype/support_ticket/listview.js index eb0ba72551..503e2ab8ba 100644 --- a/erpnext/support/doctype/support_ticket/listview.js +++ b/erpnext/support/doctype/support_ticket/listview.js @@ -29,10 +29,7 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({ data.status = 'Waiting' } data.status_html = repl('%(status)s', data); - var a = $(data.status_html).click(function() { - me.set_filter('status', $(this).text()); - }); - + // escape double quotes data.description = cstr(data.subject).replace(/"/gi, '\"') + " | " + cstr(data.description).replace(/"/gi, '\"'); From bfd925832673f8ba506b0852a62b0a5107e60bca Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 28 Jun 2012 20:46:46 +0530 Subject: [PATCH 2/6] fix in cacheitem table --- erpnext/patches/june_2012/cache_item_table.py | 11 +++++++++++ erpnext/patches/patch_list.py | 5 +++++ 2 files changed, 16 insertions(+) create mode 100644 erpnext/patches/june_2012/cache_item_table.py diff --git a/erpnext/patches/june_2012/cache_item_table.py b/erpnext/patches/june_2012/cache_item_table.py new file mode 100644 index 0000000000..552fe7dbb4 --- /dev/null +++ b/erpnext/patches/june_2012/cache_item_table.py @@ -0,0 +1,11 @@ +def execute(): + """drop and create __CacheItem table again""" + import webnotes + webnotes.conn.commit() + webnotes.conn.sql("drop table __CacheItem") + webnotes.conn.sql("""create table __CacheItem( + `key` VARCHAR(180) NOT NULL PRIMARY KEY, + `value` LONGTEXT, + `expires_on` DATETIME + ) ENGINE=MyISAM DEFAULT CHARSET=utf8""") + webnotes.conn.begin() \ No newline at end of file diff --git a/erpnext/patches/patch_list.py b/erpnext/patches/patch_list.py index 23ce8fa227..35b59fdd33 100644 --- a/erpnext/patches/patch_list.py +++ b/erpnext/patches/patch_list.py @@ -457,4 +457,9 @@ patch_list = [ 'patch_file': 'delete_about_contact', 'description': "delete depracated doctypes of website module" }, + { + 'patch_module': 'patches.june_2012', + 'patch_file': 'cache_item_table', + 'description': "create cache item table again" + }, ] \ No newline at end of file From bd025a6cdf147577f8dc2b52825c85ea282c30df Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 29 Jun 2012 12:23:44 +0530 Subject: [PATCH 3/6] added field descriptions for packing slip --- .../doctype/packing_slip/packing_slip.js | 8 ++++++++ .../doctype/packing_slip/packing_slip.txt | 19 +++++++++++++------ 2 files changed, 21 insertions(+), 6 deletions(-) diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.js b/erpnext/stock/doctype/packing_slip/packing_slip.js index aea22fff68..d3cf9be030 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.js +++ b/erpnext/stock/doctype/packing_slip/packing_slip.js @@ -52,6 +52,14 @@ cur_frm.cscript.onload = function(doc, cdt, cdn) { } } +cur_frm.cscript.refresh = function(doc, dt, dn) { + if(!doc.amended_from) { + hide_field('misc_details'); + } else { + unhide_field('misc_details'); + } +} + cur_frm.cscript.update_item_details = function(doc) { $c_obj(make_doclist(doc.doctype, doc.name), 'update_item_details', '', function(r, rt) { diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt index e3801222b7..625aa0d906 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.txt +++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt @@ -3,9 +3,9 @@ # These values are common in all dictionaries { - 'creation': '2012-03-27 14:36:34', + 'creation': '2012-05-15 12:15:08', 'docstatus': 0, - 'modified': '2012-03-27 14:45:49', + 'modified': '2012-06-29 12:22:43', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -15,6 +15,7 @@ '_last_update': u'1328091392', 'autoname': u'PS.#######', 'colour': u'White:FFF', + 'description': u'Generate packing slips for packages to be delivered. Used to notify case/package number, package contents and its weight.', 'doctype': 'DocType', 'document_type': u'Transaction', 'is_submittable': 1, @@ -26,7 +27,7 @@ 'section_style': u'Simple', 'show_in_menu': 0, 'subject': u'[%(delivery_note)s] Case Nos: %(from_case_no)s - %(to_case_no)s | Net Weight: %(net_weight_pkg)s %(net_weight_uom)s | Gross Weight: %(gross_weight_pkg)s %(gross_weight_uom)s', - 'version': 40 + 'version': 1 }, # These values are common for all DocField @@ -140,6 +141,8 @@ # DocField { + 'colour': u'White:FFF', + 'description': u'Indicates that the package is a part of this delivery', 'doctype': u'DocField', 'fieldname': u'delivery_note', 'fieldtype': u'Link', @@ -190,10 +193,11 @@ # DocField { 'colour': u'White:FFF', + 'description': u'Identification of the package for the delivery (for print)', 'doctype': u'DocField', 'fieldname': u'from_case_no', 'fieldtype': u'Data', - 'label': u'From Case No.', + 'label': u'From Package No.', 'no_copy': 1, 'permlevel': 0, 'reqd': 1, @@ -211,10 +215,11 @@ # DocField { 'colour': u'White:FFF', + 'description': u'If more than one package of the same type (for print)', 'doctype': u'DocField', 'fieldname': u'to_case_no', 'fieldtype': u'Data', - 'label': u'To Case No.', + 'label': u'To Package No.', 'no_copy': 1, 'permlevel': 0, 'width': u'50px' @@ -251,6 +256,7 @@ # DocField { 'colour': u'White:FFF', + 'description': u'The net weight of this package. (calculated automatically as sum of net weight of items)', 'doctype': u'DocField', 'fieldname': u'net_weight_pkg', 'fieldtype': u'Currency', @@ -281,6 +287,7 @@ # DocField { 'colour': u'White:FFF', + 'description': u'The gross weight of the package. Usually net weight + packaging material weight.', 'doctype': u'DocField', 'fieldname': u'gross_weight_pkg', 'fieldtype': u'Currency', @@ -303,7 +310,7 @@ # DocField { - 'depends_on': u'eval:doc.amended_from', + 'colour': u'White:FFF', 'doctype': u'DocField', 'fieldname': u'misc_details', 'fieldtype': u'Section Break', From 08faf5bb7fdc530f6e5405d2adcec53728ea9ad3 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 29 Jun 2012 12:24:35 +0530 Subject: [PATCH 4/6] added field descriptions for packing slip --- erpnext/stock/doctype/packing_slip/packing_slip.txt | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/stock/doctype/packing_slip/packing_slip.txt b/erpnext/stock/doctype/packing_slip/packing_slip.txt index 625aa0d906..c610dadd8a 100644 --- a/erpnext/stock/doctype/packing_slip/packing_slip.txt +++ b/erpnext/stock/doctype/packing_slip/packing_slip.txt @@ -5,7 +5,7 @@ { 'creation': '2012-05-15 12:15:08', 'docstatus': 0, - 'modified': '2012-06-29 12:22:43', + 'modified': '2012-06-29 12:24:16', 'modified_by': u'Administrator', 'owner': u'Administrator' }, @@ -15,7 +15,7 @@ '_last_update': u'1328091392', 'autoname': u'PS.#######', 'colour': u'White:FFF', - 'description': u'Generate packing slips for packages to be delivered. Used to notify case/package number, package contents and its weight.', + 'description': u'Generate packing slips for packages to be delivered. Used to notify package number, package contents and its weight.', 'doctype': 'DocType', 'document_type': u'Transaction', 'is_submittable': 1, @@ -287,7 +287,7 @@ # DocField { 'colour': u'White:FFF', - 'description': u'The gross weight of the package. Usually net weight + packaging material weight.', + 'description': u'The gross weight of the package. Usually net weight + packaging material weight. (for print)', 'doctype': u'DocField', 'fieldname': u'gross_weight_pkg', 'fieldtype': u'Currency', From 351352670eec122b472ae314bfde3e097079e5d8 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 29 Jun 2012 19:03:59 +0530 Subject: [PATCH 5/6] formatted money in chart of accounts tree --- erpnext/accounts/page/accounts_browser/accounts_browser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index 3f7792029c..db08968e1f 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -102,7 +102,7 @@ erpnext.AccountsChart = Class.extend({ if (ctype == 'Account') { var bal = treenode.data && treenode.data.balance.split(' ') || ['','']; treenode.parent.append(''+ bal[0] + ' ' - + bal[1] + ''); + + fmt_money(bal[1]) + ''); } } }); From 54b72357054a72b992c6640e742487ee71730269 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Fri, 29 Jun 2012 19:07:20 +0530 Subject: [PATCH 6/6] formatted money in chart of accounts tree --- erpnext/accounts/page/accounts_browser/accounts_browser.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/erpnext/accounts/page/accounts_browser/accounts_browser.js b/erpnext/accounts/page/accounts_browser/accounts_browser.js index db08968e1f..734e4de18a 100644 --- a/erpnext/accounts/page/accounts_browser/accounts_browser.js +++ b/erpnext/accounts/page/accounts_browser/accounts_browser.js @@ -101,8 +101,11 @@ erpnext.AccountsChart = Class.extend({ onrender: function(treenode) { if (ctype == 'Account') { var bal = treenode.data && treenode.data.balance.split(' ') || ['','']; - treenode.parent.append(''+ bal[0] + ' ' - + fmt_money(bal[1]) + ''); + if (bal && flt(bal[1])) { + treenode.parent.append('\ + '+ bal[0] + ' ' + + fmt_money(bal[1]) + ''); + } } } });