mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-07-09 03:14:30 -04:00
Minor fixes
This commit is contained in:
parent
400fb609ee
commit
f0c6df6c4a
@ -206,7 +206,7 @@ class BaseModel extends Model
|
||||
return ctrans('texts.item');
|
||||
}
|
||||
|
||||
public function sendEvent($event_id, $additional_data){
|
||||
public function sendEvent($event_id, $additional_data=""){
|
||||
$subscriptions = Webhook::where('company_id', $this->company_id)
|
||||
->where('event_id', $event_id)
|
||||
->exists();
|
||||
|
@ -54,13 +54,7 @@ class MarkSent
|
||||
|
||||
event(new CreditWasMarkedSent($this->credit, $this->credit->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
$subscriptions = Webhook::where('company_id', $this->credit->company_id)
|
||||
->where('event_id', Webhook::EVENT_SENT_CREDIT)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions) {
|
||||
WebhookHandler::dispatch(Webhook::EVENT_SENT_CREDIT, $this->credit, $this->credit->company)->delay(0);
|
||||
}
|
||||
$this->credit->sendEvent(Webhook::EVENT_SENT_CREDIT);
|
||||
|
||||
return $this->credit;
|
||||
}
|
||||
|
@ -45,12 +45,7 @@ class MarkSent
|
||||
->adjustBalance($this->purchase_order->amount) //why was this commented out previously?
|
||||
->save();
|
||||
|
||||
$subscriptions = Webhook::where('company_id', $this->purchase_order->company_id)
|
||||
->where('event_id', Webhook::EVENT_SENT_PURCHASE_ORDER)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions)
|
||||
WebhookHandler::dispatch(Webhook::EVENT_SENT_PURCHASE_ORDER, $this->purchase_order, $this->purchase_order->company, 'vendor')->delay(0);
|
||||
$this->purchase_order->sendEvent(Webhook::EVENT_SENT_PURCHASE_ORDER, "vendor");
|
||||
|
||||
return $this->purchase_order;
|
||||
}
|
||||
|
@ -54,12 +54,7 @@ class MarkSent
|
||||
|
||||
event(new QuoteWasMarkedSent($this->quote, $this->quote->company, Ninja::eventVars(auth()->user() ? auth()->user()->id : null)));
|
||||
|
||||
$subscriptions = Webhook::where('company_id', $this->quote->company_id)
|
||||
->where('event_id', Webhook::EVENT_SENT_QUOTE)
|
||||
->exists();
|
||||
|
||||
if ($subscriptions)
|
||||
WebhookHandler::dispatch(Webhook::EVENT_SENT_QUOTE, $this->quote, $this->quote->company, 'client')->delay(0);
|
||||
$this->quote->sendEvent(Webhook::EVENT_SENT_QUOTE, "client");
|
||||
|
||||
return $this->quote;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user