From 6342225cc17267b82df9d8e5ee1a86c619215e5f Mon Sep 17 00:00:00 2001 From: data Date: Fri, 20 Feb 2026 09:12:53 +0100 Subject: [PATCH] Fix: Wrong column name fk_paiement_fourn -> fk_paiementfourn The column in llx_paiementfourn_facturefourn is fk_paiementfourn (no underscore) not fk_paiement_fourn. This caused payment lookups to fail, creating duplicate payments instead of linking to existing ones. Co-Authored-By: Claude Opus 4.5 --- card.php | 2 +- class/banktransaction.class.php | 4 ++-- core/modules/modBankImport.class.php | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/card.php b/card.php index 4a7f88a..ee287cc 100755 --- a/card.php +++ b/card.php @@ -496,7 +496,7 @@ if ($object->id > 0) { $sql = "SELECT pf.fk_facturefourn, pf.amount, f.ref, f.ref_supplier, f.total_ttc"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pf"; $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."facture_fourn as f ON pf.fk_facturefourn = f.rowid"; - $sql .= " WHERE pf.fk_paiement_fourn = ".((int) $object->fk_paiementfourn); + $sql .= " WHERE pf.fk_paiementfourn = ".((int) $object->fk_paiementfourn); $resql = $db->query($sql); $invoicesFound = false; if ($resql && $db->num_rows($resql) > 0) { diff --git a/class/banktransaction.class.php b/class/banktransaction.class.php index 8ce492c..7d836aa 100755 --- a/class/banktransaction.class.php +++ b/class/banktransaction.class.php @@ -1656,7 +1656,7 @@ class BankImportTransaction extends CommonObject } // Find the payment(s) for this invoice - $sql = "SELECT pfp.fk_paiement_fourn as payment_id, pfp.amount"; + $sql = "SELECT pfp.fk_paiementfourn as payment_id, pfp.amount"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pfp"; $sql .= " WHERE pfp.fk_facturefourn = ".((int) $invoiceId); $sql .= " ORDER BY pfp.rowid DESC"; @@ -1951,7 +1951,7 @@ class BankImportTransaction extends CommonObject } // Find payment for this invoice - $sql = "SELECT pfp.fk_paiement_fourn as payment_id"; + $sql = "SELECT pfp.fk_paiementfourn as payment_id"; $sql .= " FROM ".MAIN_DB_PREFIX."paiementfourn_facturefourn as pfp"; $sql .= " WHERE pfp.fk_facturefourn = ".((int) $invoiceId); $sql .= " ORDER BY pfp.rowid DESC LIMIT 1"; diff --git a/core/modules/modBankImport.class.php b/core/modules/modBankImport.class.php index 14d647e..fb1f83b 100755 --- a/core/modules/modBankImport.class.php +++ b/core/modules/modBankImport.class.php @@ -76,7 +76,7 @@ class modBankImport extends DolibarrModules $this->editor_squarred_logo = ''; // Must be image filename into the module/img directory followed with @modulename. Example: 'myimage.png@bankimport' // Possible values for version are: 'development', 'experimental', 'dolibarr', 'dolibarr_deprecated', 'experimental_deprecated' or a version string like 'x.y.z' - $this->version = '1.7'; + $this->version = '1.8'; // Url to the file with your last numberversion of this module //$this->url_last_version = 'http://www.example.com/versionmodule.txt';