Clean up code.

This commit is contained in:
James Cole
2025-05-04 17:41:26 +02:00
parent e28e538272
commit 0573bf2402
147 changed files with 1758 additions and 1770 deletions

View File

@@ -43,16 +43,16 @@ use Illuminate\Support\Collection;
*/
class BudgetReportGenerator
{
private Collection $accounts;
private Collection $accounts;
private readonly BudgetLimitRepositoryInterface $blRepository;
private Collection $budgets;
private TransactionCurrency $currency;
private Carbon $end;
private Collection $budgets;
private TransactionCurrency $currency;
private Carbon $end;
private readonly NoBudgetRepositoryInterface $nbRepository;
private readonly OperationsRepositoryInterface $opsRepository;
private array $report;
private array $report;
private readonly BudgetRepositoryInterface $repository;
private Carbon $start;
private Carbon $start;
/**
* BudgetReportGenerator constructor.
@@ -213,16 +213,16 @@ class BudgetReportGenerator
// make sum information:
$this->report['sums'][$currencyId]
??= [
'budgeted' => '0',
'spent' => '0',
'left' => '0',
'overspent' => '0',
'currency_id' => $currencyId,
'currency_code' => $limitCurrency->code,
'currency_name' => $limitCurrency->name,
'currency_symbol' => $limitCurrency->symbol,
'currency_decimal_places' => $limitCurrency->decimal_places,
];
'budgeted' => '0',
'spent' => '0',
'left' => '0',
'overspent' => '0',
'currency_id' => $currencyId,
'currency_code' => $limitCurrency->code,
'currency_name' => $limitCurrency->name,
'currency_symbol' => $limitCurrency->symbol,
'currency_decimal_places' => $limitCurrency->decimal_places,
];
$this->report['sums'][$currencyId]['budgeted'] = bcadd((string) $this->report['sums'][$currencyId]['budgeted'], $limit->amount);
$this->report['sums'][$currencyId]['spent'] = bcadd((string) $this->report['sums'][$currencyId]['spent'], $spent);
$this->report['sums'][$currencyId]['left'] = bcadd((string) $this->report['sums'][$currencyId]['left'], bcadd($limit->amount, $spent));