From 87fc31fa7cccba7c6ff1999f7b50d6a9fea5c899 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Charl=C3=A8ne=20Benke?= <1179011+defrance@users.noreply.github.com> Date: Mon, 16 Feb 2026 20:03:27 +0100 Subject: [PATCH] add company name on dropdown contract list (#37245) --- htdocs/core/class/html.formcontract.class.php | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/htdocs/core/class/html.formcontract.class.php b/htdocs/core/class/html.formcontract.class.php index 11eca55e4b6..2eb6591b79b 100644 --- a/htdocs/core/class/html.formcontract.class.php +++ b/htdocs/core/class/html.formcontract.class.php @@ -1,5 +1,5 @@ +/* Copyright (C) 2012-2026 Charlene BENKE * Copyright (C) 2025 MDW * * This program is free software; you can redistribute it and/or modify @@ -77,9 +77,10 @@ class FormContract $ret = ''; // Search all contacts - $sql = "SELECT c.rowid, c.ref, c.fk_soc, c.statut,"; + $sql = "SELECT c.rowid, c.ref, c.fk_soc, c.statut, s.nom,"; $sql .= " c.ref_customer, c.ref_supplier"; $sql .= " FROM ".$this->db->prefix()."contrat as c"; + $sql .= " INNER JOIN".$this->db->prefix()."societe as s ON s.rowid = c.fk_soc"; $sql .= " WHERE c.entity = ".$conf->entity; //if ($contratListId) $sql.= " AND c.rowid IN (".$this->db->sanitize($contratListId).")"; if ($socid > 0) { @@ -115,6 +116,7 @@ class FormContract $labeltoshow = dol_trunc($obj->ref, 18); if ($showRef) { + $labeltoshow = $labeltoshow." - ".$obj->nom; if ($obj->ref_customer) { $labeltoshow = $labeltoshow." - ".$obj->ref_customer; }