Code refactoring after commit 510c38adcce51e6b997f4bd760089040c2e7df6c
This commit is contained in:
parent
510c38adcc
commit
fb00b31b6c
@ -67,7 +67,7 @@ class Bills extends BulkAction
|
|||||||
$bills = $this->getSelectedRecords($request);
|
$bills = $this->getSelectedRecords($request);
|
||||||
|
|
||||||
foreach ($bills as $bill) {
|
foreach ($bills as $bill) {
|
||||||
if ($bill->status == 'cancelled') {
|
if (! in_array($bill->status, ['cancelled', 'draft'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -67,7 +67,7 @@ class Invoices extends BulkAction
|
|||||||
$invoices = $this->getSelectedRecords($request);
|
$invoices = $this->getSelectedRecords($request);
|
||||||
|
|
||||||
foreach ($invoices as $invoice) {
|
foreach ($invoices as $invoice) {
|
||||||
if ($invoice->status == 'cancelled' || $invoice->status == 'draft') {
|
if (! in_array($invoice->status, ['cancelled', 'draft'])) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -611,7 +611,7 @@ class Document extends Model
|
|||||||
'type' => 'divider',
|
'type' => 'divider',
|
||||||
];
|
];
|
||||||
|
|
||||||
if ($this->status != 'cancelled' && $this->status != 'draft') {
|
if (! in_array($this->status, ['cancelled', 'draft'])) {
|
||||||
try {
|
try {
|
||||||
$actions[] = [
|
$actions[] = [
|
||||||
'title' => trans('general.cancel'),
|
'title' => trans('general.cancel'),
|
||||||
|
@ -108,15 +108,13 @@
|
|||||||
|
|
||||||
@stack('button_cancelled_start')
|
@stack('button_cancelled_start')
|
||||||
|
|
||||||
@if (! $hideCancel)
|
@if (! $hideCancel && ! in_array($document->status, ['cancelled', 'draft']))
|
||||||
@can($permissionUpdate)
|
@can($permissionUpdate)
|
||||||
<x-dropdown.divider />
|
<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 }}">
|
<x-dropdown.link href="{{ route($cancelledRoute, $document->id) }}" id="show-more-actions-cancel-{{ $document->type }}">
|
||||||
{{ trans('general.cancel') }}
|
{{ trans('general.cancel') }}
|
||||||
</x-dropdown.link>
|
</x-dropdown.link>
|
||||||
@endif
|
|
||||||
@endcan
|
@endcan
|
||||||
@endif
|
@endif
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user