Added translation for initial balance account name on creation

This commit is contained in:
Dennis Enderink
2018-10-27 23:20:54 +02:00
parent 3a427dd0f4
commit 81a23b5b22
12 changed files with 13 additions and 2 deletions

View File

@@ -217,13 +217,13 @@ trait AccountServiceTrait
*/
public function storeOpposingAccount(User $user, string $name): Account
{
$name .= ' initial balance';
$opposingAccountName = trans('firefly.initial_balance_account', ['name' => $name]);
Log::debug('Going to create an opening balance opposing account.');
/** @var AccountFactory $factory */
$factory = app(AccountFactory::class);
$factory->setUser($user);
return $factory->findOrCreate($name, AccountType::INITIAL_BALANCE);
return $factory->findOrCreate($opposingAccountName, AccountType::INITIAL_BALANCE);
}
/**