* * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation; either version 2 of the License, or * (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ * $Source$ * */ require("./pre.inc.php"); $page = $_GET["page"]; $sortorder = $_GET["sortorder"]; $sortfield = $_GET["sortfield"]; llxHeader(); /* * Sécurité accés client */ if ($user->societe_id > 0) { $action = ''; $socidp = $user->societe_id; } if ($sortorder == "") { $sortorder="DESC"; } if ($sortfield == "") { $sortfield="f.date"; } if ($page == -1) { $page = 0 ; } /* * Mode Liste * * * */ $sql = "SELECT distinct(ligne), sum(montant) "; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_import_cdr"; if ($_GET["search_ligne"]) { $sql .= " WHERE f.ligne LIKE '%".$_GET["search_ligne"]."%'"; } $sql .= " GROUP BY ligne"; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); $i = 0; print_barre_liste("Vérification avant facturation", $page, "check.php", "", $sortfield, $sortorder, '', $num); print '
| Ligne'; print ' | Client | Client facturé | Montant | Remise LMN | '; print 'RIB'; print ' | ||||||||||||
";
$ligne = new LigneTel($db);
if ($ligne->fetch($row[0]) == 1)
{
print ' ';
print '';
print img_file();
print ' ';
print dolibarr_print_phone($row[0])." | \n";
print ''; $client = new Societe($db); if ($client->fetch($ligne->client_id)) { print $client->nom." | \n"; } else { print "Erreur"; } print ''; if ($ligne->facturable) { $clientf = new Societe($db); if ($clientf->fetch($ligne->client_facture_id)) { print ''; print $clientf->nom." | \n"; print ''.price($row[1])." | ";; /* Remise LMN */ print ''.$ligne->remise.' % | '; print ''; if ($ligne->mode_paiement == 'pre') { if ($clientf->verif_rib()) { print 'ok'; } else { print "Alerte RIB"; } } else { print 'Virement'; } print " | \n"; } else { print "Erreur- | "; } print ''; $cfs = $ligne->get_contact_facture(); if (sizeof($cfs)) { print $cfs[0]; } else { print "Alerte Emails"; } print " | \n"; } else { print 'Client non facturé'; } } else { print dolibarr_print_phone($row[0]); print ' | Ligne inconnue | '; print ''; } print " | |||||||
| Total HT | '.price($total).' | '; print " | |||||||||||||||
| Total TTC | '.price($total*1.196).' | '; print " | |||||||||||||||