Synchro
This commit is contained in:
parent
f08dd65d65
commit
851e3fe891
@ -89,7 +89,11 @@ if ($result)
|
||||
|
||||
$urladd= "&statut=".$_GET["statut"];
|
||||
|
||||
print_barre_liste("Les clients de ".$user->fullname, $page, "my.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
$titre = "Les clients de ".$user->fullname;
|
||||
|
||||
print_barre_liste($titre, $page, "my.php", $urladd, $sortfield, $sortorder, '', $num);
|
||||
|
||||
print '<a href="myxls.php">Exporter dans un tableur</a>';
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre">';
|
||||
@ -106,7 +110,6 @@ if ($result)
|
||||
print '</form>';
|
||||
print '</tr>';
|
||||
|
||||
|
||||
$var=True;
|
||||
|
||||
$ligne = new LigneTel($db);
|
||||
|
||||
@ -74,8 +74,6 @@ if ($_POST["action"] == 'update' && $_POST["cancel"] <> $langs->trans("Cancel"))
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($_POST["action"] == 'addcontact')
|
||||
{
|
||||
$contrat = new TelephonieContrat($db);
|
||||
@ -98,8 +96,6 @@ if ($_GET["action"] == 'delcontact')
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
if ($_GET["action"] == 'delete')
|
||||
{
|
||||
$contrat = new TelephonieContrat($db);
|
||||
|
||||
@ -76,33 +76,31 @@ if ($_GET["id"])
|
||||
|
||||
print_fiche_titre('Fiche Contrat', $mesg);
|
||||
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
$client_comm = new Societe($db, $contrat->client_comm_id);
|
||||
$client_comm->fetch($contrat->client_comm_id);
|
||||
|
||||
print '<tr><td width="20%">Référence</td><td>'.$contrat->ref.'</td>';
|
||||
print '<td colspan="2">Facturé : '.$contrat->facturable.'</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">Client</td><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">';
|
||||
|
||||
print $client_comm->nom.'</a></td><td colspan="2">'.$client_comm->code_client;
|
||||
print '</td></tr>';
|
||||
|
||||
$commercial = new User($db, $contrat->commercial_sign_id);
|
||||
$commercial->fetch();
|
||||
$commercial_suiv = new User($db, $contrat->commercial_suiv_id);
|
||||
$commercial_suiv->fetch();
|
||||
|
||||
print '<tr><td width="20%">Commercial Suivi/Signature</td>';
|
||||
print '<td colspan="3">'.$commercial_suiv->fullname.'/'.$commercial->fullname.'</td></tr>';
|
||||
|
||||
/* Fin Contacts */
|
||||
|
||||
print "</table><br />";
|
||||
|
||||
print '<table class="border" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
$client_comm = new Societe($db, $contrat->client_comm_id);
|
||||
$client_comm->fetch($contrat->client_comm_id);
|
||||
|
||||
print '<tr><td width="20%">Référence</td><td>'.$contrat->ref.'</td>';
|
||||
print '<td colspan="2">Facturé : '.$contrat->facturable.'</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">Client</td><td>';
|
||||
print '<a href="'.DOL_URL_ROOT.'/telephonie/client/fiche.php?id='.$client_comm->id.'">';
|
||||
|
||||
print $client_comm->nom.'</a></td><td colspan="2">'.$client_comm->code_client;
|
||||
print '</td></tr>';
|
||||
|
||||
$commercial = new User($db, $contrat->commercial_sign_id);
|
||||
$commercial->fetch();
|
||||
$commercial_suiv = new User($db, $contrat->commercial_suiv_id);
|
||||
$commercial_suiv->fetch();
|
||||
|
||||
print '<tr><td width="20%">Commercial Suivi/Signature</td>';
|
||||
print '<td colspan="3">'.$commercial_suiv->fullname.'/'.$commercial->fullname.'</td></tr>';
|
||||
|
||||
print "</table><br />";
|
||||
|
||||
|
||||
print '<table class="border" cellpadding="3" cellspacing="0" width="100%">';
|
||||
print '<tr><td width="50%" align="center">Chiffre d\'affaire</td>';
|
||||
print '<td width="50%" align="center">Gain</td></tr>';
|
||||
|
||||
@ -56,6 +56,10 @@ if ($_GET["id"] or $_GET["numero"])
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/facturesdet.php?id=".$ligne->id;
|
||||
$head[$h][1] = $langs->trans('Factures détaillées');
|
||||
$h++;
|
||||
|
||||
$head[$h][0] = DOL_URL_ROOT."/telephonie/ligne/infoc.php?id=".$ligne->id;
|
||||
$head[$h][1] = $langs->trans('Infos');
|
||||
$h++;
|
||||
|
||||
@ -104,6 +104,27 @@ if ($cancel == $langs->trans("Cancel"))
|
||||
print $ligne->statuts[$ligne->statut];
|
||||
print '</td></tr>';
|
||||
|
||||
if ($ligne->user_creat)
|
||||
{
|
||||
print '<tr><td width="20%">Créé par</td><td colspan="2">';
|
||||
|
||||
$cuser = new User($db, $ligne->user_creat);
|
||||
$cuser->fetch();
|
||||
|
||||
print $cuser->fullname;
|
||||
print '</td></tr>';
|
||||
}
|
||||
if ($ligne->user_commande)
|
||||
{
|
||||
print '<tr><td width="20%">Commandé par</td><td colspan="2">';
|
||||
|
||||
$couser = new User($db, $ligne->user_commande);
|
||||
$couser->fetch();
|
||||
|
||||
print $couser->fullname;
|
||||
print '</td></tr>';
|
||||
}
|
||||
|
||||
print '<tr class="liste_titre">';
|
||||
print '<td>Date</td>';
|
||||
print '<td>Statut</td>';
|
||||
|
||||
@ -107,6 +107,8 @@ if (!$error)
|
||||
|
||||
if (!$error && sizeof($factures))
|
||||
{
|
||||
$facok = 0;
|
||||
|
||||
foreach ($factures as $facid)
|
||||
{
|
||||
$error = 0;
|
||||
@ -116,13 +118,12 @@ if (!$error && sizeof($factures))
|
||||
$factel = new FactureTel($db);
|
||||
if ($factel->fetch($facid) == 0)
|
||||
{
|
||||
|
||||
$objligne = new LigneTel($db);
|
||||
|
||||
|
||||
if ($objligne->fetch($factel->ligne) == 1)
|
||||
{
|
||||
// Différents modèles de factures détaillées
|
||||
|
||||
|
||||
$modele = "standard";
|
||||
|
||||
require_once (DOL_DOCUMENT_ROOT."/telephonie/pdf/pdfdetail_".$modele.".modules.php");
|
||||
@ -130,17 +131,21 @@ if (!$error && sizeof($factures))
|
||||
|
||||
$facdet = new $class($db, $ligne, $year, $month, $factel);
|
||||
|
||||
if (! $facdet->write_pdf_file($factel, $factel->ligne))
|
||||
if ($facdet->write_pdf_file($factel, $factel->ligne) == 0)
|
||||
{
|
||||
$facok++;
|
||||
}
|
||||
else
|
||||
{
|
||||
dolibarr_syslog("ERREUR lors de Génération du pdf détaillé");
|
||||
$error = 19;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
dolibarr_syslog(sizeof($factures)." factures traitées");
|
||||
dolibarr_syslog($facok." factures générées");
|
||||
}
|
||||
|
||||
$db->close();
|
||||
|
||||
@ -213,7 +213,7 @@ if (!$error)
|
||||
|
||||
if (sizeof($numlignes) > 0)
|
||||
{
|
||||
_emails($db, $user, $factures_a_mailer);
|
||||
_emails($db, $user, $contrat, $factures_a_mailer);
|
||||
}
|
||||
|
||||
}
|
||||
@ -599,9 +599,8 @@ function _prelevements($db, $user, $factures_prev)
|
||||
|
||||
|
||||
|
||||
function _emails($db, $user, $factures_a_mailer)
|
||||
function _emails($db, $user, $contrat_id, $factures_a_mailer)
|
||||
{
|
||||
|
||||
/********************************************************************
|
||||
* *
|
||||
* *
|
||||
@ -619,6 +618,9 @@ function _emails($db, $user, $factures_a_mailer)
|
||||
$fact = new Facture($db);
|
||||
$fact->fetch($fac);
|
||||
|
||||
$contrat = new TelephonieContrat($db);
|
||||
$contrat->fetch($contrat_id);
|
||||
|
||||
$ligne = new LigneTel($db);
|
||||
|
||||
if ($ligne->fetch_by_facture_number($fact->id) == 0)
|
||||
|
||||
@ -37,7 +37,8 @@ class FactureDetailTableurOne {
|
||||
$dir = "/tmp";
|
||||
$error = 0;
|
||||
|
||||
$fname = $dir."/".$this->ligne."-".substr('00'.$month, -2)."-".$year.".xls";
|
||||
$dir = FAC_OUTPUTDIR . "/" . $fac->ref . "/" ;
|
||||
$file = $dir . $fac->ref . "-$ligne-$objlignetel->code_analytique-detail.xls";
|
||||
|
||||
dolibarr_syslog("Open $fname");
|
||||
|
||||
|
||||
@ -27,6 +27,6 @@ require ("../../master.inc.php");
|
||||
require_once (DOL_DOCUMENT_ROOT."/telephonie/stats/ProcessGraphContrats.class.php");
|
||||
|
||||
$process = new ProcessGraphContrats( $childrenNow, $clientPerChild );
|
||||
$process->go("269");
|
||||
$process->go(269);
|
||||
|
||||
?>
|
||||
|
||||
@ -48,15 +48,10 @@ if ($_POST["action"] == 'add')
|
||||
|
||||
if ($_GET["action"] == 'active')
|
||||
{
|
||||
$service = new LigneTel($db);
|
||||
$service->fetch_by_id($_GET["id"]);
|
||||
$service = new TelephonieService($db);
|
||||
$service->id = $_GET["id"];
|
||||
|
||||
$datea = $db->idate(mktime($h, $m , $s,
|
||||
$_POST["remonth"],
|
||||
$_POST["reday"],
|
||||
$_POST["reyear"]));
|
||||
|
||||
if ( $service->set_statut($user, 3, $datea) == 0)
|
||||
if ( $service->active($user) == 0)
|
||||
{
|
||||
Header("Location: fiche.php?id=".$service->id);
|
||||
}
|
||||
@ -145,7 +140,7 @@ else
|
||||
$hselected = $h;
|
||||
$h++;
|
||||
|
||||
dolibarr_fiche_head($head, $hselected, 'Service : '.$service->numero);
|
||||
dolibarr_fiche_head($head, $hselected, 'Service : '.$service->id);
|
||||
|
||||
print_fiche_titre('Fiche Service', $mesg);
|
||||
|
||||
@ -154,7 +149,7 @@ else
|
||||
print '<tr><td width="20%">Libellé</td><td>'.$service->libelle.'</td></tr>';
|
||||
print '<tr><td width="20%">Libellé Facture</td><td>'.$service->libelle_facture.'</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">Montant HT</td><td>'.dolibarr_print_phone($service->montant).'</td></tr>';
|
||||
print '<tr><td width="20%">Montant mensuel HT</td><td>'.$service->montant.'</td></tr>';
|
||||
print '<tr><td width="20%">Statut</td><td>'.$service->statuts[$service->statut].'</td></tr>';
|
||||
print "</table><br />";
|
||||
print '</div>';
|
||||
@ -195,24 +190,15 @@ else
|
||||
print '<input name="libelle_facture" size="20" value="'.$service->libelle_facture.'">';
|
||||
print '</td></tr>';
|
||||
|
||||
print '<tr><td width="20%">Montant HT</td><td>';
|
||||
print '<tr><td width="20%">Montant mensuel HT</td><td>';
|
||||
print '<input name="montant" size="20" value="'.$service->montant.'"> euros HT';
|
||||
print '</td></tr>';
|
||||
|
||||
|
||||
|
||||
print '<tr><td align="center" colspan="2"><input type="submit">';
|
||||
|
||||
print '</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
/*
|
||||
*
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
print '</div>';
|
||||
|
||||
}
|
||||
@ -234,13 +220,19 @@ else
|
||||
|
||||
print "\n<div class=\"tabsAction\">\n";
|
||||
|
||||
if ($_GET["action"] == '' && $service->statut == 0)
|
||||
{
|
||||
print "<a class=\"tabAction\" href=\"fiche.php?action=active&id=$service->id\">".$langs->trans("Active")."</a>";
|
||||
}
|
||||
|
||||
|
||||
if ($_GET["action"] == '')
|
||||
{
|
||||
|
||||
print "<a class=\"tabAction\" href=\"fiche.php?action=edit&id=$service->id\">".$langs->trans("Edit")."</a>";
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
print "</div>";
|
||||
|
||||
|
||||
|
||||
@ -37,24 +37,27 @@ print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
|
||||
print '<tr><td width="30%" valign="top">';
|
||||
|
||||
$sql = "SELECT libelle, montant ";
|
||||
$sql = "SELECT s.rowid , libelle, count(cs.rowid) ";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."telephonie_service as s";
|
||||
|
||||
$sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat_service as cs";
|
||||
$sql .= " WHERE cs.fk_service = s.rowid";
|
||||
$sql .= " GROUP by s.rowid DESC";
|
||||
//print $sql;
|
||||
if ($db->query($sql))
|
||||
{
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
|
||||
|
||||
print '<table class="noborder" width="100%" cellspacing="0" cellpadding="4">';
|
||||
print '<tr class="liste_titre"><td>Libellé</td>';
|
||||
print '<tr class="liste_titre"><td>Libellé</td><td>-</td>';
|
||||
print "</tr>\n";
|
||||
$var=True;
|
||||
|
||||
while ($i < min($num,$conf->liste_limit))
|
||||
{
|
||||
$obj = $db->fetch_object($i);
|
||||
print "<tr><td>".stripslashes($obj->libelle)."</td></tr>";
|
||||
$row = $db->fetch_row();
|
||||
print '<tr><td><a href="fiche.php?id='.$row[0].'">'.stripslashes($row[1])."</a></td>";
|
||||
print '<td>'.$row[2]."</td></tr>";
|
||||
$i++;
|
||||
}
|
||||
|
||||
@ -69,10 +72,11 @@ else
|
||||
}
|
||||
|
||||
print '<br />';
|
||||
|
||||
print '</td><td width="70%" valign="top"> ';
|
||||
|
||||
print '</td>';
|
||||
|
||||
|
||||
print '</table>';
|
||||
|
||||
|
||||
|
||||
@ -57,8 +57,6 @@ function llxHeader($head = "", $title="") {
|
||||
|
||||
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/statca/", "Chiffre d'affaire");
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
|
||||
@ -34,30 +34,7 @@ function llxHeader($head = "", $title="") {
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/client/index.php", "Clients");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/contrat/index.php", "Contrats");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/clients/", "Clients");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/commerciaux/", "Commerciaux");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/lignes/", "Lignes");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/communications/", "Communications");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/factures/", "Factures");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/tarifs/", "Tarifs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/fournisseurs.php", "Fournisseurs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/statca/", "Chiffre d'affaire");
|
||||
include "../menus.php";
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
<?PHP
|
||||
/* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
*
|
||||
* 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
|
||||
@ -20,7 +20,6 @@
|
||||
*
|
||||
*/
|
||||
require("../../../main.inc.php");
|
||||
require(DOL_DOCUMENT_ROOT."/telephonie/lignetel.class.php");
|
||||
|
||||
$user->getrights('telephonie');
|
||||
|
||||
@ -35,31 +34,7 @@ function llxHeader($head = "", $title="") {
|
||||
|
||||
$menu = new Menu();
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/index.php", "Telephonie");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/client/index.php", "Clients");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/contrat/index.php", "Contrats");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/index.php", "Lignes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/ligne/commande/", "Commandes");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/stats/", "Statistiques");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/clients/", "Clients");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/commerciaux/", "Commerciaux");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/lignes/", "Lignes");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/communications/", "Communications");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/fournisseurs/", "Fournisseurs");
|
||||
$menu->add_submenu(DOL_URL_ROOT."/telephonie/stats/factures/", "Factures");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/facture/", "Factures");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/tarifs/", "Tarifs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/fournisseurs.php", "Fournisseurs");
|
||||
|
||||
$menu->add(DOL_URL_ROOT."/telephonie/statca/", "Chiffre d'affaire");
|
||||
include "../menus.php";
|
||||
|
||||
left_menu($menu->liste);
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user