BasePaymentDriver - Convert Quote - Fix Invitation
Signed-off-by: Kristián Feldsam <feldsam@gmail.com>
This commit is contained in:
parent
d7368851f5
commit
90d132ad20
2 changed files with 15 additions and 0 deletions
|
|
@ -542,6 +542,20 @@ class Invoice extends EntityModel implements BalanceAffecting
|
|||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* @return Invitation|null
|
||||
*/
|
||||
public function invitationByContactId(int $contactId)
|
||||
{
|
||||
foreach ($this->invitations as $invitation) {
|
||||
if ($invitation->contact_id === $contactId) {
|
||||
return $invitation;
|
||||
}
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param $typeId
|
||||
*
|
||||
|
|
|
|||
|
|
@ -703,6 +703,7 @@ class BasePaymentDriver
|
|||
if($invoice->isQuote()) {
|
||||
$invoiceService = app('App\Services\InvoiceService');
|
||||
$invoice = $invoiceService->convertQuote($invoice);
|
||||
$invitation = $invoice->invitationByContactId($invitation->contact_id);
|
||||
}
|
||||
|
||||
$invoice->markSentIfUnsent();
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue