diff --git a/app/Http/routes.php b/app/Http/routes.php index 4acd05d9c1ed..d16f7e140590 100644 --- a/app/Http/routes.php +++ b/app/Http/routes.php @@ -634,8 +634,6 @@ if (!defined('CONTACT_EMAIL')) { define('EVENT_CREATE_QUOTE', 3); define('EVENT_CREATE_PAYMENT', 4); define('EVENT_CREATE_VENDOR', 5); - - // Added new events define('EVENT_UPDATE_QUOTE', 6); define('EVENT_DELETE_QUOTE', 7); define('EVENT_UPDATE_INVOICE', 8); diff --git a/app/Listeners/SubscriptionListener.php b/app/Listeners/SubscriptionListener.php index 3bf558a0a868..595bc868bb12 100644 --- a/app/Listeners/SubscriptionListener.php +++ b/app/Listeners/SubscriptionListener.php @@ -3,6 +3,7 @@ use App\Events\InvoiceWasDeleted; use App\Events\InvoiceWasUpdated; use App\Events\QuoteWasUpdated; +use App\Events\QuoteWasDeleted; use Utils; use App\Models\EntityModel; use App\Events\ClientWasCreated; @@ -82,15 +83,6 @@ class SubscriptionListener public function createdExpense(ExpenseWasCreated $event) { - } - - /** - * @param QuoteWasUpdated $event - */ - public function updatedQuote(QuoteWasUpdated $event) - { - $transformer = new InvoiceTransformer($event->quote->account); - $this->checkSubscriptions(EVENT_UPDATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); } /** @@ -102,7 +94,7 @@ class SubscriptionListener $this->checkSubscriptions(EVENT_UPDATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT); } - /** + /** * @param InvoiceWasDeleted $event */ public function deletedInvoice(InvoiceWasDeleted $event) @@ -111,6 +103,24 @@ class SubscriptionListener $this->checkSubscriptions(EVENT_DELETE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT); } + /** + * @param QuoteWasUpdated $event + */ + public function updatedQuote(QuoteWasUpdated $event) + { + $transformer = new InvoiceTransformer($event->quote->account); + $this->checkSubscriptions(EVENT_UPDATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); + } + + /** + * @param InvoiceWasDeleted $event + */ + public function deletedQuote(QuoteWasDeleted $event) + { + $transformer = new InvoiceTransformer($event->quote->account); + $this->checkSubscriptions(EVENT_DELETE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); + } + /** * @param $eventId * @param $entity