Fix to floating point issue in grand total

This commit is contained in:
Anand Doshi 2012-01-13 14:35:42 +05:30
parent 7b96d1f300
commit 560883145c

View File

@ -252,7 +252,7 @@ cur_frm.cscript.calc_doc_values = function(doc, cdt, cdn, tname, fname, other_fn
//console.log("Other Charges: " + other_charges_total);
doc.net_total = net_total_incl > net_total ? flt(net_total_incl) : flt(net_total);
doc.other_charges_total = flt(other_charges_total);
doc.grand_total = flt(flt(net_total) + flt(other_charges_total));
doc.grand_total = flt((flt(net_total) + flt(other_charges_total)).toFixed(2));
doc.rounded_total = Math.round(doc.grand_total);
doc.grand_total_export = flt(flt(doc.grand_total) / flt(doc.conversion_rate));
doc.rounded_total_export = Math.round(doc.grand_total_export);