diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php
index d2b03476f57..e2289c8be23 100644
--- a/htdocs/telephonie/ligne/fiche.php
+++ b/htdocs/telephonie/ligne/fiche.php
@@ -612,16 +612,83 @@ else
print $client_facture->nom.'
';
print $client_facture->cp . " " .$client_facture->ville;
- print '
';
+ print ' | ';
- if ($ligne->mode_paiement == 'pre')
+ /* Historique */
+
+ print '';
+ print '';
+ print '| Date | ';
+ print 'Statut | ';
+ print 'Fournisseur | ';
+ print 'Rapporteur | ';
+ print ' ';
+ $ff = array();
+ $sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_fournisseur";
+ $sql .= " ORDER BY nom ";
+
+ $resql = $db->query($sql);
+ if ($resql)
{
- print 'RIB : '.$client_facture->display_rib();
+ $num = $db->num_rows($resql);
+ if ( $num > 0 )
+ {
+ $i = 0;
+ while ($i < $num)
+ {
+ $row = $db->fetch_row($resql);
+ $ff[$row[0]] = $row[1];
+ $i++;
+ }
+ }
+ $db->free($resql);
+ }
+
+ $sql = "SELECT ".$db->pdate("l.tms").", l.statut, l.fk_user";
+ $sql .= ", u.code, u.code, l.comment, l.fk_fournisseur";
+ $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne_statut as l";
+ $sql .= ",".MAIN_DB_PREFIX."user as u";
+ $sql .= " WHERE u.rowid = l.fk_user AND l.fk_ligne = ".$ligne->id;
+ $sql .= " ORDER BY l.tms DESC ";
+ if ( $db->query( $sql) )
+ {
+ $num = $db->num_rows();
+ if ( $num > 0 )
+ {
+ $i = 0;
+ while ($i < $num)
+ {
+ $row = $db->fetch_row($i);
+
+ print '| '.strftime("%d/%m/%y",$row[0]).' | ';
+ print ' ';
+ print $ligne->statuts[$row[1]];
+ if ($row[5])
+ {
+ print ' '.$row[5];
+ }
+
+ print ' | ';
+
+ print $ff[$row[6]];
+
+ print ' | '. $row[3] . " | ";
+ $i++;
+ }
+ }
+ $db->free();
}
else
{
- print 'Paiement par virement';
+ print $sql;
}
+
+ print " ";
+
+
+ /* Fin historique */
+
+
print ' | ';
@@ -640,21 +707,21 @@ else
}
$db->free();
}
- print 'PDF détail : '.$ligne->pdfdetail;
-
print ' | ';
+ print '| PDF détail | '.$ligne->pdfdetail.' |
';
- print '| Remise LMN | '.$ligne->remise.' % | ';
- print 'historique |
';
+
+ print '| Remise LMN | '.$ligne->remise.' % ';
+ print '(historique) |
';
$commercial_suiv = new User($db, $ligne->commercial_suiv_id);
$commercial_suiv->fetch();
print '| Commercial | ';
- print ''.$commercial_suiv->fullname.' | ';
- print 'Signé par : ';
+ print ' | '.$commercial_suiv->fullname.' |
';
+ print '| Signé par | ';
if ($ligne->commercial_suiv_id <> $ligne->commercial_sign_id)
@@ -671,13 +738,13 @@ else
print ' |
| Concurrent précédent | ';
- print ''.$ligne->print_concurrent_nom().' |
';
+ print ''.$ligne->print_concurrent_nom().' | ';
- print '| Communications | ';
+ print ' |
| Communications | ';
print 'liste';
print ' |
';
- print '| Factures | ';
+ print ' |
| Factures | ';
print 'liste';
print ' |
';