closed #2492 Fixed: Transaction index and show page action button.. ( #33224ej )
This commit is contained in:
parent
251be5fb4a
commit
0c6fad2bba
@ -444,7 +444,7 @@ class Transaction extends Model
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
try {
|
||||
if (! $this->reconciled) {
|
||||
if (! $this->reconciled && ! $this->hasTransferRelation) {
|
||||
$actions[] = [
|
||||
'title' => trans('general.edit'),
|
||||
'icon' => 'edit',
|
||||
@ -458,7 +458,7 @@ class Transaction extends Model
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
try {
|
||||
if (empty($this->document_id)) {
|
||||
if (empty($this->document_id) && ! $this->hasTransferRelation) {
|
||||
$actions[] = [
|
||||
'title' => trans('general.duplicate'),
|
||||
'icon' => 'file_copy',
|
||||
@ -472,7 +472,7 @@ class Transaction extends Model
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
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 = [
|
||||
'type' => 'button',
|
||||
'title' => trans('general.connect'),
|
||||
@ -519,54 +519,56 @@ class Transaction extends Model
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
if ($prefix != 'recurring-transactions') {
|
||||
$actions[] = [
|
||||
'type' => 'divider',
|
||||
];
|
||||
|
||||
try {
|
||||
if (! $this->hasTransferRelation) {
|
||||
$actions[] = [
|
||||
'type' => 'button',
|
||||
'title' => trans('general.share_link'),
|
||||
'icon' => 'share',
|
||||
'url' => route('modals.transactions.share.create', $this->id),
|
||||
'permission' => 'read-banking-transactions',
|
||||
'attributes' => [
|
||||
'id' => 'index-more-actions-share-' . $this->id,
|
||||
'@click' => 'onShareLink("' . route('modals.transactions.share.create', $this->id) . '")',
|
||||
],
|
||||
'type' => 'divider',
|
||||
];
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
try {
|
||||
$actions[] = [
|
||||
'type' => 'button',
|
||||
'title' => trans('invoices.send_mail'),
|
||||
'icon' => 'email',
|
||||
'url' => route('modals.transactions.emails.create', $this->id),
|
||||
'permission' => 'read-banking-transactions',
|
||||
'attributes' => [
|
||||
'id' => 'index-more-actions-send-email-' . $this->id,
|
||||
'@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")',
|
||||
],
|
||||
];
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
$actions[] = [
|
||||
'type' => 'divider',
|
||||
];
|
||||
|
||||
try {
|
||||
if (! $this->reconciled) {
|
||||
try {
|
||||
$actions[] = [
|
||||
'type' => 'delete',
|
||||
'icon' => 'delete',
|
||||
'text' => ! empty($this->recurring) ? 'transactions' : 'recurring_template',
|
||||
'route' => $prefix. '.destroy',
|
||||
'permission' => 'delete-banking-transactions',
|
||||
'model' => $this,
|
||||
'type' => 'button',
|
||||
'title' => trans('general.share_link'),
|
||||
'icon' => 'share',
|
||||
'url' => route('modals.transactions.share.create', $this->id),
|
||||
'permission' => 'read-banking-transactions',
|
||||
'attributes' => [
|
||||
'id' => 'index-more-actions-share-' . $this->id,
|
||||
'@click' => 'onShareLink("' . route('modals.transactions.share.create', $this->id) . '")',
|
||||
],
|
||||
];
|
||||
}
|
||||
} catch (\Exception $e) {}
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
try {
|
||||
$actions[] = [
|
||||
'type' => 'button',
|
||||
'title' => trans('invoices.send_mail'),
|
||||
'icon' => 'email',
|
||||
'url' => route('modals.transactions.emails.create', $this->id),
|
||||
'permission' => 'read-banking-transactions',
|
||||
'attributes' => [
|
||||
'id' => 'index-more-actions-send-email-' . $this->id,
|
||||
'@click' => 'onEmail("' . route('modals.transactions.emails.create', $this->id) . '")',
|
||||
],
|
||||
];
|
||||
} catch (\Exception $e) {}
|
||||
|
||||
$actions[] = [
|
||||
'type' => 'divider',
|
||||
];
|
||||
|
||||
try {
|
||||
if (! $this->reconciled) {
|
||||
$actions[] = [
|
||||
'type' => 'delete',
|
||||
'icon' => 'delete',
|
||||
'text' => ! empty($this->recurring) ? 'transactions' : 'recurring_template',
|
||||
'route' => $prefix. '.destroy',
|
||||
'permission' => 'delete-banking-transactions',
|
||||
'model' => $this,
|
||||
];
|
||||
}
|
||||
} catch (\Exception $e) {}
|
||||
}
|
||||
} else {
|
||||
try {
|
||||
$actions[] = [
|
||||
|
@ -10,7 +10,7 @@
|
||||
|
||||
@stack('edit_button_start')
|
||||
|
||||
@if (! $transaction->hasTransferRelation)
|
||||
@if (! $transaction->reconciled && ! $transaction->hasTransferRelation)
|
||||
@if (! $hideButtonEdit)
|
||||
@can($permissionUpdate)
|
||||
<x-link href="{{ route($routeButtonEdit, [$transaction->id, 'type' => $type]) }}">
|
||||
|
@ -8,7 +8,7 @@
|
||||
|
||||
@stack('duplicate_button_start')
|
||||
|
||||
@if (! $transaction->hasTransferRelation)
|
||||
@if (empty($transaction->document_id) && ! $transaction->hasTransferRelation)
|
||||
@if (! $hideButtonDuplicate)
|
||||
@can($permissionCreate)
|
||||
<x-dropdown.link href="{{ route($routeButtonDuplicate, [$transaction->id, 'type' => $type]) }}">
|
||||
@ -22,7 +22,7 @@
|
||||
|
||||
@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)
|
||||
@can($permissionCreate)
|
||||
<button
|
||||
@ -38,7 +38,7 @@
|
||||
|
||||
@stack('connect_button_end')
|
||||
|
||||
@if (! $hideDivider1)
|
||||
@if (! $hideDivider1 && ! $transaction->hasTransferRelation)
|
||||
<x-dropdown.divider />
|
||||
@endif
|
||||
|
||||
@ -62,7 +62,7 @@
|
||||
|
||||
@stack('button_pdf_end')
|
||||
|
||||
@if (! $hideDivider2)
|
||||
@if (! $hideDivider2 && ! $transaction->hasTransferRelation)
|
||||
<x-dropdown.divider />
|
||||
@endif
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
|
||||
@stack('email_button_end')
|
||||
|
||||
@if (! $hideDivider3)
|
||||
@if (! $hideDivider3 && ! $transaction->hasTransferRelation)
|
||||
<x-dropdown.divider />
|
||||
@endif
|
||||
|
||||
@ -112,7 +112,7 @@
|
||||
|
||||
@stack('button_end_end')
|
||||
|
||||
@if (! $hideDivider4)
|
||||
@if (! $hideDivider4 && ! $transaction->hasTransferRelation)
|
||||
<x-dropdown.divider />
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user