mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 19:14:40 -04:00
Fix amount formatting #1356
This commit is contained in:
parent
d42fe69238
commit
dba28c0ead
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@ -462,7 +462,7 @@ NINJA.invoiceLines = function(invoice) {
|
||||
}
|
||||
if (!hideQuantity) {
|
||||
row.push({style:["cost", rowStyle], text:cost});
|
||||
row.push({style:["quantity", rowStyle], text:qty || ' '});
|
||||
row.push({style:["quantity", rowStyle], text:formatAmount(qty, invoice.client.currency_id) || ' '});
|
||||
}
|
||||
if (showItemTaxes) {
|
||||
var str = ' ';
|
||||
|
@ -63,6 +63,24 @@
|
||||
return formatMoney(value, currencyId, countryId, decorator)
|
||||
}
|
||||
|
||||
function formatAmount(value, currencyId) {
|
||||
|
||||
if (!currencyId) {
|
||||
currencyId = {{ Session::get(SESSION_CURRENCY, DEFAULT_CURRENCY) }};
|
||||
}
|
||||
|
||||
var currency = currencyMap[currencyId];
|
||||
var decimal = currency.decimal_separator;
|
||||
|
||||
value = NINJA.parseFloat(value) + '';
|
||||
|
||||
if (decimal == '.') {
|
||||
return value;
|
||||
} else {
|
||||
return value.replace('.', decimal);
|
||||
}
|
||||
}
|
||||
|
||||
function formatMoney(value, currencyId, countryId, decorator) {
|
||||
value = NINJA.parseFloat(value);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user