From ab0e1677fb4782fe91634fabad3d519116c2c6d6 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sun, 13 Feb 2022 19:48:59 +1100 Subject: [PATCH] Show last invoice in previews --- app/Http/Controllers/PreviewController.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Http/Controllers/PreviewController.php b/app/Http/Controllers/PreviewController.php index 28d28df4d86d..3581cba35c22 100644 --- a/app/Http/Controllers/PreviewController.php +++ b/app/Http/Controllers/PreviewController.php @@ -311,7 +311,7 @@ class PreviewController extends BaseController $t = app('translator'); $t->replace(Ninja::transformTranslations(auth()->user()->company()->settings)); - $invitation = InvoiceInvitation::where('company_id', auth()->user()->company()->id)->first(); + $invitation = InvoiceInvitation::where('company_id', auth()->user()->company()->id)->orderBy('id', 'desc')->first(); /* If we don't have a valid invitation in the system - create a mock using transactions */ if(!$invitation)