Merge pull request #2874 from novag/hide-cancel
hide cancel button for drafts
This commit is contained in:
commit
9c1ebc9287
@ -67,7 +67,7 @@ class Bills extends BulkAction
|
||||
$bills = $this->getSelectedRecords($request);
|
||||
|
||||
foreach ($bills as $bill) {
|
||||
if ($bill->status == 'cancelled') {
|
||||
if (in_array($bill->status, ['cancelled', 'draft'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -67,7 +67,7 @@ class Invoices extends BulkAction
|
||||
$invoices = $this->getSelectedRecords($request);
|
||||
|
||||
foreach ($invoices as $invoice) {
|
||||
if ($invoice->status == 'cancelled') {
|
||||
if (in_array($invoice->status, ['cancelled', 'draft'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -611,7 +611,7 @@ class Document extends Model
|
||||
'type' => 'divider',
|
||||
];
|
||||
|
||||
if ($this->status != 'cancelled') {
|
||||
if (! in_array($this->status, ['cancelled', 'draft'])) {
|
||||
try {
|
||||
$actions[] = [
|
||||
'title' => trans('general.cancel'),
|
||||
|
@ -108,15 +108,13 @@
|
||||
|
||||
@stack('button_cancelled_start')
|
||||
|
||||
@if (! $hideCancel)
|
||||
@if (! $hideCancel && ! in_array($document->status, ['cancelled', 'draft']))
|
||||
@can($permissionUpdate)
|
||||
<x-dropdown.divider />
|
||||
|
||||
@if ($document->status != 'cancelled')
|
||||
<x-dropdown.link href="{{ route($cancelledRoute, $document->id) }}" id="show-more-actions-cancel-{{ $document->type }}">
|
||||
{{ trans('general.cancel') }}
|
||||
</x-dropdown.link>
|
||||
@endif
|
||||
<x-dropdown.link href="{{ route($cancelledRoute, $document->id) }}" id="show-more-actions-cancel-{{ $document->type }}">
|
||||
{{ trans('general.cancel') }}
|
||||
</x-dropdown.link>
|
||||
@endcan
|
||||
@endif
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user