From a6cedef7d8301aa0b86f7da82112dfb6007f3e96 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Thu, 15 Feb 2024 08:31:08 +1100 Subject: [PATCH] Fixes for recurring ivnoices --- app/Jobs/Cron/SubscriptionCron.php | 4 ++-- app/Jobs/Util/VersionCheck.php | 2 +- app/Mail/Admin/InventoryNotificationObject.php | 2 +- app/Models/RecurringInvoice.php | 4 +++- 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/app/Jobs/Cron/SubscriptionCron.php b/app/Jobs/Cron/SubscriptionCron.php index 2eedf262c576..42b61a2ddcd8 100644 --- a/app/Jobs/Cron/SubscriptionCron.php +++ b/app/Jobs/Cron/SubscriptionCron.php @@ -52,7 +52,7 @@ class SubscriptionCron ->whereNotNull('subscription_id') ->cursor(); - $invoices->each(function ($invoice) { + $invoices->each(function (Invoice $invoice) { $subscription = $invoice->subscription; $body = [ @@ -80,7 +80,7 @@ class SubscriptionCron ->whereNotNull('subscription_id') ->cursor(); - $invoices->each(function ($invoice) { + $invoices->each(function (Invoice $invoice) { $subscription = $invoice->subscription; $body = [ diff --git a/app/Jobs/Util/VersionCheck.php b/app/Jobs/Util/VersionCheck.php index 4a69a1586232..070ad3cda361 100644 --- a/app/Jobs/Util/VersionCheck.php +++ b/app/Jobs/Util/VersionCheck.php @@ -94,7 +94,7 @@ class VersionCheck implements ShouldQueue Client::doesntHave('contacts') ->cursor() - ->each(function ($client) { + ->each(function (Client $client) { $new_contact = ClientContactFactory::create($client->company_id, $client->user_id); $new_contact->client_id = $client->id; diff --git a/app/Mail/Admin/InventoryNotificationObject.php b/app/Mail/Admin/InventoryNotificationObject.php index 66cdc909da7b..1beb298cb830 100644 --- a/app/Mail/Admin/InventoryNotificationObject.php +++ b/app/Mail/Admin/InventoryNotificationObject.php @@ -76,7 +76,7 @@ class InventoryNotificationObject 'settings' => $this->product->company->settings, 'whitelabel' => $this->product->company->account->isPaid() ? true : false, 'text_body' => $content, - 'template' => $this->company->account->isPremium() ? 'email.template.admin_premium' : 'email.template.admin', + 'template' => $this->product->company->account->isPremium() ? 'email.template.admin_premium' : 'email.template.admin', ]; return $data; diff --git a/app/Models/RecurringInvoice.php b/app/Models/RecurringInvoice.php index 1748b9f812fa..0236db9f33d9 100644 --- a/app/Models/RecurringInvoice.php +++ b/app/Models/RecurringInvoice.php @@ -122,7 +122,6 @@ use Laracasts\Presenter\PresentableTrait; * @property-read \Illuminate\Database\Eloquent\Collection $history * @property-read \Illuminate\Database\Eloquent\Collection $invitations * @property-read \Illuminate\Database\Eloquent\Collection $invoices - * @method static \Illuminate\Database\Eloquent\Builder|BaseModel company() * @property bool $is_proforma * @mixin \Eloquent */ @@ -295,6 +294,9 @@ class RecurringInvoice extends BaseModel return $this->hasManyThrough(Backup::class, Activity::class); } + /** + * @return \Illuminate\Database\Eloquent\Relations\BelongsTo + */ public function company(): \Illuminate\Database\Eloquent\Relations\BelongsTo { return $this->belongsTo(Company::class);