From 1cfb2a0ad1f888fe4392fbb5d32c3a4c6de0e223 Mon Sep 17 00:00:00 2001 From: David Bomba Date: Sat, 22 Jun 2024 14:53:45 +1000 Subject: [PATCH] Fixes for tests --- app/Services/Subscription/SubscriptionStatus.php | 2 +- app/Utils/Traits/MakesReminders.php | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/app/Services/Subscription/SubscriptionStatus.php b/app/Services/Subscription/SubscriptionStatus.php index 8aa6226bfdbe..e4252a8dd3bd 100644 --- a/app/Services/Subscription/SubscriptionStatus.php +++ b/app/Services/Subscription/SubscriptionStatus.php @@ -174,7 +174,7 @@ class SubscriptionStatus extends AbstractService */ private function checkRefundable(): self { - if(!$this->recurring_invoice->subscription->refund_period || $this->recurring_invoice->subscription->refund_period === 0) { + if(!$this->recurring_invoice->subscription->refund_period || (int)$this->recurring_invoice->subscription->refund_period == 0) { return $this->setRefundable(false); } diff --git a/app/Utils/Traits/MakesReminders.php b/app/Utils/Traits/MakesReminders.php index dcfd9a95988e..e6e6460abaed 100644 --- a/app/Utils/Traits/MakesReminders.php +++ b/app/Utils/Traits/MakesReminders.php @@ -82,6 +82,9 @@ trait MakesReminders private function checkEndlessReminder($last_sent_date, $endless_reminder_frequency_id): bool { + if(!$last_sent_date) + return false; + if (Carbon::now()->startOfDay()->eq($this->addTimeInterval($last_sent_date, $endless_reminder_frequency_id))) { return true; }