Skip to content

Commit

Permalink
fixed reconciliations list page broken deleted account ( #8669n0ywu )
Browse files Browse the repository at this point in the history
  • Loading branch information
cuneytsenturk committed Jun 15, 2023
1 parent 7bdc7c8 commit ca0843c
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions app/Jobs/Banking/DeleteAccount.php
Expand Up @@ -34,6 +34,7 @@ public function getRelationships(): array
{
$rels = [
'transactions' => 'transactions',
'reconciliations' => 'reconciliations',
];

$relationships = $this->countRelationships($this->model, $rels);
Expand Down
5 changes: 5 additions & 0 deletions app/Models/Banking/Account.php
Expand Up @@ -65,6 +65,11 @@ public function transactions()
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);
Expand Down
2 changes: 1 addition & 1 deletion app/Models/Banking/Reconciliation.php
Expand Up @@ -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')]);
}

/**
Expand Down

0 comments on commit ca0843c

Please sign in to comment.