cancel invoice/bill
This commit is contained in:
26
app/Listeners/Purchase/MarkBillCancelled.php
Normal file
26
app/Listeners/Purchase/MarkBillCancelled.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Purchase;
|
||||
|
||||
use App\Events\Purchase\BillCancelled as Event;
|
||||
use App\Jobs\Purchase\CancelBill;
|
||||
use App\Jobs\Purchase\CreateBillHistory;
|
||||
use App\Traits\Jobs;
|
||||
|
||||
class MarkBillCancelled
|
||||
{
|
||||
use Jobs;
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
$this->dispatch(new CancelBill($event->bill));
|
||||
|
||||
$this->dispatch(new CreateBillHistory($event->bill, 0, trans('bills.messages.marked_cancelled')));
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,6 @@ class MarkBillReceived
|
||||
$event->bill->save();
|
||||
}
|
||||
|
||||
$this->dispatch(new CreateBillHistory($event->bill, 0, trans('bills.mark_received')));
|
||||
$this->dispatch(new CreateBillHistory($event->bill, 0, trans('bills.messages.marked_received')));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user