diff --git a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js b/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js index 129f3cdc91..e31cee8130 100644 --- a/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js +++ b/erpnext/accounts/doctype/journal_voucher/journal_voucher_list.js @@ -6,6 +6,7 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ '`tabJournal Voucher`.remark', '`tabJournal Voucher`.total_debit', '`tabJournal Voucher`.company', + "`tabJournal Voucher`.posting_date", ]); this.stats = this.stats.concat(['voucher_type', 'company']); }, @@ -31,6 +32,8 @@ wn.doclistviews['Journal Voucher'] = wn.views.ListView.extend({ }, css: {'text-align':'right'} }, - {width: '12%', content: 'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Journal Voucher Date", type: "date"} ], }); \ No newline at end of file diff --git a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js index c0c6625cf8..f9dd4cde9e 100644 --- a/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js +++ b/erpnext/accounts/doctype/purchase_invoice/purchase_invoice_list.js @@ -9,6 +9,7 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ 'IFNULL(`tabPurchase Invoice`.grand_total_import, 0) as grand_total_import', 'IFNULL(`tabPurchase Invoice`.grand_total, 0) as grand_total', 'IFNULL(`tabPurchase Invoice`.outstanding_amount, 0) as outstanding_amount', + "`tabPurchase Invoice`.posting_date" ]); this.stats = this.stats.concat(['company']); }, @@ -40,8 +41,8 @@ wn.doclistviews['Purchase Invoice'] = wn.views.ListView.extend({ css: {'text-align':'right'} }, {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, - {width: '12%', content:'modified', css: { - 'text-align': 'right', 'color':'#777' - }}, + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Purchase Invoice Date", type: "date"}, ] }); diff --git a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js index ae923f4859..1c3b2d38ce 100644 --- a/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js +++ b/erpnext/accounts/doctype/sales_invoice/sales_invoice_list.js @@ -8,7 +8,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ "ifnull(`tabSales Invoice`.outstanding_amount,0) as outstanding_amount", "ifnull(`tabSales Invoice`.grand_total,0) as grand_total", "`tabSales Invoice`.currency", - "ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export" + "ifnull(`tabSales Invoice`.grand_total_export,0) as grand_total_export", + "`tabSales Invoice`.posting_date", ]); }, prepare_data: function(data) { @@ -35,6 +36,8 @@ wn.doclistviews['Sales Invoice'] = wn.views.ListView.extend({ css: {'text-align':'right'} }, {width: '10%', content: 'paid', type:'bar-graph', label:'Paid'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Sales Invoice Date", type: "date"} ] }); diff --git a/erpnext/buying/doctype/purchase_order/purchase_order_list.js b/erpnext/buying/doctype/purchase_order/purchase_order_list.js index 0f90e12193..69f97f5aa3 100644 --- a/erpnext/buying/doctype/purchase_order/purchase_order_list.js +++ b/erpnext/buying/doctype/purchase_order/purchase_order_list.js @@ -7,7 +7,9 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({ "ifnull(`tabPurchase Order`.per_received,0) as per_received", "ifnull(`tabPurchase Order`.per_billed,0) as per_billed", "`tabPurchase Order`.currency", - "ifnull(`tabPurchase Order`.grand_total_import,0) as grand_total_import" + "ifnull(`tabPurchase Order`.grand_total_import,0) as grand_total_import", + "`tabPurchase Order`.transaction_date", + ]); this.stats = this.stats.concat(['status', 'company']); }, @@ -27,7 +29,9 @@ wn.doclistviews['Purchase Order'] = wn.views.ListView.extend({ }, {width: '8%', content: 'per_received', type:'bar-graph', label:'Delivered'}, {width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Purchase Order Date", type: "date"} ] }); diff --git a/erpnext/buying/doctype/purchase_request/purchase_request_list.js b/erpnext/buying/doctype/purchase_request/purchase_request_list.js index e4266c7606..967c2d4a8c 100644 --- a/erpnext/buying/doctype/purchase_request/purchase_request_list.js +++ b/erpnext/buying/doctype/purchase_request/purchase_request_list.js @@ -6,6 +6,7 @@ wn.doclistviews['Purchase Request'] = wn.views.ListView.extend({ "`tabPurchase Request`.status", "IFNULL(`tabPurchase Request`.per_ordered, 0) as per_ordered", "`tabPurchase Request`.remark", + "`tabPurchase Request`.transaction_date", ]); this.stats = this.stats.concat(['status', 'company']); }, @@ -28,7 +29,9 @@ wn.doclistviews['Purchase Request'] = wn.views.ListView.extend({ {width: '17%', content:'name'}, {width: '50%', content:'status_html+remark+tags', css: {'color': '#222'}}, {width: '10%', content: 'per_ordered', type:'bar-graph', label:'Ordered'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Quotation Date", type: "date"} ] }); diff --git a/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js new file mode 100644 index 0000000000..60b1f5285d --- /dev/null +++ b/erpnext/buying/doctype/supplier_quotation/supplier_quotation_list.js @@ -0,0 +1,33 @@ +// render +wn.doclistviews['Supplier Quotation'] = wn.views.ListView.extend({ + init: function(d) { + this._super(d) + this.fields = this.fields.concat([ + "`tabSupplier Quotation`.supplier_name", + "`tabSupplier Quotation`.currency", + "ifnull(`tabSupplier Quotation`.grand_total_import,0) as grand_total_import", + "`tabSupplier Quotation`.transaction_date", + ]); + this.stats = this.stats.concat(['status', 'company']); + }, + + columns: [ + {width: '3%', content: 'check'}, + {width: '5%', content:'avatar'}, + {width: '3%', content:'docstatus'}, + {width: '15%', content:'name'}, + {width: '44%', content:'supplier_name+tags', css: {color:'#222'}}, + { + width: '18%', + content: function(parent, data) { + $(parent).html(data.currency + ' ' + fmt_money(data.grand_total_import)) + }, + css: {'text-align':'right'} + }, + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Supplier Quotation Date", type: "date"} + ] + +}); + diff --git a/erpnext/patches/july_2012/repost_stock_due_to_wrong_packing_list.py b/erpnext/patches/july_2012/repost_stock_due_to_wrong_packing_list.py index b552021cc4..40e081c9f7 100644 --- a/erpnext/patches/july_2012/repost_stock_due_to_wrong_packing_list.py +++ b/erpnext/patches/july_2012/repost_stock_due_to_wrong_packing_list.py @@ -11,8 +11,10 @@ def execute(): pass webnotes.conn.begin() + webnotes.conn.auto_commit_on_many_writes = 1 repost_reserved_qty() cleanup_wrong_sle() + webnotes.conn.auto_commit_on_many_writes = 0 def repost_reserved_qty(): from webnotes.utils import flt diff --git a/erpnext/selling/doctype/opportunity/opportunity_list.js b/erpnext/selling/doctype/opportunity/opportunity_list.js index a661d813f5..949422e03b 100644 --- a/erpnext/selling/doctype/opportunity/opportunity_list.js +++ b/erpnext/selling/doctype/opportunity/opportunity_list.js @@ -6,6 +6,7 @@ wn.doclistviews['Opportunity'] = wn.views.ListView.extend({ 'tabOpportunity.lead_name', 'tabOpportunity.customer_name', 'tabOpportunity.status', + 'tabOpportunity.transaction_date', ]); this.stats = this.stats.concat(['status', 'source', 'enquiry_from', 'company']); }, @@ -33,6 +34,8 @@ wn.doclistviews['Opportunity'] = wn.views.ListView.extend({ {width: '15%', content:'name'}, {width: '18%', content:'status_html'}, {width: '52%', content:'enquiry_name+tags', css: {color:'#222'}}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Opportunity Date", type: "date"} ] }) diff --git a/erpnext/selling/doctype/quotation/quotation_list.js b/erpnext/selling/doctype/quotation/quotation_list.js index d1fad5aa82..8530629a13 100644 --- a/erpnext/selling/doctype/quotation/quotation_list.js +++ b/erpnext/selling/doctype/quotation/quotation_list.js @@ -7,7 +7,8 @@ wn.doclistviews['Quotation'] = wn.views.ListView.extend({ "`tabQuotation`.lead_name", "`tabQuotation`.customer_name", "`tabQuotation`.currency", - "ifnull(`tabQuotation`.grand_total_export,0) as grand_total_export" + "ifnull(`tabQuotation`.grand_total_export,0) as grand_total_export", + "`tabQuotation`.transaction_date", ]); this.stats = this.stats.concat(['status', 'quotation_to', 'company']); }, @@ -34,7 +35,9 @@ wn.doclistviews['Quotation'] = wn.views.ListView.extend({ }, css: {'text-align':'right'} }, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Quotation Date", type: "date"} ] }); diff --git a/erpnext/selling/doctype/sales_order/sales_order_list.js b/erpnext/selling/doctype/sales_order/sales_order_list.js index c15944b0a4..a386f3537e 100644 --- a/erpnext/selling/doctype/sales_order/sales_order_list.js +++ b/erpnext/selling/doctype/sales_order/sales_order_list.js @@ -9,7 +9,8 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ "ifnull(`tabSales Order`.per_delivered,0) as per_delivered", "ifnull(`tabSales Order`.per_billed,0) as per_billed", "`tabSales Order`.currency", - "ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export" + "ifnull(`tabSales Order`.grand_total_export,0) as grand_total_export", + "`tabSales Order`.transaction_date", ]); this.stats = this.stats.concat(['status', 'order_type', 'company']); }, @@ -41,7 +42,9 @@ wn.doclistviews['Sales Order'] = wn.views.ListView.extend({ }, }, {width: '8%', content: 'per_billed', type:'bar-graph', label:'Billed'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'transaction_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Sales Order Date", type: "date"} ] }); diff --git a/erpnext/setup/doctype/notification_control/notification_control.js b/erpnext/setup/doctype/notification_control/notification_control.js index 0ac33a1380..b52520a5a7 100644 --- a/erpnext/setup/doctype/notification_control/notification_control.js +++ b/erpnext/setup/doctype/notification_control/notification_control.js @@ -26,6 +26,7 @@ cur_frm.cscript.select_transaction = function(doc, cdt, cdn) { } cur_frm.cscript.notify = function(doc, args) { + var doc = locals[doc.doctype][doc.name]; $c_obj(make_doclist(doc.doctype, doc.name), 'get_formatted_message', { type: args['type'], doctype: args['doctype'], diff --git a/erpnext/stock/doctype/delivery_note/delivery_note_list.js b/erpnext/stock/doctype/delivery_note/delivery_note_list.js index e65d75a0e7..9c94fdbb25 100644 --- a/erpnext/stock/doctype/delivery_note/delivery_note_list.js +++ b/erpnext/stock/doctype/delivery_note/delivery_note_list.js @@ -4,7 +4,8 @@ wn.doclistviews['Delivery Note'] = wn.views.ListView.extend({ this._super(d); this.fields = this.fields.concat([ "`tabDelivery Note`.customer_name", - "`tabDelivery Note`.sales_order_no" + "`tabDelivery Note`.sales_order_no", + "`tabDelivery Note`.posting_date", ]); }, columns: [ @@ -14,6 +15,8 @@ wn.doclistviews['Delivery Note'] = wn.views.ListView.extend({ {width: '15%', content:'name'}, {width: '47%', content:'customer_name+tags', css: {color:'#222'}}, {width: '15%', content:'sales_order_no', type:'link', doctype:'Sales Order'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Delivery Note Date", type: "date"} ] }); diff --git a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js index ae42eac07d..e04ef7e7db 100644 --- a/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js +++ b/erpnext/stock/doctype/purchase_receipt/purchase_receipt_list.js @@ -5,6 +5,7 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({ this.fields = this.fields.concat([ "`tabPurchase Receipt`.supplier_name", "group_concat(`tabPurchase Receipt Item`.prevdoc_docname) as purchase_order_no", + "`tabPurchase Receipt`.posting_date", ]); this.group_by = "`tabPurchase Receipt`.name"; }, @@ -14,7 +15,9 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({ data.purchase_order_no = data.purchase_order_no.split(","); var po_list = []; $.each(data.purchase_order_no, function(i, v){ - if(po_list.indexOf(v)==-1) po_list.push(v); + if(po_list.indexOf(v)==-1) po_list.push( + repl("%(name)s", + {name: v})); }); data.purchase_order_no = po_list.join(", "); } @@ -26,6 +29,8 @@ wn.doclistviews['Purchase Receipt'] = wn.views.ListView.extend({ {width: '15%', content:'name'}, {width: '32%', content:'supplier_name+tags', css: {color:'#222'}}, {width: '30%', content:'purchase_order_no'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Purhcase Receipt Date", type: "date"} ] }); diff --git a/erpnext/stock/doctype/stock_entry/stock_entry_list.js b/erpnext/stock/doctype/stock_entry/stock_entry_list.js index 90f43a79da..60526cb719 100644 --- a/erpnext/stock/doctype/stock_entry/stock_entry_list.js +++ b/erpnext/stock/doctype/stock_entry/stock_entry_list.js @@ -6,6 +6,7 @@ wn.doclistviews['Stock Entry'] = wn.views.ListView.extend({ "`tabStock Entry`.purpose", "`tabStock Entry`.from_warehouse", "`tabStock Entry`.to_warehouse", + "`tabStock Entry`.posting_date", ]); }, columns: [ @@ -16,6 +17,8 @@ wn.doclistviews['Stock Entry'] = wn.views.ListView.extend({ {width: '15%', content:'purpose+tags', css: {color:'#222'}}, {width: '18%', content:'from_warehouse', template: 'From %(from_warehouse)s'}, {width: '18%', content:'to_warehouse', template: 'To %(to_warehouse)s'}, - {width: '12%', content:'modified', css: {'text-align': 'right', 'color':'#777'}} + {width: '12%', content:'posting_date', + css: {'text-align': 'right', 'color':'#777'}, + title: "Stock Entry Date", type: "date"} ] }); diff --git a/public/js/all-app.js b/public/js/all-app.js index 92ad1937c0..e5fb717dd8 100644 --- a/public/js/all-app.js +++ b/public/js/all-app.js @@ -1014,7 +1014,8 @@ else if(opts.type=='bar-graph'){this.render_bar_graph(parent,data,opts.content,o else if(opts.type=='link'&&opts.doctype){$(parent).append(repl(''+data[opts.content]+'',data));} else if(opts.template){$(parent).append(repl(opts.template,data));} -else if(data[opts.content]){$(parent).append(' '+data[opts.content]);}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('',v);});var tr=$(row).html(''+rowhtml+'
').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;this.prepare_when(data,data.modified);if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';} +else if(data[opts.content]){if(opts.type=="date"){data[opts.content]=wn.datetime.str_to_user(data[opts.content])} +$(parent).append(repl(' %(content)s',{"title":opts.title||opts.content,"content":data[opts.content]}));}},render:function(row,data){var me=this;this.prepare_data(data);rowhtml='';$.each(this.columns,function(i,v){rowhtml+=repl('',v);});var tr=$(row).html(''+rowhtml+'
').find('tr').get(0);$.each(this.columns,function(i,v){me.render_column(data,tr.cells[i],v);});},prepare_data:function(data){data.fullname=wn.user_info(data.owner).fullname;data.avatar=wn.user_info(data.owner).image;this.prepare_when(data,data.modified);if(data.docstatus==0||data.docstatus==null){data.docstatus_icon='icon-pencil';data.docstatus_title='Editable';}else if(data.docstatus==1){data.docstatus_icon='icon-lock';data.docstatus_title='Submitted';}else if(data.docstatus==2){data.docstatus_icon='icon-remove';data.docstatus_title='Cancelled';} for(key in data){if(data[key]==null){data[key]='';}}},prepare_when:function(data,date_str){if(!date_str)date_str=data.modified;data.when=dateutil.str_to_user(date_str).split(' ')[0];var diff=dateutil.get_diff(dateutil.get_today(),date_str.split(' ')[0]);if(diff==0){data.when=dateutil.comment_when(date_str);} if(diff==1){data.when='Yesterday'} if(diff==2){data.when='2 days ago'}},add_user_tags:function(parent,data){var me=this;if(data._user_tags){if($(parent).html().length>0){$(parent).append('
');}