mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix account api for new features.
This commit is contained in:
@@ -293,7 +293,7 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
/**
|
||||
* Returns the amount of the opening balance for this account.
|
||||
*/
|
||||
public function getOpeningBalanceAmount(Account $account): ?string
|
||||
public function getOpeningBalanceAmount(Account $account, bool $convertToNative): ?string
|
||||
{
|
||||
$journal = TransactionJournal::leftJoin('transactions', 'transactions.transaction_journal_id', '=', 'transaction_journals.id')
|
||||
->where('transactions.account_id', $account->id)
|
||||
@@ -307,6 +307,9 @@ class AccountRepository implements AccountRepositoryInterface
|
||||
if (null === $transaction) {
|
||||
return null;
|
||||
}
|
||||
if($convertToNative) {
|
||||
return $transaction->native_amount ?? '0';
|
||||
}
|
||||
|
||||
return $transaction->amount;
|
||||
}
|
||||
|
@@ -106,7 +106,7 @@ interface AccountRepositoryInterface
|
||||
/**
|
||||
* Returns the amount of the opening balance for this account.
|
||||
*/
|
||||
public function getOpeningBalanceAmount(Account $account): ?string;
|
||||
public function getOpeningBalanceAmount(Account $account, bool $convertToNative): ?string;
|
||||
|
||||
/**
|
||||
* Return date of opening balance as string or null.
|
||||
|
Reference in New Issue
Block a user