mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-23 09:26:29 -06:00
Fixed the tests.
This commit is contained in:
parent
83f5b5e293
commit
1d3987ece6
@ -197,20 +197,27 @@ class Account implements CUDInterface, CommonDatabaseCallsInterface, AccountInte
|
|||||||
\Transaction::whereIn('id', $transactions)->delete();
|
\Transaction::whereIn('id', $transactions)->delete();
|
||||||
}
|
}
|
||||||
\Event::fire('account.destroy', [$model]);
|
\Event::fire('account.destroy', [$model]);
|
||||||
\Account::
|
|
||||||
leftJoin('account_types', 'account_types.id', '=', 'accounts.account_type_id')
|
// get account type:
|
||||||
->where(
|
/** @var \FireflyIII\Database\AccountType\AccountType $acctType */
|
||||||
function (EloquentBuilder $q) use ($model) {
|
$acctType = \App::make('FireflyIII\Database\AccountType\AccountType');
|
||||||
$q->where('id', $model->id);
|
|
||||||
$q->orWhere(
|
$accountType = $acctType->findByWhat('initial');
|
||||||
function (EloquentBuilder $q) use ($model) {
|
|
||||||
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
//$q->where('account_types.type', '');
|
||||||
$q->where('account_types.type', 'Initial balance account');
|
|
||||||
$q->where('accounts.active', 0);
|
\Account::where(
|
||||||
}
|
function (EloquentBuilder $q) use ($model, $accountType) {
|
||||||
);
|
$q->where('id', $model->id);
|
||||||
|
$q->orWhere(
|
||||||
|
function (EloquentBuilder $q) use ($model, $accountType) {
|
||||||
|
$q->where('accounts.name', 'LIKE', '%' . $model->name . '%');
|
||||||
|
$q->where('accounts.account_type_id', $accountType->id);
|
||||||
|
$q->where('accounts.active', 0);
|
||||||
}
|
}
|
||||||
)->delete();
|
);
|
||||||
|
}
|
||||||
|
)->delete();
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user