mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-11-18 07:38:29 +00:00
Expand types.
This commit is contained in:
@@ -38,6 +38,8 @@ class AccountType extends Model
|
|||||||
const INITIAL_BALANCE = 'Initial balance account';
|
const INITIAL_BALANCE = 'Initial balance account';
|
||||||
const BENEFICIARY = 'Beneficiary account';
|
const BENEFICIARY = 'Beneficiary account';
|
||||||
const IMPORT = 'Import account';
|
const IMPORT = 'Import account';
|
||||||
|
const RECONCILIATION = 'Reconciliation account';
|
||||||
|
const LOAN = 'Loan';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be casted to native types.
|
* The attributes that should be casted to native types.
|
||||||
|
|||||||
@@ -37,6 +37,7 @@ class TransactionType extends Model
|
|||||||
const DEPOSIT = 'Deposit';
|
const DEPOSIT = 'Deposit';
|
||||||
const TRANSFER = 'Transfer';
|
const TRANSFER = 'Transfer';
|
||||||
const OPENING_BALANCE = 'Opening balance';
|
const OPENING_BALANCE = 'Opening balance';
|
||||||
|
const RECONCILIATION = 'Reconciliation';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The attributes that should be casted to native types.
|
* The attributes that should be casted to native types.
|
||||||
@@ -58,13 +59,13 @@ class TransactionType extends Model
|
|||||||
public static function routeBinder(string $type)
|
public static function routeBinder(string $type)
|
||||||
{
|
{
|
||||||
if (!auth()->check()) {
|
if (!auth()->check()) {
|
||||||
throw new NotFoundHttpException;
|
throw new NotFoundHttpException();
|
||||||
}
|
}
|
||||||
$transactionType = self::where('type', ucfirst($type))->first();
|
$transactionType = self::where('type', ucfirst($type))->first();
|
||||||
if (null !== $transactionType) {
|
if (null !== $transactionType) {
|
||||||
return $transactionType;
|
return $transactionType;
|
||||||
}
|
}
|
||||||
throw new NotFoundHttpException;
|
throw new NotFoundHttpException();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -21,14 +21,15 @@ class AccountTypeSeeder extends Seeder
|
|||||||
{
|
{
|
||||||
public function run()
|
public function run()
|
||||||
{
|
{
|
||||||
AccountType::create(['type' => 'Default account']);
|
AccountType::create(['type' => AccountType::DEFAULT]);
|
||||||
AccountType::create(['type' => 'Cash account']);
|
AccountType::create(['type' => AccountType::CASH]);
|
||||||
AccountType::create(['type' => 'Asset account']);
|
AccountType::create(['type' => AccountType::ASSET]);
|
||||||
AccountType::create(['type' => 'Expense account']);
|
AccountType::create(['type' => AccountType::EXPENSE]);
|
||||||
AccountType::create(['type' => 'Revenue account']);
|
AccountType::create(['type' => AccountType::REVENUE]);
|
||||||
AccountType::create(['type' => 'Initial balance account']);
|
AccountType::create(['type' => AccountType::INITIAL_BALANCE]);
|
||||||
AccountType::create(['type' => 'Beneficiary account']);
|
AccountType::create(['type' => AccountType::BENEFICIARY]);
|
||||||
AccountType::create(['type' => 'Import account']);
|
AccountType::create(['type' => AccountType::IMPORT]);
|
||||||
AccountType::create(['type' => 'Loan']);
|
AccountType::create(['type' => AccountType::LOAN]);
|
||||||
|
AccountType::create(['type' => AccountType::RECONCILIATION]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,5 +25,6 @@ class TransactionTypeSeeder extends Seeder
|
|||||||
TransactionType::create(['type' => TransactionType::DEPOSIT]);
|
TransactionType::create(['type' => TransactionType::DEPOSIT]);
|
||||||
TransactionType::create(['type' => TransactionType::TRANSFER]);
|
TransactionType::create(['type' => TransactionType::TRANSFER]);
|
||||||
TransactionType::create(['type' => TransactionType::OPENING_BALANCE]);
|
TransactionType::create(['type' => TransactionType::OPENING_BALANCE]);
|
||||||
|
TransactionType::create(['type' => TransactionType::RECONCILIATION]);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user