1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-11 21:52:35 +01:00
invoiceninja/app/Utils/Traits/Invoice/ActionsInvoice.php
David Bomba 8cffccb3bc
Fixes for composer 2 (#3593)
* Add privacy link to setup page

* Italics

* Tests for invoice actions

* Fixes for autoloading
2020-04-06 22:32:27 +10:00

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