From c412d6c5a3f695d1c9a5a5e93eb620dbd8fe6297 Mon Sep 17 00:00:00 2001 From: data Date: Tue, 17 Feb 2026 07:05:51 +0100 Subject: [PATCH] Einkaufspreise aller Lieferanten bei zugeordneten Produkten anzeigen Co-Authored-By: Claude Opus 4.6 --- import.php | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/import.php b/import.php index 83eb27c..3cf83be 100755 --- a/import.php +++ b/import.php @@ -2056,6 +2056,32 @@ if ($action == 'edit' && $import->id > 0) { print '
'.dol_escape_htmltag($line->ean).''; } print ' '; + + // Alle Einkaufspreise des Produktes anzeigen + $sqlPrices = "SELECT pfp.fk_soc, pfp.price, pfp.ref_fourn, pfp.quantity, s.nom as supplier_name"; + $sqlPrices .= " FROM ".MAIN_DB_PREFIX."product_fournisseur_price pfp"; + $sqlPrices .= " LEFT JOIN ".MAIN_DB_PREFIX."societe s ON s.rowid = pfp.fk_soc"; + $sqlPrices .= " WHERE pfp.fk_product = ".(int)$line->fk_product; + $sqlPrices .= " ORDER BY pfp.price ASC"; + $resPrices = $db->query($sqlPrices); + if ($resPrices && $db->num_rows($resPrices) > 0) { + print '
'; + while ($objP = $db->fetch_object($resPrices)) { + $isInvoiceSupplier = ($objP->fk_soc == $import->fk_soc); + $style = $isInvoiceSupplier ? 'font-weight: bold;' : 'color: #666;'; + print '
'; + print dol_escape_htmltag($objP->supplier_name); + print ': '.price($objP->price).''; + if (!empty($objP->ref_fourn)) { + print ' ('.dol_escape_htmltag($objP->ref_fourn).')'; + } + if ($isInvoiceSupplier) { + print ' '; + } + print '
'; + } + print '
'; + } } else { print ''.$langs->trans('NoProductMatch').''; }