mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 01:17:30 -05:00 
			
		
		
		
	Added 'approved quote' subscription
This commit is contained in:
		
							parent
							
								
									5f1970a2c2
								
							
						
					
					
						commit
						a77e594da0
					
				@ -319,6 +319,7 @@ if (! defined('APP_NAME')) {
 | 
			
		||||
    define('EVENT_CREATE_TASK', 18);
 | 
			
		||||
    define('EVENT_UPDATE_TASK', 19);
 | 
			
		||||
    define('EVENT_DELETE_TASK', 20);
 | 
			
		||||
    define('EVENT_APPROVE_QUOTE', 21);
 | 
			
		||||
 | 
			
		||||
    define('REQUESTED_PRO_PLAN', 'REQUESTED_PRO_PLAN');
 | 
			
		||||
    define('NINJA_ACCOUNT_KEY', env('NINJA_ACCOUNT_KEY', 'zg4ylmzDkdkPOT8yoKQw9LTWaoZJx79h'));
 | 
			
		||||
 | 
			
		||||
@ -11,6 +11,7 @@ use App\Events\ExpenseWasDeleted;
 | 
			
		||||
use App\Events\QuoteItemsWereCreated;
 | 
			
		||||
use App\Events\QuoteItemsWereUpdated;
 | 
			
		||||
use App\Events\QuoteWasDeleted;
 | 
			
		||||
use App\Events\QuoteInvitationWasApproved;
 | 
			
		||||
use App\Events\PaymentWasCreated;
 | 
			
		||||
use App\Events\PaymentWasDeleted;
 | 
			
		||||
use App\Events\InvoiceItemsWereCreated;
 | 
			
		||||
@ -132,6 +133,15 @@ class SubscriptionListener
 | 
			
		||||
        $this->checkSubscriptions(EVENT_UPDATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param QuoteInvitationWasApproved $event
 | 
			
		||||
     */
 | 
			
		||||
    public function approvedQuote(QuoteInvitationWasApproved $event)
 | 
			
		||||
    {
 | 
			
		||||
        $transformer = new InvoiceTransformer($event->quote->account);
 | 
			
		||||
        $this->checkSubscriptions(EVENT_APPROVE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT);
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
     * @param InvoiceWasDeleted $event
 | 
			
		||||
     */
 | 
			
		||||
 | 
			
		||||
@ -108,6 +108,7 @@ class EventServiceProvider extends ServiceProvider
 | 
			
		||||
        'App\Events\QuoteInvitationWasApproved' => [
 | 
			
		||||
            'App\Listeners\ActivityListener@approvedQuote',
 | 
			
		||||
            'App\Listeners\NotificationListener@approvedQuote',
 | 
			
		||||
            'App\Listeners\SubscriptionListener@approvedQuote',
 | 
			
		||||
        ],
 | 
			
		||||
 | 
			
		||||
        // Payments
 | 
			
		||||
 | 
			
		||||
@ -2593,6 +2593,7 @@ $LANG = array(
 | 
			
		||||
    'subscription_event_18' => 'Created Task',
 | 
			
		||||
    'subscription_event_19' => 'Updated Task',
 | 
			
		||||
    'subscription_event_20' => 'Deleted Task',
 | 
			
		||||
    'subscription_event_21' => 'Approved Quote',
 | 
			
		||||
    'subscriptions' => 'Subscriptions',
 | 
			
		||||
    'updated_subscription' => 'Successfully updated subscription',
 | 
			
		||||
    'created_subscription' => 'Successfully created subscription',
 | 
			
		||||
 | 
			
		||||
@ -38,6 +38,7 @@
 | 
			
		||||
                        trans('texts.quotes') => [
 | 
			
		||||
                            EVENT_CREATE_QUOTE => trans('texts.subscription_event_' . EVENT_CREATE_QUOTE),
 | 
			
		||||
                            EVENT_UPDATE_QUOTE => trans('texts.subscription_event_' . EVENT_UPDATE_QUOTE),
 | 
			
		||||
                            EVENT_APPROVE_QUOTE => trans('texts.subscription_event_' . EVENT_APPROVE_QUOTE),
 | 
			
		||||
                            EVENT_DELETE_QUOTE => trans('texts.subscription_event_' . EVENT_DELETE_QUOTE),
 | 
			
		||||
                        ],
 | 
			
		||||
                        trans('texts.tasks') => [
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user