1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 00:11:35 +02:00

PaymentDriver - Convert quote to invoice on payment

Signed-off-by: Kristián Feldsam <feldsam@gmail.com>
This commit is contained in:
Kristián Feldsam 2019-04-29 10:59:24 +02:00
parent f119a6f74c
commit d7368851f5

View File

@ -698,6 +698,13 @@ class BasePaymentDriver
if (! $invoice->canBePaid()) {
return false;
}
// check if invoice is quote and if is, them convert it
if($invoice->isQuote()) {
$invoiceService = app('App\Services\InvoiceService');
$invoice = $invoiceService->convertQuote($invoice);
}
$invoice->markSentIfUnsent();
$payment = Payment::createNew($invitation);