From 9e3e4f9636c6a7fba614f4e5955e2ab9c421659c Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Nov 2024 11:29:57 +0100 Subject: [PATCH 1/2] fix #32060 --- htdocs/compta/facture/class/facture-rec.class.php | 3 ++- htdocs/fourn/class/fournisseur.facture-rec.class.php | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index 3a5fe7166ab60..ae484d57a3b9d 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1311,7 +1311,8 @@ public function getNextDate() if (empty($this->date_when)) { return false; } - return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency); + // TODO : In case of YEAR should calculate the real next day of the year and not hard coded +365 days + return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency, 1); } /** diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index f57cfab72fbe6..402b53a68f470 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1307,7 +1307,8 @@ public function getNextDate() if (empty($this->date_when)) { return false; } - return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency); + // TODO : In case of YEAR should calculate the real next day of the year and not hard coded +365 days + return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency, 1); } /** From 75d7e803bec8e5bbfcd10d63dbd703ba4abe27ef Mon Sep 17 00:00:00 2001 From: Florian HENRY Date: Fri, 22 Nov 2024 11:40:22 +0100 Subject: [PATCH 2/2] fix #32060 --- htdocs/compta/facture/class/facture-rec.class.php | 1 - htdocs/fourn/class/fournisseur.facture-rec.class.php | 1 - 2 files changed, 2 deletions(-) diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php index ae484d57a3b9d..f9cd158244f0a 100644 --- a/htdocs/compta/facture/class/facture-rec.class.php +++ b/htdocs/compta/facture/class/facture-rec.class.php @@ -1311,7 +1311,6 @@ public function getNextDate() if (empty($this->date_when)) { return false; } - // TODO : In case of YEAR should calculate the real next day of the year and not hard coded +365 days return dol_time_plus_duree($this->date_when, $this->frequency, $this->unit_frequency, 1); } diff --git a/htdocs/fourn/class/fournisseur.facture-rec.class.php b/htdocs/fourn/class/fournisseur.facture-rec.class.php index 402b53a68f470..7d2ea231dfc70 100644 --- a/htdocs/fourn/class/fournisseur.facture-rec.class.php +++ b/htdocs/fourn/class/fournisseur.facture-rec.class.php @@ -1307,7 +1307,6 @@ public function getNextDate() if (empty($this->date_when)) { return false; } - // TODO : In case of YEAR should calculate the real next day of the year and not hard coded +365 days return dol_time_plus_duree((int) $this->date_when, $this->frequency, $this->unit_frequency, 1); }