Use format_currency only if fieldtype is currency

This commit is contained in:
Nabin Hait 2017-10-05 15:28:43 +05:30
parent f8ad0cbe70
commit 34ad2e6a60

View File

@ -12,21 +12,21 @@
{% } %} {% } %}
</tr> </tr>
</thead> </thead>
<tbody> <tbody>
{% for(var j=0, k=data.length; j<k; j++) { %} {% for(var j=0, k=data.length; j<k; j++) { %}
{% {%
var row = data[j]; var row = data[j];
%} %}
<tr> <tr>
{% for(var i=1, l=report.columns.length; i<l; i++) { %} {% for(var i=1, l=report.columns.length; i<l; i++) { %}
<td class="text-right"> <td class="text-right">
{% var fieldname = report.columns[i].field; %} {% var fieldname = report.columns[i].field; %}
{% if (!isNaN(row[fieldname])) { %} {% if (report.columns[i].fieldtype=='Currency' && !isNaN(row[fieldname])) { %}
{%= format_currency(row[fieldname]) %} {%= format_currency(row[fieldname]) %}
{% } else { %} {% } else { %}
{% if (!is_null(row[fieldname])) { %} {% if (!is_null(row[fieldname])) { %}
{%= row[fieldname] %} {%= row[fieldname] %}
{% } %} {% } %}
{% } %} {% } %}
</td> </td>
{% } %} {% } %}