From d551281cbe45ace3c5eb6cb3f5070ebab2c14e05 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 16:57:08 +0530 Subject: [PATCH 1/6] cdt not defined fixed --- erpnext/accounts/doctype/payable_voucher/payable_voucher.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js index 99bd24c6b8..f8ef91ec3e 100644 --- a/erpnext/accounts/doctype/payable_voucher/payable_voucher.js +++ b/erpnext/accounts/doctype/payable_voucher/payable_voucher.js @@ -162,7 +162,7 @@ cur_frm.cscript.is_opening = function(doc, dt, dn) { // Recalculate Button // ------------------- -cur_frm.cscript['Recalculate'] = function(doc, dt, dn) { +cur_frm.cscript['Recalculate'] = function(doc, cdt, cdn) { cur_frm.cscript['Calculate Tax'](doc,cdt,cdn); calc_total_advance(doc,cdt,cdn); } From 653536596d698747578e5ca79808917e12be7a8e Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Wed, 21 Mar 2012 17:07:42 +0530 Subject: [PATCH 2/6] fax added in address display --- erpnext/utilities/transaction_base.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/utilities/transaction_base.py b/erpnext/utilities/transaction_base.py index ee23c75fc9..032b52faa6 100644 --- a/erpnext/utilities/transaction_base.py +++ b/erpnext/utilities/transaction_base.py @@ -81,12 +81,12 @@ class TransactionBase: cond = 'name="%s"' % address_name if is_shipping_address: - details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone from `tabAddress` where %s and docstatus != 2 order by is_shipping_address desc limit 1" % cond, as_dict = 1) + details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone, fax from `tabAddress` where %s and docstatus != 2 order by is_shipping_address desc limit 1" % cond, as_dict = 1) else: - details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone from `tabAddress` where %s and docstatus != 2 order by is_primary_address desc limit 1" % cond, as_dict = 1) + details = webnotes.conn.sql("select name, address_line1, address_line2, city, country, pincode, state, phone, fax from `tabAddress` where %s and docstatus != 2 order by is_primary_address desc limit 1" % cond, as_dict = 1) extract = lambda x: details and details[0] and details[0].get(x,'') or '' - address_fields = [('','address_line1'),('\n','address_line2'),('\n','city'),(' ','pincode'),('\n','state'),('\n','country'),('\nPhone: ','phone')] + address_fields = [('','address_line1'),('\n','address_line2'),('\n','city'),(' ','pincode'),('\n','state'),('\n','country'),('\nPhone: ','phone'),('\nFax: ', 'fax')] address_display = ''.join([a[0]+extract(a[1]) for a in address_fields if extract(a[1])]) if address_display.startswith('\n'): address_display = address_display[1:] From 29ed95ba22e7da8ef3b336798c99b51d228b572a Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Wed, 21 Mar 2012 18:02:17 +0530 Subject: [PATCH 3/6] simple fixes in todo --- erpnext/utilities/page/todo/todo.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js index dfaa7cdecf..0f1aa5c65d 100644 --- a/erpnext/utilities/page/todo/todo.js +++ b/erpnext/utilities/page/todo/todo.js @@ -45,10 +45,10 @@ erpnext.todo.ToDoItem = Class.extend({ 'Low':'' } todo.labelclass = label_map[todo.priority]; - todo.userdate = dateutil.str_to_user(todo.date); + todo.userdate = dateutil.str_to_user(todo.date) || ''; if(todo.reference_name && todo.reference_type) { todo.link = repl('\ - %(reference_name)s', todo); + %(reference_type)s: %(reference_name)s', todo); } else if(todo.reference_type) { todo.link = repl('\ %(reference_type)s', todo); @@ -60,7 +60,7 @@ erpnext.todo.ToDoItem = Class.extend({ %(priority)s\ %(userdate)s\ %(description)s\ - →\ + →  \ %(link)s\ ×\ ', todo)); From bad13149b23fbc4b2971928137d6bc690ebba324 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 22 Mar 2012 10:24:26 +0530 Subject: [PATCH 4/6] item query changes in stock entry --- erpnext/stock/doctype/stock_entry/stock_entry.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index 3593fa0c3c..b75538de8c 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -111,6 +111,7 @@ fld.get_query = function(doc, cdt, cdn) { +'AND ifnull(`tabBin`.`actual_qty`,0) > 0 ' +'AND tabBin.warehouse="'+ d.s_warehouse +'" ' +'AND tabItem.docstatus < 2 ' + +'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")' +'AND tabItem.%(key)s LIKE "%s" ' +'ORDER BY tabItem.name ASC ' +'LIMIT 50' @@ -118,6 +119,7 @@ fld.get_query = function(doc, cdt, cdn) { return 'SELECT tabItem.name, tabItem.description ' +'FROM tabItem ' +'WHERE tabItem.docstatus < 2 ' + +'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")' +'AND tabItem.%(key)s LIKE "%s" ' +'ORDER BY tabItem.name ASC ' +'LIMIT 50' From 2f82219fd0e7ec6962966ff102bc38b56aa80537 Mon Sep 17 00:00:00 2001 From: Nabin Hait Date: Thu, 22 Mar 2012 10:32:06 +0530 Subject: [PATCH 5/6] item query changes in stock entry --- erpnext/stock/doctype/stock_entry/stock_entry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/erpnext/stock/doctype/stock_entry/stock_entry.js b/erpnext/stock/doctype/stock_entry/stock_entry.js index b75538de8c..07e83edc14 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry.js @@ -111,7 +111,7 @@ fld.get_query = function(doc, cdt, cdn) { +'AND ifnull(`tabBin`.`actual_qty`,0) > 0 ' +'AND tabBin.warehouse="'+ d.s_warehouse +'" ' +'AND tabItem.docstatus < 2 ' - +'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")' + +'AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") ' +'AND tabItem.%(key)s LIKE "%s" ' +'ORDER BY tabItem.name ASC ' +'LIMIT 50' @@ -119,7 +119,7 @@ fld.get_query = function(doc, cdt, cdn) { return 'SELECT tabItem.name, tabItem.description ' +'FROM tabItem ' +'WHERE tabItem.docstatus < 2 ' - +'(ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00")' + +'AND (ifnull(`tabItem`.`end_of_life`,"") = "" OR `tabItem`.`end_of_life` > NOW() OR `tabItem`.`end_of_life`="0000-00-00") ' +'AND tabItem.%(key)s LIKE "%s" ' +'ORDER BY tabItem.name ASC ' +'LIMIT 50' From 06fcfdfcdebed1cd3bca1de72642f50cc612f519 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Thu, 22 Mar 2012 11:01:38 +0530 Subject: [PATCH 6/6] assign to - allow comments --- erpnext/utilities/page/todo/todo.css | 4 ++-- erpnext/utilities/page/todo/todo.js | 7 ++++++- js/all-app.js | 2 +- version.num | 2 +- 4 files changed, 10 insertions(+), 5 deletions(-) diff --git a/erpnext/utilities/page/todo/todo.css b/erpnext/utilities/page/todo/todo.css index 4ac49d621c..01a4d243a9 100644 --- a/erpnext/utilities/page/todo/todo.css +++ b/erpnext/utilities/page/todo/todo.css @@ -20,7 +20,7 @@ .todoitem .ref_link { float: left; - margin-left: 14px; + margin-left: 10px; display: inline-block; line-height: 18px; } @@ -28,4 +28,4 @@ .todoitem .description { cursor: pointer; float: left; -} \ No newline at end of file +} diff --git a/erpnext/utilities/page/todo/todo.js b/erpnext/utilities/page/todo/todo.js index 0f1aa5c65d..d9fd7a7db4 100644 --- a/erpnext/utilities/page/todo/todo.js +++ b/erpnext/utilities/page/todo/todo.js @@ -46,6 +46,11 @@ erpnext.todo.ToDoItem = Class.extend({ } todo.labelclass = label_map[todo.priority]; todo.userdate = dateutil.str_to_user(todo.date) || ''; + if(todo.assigned_by) { + todo.fullname = repl("[By %(fullname)s] ", { + fullname: wn.boot.user_info[todo.assigned_by].fullname + }) + } if(todo.reference_name && todo.reference_type) { todo.link = repl('\ %(reference_type)s: %(reference_name)s', todo); @@ -59,7 +64,7 @@ erpnext.todo.ToDoItem = Class.extend({ \ %(priority)s\ %(userdate)s\ - %(description)s\ + %(fullname)s%(description)s\ →  \ %(link)s\ ×\ diff --git a/js/all-app.js b/js/all-app.js index abb3c085aa..6987da6e57 100644 --- a/js/all-app.js +++ b/js/all-app.js @@ -2170,7 +2170,7 @@ wn.widgets.form.sidebar.AssignTo=Class.extend({init:function(parent,sidebar,doct this.refresh();},refresh:function(){var me=this;$c('webnotes.widgets.form.assign_to.get',{doctype:me.doctype,name:me.name},function(r,rt){me.render(r.message)})},render:function(d){var me=this;$(this.body).empty();if(this.dialog){this.dialog.hide();} for(var i=0;i%(owner)s \ ×',d[i]))} -$(this.body).find('a.close').click(function(){$c('webnotes.widgets.form.assign_to.remove',{doctype:me.doctype,name:me.name,assign_to:$(this).attr('data-owner')},function(r,rt){me.render(r.message);});return false;});},add:function(){var me=this;if(!me.dialog){me.dialog=new wn.widgets.Dialog({title:'Add to To Do',width:350,fields:[{fieldtype:'Link',fieldname:'assign_to',options:'Profile',label:'Assign To',description:'Add to To Do List of',reqd:true},{fieldtype:'Data',fieldname:'description',label:'Comment','default':'Assigned by '+user},{fieldtype:'Date',fieldname:'date',label:'Complete By'},{fieldtype:'Select',fieldname:'priority',label:'Priority',options:'Low\nMedium\nHigh','default':'Medium'},{fieldtype:'Check',fieldname:'notify',label:'Notify By Email'},{fieldtype:'Button',label:'Add',fieldname:'add_btn'}]});me.dialog.fields_dict.add_btn.input.onclick=function(){var assign_to=me.dialog.fields_dict.assign_to.get_value();if(assign_to){$c('webnotes.widgets.form.assign_to.add',{doctype:me.doctype,name:me.name,assign_to:assign_to,description:me.dialog.fields_dict.description.get_value(),priority:me.dialog.fields_dict.priority.get_value(),date:me.dialog.fields_dict.date.get_value(),notify:me.dialog.fields_dict.notify.get_value()},function(r,rt){me.render(r.message);});}}} +$(this.body).find('a.close').click(function(){$c('webnotes.widgets.form.assign_to.remove',{doctype:me.doctype,name:me.name,assign_to:$(this).attr('data-owner')},function(r,rt){me.render(r.message);});return false;});},add:function(){var me=this;if(!me.dialog){me.dialog=new wn.widgets.Dialog({title:'Add to To Do',width:350,fields:[{fieldtype:'Link',fieldname:'assign_to',options:'Profile',label:'Assign To',description:'Add to To Do List of',reqd:true},{fieldtype:'Data',fieldname:'description',label:'Comment'},{fieldtype:'Date',fieldname:'date',label:'Complete By'},{fieldtype:'Select',fieldname:'priority',label:'Priority',options:'Low\nMedium\nHigh','default':'Medium'},{fieldtype:'Check',fieldname:'notify',label:'Notify By Email'},{fieldtype:'Button',label:'Add',fieldname:'add_btn'}]});me.dialog.fields_dict.add_btn.input.onclick=function(){var assign_to=me.dialog.fields_dict.assign_to.get_value();if(assign_to){$c('webnotes.widgets.form.assign_to.add',{doctype:me.doctype,name:me.name,assign_to:assign_to,description:me.dialog.fields_dict.description.get_value(),priority:me.dialog.fields_dict.priority.get_value(),date:me.dialog.fields_dict.date.get_value(),notify:me.dialog.fields_dict.notify.get_value()},function(r,rt){me.render(r.message);});}}} me.dialog.clear();me.dialog.show();}}); /* * lib/js/legacy/app.js diff --git a/version.num b/version.num index f08bce7b1c..3f986b9191 100644 --- a/version.num +++ b/version.num @@ -1 +1 @@ -841 \ No newline at end of file +842 \ No newline at end of file