From ee0f2b3c020d26baeb891b250fdbc8e029d47ec3 Mon Sep 17 00:00:00 2001 From: ole1986 Date: Fri, 29 Apr 2022 09:36:17 +0200 Subject: [PATCH 1/2] Fixed invoice reminder from due date calculation --- model/invoice-task.php | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/model/invoice-task.php b/model/invoice-task.php index 8dfe5c8..7e1def2 100644 --- a/model/invoice-task.php +++ b/model/invoice-task.php @@ -224,14 +224,13 @@ public function payment_reminder() if (!empty($res)) { foreach ($res as $v) { $due_date = new \DateTime($v->due_date); - $due_date->add(new \DateInterval("P{$age}D")); $diff = $due_date->diff(new \DateTime()); $diffDays = intval($diff->format("%a")); - $acceptableDays = $age + ($interval * $v->reminder_sent); + $acceptableDays = $age + ($interval * intval($v->reminder_sent)); - if ($v->reminder_sent >= 1 && $diffDays <= $acceptableDays) { + if ($diffDays <= $acceptableDays) { // age: 2 days, interval: 2 days // 4 days later for the second reminder // 6 days later for the third reminder From 211b80c4242cb1148f29f93f372d4496286793ee Mon Sep 17 00:00:00 2001 From: ole1986 Date: Fri, 29 Apr 2022 09:37:05 +0200 Subject: [PATCH 2/2] Version 1.5.16 --- wc-invoice-pdf.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wc-invoice-pdf.php b/wc-invoice-pdf.php index bcb5cc4..c3f27bd 100644 --- a/wc-invoice-pdf.php +++ b/wc-invoice-pdf.php @@ -2,7 +2,7 @@ /* * Plugin Name: WC Recurring Invoice PDF * Description: WooCommerce invoice pdf plugin with recurring payments (scheduled) - * Version: 1.5.15 + * Version: 1.5.16 * Author: ole1986 * Author URI: https://github.com/ole1986/wc-invoice-pdf * Plugin URI: https://github.com/ole1986/wc-invoice-pdf/releases