[fixes][currency symbol] fieldtype in report

This commit is contained in:
Nabin Hait 2013-05-07 12:03:33 +05:30
parent b780ef5ff3
commit 4d783036ff
3 changed files with 4 additions and 6 deletions

View file

@ -942,9 +942,9 @@ CurrencyField.prototype.get_field_currency = function() {
};
CurrencyField.prototype.get_formatted = function(val) {
if(this.not_in_form)
if(!this.doctype)
return val;
return format_currency(val, this.get_field_currency());
}
CurrencyField.prototype.set_disp = function(val) {

View file

@ -247,7 +247,8 @@ _f.Grid.prototype.set_cell_value = function(cell) {
// variations
if(cell.cellIndex) {
$(cell.div).html(wn.format(v, hc.df, {for_print:
((doc && doc.docstatus==0 && !cint(hc.df ? hc.df.read_only : 1)) ? true : false)}));
((doc && doc.docstatus==0 && !cint(hc.df ? hc.df.read_only : 1))
? true : false)}, doc));
} else {
// Index column
cell.div.style.padding = '2px';

View file

@ -127,7 +127,6 @@ $.extend(wn.meta, {
get_field_currency: function(df, doc) {
var currency = wn.boot.sysdefaults.currency;
if(!doc && cur_frm)
doc = cur_frm.doc;
@ -145,8 +144,6 @@ $.extend(wn.meta, {
}
} else if(doc && doc[df.options]) {
currency = doc[df.options];
} else if(cur_frm && cur_frm.doc[df.options]) {
currency = cur_frm.doc[df.options];
}
}
return currency;