renamed income/expense
This commit is contained in:
37
app/Jobs/Sale/DeleteInvoice.php
Normal file
37
app/Jobs/Sale/DeleteInvoice.php
Normal file
@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
namespace App\Jobs\Sale;
|
||||
|
||||
use App\Abstracts\Job;
|
||||
use App\Models\Sale\Invoice;
|
||||
|
||||
class DeleteInvoice extends Job
|
||||
{
|
||||
protected $invoice;
|
||||
|
||||
/**
|
||||
* Create a new job instance.
|
||||
*
|
||||
* @param $invoice
|
||||
*/
|
||||
public function __construct($invoice)
|
||||
{
|
||||
$this->invoice = $invoice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Execute the job.
|
||||
*
|
||||
* @return Invoice
|
||||
*/
|
||||
public function handle()
|
||||
{
|
||||
$this->deleteRelationships($this->invoice, [
|
||||
'items', 'item_taxes', 'histories', 'transactions', 'recurring', 'totals'
|
||||
]);
|
||||
|
||||
$this->invoice->delete();
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user