diff --git a/htdocs/telephonie/script/facturation-calcul.php b/htdocs/telephonie/script/facturation-calcul.php index 7ade1b759de..8d9d69a4c12 100644 --- a/htdocs/telephonie/script/facturation-calcul.php +++ b/htdocs/telephonie/script/facturation-calcul.php @@ -253,10 +253,11 @@ if (!$error) } $sql = "INSERT INTO ".MAIN_DB_PREFIX."telephonie_facture"; - $sql .= " (fk_ligne, ligne, date, isfacturable, fk_batch)"; + $sql .= " (fk_ligne, ligne, date, isfacturable, fk_batch, fk_contrat)"; $sql .= " VALUES (".$ligne->id.","; $sql .= " '$ligne->numero','".$year."-".$month."-01'"; - $sql .= ", '$facturable',".$batch_id.")"; + $sql .= ", '$facturable',".$batch_id; + $sql .= ", ".$ligne->contrat.")"; if ($db->query($sql)) {