From 3ed18dc92c3943d56598abb735af61ba469f71ec Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Fri, 5 Jan 2024 15:47:24 +0100 Subject: [PATCH] fix create invoice from contract with free service line --- htdocs/compta/facture/card.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index 3a2d80e8709..404e9afa3da 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1723,7 +1723,8 @@ if (empty($reshook)) { } } else { // Positive line - $product_type = ($lines[$i]->product_type ? $lines[$i]->product_type : 0); + // we keep first type from product if exist, otherwise we keep type from line (free line) + $product_type = $lines[$i]->product_type ?? ($lines[$i]->type ?? 0); // Date start $date_start = false;