612 |
print $client_facture->nom.'</a><br />'; |
print $client_facture->nom.'</a><br />'; |
613 |
print $client_facture->cp . " " .$client_facture->ville; |
print $client_facture->cp . " " .$client_facture->ville; |
614 |
|
|
615 |
print '</td><td>'; |
print '</td><td valign="top" rowspan="9">'; |
616 |
|
|
617 |
if ($ligne->mode_paiement == 'pre') |
/* Historique */ |
618 |
|
|
619 |
|
print '<table width="100%" class="border">'; |
620 |
|
print '<tr class="liste_titre">'; |
621 |
|
print '<td>Date</td>'; |
622 |
|
print '<td>Statut</td>'; |
623 |
|
print '<td>Fournisseur</td>'; |
624 |
|
print '<td>Rapporteur</td>'; |
625 |
|
print '</tr>'; |
626 |
|
$ff = array(); |
627 |
|
$sql = "SELECT rowid, nom FROM ".MAIN_DB_PREFIX."telephonie_fournisseur"; |
628 |
|
$sql .= " ORDER BY nom "; |
629 |
|
|
630 |
|
$resql = $db->query($sql); |
631 |
|
if ($resql) |
632 |
|
{ |
633 |
|
$num = $db->num_rows($resql); |
634 |
|
if ( $num > 0 ) |
635 |
|
{ |
636 |
|
$i = 0; |
637 |
|
while ($i < $num) |
638 |
|
{ |
639 |
|
$row = $db->fetch_row($resql); |
640 |
|
$ff[$row[0]] = $row[1]; |
641 |
|
$i++; |
642 |
|
} |
643 |
|
} |
644 |
|
$db->free($resql); |
645 |
|
} |
646 |
|
|
647 |
|
$sql = "SELECT ".$db->pdate("l.tms").", l.statut, l.fk_user"; |
648 |
|
$sql .= ", u.code, u.code, l.comment, l.fk_fournisseur"; |
649 |
|
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne_statut as l"; |
650 |
|
$sql .= ",".MAIN_DB_PREFIX."user as u"; |
651 |
|
$sql .= " WHERE u.rowid = l.fk_user AND l.fk_ligne = ".$ligne->id; |
652 |
|
$sql .= " ORDER BY l.tms DESC "; |
653 |
|
if ( $db->query( $sql) ) |
654 |
{ |
{ |
655 |
print 'RIB : '.$client_facture->display_rib(); |
$num = $db->num_rows(); |
656 |
|
if ( $num > 0 ) |
657 |
|
{ |
658 |
|
$i = 0; |
659 |
|
while ($i < $num) |
660 |
|
{ |
661 |
|
$row = $db->fetch_row($i); |
662 |
|
|
663 |
|
print '<tr><td valign="top" width="20%">'.strftime("%d/%m/%y",$row[0]).'</td>'; |
664 |
|
print '<td><img src="./graph'.$row[1].'.png"> '; |
665 |
|
print $ligne->statuts[$row[1]]; |
666 |
|
if ($row[5]) |
667 |
|
{ |
668 |
|
print '<br />'.$row[5]; |
669 |
|
} |
670 |
|
|
671 |
|
print '</td><td>'; |
672 |
|
|
673 |
|
print $ff[$row[6]]; |
674 |
|
|
675 |
|
print '</td><td>'. $row[3] . "</td></tr>"; |
676 |
|
$i++; |
677 |
|
} |
678 |
|
} |
679 |
|
$db->free(); |
680 |
} |
} |
681 |
else |
else |
682 |
{ |
{ |
683 |
print 'Paiement par virement'; |
print $sql; |
684 |
} |
} |
685 |
|
|
686 |
|
print "</table>"; |
687 |
|
|
688 |
|
|
689 |
|
/* Fin historique */ |
690 |
|
|
691 |
|
|
692 |
|
|
693 |
print '</td></tr>'; |
print '</td></tr>'; |
694 |
|
|
707 |
} |
} |
708 |
$db->free(); |
$db->free(); |
709 |
} |
} |
|
print '</td><td>PDF détail : '.$ligne->pdfdetail; |
|
|
|
|
710 |
print '</td></tr>'; |
print '</td></tr>'; |
711 |
|
|
712 |
|
print '<tr><td>PDF détail</td><td>'.$ligne->pdfdetail.'</td></tr>'; |
713 |
|
|
714 |
|
|
715 |
|
|
716 |
print '<tr><td width="20%">Remise LMN</td><td>'.$ligne->remise.' %</td>'; |
print '<tr><td width="20%">Remise LMN</td><td>'.$ligne->remise.' % '; |
717 |
print '<td><a href="remises.php?id='.$ligne->id.'">historique</a></td></tr>'; |
print '(<a href="remises.php?id='.$ligne->id.'">historique</a>)</td></tr>'; |
718 |
|
|
719 |
$commercial_suiv = new User($db, $ligne->commercial_suiv_id); |
$commercial_suiv = new User($db, $ligne->commercial_suiv_id); |
720 |
$commercial_suiv->fetch(); |
$commercial_suiv->fetch(); |
721 |
|
|
722 |
print '<tr><td width="20%">Commercial</td>'; |
print '<tr><td width="20%">Commercial</td>'; |
723 |
print '<td>'.$commercial_suiv->fullname.'</td>'; |
print '<td>'.$commercial_suiv->fullname.'</td></tr>'; |
724 |
print '<td>Signé par : '; |
print '<tr><td>Signé par</td><td>'; |
725 |
|
|
726 |
|
|
727 |
if ($ligne->commercial_suiv_id <> $ligne->commercial_sign_id) |
if ($ligne->commercial_suiv_id <> $ligne->commercial_sign_id) |
738 |
|
|
739 |
|
|
740 |
print '<tr><td width="20%">Concurrent précédent</td>'; |
print '<tr><td width="20%">Concurrent précédent</td>'; |
741 |
print '<td colspan="2">'.$ligne->print_concurrent_nom().'</td></tr>'; |
print '<td>'.$ligne->print_concurrent_nom().'</td></tr>'; |
742 |
|
|
743 |
print '<tr><td width="20%">Communications</td><td colspan="2">'; |
print '<tr><td width="20%">Communications</td><td>'; |
744 |
print '<a href="communications.php?ligne='.$ligne->numero.'">liste</a>'; |
print '<a href="communications.php?ligne='.$ligne->numero.'">liste</a>'; |
745 |
print '</td></tr>'; |
print '</td></tr>'; |
746 |
|
|
747 |
print '<tr><td width="20%">Factures</td><td colspan="2">'; |
print '<tr><td width="20%">Factures</td><td>'; |
748 |
print '<a href="'.DOL_URL_ROOT.'/telephonie/facture/liste.php?search_ligne='.$ligne->numero.'">liste</a>'; |
print '<a href="'.DOL_URL_ROOT.'/telephonie/facture/liste.php?search_ligne='.$ligne->numero.'">liste</a>'; |
749 |
print '</td></tr>'; |
print '</td></tr>'; |
750 |
|
|