mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-07 11:04:41 -04:00
Merge pull request #2803 from FELDSAM-INC/fix/dashboard-totals-currency-chart
Dashboard totals - fix currency in chart
This commit is contained in:
commit
46f0cd500f
@ -49,7 +49,7 @@
|
|||||||
var label = " {!! trans('texts.expenses') !!}: ";
|
var label = " {!! trans('texts.expenses') !!}: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
return label + formatMoney(item.yLabel, chartCurrencyId, account.country_id);
|
return label + formatMoney(item.yLabel, realCurrencyId, account.country_id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@ -73,7 +73,7 @@
|
|||||||
ticks: {
|
ticks: {
|
||||||
beginAtZero: true,
|
beginAtZero: true,
|
||||||
callback: function(label, index, labels) {
|
callback: function(label, index, labels) {
|
||||||
return formatMoney(label, chartCurrencyId, account.country_id);
|
return formatMoney(label, realCurrencyId, account.country_id);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
}]
|
}]
|
||||||
@ -85,6 +85,7 @@
|
|||||||
|
|
||||||
var account = {!! $account !!};
|
var account = {!! $account !!};
|
||||||
var chartGroupBy = 'day';
|
var chartGroupBy = 'day';
|
||||||
|
var realCurrencyId = {{ $account->getCurrencyId() }};
|
||||||
var chartCurrencyId = {{ $account->getCurrencyId() }};
|
var chartCurrencyId = {{ $account->getCurrencyId() }};
|
||||||
var chartQuarter = moment().quarter();
|
var chartQuarter = moment().quarter();
|
||||||
var dateRanges = {!! $account->present()->dateRangeOptions !!};
|
var dateRanges = {!! $account->present()->dateRangeOptions !!};
|
||||||
@ -161,10 +162,11 @@
|
|||||||
t.addClass("active").siblings().removeClass("active");
|
t.addClass("active").siblings().removeClass("active");
|
||||||
|
|
||||||
if(t.attr("data-button") === "totals"){
|
if(t.attr("data-button") === "totals"){
|
||||||
|
realCurrencyId = account.currency.id;
|
||||||
chartCurrencyId = 'totals';
|
chartCurrencyId = "totals";
|
||||||
}else {
|
}else {
|
||||||
chartCurrencyId = currencyMap[t.text()].id;
|
realCurrencyId = currencyMap[t.text()].id;
|
||||||
|
chartCurrencyId = realCurrencyId;
|
||||||
}
|
}
|
||||||
displayTotalsNote();
|
displayTotalsNote();
|
||||||
|
|
||||||
@ -191,10 +193,6 @@
|
|||||||
response = JSON.parse(response);
|
response = JSON.parse(response);
|
||||||
loadChart(response.data);
|
loadChart(response.data);
|
||||||
|
|
||||||
var realCurrencyId = chartCurrencyId;
|
|
||||||
if(chartCurrencyId === "totals") realCurrencyId = account.currency.id;
|
|
||||||
|
|
||||||
|
|
||||||
var totals = response.totals;
|
var totals = response.totals;
|
||||||
$('.revenue-div').text(formatMoney(totals.revenue, realCurrencyId, account.country_id));
|
$('.revenue-div').text(formatMoney(totals.revenue, realCurrencyId, account.country_id));
|
||||||
$('.outstanding-div').text(formatMoney(totals.balance, realCurrencyId, account.country_id));
|
$('.outstanding-div').text(formatMoney(totals.balance, realCurrencyId, account.country_id));
|
||||||
|
Loading…
x
Reference in New Issue
Block a user