closed #2492 Fixed: Transaction index and show page action button.. ( #33224ej )

This commit is contained in:
Cüneyt Şentürk 2022-06-28 15:09:11 +03:00
parent 251be5fb4a
commit 0c6fad2bba
3 changed files with 55 additions and 53 deletions

View File

@ -444,7 +444,7 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
try { try {
if (! $this->reconciled) { if (! $this->reconciled && ! $this->hasTransferRelation) {
$actions[] = [ $actions[] = [
'title' => trans('general.edit'), 'title' => trans('general.edit'),
'icon' => 'edit', 'icon' => 'edit',
@ -458,7 +458,7 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
try { try {
if (empty($this->document_id)) { if (empty($this->document_id) && ! $this->hasTransferRelation) {
$actions[] = [ $actions[] = [
'title' => trans('general.duplicate'), 'title' => trans('general.duplicate'),
'icon' => 'file_copy', 'icon' => 'file_copy',
@ -472,7 +472,7 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
try { try {
if ($this->is_splittable && empty($this->document_id) && empty($this->recurring)) { if ($this->is_splittable && empty($this->document_id) && empty($this->recurring) && ! $this->hasTransferRelation) {
$connect = [ $connect = [
'type' => 'button', 'type' => 'button',
'title' => trans('general.connect'), 'title' => trans('general.connect'),
@ -519,6 +519,7 @@ class Transaction extends Model
} catch (\Exception $e) {} } catch (\Exception $e) {}
if ($prefix != 'recurring-transactions') { if ($prefix != 'recurring-transactions') {
if (! $this->hasTransferRelation) {
$actions[] = [ $actions[] = [
'type' => 'divider', 'type' => 'divider',
]; ];
@ -567,6 +568,7 @@ class Transaction extends Model
]; ];
} }
} catch (\Exception $e) {} } catch (\Exception $e) {}
}
} else { } else {
try { try {
$actions[] = [ $actions[] = [

View File

@ -10,7 +10,7 @@
@stack('edit_button_start') @stack('edit_button_start')
@if (! $transaction->hasTransferRelation) @if (! $transaction->reconciled && ! $transaction->hasTransferRelation)
@if (! $hideButtonEdit) @if (! $hideButtonEdit)
@can($permissionUpdate) @can($permissionUpdate)
<x-link href="{{ route($routeButtonEdit, [$transaction->id, 'type' => $type]) }}"> <x-link href="{{ route($routeButtonEdit, [$transaction->id, 'type' => $type]) }}">

View File

@ -8,7 +8,7 @@
@stack('duplicate_button_start') @stack('duplicate_button_start')
@if (! $transaction->hasTransferRelation) @if (empty($transaction->document_id) && ! $transaction->hasTransferRelation)
@if (! $hideButtonDuplicate) @if (! $hideButtonDuplicate)
@can($permissionCreate) @can($permissionCreate)
<x-dropdown.link href="{{ route($routeButtonDuplicate, [$transaction->id, 'type' => $type]) }}"> <x-dropdown.link href="{{ route($routeButtonDuplicate, [$transaction->id, 'type' => $type]) }}">
@ -22,7 +22,7 @@
@stack('connect_button_start') @stack('connect_button_start')
@if ($transaction->is_splittable && empty($transaction->document_id) && empty($transaction->recurring)) @if ($transaction->is_splittable && empty($transaction->document_id) && empty($transaction->recurring) && ! $transaction->hasTransferRelation)
@if (! $hideButtonConnect) @if (! $hideButtonConnect)
@can($permissionCreate) @can($permissionCreate)
<button <button
@ -38,7 +38,7 @@
@stack('connect_button_end') @stack('connect_button_end')
@if (! $hideDivider1) @if (! $hideDivider1 && ! $transaction->hasTransferRelation)
<x-dropdown.divider /> <x-dropdown.divider />
@endif @endif
@ -62,7 +62,7 @@
@stack('button_pdf_end') @stack('button_pdf_end')
@if (! $hideDivider2) @if (! $hideDivider2 && ! $transaction->hasTransferRelation)
<x-dropdown.divider /> <x-dropdown.divider />
@endif @endif
@ -98,7 +98,7 @@
@stack('email_button_end') @stack('email_button_end')
@if (! $hideDivider3) @if (! $hideDivider3 && ! $transaction->hasTransferRelation)
<x-dropdown.divider /> <x-dropdown.divider />
@endif @endif
@ -112,7 +112,7 @@
@stack('button_end_end') @stack('button_end_end')
@if (! $hideDivider4) @if (! $hideDivider4 && ! $transaction->hasTransferRelation)
<x-dropdown.divider /> <x-dropdown.divider />
@endif @endif