cancel invoice/bill
This commit is contained in:
26
app/Listeners/Sale/MarkInvoiceCancelled.php
Normal file
26
app/Listeners/Sale/MarkInvoiceCancelled.php
Normal file
@@ -0,0 +1,26 @@
|
||||
<?php
|
||||
|
||||
namespace App\Listeners\Sale;
|
||||
|
||||
use App\Events\Sale\InvoiceCancelled as Event;
|
||||
use App\Jobs\Sale\CancelInvoice;
|
||||
use App\Jobs\Sale\CreateInvoiceHistory;
|
||||
use App\Traits\Jobs;
|
||||
|
||||
class MarkInvoiceCancelled
|
||||
{
|
||||
use Jobs;
|
||||
|
||||
/**
|
||||
* Handle the event.
|
||||
*
|
||||
* @param $event
|
||||
* @return void
|
||||
*/
|
||||
public function handle(Event $event)
|
||||
{
|
||||
$this->dispatch(new CancelInvoice($event->invoice));
|
||||
|
||||
$this->dispatch(new CreateInvoiceHistory($event->invoice, 0, trans('invoices.messages.marked_cancelled')));
|
||||
}
|
||||
}
|
||||
@@ -24,6 +24,6 @@ class MarkInvoiceSent
|
||||
$event->invoice->save();
|
||||
}
|
||||
|
||||
$this->dispatch(new CreateInvoiceHistory($event->invoice, 0, trans('invoices.mark_sent')));
|
||||
$this->dispatch(new CreateInvoiceHistory($event->invoice, 0, trans('invoices.messages.marked_sent')));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,6 +29,6 @@ class MarkInvoiceViewed
|
||||
$invoice->status = 'viewed';
|
||||
$invoice->save();
|
||||
|
||||
$this->dispatch(new CreateInvoiceHistory($event->invoice, 0, trans('invoices.mark_viewed')));
|
||||
$this->dispatch(new CreateInvoiceHistory($event->invoice, 0, trans('invoices.messages.marked_viewed')));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user