mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-16 22:58:09 +00:00
Rename "native" to "primary".
This commit is contained in:
@@ -109,7 +109,7 @@ class BillController extends Controller
|
||||
$cache = new CacheProperties();
|
||||
$cache->addProperty('chart.bill.single');
|
||||
$cache->addProperty($bill->id);
|
||||
$cache->addProperty($this->convertToNative);
|
||||
$cache->addProperty($this->convertToPrimary);
|
||||
if ($cache->has()) {
|
||||
return response()->json($cache->get());
|
||||
}
|
||||
@@ -134,8 +134,8 @@ class BillController extends Controller
|
||||
}
|
||||
);
|
||||
$currency = $bill->transactionCurrency;
|
||||
if ($this->convertToNative) {
|
||||
$currency = $this->defaultCurrency;
|
||||
if ($this->convertToPrimary) {
|
||||
$currency = $this->primaryCurrency;
|
||||
}
|
||||
|
||||
$chartData = [
|
||||
@@ -164,7 +164,7 @@ class BillController extends Controller
|
||||
$currencyId = $bill->transaction_currency_id;
|
||||
$amountMin = $bill->amount_min;
|
||||
$amountMax = $bill->amount_max;
|
||||
if ($this->convertToNative && $currencyId !== $this->defaultCurrency->id) {
|
||||
if ($this->convertToPrimary && $currencyId !== $this->primaryCurrency->id) {
|
||||
$amountMin = $bill->native_amount_min;
|
||||
$amountMax = $bill->native_amount_max;
|
||||
}
|
||||
@@ -178,11 +178,11 @@ class BillController extends Controller
|
||||
$chartData[2]['entries'][$date] = '0';
|
||||
}
|
||||
$amount = bcmul((string) $journal['amount'], '-1');
|
||||
if ($this->convertToNative && $currencyId !== $journal['currency_id']) {
|
||||
$amount = bcmul($journal['native_amount'] ?? '0', '-1');
|
||||
if ($this->convertToPrimary && $currencyId !== $journal['currency_id']) {
|
||||
$amount = bcmul($journal['pc_amount'] ?? '0', '-1');
|
||||
}
|
||||
if ($this->convertToNative && $currencyId === $journal['foreign_currency_id']) {
|
||||
$amount = bcmul((string) $journal['foreign_amount'], '-1');
|
||||
if ($this->convertToPrimary && $currencyId === $journal['foreign_currency_id']) {
|
||||
$amount = bcmul((string) $journal['pc_amount'], '-1');
|
||||
}
|
||||
|
||||
$chartData[2]['entries'][$date] = bcadd($chartData[2]['entries'][$date], $amount); // amount of journal
|
||||
|
||||
Reference in New Issue
Block a user