Undo fix for Zapier
This commit is contained in:
parent
6bb47c3b95
commit
f1908e7be6
2 changed files with 21 additions and 1 deletions
|
|
@ -2,6 +2,10 @@
|
|||
|
||||
namespace App\Models;
|
||||
|
||||
use App\Events\InvoiceWasCreated;
|
||||
use App\Events\InvoiceWasUpdated;
|
||||
use App\Events\QuoteWasCreated;
|
||||
use App\Events\QuoteWasUpdated;
|
||||
use App\Events\InvoiceInvitationWasEmailed;
|
||||
use App\Events\QuoteInvitationWasEmailed;
|
||||
use App\Libraries\CurlUtils;
|
||||
|
|
@ -1518,3 +1522,19 @@ Invoice::creating(function ($invoice) {
|
|||
$invoice->account->incrementCounter($invoice);
|
||||
}
|
||||
});
|
||||
|
||||
Invoice::created(function ($invoice) {
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
|
||||
event(new QuoteWasCreated($invoice));
|
||||
} else {
|
||||
event(new InvoiceWasCreated($invoice));
|
||||
}
|
||||
});
|
||||
|
||||
Invoice::updating(function ($invoice) {
|
||||
if ($invoice->isType(INVOICE_TYPE_QUOTE)) {
|
||||
event(new QuoteWasUpdated($invoice));
|
||||
} else {
|
||||
event(new InvoiceWasUpdated($invoice));
|
||||
}
|
||||
});
|
||||
|
|
|
|||
|
|
@ -697,7 +697,7 @@ class InvoiceRepository extends BaseRepository
|
|||
$invoice = $this->saveInvitations($invoice);
|
||||
}
|
||||
|
||||
$this->dispachEvents($invoice);
|
||||
//$this->dispachEvents($invoice);
|
||||
|
||||
return $invoice;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue