mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-02-25 18:45:27 -06:00
Some charts will render correctly #1000
This commit is contained in:
parent
0812901745
commit
64fc6b6523
@ -92,20 +92,30 @@ class JavascriptController extends Controller
|
|||||||
*
|
*
|
||||||
* @return \Illuminate\Http\Response
|
* @return \Illuminate\Http\Response
|
||||||
*/
|
*/
|
||||||
public function variables(Request $request)
|
public function variables(Request $request, AccountRepositoryInterface $repository, CurrencyRepositoryInterface $currencyRepository)
|
||||||
{
|
{
|
||||||
|
$account = $repository->find(intval($request->get('account')));
|
||||||
|
$currencyId = 0;
|
||||||
|
if (null !== $account) {
|
||||||
|
$currencyId = intval($account->getMeta('currency_id'));
|
||||||
|
}
|
||||||
|
/** @var TransactionCurrency $currency */
|
||||||
|
$currency = $currencyRepository->find($currencyId);
|
||||||
|
if (0 === $currencyId) {
|
||||||
|
$currency = app('amount')->getDefaultCurrency();
|
||||||
|
}
|
||||||
|
|
||||||
$localeconv = localeconv();
|
$localeconv = localeconv();
|
||||||
$accounting = app('amount')->getJsConfig($localeconv);
|
$accounting = app('amount')->getJsConfig($localeconv);
|
||||||
$localeconv = localeconv();
|
$localeconv = localeconv();
|
||||||
$defaultCurrency = app('amount')->getDefaultCurrency();
|
$localeconv['frac_digits'] = $currency->decimal_places;
|
||||||
$localeconv['frac_digits'] = $defaultCurrency->decimal_places;
|
|
||||||
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
$pref = Preferences::get('language', config('firefly.default_language', 'en_US'));
|
||||||
$lang = $pref->data;
|
$lang = $pref->data;
|
||||||
$dateRange = $this->getDateRangeConfig();
|
$dateRange = $this->getDateRangeConfig();
|
||||||
|
|
||||||
$data = [
|
$data = [
|
||||||
'currencyCode' => app('amount')->getCurrencyCode(),
|
'currencyCode' => $currency->code,
|
||||||
'currencySymbol' => app('amount')->getCurrencySymbol(),
|
'currencySymbol' => $currency->symbol,
|
||||||
'accounting' => $accounting,
|
'accounting' => $accounting,
|
||||||
'localeconv' => $localeconv,
|
'localeconv' => $localeconv,
|
||||||
'language' => $lang,
|
'language' => $lang,
|
||||||
|
@ -185,7 +185,7 @@
|
|||||||
<script src="js/lib/daterangepicker.js?v={{ FF_VERSION }}" type="text/javascript"></script>
|
<script src="js/lib/daterangepicker.js?v={{ FF_VERSION }}" type="text/javascript"></script>
|
||||||
<script src="lib/adminlte/js/app.min.js?v={{ FF_VERSION }}" type="text/javascript"></script>
|
<script src="lib/adminlte/js/app.min.js?v={{ FF_VERSION }}" type="text/javascript"></script>
|
||||||
<script type="text/javascript" src="js/lib/accounting.min.js?v={{ FF_VERSION }}"></script>
|
<script type="text/javascript" src="js/lib/accounting.min.js?v={{ FF_VERSION }}"></script>
|
||||||
<script src="{{ route('javascript.variables') }}?ext=.js&v={{ FF_VERSION }}" type="text/javascript"></script>
|
<script src="{{ route('javascript.variables') }}?ext=.js&v={{ FF_VERSION }}{% if account %}&account={{ account.id }}{% endif %}" type="text/javascript"></script>
|
||||||
<script type="text/javascript" src="js/ff/firefly.js?v={{ FF_VERSION }}"></script>
|
<script type="text/javascript" src="js/ff/firefly.js?v={{ FF_VERSION }}"></script>
|
||||||
<script type="text/javascript" src="js/ff/help.js?v={{ FF_VERSION }}"></script>
|
<script type="text/javascript" src="js/ff/help.js?v={{ FF_VERSION }}"></script>
|
||||||
{% if not shownDemo %}
|
{% if not shownDemo %}
|
||||||
|
Loading…
Reference in New Issue
Block a user