mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-26 19:00:22 -06:00
Fix #6556
This commit is contained in:
parent
abdb717b37
commit
2f66315416
@ -31,7 +31,6 @@ use FireflyIII\Repositories\Bill\BillRepositoryInterface;
|
|||||||
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
use FireflyIII\Repositories\Currency\CurrencyRepositoryInterface;
|
||||||
use FireflyIII\Support\CacheProperties;
|
use FireflyIII\Support\CacheProperties;
|
||||||
use Illuminate\Http\JsonResponse;
|
use Illuminate\Http\JsonResponse;
|
||||||
use JsonException;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class BillController.
|
* Class BillController.
|
||||||
@ -142,7 +141,7 @@ class BillController extends Controller
|
|||||||
['type' => 'bar', 'label' => (string) trans('firefly.journal-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
['type' => 'bar', 'label' => (string) trans('firefly.journal-amount'), 'currency_symbol' => $bill->transactionCurrency->symbol,
|
||||||
'currency_code' => $bill->transactionCurrency->code, 'entries' => []],
|
'currency_code' => $bill->transactionCurrency->code, 'entries' => []],
|
||||||
];
|
];
|
||||||
|
$currencyId = (int) $bill->transaction_currency_id;
|
||||||
foreach ($journals as $journal) {
|
foreach ($journals as $journal) {
|
||||||
$date = $journal['date']->isoFormat((string) trans('config.month_and_day_js', [], $locale));
|
$date = $journal['date']->isoFormat((string) trans('config.month_and_day_js', [], $locale));
|
||||||
$chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill
|
$chartData[0]['entries'][$date] = $bill->amount_min; // minimum amount of bill
|
||||||
@ -153,6 +152,11 @@ class BillController extends Controller
|
|||||||
$chartData[2]['entries'][$date] = '0';
|
$chartData[2]['entries'][$date] = '0';
|
||||||
}
|
}
|
||||||
$amount = bcmul($journal['amount'], '-1');
|
$amount = bcmul($journal['amount'], '-1');
|
||||||
|
if ($currencyId === $journal['foreign_currency_id']) {
|
||||||
|
$amount = bcmul($journal['foreign_amount'], '-1');
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$chartData[2]['entries'][$date] = bcadd($chartData[2]['entries'][$date], $amount); // amount of journal
|
$chartData[2]['entries'][$date] = bcadd($chartData[2]['entries'][$date], $amount); // amount of journal
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user