mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-06-23 20:00:33 -04:00
Fix for data viz
This commit is contained in:
parent
33e430a4d2
commit
e59a547d3d
@ -125,6 +125,7 @@
|
|||||||
if (currencyId != accountCurrencyId) {
|
if (currencyId != accountCurrencyId) {
|
||||||
total = convertCurrency(total, currencyId, accountCurrencyId);
|
total = convertCurrency(total, currencyId, accountCurrencyId);
|
||||||
}
|
}
|
||||||
|
if (total > 0) {
|
||||||
client.convertedTotal = total;
|
client.convertedTotal = total;
|
||||||
client.displayName = getClientDisplayName(client);
|
client.displayName = getClientDisplayName(client);
|
||||||
client.displayBalance = +client.balance;
|
client.displayBalance = +client.balance;
|
||||||
@ -132,6 +133,7 @@
|
|||||||
var oldestInvoice = _.max(client.invoices, function(invoice) { return calculateInvoiceAge(invoice) });
|
var oldestInvoice = _.max(client.invoices, function(invoice) { return calculateInvoiceAge(invoice) });
|
||||||
client.displayAge = oldestInvoice ? calculateInvoiceAge(oldestInvoice) : -1;
|
client.displayAge = oldestInvoice ? calculateInvoiceAge(oldestInvoice) : -1;
|
||||||
client.currencyId = currencyId;
|
client.currencyId = currencyId;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each(invoices, function(invoice) {
|
_.each(invoices, function(invoice) {
|
||||||
@ -141,12 +143,14 @@
|
|||||||
if (currencyId != accountCurrencyId) {
|
if (currencyId != accountCurrencyId) {
|
||||||
total = convertCurrency(total, currencyId, accountCurrencyId);
|
total = convertCurrency(total, currencyId, accountCurrencyId);
|
||||||
}
|
}
|
||||||
|
if (total > 0) {
|
||||||
invoice.convertedTotal = total;
|
invoice.convertedTotal = total;
|
||||||
invoice.displayName = invoice.invoice_number;
|
invoice.displayName = invoice.invoice_number;
|
||||||
invoice.displayBalance = +invoice.balance;
|
invoice.displayBalance = +invoice.balance;
|
||||||
invoice.displayPercent = (+invoice.amount - +invoice.balance) / +invoice.amount;
|
invoice.displayPercent = (+invoice.amount - +invoice.balance) / +invoice.amount;
|
||||||
invoice.displayAge = calculateInvoiceAge(invoice);
|
invoice.displayAge = calculateInvoiceAge(invoice);
|
||||||
invoice.currencyId = currencyId;
|
invoice.currencyId = currencyId;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
_.each(products, function(product) {
|
_.each(products, function(product) {
|
||||||
@ -156,12 +160,14 @@
|
|||||||
if (currencyId != accountCurrencyId) {
|
if (currencyId != accountCurrencyId) {
|
||||||
total = convertCurrency(total, currencyId, accountCurrencyId);
|
total = convertCurrency(total, currencyId, accountCurrencyId);
|
||||||
}
|
}
|
||||||
|
if (total > 0) {
|
||||||
product.convertedTotal = total;
|
product.convertedTotal = total;
|
||||||
product.displayName = product.key;
|
product.displayName = product.key;
|
||||||
product.displayBalance = product.values.amount - product.values.paid;
|
product.displayBalance = product.values.amount - product.values.paid;
|
||||||
product.displayPercent = (product.values.paid / product.values.amount).toFixed(2);
|
product.displayPercent = (product.values.paid / product.values.amount).toFixed(2);
|
||||||
product.displayAge = product.values.age;
|
product.displayAge = product.values.age;
|
||||||
product.currencyId = currencyId;
|
product.currencyId = currencyId;
|
||||||
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
//console.log(JSON.stringify(clients));
|
//console.log(JSON.stringify(clients));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user