From 0dd56d89a2423802fb939d58cbb4b0a318a6fdc9 Mon Sep 17 00:00:00 2001 From: Pichinov-Jose Date: Wed, 19 Aug 2026 01:03:48 +0200 Subject: [PATCH] Add thirdparty (supplier) line to FactureFournisseur and SupplierProposal tooltips (#39570) CommandeFournisseur::getTooltipContentArray() already adds a "Supplier" line (thirdparty getNomUrl) to the getNomUrl tooltip, but FactureFournisseur and SupplierProposal do not. Hovering a supplier invoice or supplier proposal link therefore never shows which thirdparty it belongs to, an inconsistency between three otherwise-similar objects. Align both with CommandeFournisseur: add the same $datas['supplier'] entry, right after RefSupplier, honoring the 'nofetch' param. Co-authored-by: Claude Opus 4.8 --- htdocs/fourn/class/fournisseur.facture.class.php | 10 ++++++++++ .../class/supplier_proposal.class.php | 10 ++++++++++ 2 files changed, 20 insertions(+) diff --git a/htdocs/fourn/class/fournisseur.facture.class.php b/htdocs/fourn/class/fournisseur.facture.class.php index 89ed63672d1..63f0b273a95 100644 --- a/htdocs/fourn/class/fournisseur.facture.class.php +++ b/htdocs/fourn/class/fournisseur.facture.class.php @@ -17,6 +17,7 @@ * Copyright (C) 2023 Nick Fragoulis * Copyright (C) 2024-2026 MDW * Copyright (C) 2026 Vincent de Grandpré + * Copyright (C) 2026 Jose Martinez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2869,6 +2870,15 @@ class FactureFournisseur extends CommonInvoice if (!empty($this->ref_supplier)) { $datas['refsupplier'] = '
'.$langs->trans('RefSupplier').': '.$this->ref_supplier; } + if (empty($params['nofetch'])) { + $langs->load('companies'); + if (empty($this->thirdparty)) { + $this->fetch_thirdparty(); + } + if (is_object($this->thirdparty)) { + $datas['supplier'] = '
'.$langs->trans('Supplier').': '.$this->thirdparty->getNomUrl(1, '', 0, 1); + } + } if (!empty($this->label)) { $datas['label'] = '
'.$langs->trans('Label').': '.$this->label; } diff --git a/htdocs/supplier_proposal/class/supplier_proposal.class.php b/htdocs/supplier_proposal/class/supplier_proposal.class.php index cabc9f2de09..32c4146b0ff 100644 --- a/htdocs/supplier_proposal/class/supplier_proposal.class.php +++ b/htdocs/supplier_proposal/class/supplier_proposal.class.php @@ -19,6 +19,7 @@ * Copyright (C) 2024-2026 MDW * Copyright (C) 2026 Vincent de Grandpré * Copyright (C) 2026 Lionel Vessiller + * Copyright (C) 2026 Jose Martinez * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -2547,6 +2548,15 @@ class SupplierProposal extends CommonObject if (!empty($this->ref_fourn)) { $datas['ref_supplier'] = '
'.$langs->trans('RefSupplier').': '.$this->ref_fourn; } + if (empty($params['nofetch'])) { + $langs->load('companies'); + if (empty($this->thirdparty)) { + $this->fetch_thirdparty(); + } + if (is_object($this->thirdparty)) { + $datas['supplier'] = '
'.$langs->trans('Supplier').': '.$this->thirdparty->getNomUrl(1, '', 0, 1); + } + } if (!empty($this->total_ht)) { $datas['amount_ht'] = '
'.$langs->trans('AmountHT').': '.price($this->total_ht, 0, $langs, 0, -1, -1, getDolCurrency()); }