Merge branch 'master' of github.com:webnotes/erpnext into unicode

This commit is contained in:
Anand Doshi 2012-09-06 07:55:19 +05:30
commit f03e3bb06b
15 changed files with 91 additions and 20 deletions

View File

@ -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"}
],
});

View File

@ -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"},
]
});

View File

@ -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"}
]
});

View File

@ -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"}
]
});

View File

@ -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"}
]
});

View File

@ -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"}
]
});

View File

@ -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

View File

@ -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"}
]
})

View File

@ -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"}
]
});

View File

@ -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"}
]
});

View File

@ -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'],

View File

@ -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"}
]
});

View File

@ -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("<a href=\"#Form/Purchase Order/%(name)s\">%(name)s</a>",
{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"}
]
});

View File

@ -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"}
]
});

View File

@ -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('<a href="#!Form/'+opts.doctype+'/'
+data[opts.content]+'">'+data[opts.content]+'</a>',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('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').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('<span title="%(title)s"> %(content)s</span>',{"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('<td style="width: %(width)s"></td>',v);});var tr=$(row).html('<table><tbody><tr>'+rowhtml+'</tr></tbody></table>').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('<br />');}