mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2024-11-11 21:52:35 +01:00
8cffccb3bc
* Add privacy link to setup page * Italics * Tests for invoice actions * Fixes for autoloading
44 lines
995 B
PHP
44 lines
995 B
PHP
<?php
|
|
/**
|
|
* Invoice Ninja (https://invoiceninja.com)
|
|
*
|
|
* @link https://github.com/invoiceninja/invoiceninja source repository
|
|
*
|
|
* @copyright Copyright (c) 2020. Invoice Ninja LLC (https://invoiceninja.com)
|
|
*
|
|
* @license https://opensource.org/licenses/AAL
|
|
*/
|
|
|
|
namespace App\Utils\Traits\Invoice;
|
|
|
|
|
|
trait ActionsInvoice
|
|
{
|
|
public function invoiceDeletable() :bool
|
|
{
|
|
|
|
if($this->invoice->status_id <= 2 && $this->invoice->is_deleted == false && $this->invoice->deleted_at == NULL)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
public function invoiceCancellable() :bool
|
|
{
|
|
|
|
if($this->invoice->status_id == 3 && $this->invoice->is_deleted == false && $this->invoice->deleted_at == NULL)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
|
|
public function invoiceReversable() :bool
|
|
{
|
|
|
|
if(($this->invoice->status_id == 3 || $this->invoice->status_id == 4) && $this->invoice->is_deleted == false && $this->invoice->deleted_at == NULL)
|
|
return true;
|
|
|
|
return false;
|
|
}
|
|
}
|