From 43cd7910f8f4083d59a29dfe13158a8923470fc9 Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 9 Mar 2016 20:34:45 +0200 Subject: [PATCH 1/3] Merge #763 --- resources/lang/de/texts.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/resources/lang/de/texts.php b/resources/lang/de/texts.php index 3c2ec0580feb..80289bfa29f0 100644 --- a/resources/lang/de/texts.php +++ b/resources/lang/de/texts.php @@ -1121,7 +1121,7 @@ return array( 'all_pages_header' => 'Show header on', 'all_pages_footer' => 'Show footer on', 'invoice_currency' => 'Rechnungs-Währung', - 'enable_https' => 'Wir empfehlen dringend HTTPS zu verwendne, um Kreditkarten online zu akzeptieren.', + 'enable_https' => 'Wir empfehlen dringend HTTPS zu verwenden, um Kreditkarten online zu akzeptieren.', 'quote_issued_to' => 'Quote issued to', 'show_currency_code' => 'Währungscode', 'trial_message' => 'Your account will receive a free two week trial of our pro plan.', From b13e79ad8577e5309532658776e8beaef900abbd Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 9 Mar 2016 20:42:02 +0200 Subject: [PATCH 2/3] Fix for Zapier notifications --- app/Listeners/SubscriptionListener.php | 38 ++++++-------------------- 1 file changed, 9 insertions(+), 29 deletions(-) diff --git a/app/Listeners/SubscriptionListener.php b/app/Listeners/SubscriptionListener.php index 14d0bb0016c3..cac483b4d309 100644 --- a/app/Listeners/SubscriptionListener.php +++ b/app/Listeners/SubscriptionListener.php @@ -24,53 +24,33 @@ class SubscriptionListener { public function createdClient(ClientWasCreated $event) { - if ( ! Auth::check()) { - return; - } - - $transformer = new ClientTransformer(Auth::user()->account); + $transformer = new ClientTransformer($event->client->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CLIENT, $event->client, $transformer); } public function createdQuote(QuoteWasCreated $event) { - if ( ! Auth::check()) { - return; - } - - $transformer = new InvoiceTransformer(Auth::user()->account); + $transformer = new InvoiceTransformer($event->quote->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_QUOTE, $event->quote, $transformer, ENTITY_CLIENT); } public function createdPayment(PaymentWasCreated $event) { - if ( ! Auth::check()) { - return; - } - - $transformer = new PaymentTransformer(Auth::user()->account); + $transformer = new PaymentTransformer($event->payment->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_PAYMENT, $event->payment, $transformer, [ENTITY_CLIENT, ENTITY_INVOICE]); } - public function createdCredit(CreditWasCreated $event) - { - if ( ! Auth::check()) { - return; - } - - //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit); - } - public function createdInvoice(InvoiceWasCreated $event) { - if ( ! Auth::check()) { - return; - } - - $transformer = new InvoiceTransformer(Auth::user()->account); + $transformer = new InvoiceTransformer($event->invoice->account); $this->checkSubscriptions(ACTIVITY_TYPE_CREATE_INVOICE, $event->invoice, $transformer, ENTITY_CLIENT); } + public function createdCredit(CreditWasCreated $event) + { + //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_CREDIT, $event->credit); + } + public function createdVendor(VendorWasCreated $event) { //$this->checkSubscriptions(ACTIVITY_TYPE_CREATE_VENDOR, $event->vendor); From 782537812544ed43519e96ad68c2aac8452fc38a Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Fri, 11 Mar 2016 00:29:07 +0200 Subject: [PATCH 3/3] Fix for approving quotes --- app/Services/InvoiceService.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/Services/InvoiceService.php b/app/Services/InvoiceService.php index 839c6fa6adf3..c5d6f258e02c 100644 --- a/app/Services/InvoiceService.php +++ b/app/Services/InvoiceService.php @@ -79,7 +79,8 @@ class InvoiceService extends BaseService public function approveQuote($quote, $invitation = null) { - $account = Auth::user()->account; + $account = $quote->account; + if (!$quote->is_quote || $quote->quote_invoice_id) { return null; }