1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-08 12:12:48 +01:00

Fixes for credit sent events

This commit is contained in:
David Bomba 2024-10-20 08:14:05 +11:00
parent e3729525db
commit 7e9dde9513
3 changed files with 3 additions and 5 deletions

View File

@ -644,8 +644,6 @@ class CreditController extends BaseController
EmailEntity::dispatch($invitation, $credit->company, 'credit');
});
// $credit->sendEvent(Webhook::EVENT_SENT_CREDIT, "client");
if (! $bulk) {
return response()->json(['message' => 'email sent'], 200);
}

View File

@ -152,9 +152,9 @@ class CreditService
return $this;
}
public function markSent()
public function markSent($fire_event = false)
{
$this->credit = (new MarkSent($this->credit->client, $this->credit))->run();
$this->credit = (new MarkSent($this->credit->client, $this->credit))->run($fire_event);
return $this;
}

View File

@ -43,7 +43,7 @@ class TriggeredActions extends AbstractService
}
if ($this->request->has('mark_sent') && $this->request->input('mark_sent') == 'true') {
$this->credit = $this->credit->service()->markSent()->save();
$this->credit = $this->credit->service()->markSent(true)->save();
}
if ($this->request->has('save_default_footer') && $this->request->input('save_default_footer') == 'true') {