1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 05:02:36 +01: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);