Code refactoring after commit 510c38adcc
This commit is contained in:
@ -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' || $invoice->status == 'draft') {
|
||||
if (! in_array($invoice->status, ['cancelled', 'draft'])) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
@ -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'),
|
||||
|
Reference in New Issue
Block a user