From 9a40c966bd7d4cb67b8f16fbbb97b01d345034b0 Mon Sep 17 00:00:00 2001 From: piernov Date: Thu, 19 Jan 2023 16:25:59 +0100 Subject: [PATCH] Fix: don setPaid sets paid field When donation is classified as paid, paid field also needs to be set to 1 so that accounting reports show the correct information. --- htdocs/don/class/don.class.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/don/class/don.class.php b/htdocs/don/class/don.class.php index 181b3fc0ca3..3b09e8cc178 100644 --- a/htdocs/don/class/don.class.php +++ b/htdocs/don/class/don.class.php @@ -758,7 +758,7 @@ class Don extends CommonObject */ public function setPaid($id, $modepayment = 0) { - $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2"; + $sql = "UPDATE ".MAIN_DB_PREFIX."don SET fk_statut = 2, paid = 1"; if ($modepayment) { $sql .= ", fk_payment = ".((int) $modepayment); } @@ -768,6 +768,7 @@ class Don extends CommonObject if ($resql) { if ($this->db->affected_rows($resql)) { $this->statut = 2; + $this->paid = 1; return 1; } else { return 0;