fillForm([ 'name' => $name, 'profile.email' => 'company@gmail.com', 'profile.entity_type' => EntityType::LimitedLiabilityCompany, 'profile.country' => 'US', 'locale.language' => 'en', 'currencies.code' => 'USD', ]) ->call('register') ->assertHasNoErrors(); return auth()->user()->currentCompany; } function calculateRetainedEarningsBalances(ReportService $reportService, $startDate, $endDate): AccountBalanceDTO { $retainedEarningsAmount = $reportService->calculateRetainedEarnings($startDate, $endDate)->getAmount(); $isCredit = $retainedEarningsAmount >= 0; $retainedEarningsDebitAmount = $isCredit ? 0 : abs($retainedEarningsAmount); $retainedEarningsCreditAmount = $isCredit ? $retainedEarningsAmount : 0; return $reportService->formatBalances([ 'debit_balance' => $retainedEarningsDebitAmount, 'credit_balance' => $retainedEarningsCreditAmount, ]); } function formatReportBalances(array $balances): AccountBalanceDTO { $reportService = app(ReportService::class); return $reportService->formatBalances($balances); } function calculateTrialBalances(AccountCategory $accountCategory, int $endingBalance): array { $reportService = app(ReportService::class); return $reportService->calculateTrialBalance($accountCategory, $endingBalance); }