cancel invoice/bill

This commit is contained in:
denisdulici
2020-03-28 17:54:36 +03:00
parent 889be5fd98
commit 75413a0496
30 changed files with 445 additions and 104 deletions

View 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')));
}
}

View File

@@ -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')));
}
}

View File

@@ -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')));
}
}