Code refactoring after commit 510c38adcce51e6b997f4bd760089040c2e7df6c

This commit is contained in:
EnesSacid-Buker 2023-02-15 16:15:26 +03:00 committed by GitHub
parent 510c38adcc
commit fb00b31b6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 9 deletions

View File

@ -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;
}

View File

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

View File

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

View File

@ -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' && $document->status != 'draft')
<x-dropdown.link href="{{ route($cancelledRoute, $document->id) }}" id="show-more-actions-cancel-{{ $document->type }}">
{{ trans('general.cancel') }}
</x-dropdown.link>
@endif
@endcan
@endif