Fix_situation_discount_used
This commit is contained in:
parent
20c50e809d
commit
b42c87256c
@ -1362,11 +1362,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)
|
||||
{
|
||||
unset($object->lines[$i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user