diff --git a/include/Cron.php b/include/Cron.php index 80bc67a..f0f41a0 100644 --- a/include/Cron.php +++ b/include/Cron.php @@ -96,7 +96,9 @@ class Cron { $extended_loans[] = $loan; } } - $this->send_receipt($user, $new_loans, $extended_loans); + if($new_loans || $extended_loans) { + $this->send_receipt($user, $new_loans, $extended_loans); + } $delete = prepare('delete from `pending_receipt` where `user` = ? and `send_time` < ?'); bind($delete, 'ii', $user->get_id(), $this->now->getTimestamp());