hide cancel button for drafts

This commit is contained in:
novag 2023-01-17 11:04:36 +01:00
parent e429d2f283
commit 510c38adcc
3 changed files with 3 additions and 3 deletions

View File

@ -67,7 +67,7 @@ class Invoices extends BulkAction
$invoices = $this->getSelectedRecords($request);
foreach ($invoices as $invoice) {
if ($invoice->status == 'cancelled') {
if ($invoice->status == 'cancelled' || $invoice->status == 'draft') {
continue;
}

View File

@ -611,7 +611,7 @@ class Document extends Model
'type' => 'divider',
];
if ($this->status != 'cancelled') {
if ($this->status != 'cancelled' && $this->status != 'draft') {
try {
$actions[] = [
'title' => trans('general.cancel'),

View File

@ -112,7 +112,7 @@
@can($permissionUpdate)
<x-dropdown.divider />
@if ($document->status != 'cancelled')
@if ($document->status != 'cancelled' && $document->status != 'draft')
<x-dropdown.link href="{{ route($cancelledRoute, $document->id) }}" id="show-more-actions-cancel-{{ $document->type }}">
{{ trans('general.cancel') }}
</x-dropdown.link>