fixed reconciliations list page broken deleted account ( #8669n0ywu )

This commit is contained in:
Cüneyt Şentürk 2023-06-15 11:14:43 +03:00
parent 7bdc7c834e
commit ca0843c4b6
3 changed files with 7 additions and 1 deletions

View File

@ -34,6 +34,7 @@ class DeleteAccount extends Job implements ShouldDelete
{
$rels = [
'transactions' => 'transactions',
'reconciliations' => 'reconciliations',
];
$relationships = $this->countRelationships($this->model, $rels);

View File

@ -65,6 +65,11 @@ class Account extends Model
return $this->hasMany('App\Models\Banking\Transaction');
}
public function reconciliations()
{
return $this->hasMany('App\Models\Banking\Reconciliation');
}
public function scopeName($query, $name)
{
return $query->where('name', '=', $name);

View File

@ -41,7 +41,7 @@ class Reconciliation extends Model
public function account()
{
return $this->belongsTo('App\Models\Banking\Account');
return $this->belongsTo('App\Models\Banking\Account')->withDefault(['name' => trans('general.na')]);
}
/**