convert setting('default.currency') to default_currency() helper function..

This commit is contained in:
Cüneyt Şentürk
2022-10-05 10:35:19 +03:00
parent e683a0d171
commit d29859f65b
45 changed files with 84 additions and 84 deletions

View File

@ -70,7 +70,7 @@ class Account extends Factory
public function default_currency()
{
return $this->state([
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
]);
}
}

View File

@ -38,7 +38,7 @@ class Contact extends Factory
'address' => $this->faker->address,
'country' => $this->faker->randomElement($countries),
'website' => 'https://akaunting.com',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'reference' => $this->faker->text(5),
'enabled' => $this->faker->boolean ? 1 : 0,
'created_from' => 'core::factory',

View File

@ -44,7 +44,7 @@ class Document extends AbstractFactory
'company_id' => $this->company->id,
'issued_at' => $issued_at,
'due_at' => $due_at,
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'currency_rate' => '1',
'notes' => $this->faker->text(5),
'amount' => '0',
@ -247,7 +247,7 @@ class Document extends AbstractFactory
'tax_ids' => [$tax->id],
'quantity' => '1',
'price' => $amount,
'currency' => setting('default.currency'),
'currency' => default_currency(),
],
];

View File

@ -28,7 +28,7 @@ class Reconciliation extends Factory
return [
'company_id' => $this->company->id,
'account_id' => '1',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'opening_balance' => '0',
'closing_balance' => '10',
'started_at' => $started_at,

View File

@ -44,7 +44,7 @@ class Transaction extends Factory
'account_id' => setting('default.account'),
'paid_at' => $this->faker->dateTimeBetween(now()->startOfYear(), now()->endOfYear())->format('Y-m-d H:i:s'),
'amount' => $this->faker->randomFloat(2, 1, 1000),
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'currency_rate' => '1.0',
'description' => $this->faker->text(5),
'category_id' => $this->company->categories()->$category_type()->get()->random(1)->pluck('id')->first(),

View File

@ -84,7 +84,7 @@ class TestCompany extends Seeder
'type' => 'customer',
'name' => 'Test Customer',
'email' => 'customer@company.com',
'currency_code' => setting('default.currency'),
'currency_code' => default_currency(),
'password' => '123456',
'password_confirmation' => '123456',
'company_id' => company_id(),