Fixed recurring template end button issue ( #866au7m2v )

This commit is contained in:
Cüneyt Şentürk 2023-08-24 12:21:15 +03:00
parent c5c6bb2755
commit e1b47a6f8a
4 changed files with 28 additions and 24 deletions

View File

@ -610,6 +610,7 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
} }
} else { } else {
if ($this->recurring && $this->recurring->status != 'ended') {
try { try {
$actions[] = [ $actions[] = [
'title' => trans('general.end'), 'title' => trans('general.end'),
@ -622,6 +623,7 @@ class Transaction extends Model
]; ];
} catch (\Exception $e) {} } catch (\Exception $e) {}
} }
}
return $actions; return $actions;
} }

View File

@ -672,6 +672,7 @@ class Document extends Model
]; ];
} catch (\Exception $e) {} } catch (\Exception $e) {}
} else { } else {
if ($this->recurring && $this->recurring->status != 'ended') {
try { try {
$actions[] = [ $actions[] = [
'title' => trans('general.end'), 'title' => trans('general.end'),
@ -684,6 +685,7 @@ class Document extends Model
]; ];
} catch (\Exception $e) {} } catch (\Exception $e) {}
} }
}
return $actions; return $actions;
} }

View File

@ -98,7 +98,7 @@
@stack('end_button_start') @stack('end_button_start')
@if (! $hideEnd && $document->recurring) @if (! $hideEnd && $document->recurring && $document->recurring->status != 'ended')
<x-dropdown.link href="{{ route($endRoute, $document->id) }}" id="show-more-actions-end-{{ $document->type }}"> <x-dropdown.link href="{{ route($endRoute, $document->id) }}" id="show-more-actions-end-{{ $document->type }}">
{{ trans('recurring.end') }} {{ trans('recurring.end') }}
</x-dropdown.link> </x-dropdown.link>

View File

@ -107,7 +107,7 @@
@stack('button_end_start') @stack('button_end_start')
@if (! $hideButtonEnd) @if (! $hideButtonEnd && $transaction->recurring && $transaction->recurring->status != 'ended')
<x-dropdown.link href="{{ route($routeButtonEnd, $transaction->id) }}" id="show-more-actions-end-{{ $transaction->type }}"> <x-dropdown.link href="{{ route($routeButtonEnd, $transaction->id) }}" id="show-more-actions-end-{{ $transaction->type }}">
{{ trans('recurring.end') }} {{ trans('recurring.end') }}
</x-dropdown.link> </x-dropdown.link>