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

This commit is contained in:
Anand Doshi 2012-03-02 17:05:33 +05:30
commit c4e2d62333
6 changed files with 63 additions and 62 deletions

View File

@ -48,12 +48,13 @@ erpnext.ActivityFeed = Class.extend({
var date = dateutil.str_to_obj(data.modified);
var last = erpnext.last_feed_date;
if((last && dateutil.get_diff(last, date)>1) || (!last)) {
var pdate = dateutil.comment_when(date);
var diff = dateutil.get_diff(new Date(), date);
if((last && dateutil.obj_to_str(last) != dateutil.obj_to_str(date)) || (!last)) {
var diff = dateutil.get_day_diff(new Date(), date);
if(diff < 1) {
pdate = 'Today';
} else if(diff > 6) {
} else if(diff < 2) {
pdate = 'Yesterday';
} else {
pdate = dateutil.global_date_format(date);
}
$(row).html(repl('<div class="date-sep">%(date)s</div>', {date: pdate}));

View File

@ -5,7 +5,7 @@
{
'creation': '2010-08-08 17:09:22',
'docstatus': 0,
'modified': '2012-03-02 15:12:45',
'modified': '2012-03-02 15:49:26',
'modified_by': u'Administrator',
'owner': u'Administrator'
},
@ -22,7 +22,7 @@
'section_style': u'Tray',
'server_code_error': u' ',
'show_in_menu': 0,
'version': 51
'version': 53
},
# These values are common for all DocField
@ -117,18 +117,15 @@
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'oldfieldname': u'ref_rate',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'permlevel': 1,
'print_hide': 1,
'reqd': 0,
'trigger': u'Client',
'width': u'70px'
'width': u'100px'
},
# DocField
@ -146,49 +143,6 @@
'width': u'70px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'label': u'Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'label': u'Amount',
'no_copy': 0,
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'reqd': 0,
'width': u'100px'
},
# DocField
{
'doctype': u'DocField',
'fieldname': u'base_ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate*',
'oldfieldname': u'base_ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 1,
'print_hide': 1,
'width': u'100px'
},
# DocField
{
'default': u'0.00',
@ -221,6 +175,52 @@
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'ref_rate',
'fieldtype': u'Currency',
'label': u'Price List Rate',
'oldfieldname': u'ref_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'print_hide': 1,
'reqd': 0,
'trigger': u'Client',
'width': u'70px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_rate',
'fieldtype': u'Currency',
'label': u'Rate',
'oldfieldname': u'export_rate',
'oldfieldtype': u'Currency',
'permlevel': 0,
'reqd': 0,
'trigger': u'Client',
'width': u'100px'
},
# DocField
{
'default': u'0.00',
'doctype': u'DocField',
'fieldname': u'export_amount',
'fieldtype': u'Currency',
'label': u'Amount',
'no_copy': 0,
'oldfieldname': u'export_amount',
'oldfieldtype': u'Currency',
'permlevel': 1,
'reqd': 0,
'width': u'100px'
},
# DocField
{
'doctype': u'DocField',

View File

@ -128,7 +128,7 @@ pscript.feature_dict = {
'Receivable Voucher': {'fields':['conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'entries':['ref_rate','export_amount','export_rate']},
'Item': {'ref_rate_details':['ref_currency']},
'Sales BOM': {'fields':['currency']},
'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['base_ref_rate','export_amount','export_rate']}
'Sales Order': {'fields':['Note1','OT Notes','conversion_rate','currency','grand_total_export','in_words_export','rounded_total_export'],'sales_order_details':['ref_rate','export_amount','export_rate']}
},
'fs_imports': {
'Payable Voucher': {'fields':['conversion_rate','currency','grand_total_import','in_words_import','net_total_import','other_charges_added_import','other_charges_deducted_import'],'entries':['import_amount','import_rate']},

File diff suppressed because one or more lines are too long

View File

@ -239,7 +239,7 @@ function same_day(d1,d2){if(d1.getFullYear()==d2.getFullYear()&&d1.getMonth()==d
var month_list=['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'];var month_last={1:31,2:28,3:31,4:30,5:31,6:30,7:31,8:31,9:30,10:31,11:30,12:31}
var month_list_full=['January','February','March','April','May','June','July','August','September','October','November','December'];var week_list=['Sun','Mon','Tue','Wed','Thu','Fri','Sat'];var week_list_full=['Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'];function int_to_str(i,len){i=''+i;if(i.length<len)for(c=0;c<(len-i.length);c++)i='0'+i;return i}
wn.datetime={str_to_obj:function(d){if(!d)return new Date();var tm=[null,null];if(d.search(' ')!=-1){var tm=d.split(' ')[1].split(':');var d=d.split(' ')[0];}
if(d.search('-')!=-1){var t=d.split('-');return new Date(t[0],t[1]-1,t[2],tm[0],tm[1]);}else if(d.search('/')!=-1){var t=d.split('/');return new Date(t[0],t[1]-1,t[2],tm[0],tm[1]);}else{return new Date();}},obj_to_str:function(d){return d.getFullYear()+'-'+int_to_str(d.getMonth()+1,2)+'-'+int_to_str(d.getDate(),2);},obj_to_user:function(d){return dateutil.str_to_user(dateutil.obj_to_str(d));},get_diff:function(d1,d2){return((d1-d2)/86400000);},add_days:function(d,days){d.setTime(d.getTime()+(days*24*60*60*1000));return d},add_months:function(d,months){dt=dateutil.str_to_obj(d)
if(d.search('-')!=-1){var t=d.split('-');return new Date(t[0],t[1]-1,t[2],tm[0],tm[1]);}else if(d.search('/')!=-1){var t=d.split('/');return new Date(t[0],t[1]-1,t[2],tm[0],tm[1]);}else{return new Date();}},obj_to_str:function(d){return d.getFullYear()+'-'+int_to_str(d.getMonth()+1,2)+'-'+int_to_str(d.getDate(),2);},obj_to_user:function(d){return dateutil.str_to_user(dateutil.obj_to_str(d));},get_diff:function(d1,d2){return((d1-d2)/86400000);},get_day_diff:function(d1,d2){return dateutil.get_diff(new Date(d1.getYear(),d1.getMonth(),d1.getDate(),0,0),new Date(d2.getYear(),d2.getMonth(),d2.getDate(),0,0))},add_days:function(d,days){d.setTime(d.getTime()+(days*24*60*60*1000));return d},add_months:function(d,months){dt=dateutil.str_to_obj(d)
new_dt=new Date(dt.getFullYear(),dt.getMonth()+months,dt.getDate())
if(new_dt.getDate()!=dt.getDate()){return dateutil.month_end(new Date(dt.getFullYear(),dt.getMonth()+months,1))}
return dateutil.obj_to_str(new_dt);},month_start:function(){var d=new Date();return d.getFullYear()+'-'+int_to_str(d.getMonth()+1,2)+'-01';},month_end:function(d){if(!d)var d=new Date();var m=d.getMonth()+1;var y=d.getFullYear();last_date=month_last[m];if(m==2&&(y%4)==0&&((y%100)!=0||(y%400)==0))

View File

@ -1 +1 @@
817
819