diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index e3e0f60ce31..6c9707e4ff9 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -1443,11 +1443,26 @@ if (empty($reshook)) $object->origin = $origin; $object->origin_id = $originid; - foreach ($object->lines as &$line) + foreach ($object->lines as $i => &$line) { $line->origin = $object->origin; $line->origin_id = $line->id; $line->fetch_optionals($line->id); + + // Si fk_remise_except defini on vérifie si la réduction à déjà été appliquée + if ($line->fk_remise_except) + { + $discount=new DiscountAbsolute($line->db); + $result=$discount->fetch($line->fk_remise_except); + if ($result > 0) + { + // Check if discount not already affected to another invoice + if ($discount->fk_facture_line > 0) + { + $line->fk_remise_except = 0; + } + } + } } }