From c5c6bb2755c20c4d935313107976ef376bbbbf56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Thu, 24 Aug 2023 12:09:55 +0300 Subject: [PATCH] Fixed recurring list page actions.. --- app/Models/Banking/Transaction.php | 7 ++++++- app/Models/Document/Document.php | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/app/Models/Banking/Transaction.php b/app/Models/Banking/Transaction.php index 7c1eaf9af..20fcdedd6 100644 --- a/app/Models/Banking/Transaction.php +++ b/app/Models/Banking/Transaction.php @@ -502,7 +502,12 @@ class Transaction extends Model } catch (\Exception $e) {} try { - if ($this->is_splittable && empty($this->document_id) && empty($this->recurring) && $this->isNotTransferTransaction()) { + if ( + $this->is_splittable + && empty($this->document_id) + && empty($this->recurring) + && $this->isNotTransferTransaction() + ) { $connect = [ 'type' => 'button', 'title' => trans('general.connect'), diff --git a/app/Models/Document/Document.php b/app/Models/Document/Document.php index 39d986a48..314eb2eb3 100644 --- a/app/Models/Document/Document.php +++ b/app/Models/Document/Document.php @@ -540,7 +540,12 @@ class Document extends Model ]; } catch (\Exception $e) {} - if ($this->status != 'paid' && (empty($this->transactions->count()) || (! empty($this->transactions->count()) && $this->paid != $this->amount))) { + if ( + $this->status != 'paid' + && ! str_contains($this->type, 'recurring') + && (empty($this->transactions->count()) + || (! empty($this->transactions->count()) && $this->paid != $this->amount)) + ) { try { if ($this->totals->count()) { $actions[] = [