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