Optimise code.

This commit is contained in:
James Cole
2020-10-24 17:27:36 +02:00
parent b3f1737495
commit 3979e12043
21 changed files with 199 additions and 187 deletions

View File

@@ -75,7 +75,7 @@ class AccountTransformer extends AbstractTransformer
[$currencyId, $currencyCode, $currencySymbol, $decimalPlaces] = $this->getCurrency($account);
[$creditCardType, $monthlyPaymentDate] = $this->getCCInfo($account, $accountRole, $accountType);
[$openingBalance, $openingBalanceDate] = $this->getOpeningBalance($account, $accountType, $decimalPlaces);
[$openingBalance, $openingBalanceDate] = $this->getOpeningBalance($account, $accountType);
[$interest, $interestPeriod] = $this->getInterest($account, $accountType);
$openingBalance = number_format((float) $openingBalance, $decimalPlaces, '.', '');
@@ -235,7 +235,7 @@ class AccountTransformer extends AbstractTransformer
*
* TODO refactor call to getOpeningBalanceAmount / Date because its extra queries.
*/
private function getOpeningBalance(Account $account, string $accountType, int $decimalPlaces): array
private function getOpeningBalance(Account $account, string $accountType): array
{
$openingBalance = null;
$openingBalanceDate = null;