From ccce21c0eca72c55fdeebd160cf64c7894a0c1df Mon Sep 17 00:00:00 2001 From: David Bomba Date: Wed, 29 Oct 2025 16:06:23 +1100 Subject: [PATCH] Unify quote conversion --- app/Http/Controllers/QuoteController.php | 3 ++- app/Services/Quote/QuoteService.php | 11 +++++++++-- 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/app/Http/Controllers/QuoteController.php b/app/Http/Controllers/QuoteController.php index 6cfcdf966e..9cb18d9b21 100644 --- a/app/Http/Controllers/QuoteController.php +++ b/app/Http/Controllers/QuoteController.php @@ -561,7 +561,8 @@ class QuoteController extends BaseController $quotes->each(function ($quote, $key) use ($user) { if ($user->can('edit', $quote) && $quote->service()->isConvertable()) { - $quote->service()->convertToInvoice(); + // $quote->service()->convertToInvoice(); + $quote->service()->convert()->save(); } }); diff --git a/app/Services/Quote/QuoteService.php b/app/Services/Quote/QuoteService.php index 7e76a82b1a..13a380e5d0 100644 --- a/app/Services/Quote/QuoteService.php +++ b/app/Services/Quote/QuoteService.php @@ -161,12 +161,19 @@ class QuoteService return $this; } - + + /** + * convertToInvoice + * + * @NOTE - this method will force the quote to include all invitations for the + * client where ADD TO INVOICE = true + * + */ public function convertToInvoice() { $this->convert(); - $this->invoice->service()->createInvitations(); + // $this->invoice->service()->createInvitations(); return $this->invoice; }