Massive updates

This commit is contained in:
Rodolphe Quiedeville 2002-05-09 14:57:48 +00:00
parent 363c3c8566
commit 1c13bb7a62
48 changed files with 1389 additions and 1284 deletions

View File

@ -39,12 +39,13 @@ class ActionComm {
*
*
*/
Function add() {
Function add($user) {
$sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author, fk_contact, note) ";
$sql .= " VALUES ('$this->date',$this->type,$this->societe,$this->user,$this->contact,'$this->note')";
$sql .= " VALUES ('$this->date',$this->type,$this->societe, $user->id, $this->contact,'$this->note')";
if ($this->db->query($sql) ) {
}
}
/*
@ -52,23 +53,24 @@ class ActionComm {
*
*
*/
Function fetch($db, $id) {
Function fetch($id) {
$sql = "SELECT libelle FROM c_actioncomm WHERE id=$id;";
$sql = "SELECT ".$this->db->pdate("a.datea")." as da, a.note,c.libelle ";
$sql .= "FROM actioncomm as a, c_actioncomm as c WHERE a.id=$id AND a.fk_action=c.id;";
if ($db->query($sql) ) {
if ($db->num_rows()) {
$obj = $db->fetch_object(0);
if ($this->db->query($sql) ) {
if ($this->db->num_rows()) {
$obj = $this->db->fetch_object(0);
$this->id = $rowid;
$this->datep = $obj->dp;
$this->ref = $obj->ref;
$this->price = $obj->price;
$db->free();
$this->id = $obj->rowid;
$this->type = $obj->libelle;
$this->date = $obj->da;
$this->note =$obj->note;
$this->db->free();
}
} else {
print $db->error();
print $this->db->error();
}
}
}

View File

@ -21,43 +21,80 @@
*/
require("./pre.inc.php3");
require("../societe.class.php3");
require("../contact.class.php3");
require("../lib/webcal.class.php3");
require("cactioncomm.class.php3");
require("actioncomm.class.php3");
require("../todocomm.class.php3");
llxHeader();
$db = new Db();
if ($sortfield == "") {
$sortfield="a.datea";
}
if ($sortorder == "") {
$sortorder="DESC";
}
if ($page == -1) { $page = 0 ; }
$limit = 26;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
$bc1="bgcolor=\"#90c090\"";
$bc2="bgcolor=\"#b0e0b0\"";
/*
*
*
*
*/
if ($action=='add') {
if ($action=='add_action') {
$contact = new Contact($db);
$contact->fetch($contactid);
$actioncomm = new ActionComm($db);
$actioncomm->date = $date;
if ($actionid == 5) {
$actioncomm->date = $db->idate(mktime($heurehour,$heuremin,0,$remonth,$reday,$reyear));
} else {
$actioncomm->date = $date;
}
$actioncomm->type = $actionid;
$actioncomm->contact = $contactid;
$actioncomm->user = $user->id;
$actioncomm->societe = $socid;
$actioncomm->note = $note;
$actioncomm->add();
$actioncomm->add($user);
$societe = new Societe($db);
$societe->fetch($socid);
$todo = new TodoComm($db);
$todo->date = mktime(12,0,0,$remonth, $reday, $reyear);
$todo->libelle = $todo_label;
$todo->societe = $societe->id;
$todo->contact = $contactid;
$todo->note = $todo_note;
$todo->add($user);
$webcal = new Webcal();
$webcal->heure = $heurehour . $heuremin . '00';
$webcal->duree = ($dureehour * 60) + $dureemin;
if ($actionid == 5) {
$libelle = "Rendez-vous avec ".$contact->fullname;
$libelle .= "\n" . $todo->libelle;
} else {
$libelle = $todo->libelle;
}
$webcal->add($user, $todo->date, $societe->nom, $libelle);
}
/*
*
*
@ -73,40 +110,86 @@ if ($action=='create' && $actionid && $contactid) {
$societe = new Societe($db);
$societe->get_nom($socid);
/*
* Rendez-vous
*
*/
if ($actionid == 5)
{
print '<form action="'.$PHP_SELF.'?socid='.$socid.'" method="post">';
print '<input type="hidden" name="action" value="add_action">';
print '<form action="actioncomm.php3" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<input type="hidden" name="date" value="'.$db->idate(time()).'">';
print '<input type="hidden" name="actionid" value="'.$actionid.'">';
print '<input type="hidden" name="contactid" value="'.$contactid.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<input type="hidden" name="date" value="'.$db->idate(time()).'">';
print '<input type="hidden" name="actionid" value="'.$actionid.'">';
print '<input type="hidden" name="contactid" value="'.$contactid.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Rendez-vous</div></td></tr>';
print '<tr><td width="10%">Société</td><td width="40%"bgcolor="#e0e0e0">';
print '<b><a href="index.php3?socid='.$socid.'">'.$societe->nom.'</a></td></tr>';
print '<tr><td width="10%">Contact</td><td width="40%"bgcolor="#e0e0e0"><b>'.$contact->fullname.'</td></tr>';
print '<tr><td width="10%">Date</td><td width="40%">';
print_date_select();
print '</td></tr>';
print '<tr><td width="10%">Heure</td><td width="40%">';
print_heure_select("heure",8,20);
print '</td></tr>';
print '<tr><td width="10%">Durée</td><td width="40%">';
print_duree_select("duree");
print '</td></tr>';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Action effectuée</div></td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
print '</form></table>';
print '<tr><td width="10%">Action</td><td bgcolor="#e0e0e0"><b>'.$caction->libelle.'</td></tr>';
print '<tr><td width="10%">Société</td><td width="40%"bgcolor="#e0e0e0"><b><a href="index.php3?socid='.$socid.'">'.$societe->nom.'</a></td></tr>';
print '<tr><td width="10%">Contact</td><td width="40%"bgcolor="#e0e0e0"><b>'.$contact->fullname.'</td></tr>';
print '<td>Date</td><td>'.strftime('%d %B %Y %H:%M',time()).'</td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="note"></textarea></td></tr>';
}
/*
*Autre action
*
*
*/
else
{
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Prochaine Action à faire</div></td></tr>';
print '<form action="index.php3?socid='.$socid.'" method="post">';
print '<input type="hidden" name="action" value="add_action">';
print '<tr><td width="10%">Date</td><td width="40%">';
print_date_select();
print '</td></tr>';
print '<input type="hidden" name="date" value="'.$db->idate(time()).'">';
print '<input type="hidden" name="actionid" value="'.$actionid.'">';
print '<input type="hidden" name="contactid" value="'.$contactid.'">';
print '<input type="hidden" name="socid" value="'.$socid.'">';
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Action effectuée</div></td></tr>';
print '<tr><td width="10%">Action</td><td bgcolor="#e0e0e0"><b>'.$caction->libelle.'</td></tr>';
print '<tr><td width="10%">Société</td><td width="40%"bgcolor="#e0e0e0">';
print '<b><a href="index.php3?socid='.$socid.'">'.$societe->nom.'</a></td></tr>';
print '<tr><td width="10%">Contact</td><td width="40%"bgcolor="#e0e0e0"><b>'.$contact->fullname.'</td></tr>';
print '<td>Date</td><td>'.strftime('%d %B %Y %H:%M',time()).'</td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="note"></textarea></td></tr>';
print '<tr><td colspan="2" bgcolor="#e0e0e0"><div class="titre">Prochaine Action à faire</div></td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="next_note"></textarea></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
print '</form></table>';
$limit = 10;
print '<p>Vos 10 dernières actions';
print '<tr><td width="10%">Date</td><td width="40%">';
print_date_select();
print '</td></tr>';
print '<tr><td width="10%">Action</td><td><input type="text" name="todo_label" size="30"></td></tr>';
print '<tr><td valign="top">Commentaire</td><td>';
print '<textarea cols="60" rows="6" name="todo_note"></textarea></td></tr>';
print '<tr><td colspan="2" align="center"><input type="submit" value="Enregistrer"></td></tr>';
print '</form></table>';
}
}
/*
*
@ -114,14 +197,17 @@ if ($action=='create' && $actionid && $contactid) {
*
*/
if ($id) {
$act = new ActionComm($db);
$act->fetch($id);
print '<table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<tr><td width="10%">Action</td><td colspan="3" bgcolor="#e0e0e0"><b>'.$libelle.'</td></tr>';
print '<tr><td width="10%">Action</td><td colspan="3" bgcolor="#e0e0e0"><b>'.$act->type.'</td></tr>';
print '<tr><td width="10%">Société</td><td width="40%"bgcolor="#e0e0e0"><b>'.$nom.'</td>';
print '<td width="10%">Contact</td><td width="40%"bgcolor="#e0e0e0"><b>'.$fullname.'</td></tr>';
print '<tr><td>Auteur</td><td>'.$fullname.'</td>';
print '<td>Date</td><td>'.strftime('%d %B %Y %H:%M',time()).'</td></tr>';
print '<tr><td valign="top">Commentaire</td><td colspan="3">';
print '<textarea cols="60" rows="6" name="note"></textarea></td></tr>';
print nl2br($act->note).'</td></tr>';
print '</table>';
$limit = 10;
@ -135,52 +221,37 @@ if ($id) {
*/
if ($socid) {
$societe = new Societe($db);
$societe->fetch($socid);
$sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, c.libelle, u.code, a.note, u.name, u.firstname ";
$sql .= " FROM actioncomm as a, c_actioncomm as c, societe as s, llx_user as u";
$sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid";
print_barre_liste("Liste des actions commerciales effectuées sur " . $societe->nom,$page, $PHP_SELF);
$sql = "SELECT a.id,".$db->pdate("a.datea")." as da, c.libelle, u.code, a.note, u.name, u.firstname ";
$sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u";
$sql .= " WHERE a.fk_soc = $socid AND c.id=a.fk_action AND a.fk_user_author = u.rowid";
if ($type) {
$sql .= " AND c.id = $type";
}
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= " ORDER BY a.datea DESC";
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print '<TD>Date</TD>';
print '<TD>Societe</td>';
print "<TD>Note</TD>";
print "<TD>Action</TD>";
print "</TR>\n";
$var=True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
if ($i == 0) {
print "<TR bgcolor=\"orange\">";
print '<TD>Auteur</TD>';
print "<TD width=\"30%\"><a href=\"index.php3?socid=$obj->socidp\">$obj->societe</A></TD>\n";
print "<TD>&nbsp;</TD>";
print "</TR>\n";
}
$var=!$var;
if (!$var) {
$bc=$bc1;
} else {
$bc=$bc2;
}
print "<TR $bc>";
print "<TD>" .strftime("%Y %b %d %H:%M",$obj->da)."</TD>\n";
print "<TD width=\"30%\"><a href=\"index.php3?socid=$obj->socidp\">$obj->societe</A></TD>\n";
print '<TD align="left" valign="top" rowspan="2">'.nl2br($obj->note).'&nbsp;</TD>';
print "</TR>\n";
print "<TR $bc>";
print "<TD width=\"20%\">$obj->firstname $obj->name</TD>\n";
print "<TR $bc[$var]>";
print "<TD width=\"10%\">" .strftime("%Y %b %d %H:%M",$obj->da)."</TD>\n";
print '<TD width="30%"><a href="actioncomm.php3?id='.$obj->id.'">'.$obj->libelle.'</a></td>';
print "</TR>\n";
@ -188,11 +259,13 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
}
print "</TABLE>";
$db->free();
} else {
print $db->error() . '<br>' . $sql;
}
} else {
print '<div class="titre">Liste des actions commerciales effectuées</div>';
print_barre_liste("Liste des actions commerciales effectuées",$page, $PHP_SELF);
$sql = "SELECT s.nom as societe, s.idp as socidp,a.id,".$db->pdate("a.datea")." as da, a.datea, c.libelle, u.code ";
$sql .= " FROM actioncomm as a, c_actioncomm as c, societe as s, llx_user as u";
@ -202,7 +275,7 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
$sql .= " AND c.id = $type";
}
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= " ORDER BY a.datea DESC";
$sql .= $db->plimit( $limit, $offset);
@ -210,7 +283,7 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR>";
print '<TR class="liste_titre">';
print '<TD colspan="4">Date</TD>';
print '<TD>Société</a></td>';
print '<TD>Action</a></TD>';
@ -222,12 +295,7 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
$var=!$var;
if (!$var) {
$bc=$bc1;
} else {
$bc=$bc2;
}
print "<TR $bc>";
print "<TR $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) ) {
print '<td align="center">|</td>';
@ -245,7 +313,10 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n";
print "<TD width=\"50%\"><a href=\"index.php3?socid=$obj->socidp\">$obj->societe</A></TD>\n";
print '<TD width="50%">';
print '&nbsp;<a href="index.php3?socid='.$obj->socidp.'">'.$obj->societe.'</A></TD>';
print '<TD width="30%"><a href="actioncomm.php3?id='.$obj->id.'">'.$obj->libelle.'</a></td>';
print "<TD width=\"20%\">$obj->code</TD>\n";
@ -255,9 +326,9 @@ $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.r
}
print "</TABLE>";
$db->free();
} else {
print $db->error() . ' ' . $sql ;
}
}
$db->close();

View File

@ -35,15 +35,6 @@ if ($result) {
}
$db->free();
}
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$yn["t"] = "oui";
$yn["f"] = "non";
llxHeader();
print_titre("Propositions commerciales pour <b><a href=\"index.php3?socid=$socidp\">$objsoc->nom</a></b>");
if ($action == 'add') {
@ -60,10 +51,10 @@ if ($action == 'add') {
$propal->ref = $ref;
$propal->add_product($idprod1);
$propal->add_product($idprod2);
$propal->add_product($idprod3);
$propal->add_product($idprod4);
$propal->add_product($idprod1,$qty1);
$propal->add_product($idprod2,$qty2);
$propal->add_product($idprod3,$qty3);
$propal->add_product($idprod4,$qty4);
$id = $propal->create();
@ -73,7 +64,7 @@ if ($action == 'add') {
*
*/
if ($id) {
print "<hr><b>Génération du PDF</b><p>";
// print "<hr><b>Génération du PDF</b><p>";
//$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo";
@ -84,12 +75,22 @@ if ($action == 'add') {
$command .= " --templates=".$conf->propal->templatesdir;
$output = system($command);
print "<p>command : $command<br>";
print $output;
//print "<p>command : $command<br>";
//print $output;
// Header("Location: propal.php3?propalid=$id");
} else {
print $db->error();
}
}
llxHeader();
print_titre("Nouvelle proposition commerciale pour <b><a href=\"index.php3?socid=$socidp\">$objsoc->nom</a></b>");
/*
*
* Creation d'une nouvelle propale
@ -111,7 +112,9 @@ if ($action == 'create') {
}
print "<form action=\"$PHP_SELF?socidp=$socidp\" method=\"post\">";
print '<table border="0" cellspacing="3"><tr><td valign="top">';
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print '<table border="1" cellspacing="0" cellpadding="3" width="100%"><tr><td width="50%" valign="top">';
$strmonth[1] = "Janvier";
$strmonth[2] = "F&eacute;vrier";
@ -158,8 +161,6 @@ if ($action == 'create') {
}
print "</select></td></tr>";
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print '<tr><td>Auteur</td><td>'.$user->fullname.'</td></tr>';
print "<tr><td>Num</td><td><input name=\"ref\" value=\"$numpr\"></td></tr>\n";
/*
@ -245,12 +246,20 @@ if ($action == 'create') {
print "<table border=1 cellspacing=0>";
print "<tr><td>Service/Produits</td></tr>\n";
print "<tr><td><select name=\"idprod1\">$opt</select></td></tr>\n";
print "<tr><td><select name=\"idprod2\">$opt</select></td></tr>\n";
print "<tr><td><select name=\"idprod3\">$opt</select></td></tr>\n";
print "<tr><td><select name=\"idprod4\">$opt</select></td></tr>\n";
print "<tr><td align=\"right\">Remise : <input size=\"6\" name=\"remise\" value=\"0\"></td></tr>\n";
print "<tr><td colspan=\"2\">Service/Produits</td></tr>\n";
print "<tr><td><select name=\"idprod1\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty1\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod2\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty2\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod3\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty3\" value=\"1\"></td></tr>\n";
print "<tr><td><select name=\"idprod4\">$opt</select></td>";
print "<td><input type=\"text\" size=\"2\" name=\"qty4\" value=\"1\"></td></tr>\n";
print "<tr><td align=\"right\" colspan=\"2\">Remise : <input size=\"6\" name=\"remise\" value=\"0\"></td></tr>\n";
print "</table>";
/*
* Si il n'y a pas de contact pour la societe on ne permet pas la creation de propale
@ -278,18 +287,15 @@ if ($action == 'create') {
*/
$sql = "SELECT s.nom,s.idp, p.price, p.ref,".$db->pdate("p.datep")." as dp, p.rowid as propalid, c.id as statut, c.label as lst";
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c ";
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
if ($socidp) {
$sql .= " AND s.idp = $socidp";
}
$sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND s.idp = $socidp";
$sql .= " ORDER BY p.datec DESC ;";
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TR class=\"liste_titre\">";
print "<TD>Société</td>";
print "<TD>Num</TD>";
print "<TD>Statut</TD>";
print "<TD align=\"right\">Date</TD>";
@ -303,22 +309,25 @@ if ( $db->query($sql) ) {
print "<TD><a href=\"index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD><a href=\"propal.php3?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
print "<TD>$objp->lst</TD>\n";
print "<TD align=\"right\">".strftime("%d %B %Y",$objp->dp)."</TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD><td>&nbsp;</td>\n";
print "</TR>\n";
$total = $total + $objp->price;
$i++;
}
print "<tr><td colspan=\"2\" align=\"right\"><b>Total : ".francs($total)." FF</b></td><td colspan=\"3\" align=\"right\"><b>Total : ".price($total)."</b></td><td>euros</td></tr>";
print "<tr><td colspan=\"5\" align=\"right\"><b>Total : ".price($total)."</b></td><td>euros</td></tr>";
print "</TABLE>";
$db->free();
} else {
print $db->error();
print "<p>$sql";
}
/*
*
*/
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -31,15 +31,14 @@ if ($sortfield == "") {
}
if ($page == -1) { $page = 0 ; }
$limit = 26;
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
print_barre_liste("Liste des contacts",$page, $PHP_SELF);
print "<DIV align=\"center\">";
print "<A href=\"$PHP_SELF?page=$pageprev&begin=$begin&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">&lt;- Prev</A>\n| ";
print "<A href=\"$PHP_SELF?page=$pageprev&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">*</A>\n| ";
print "| <A href=\"$PHP_SELF?page=$pageprev&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">*</A>\n| ";
for ($i = 65 ; $i < 91; $i++) {
print "<A href=\"$PHP_SELF?begin=" . chr($i) . "&stcomm=$stcomm\" class=\"T3\">";
@ -50,8 +49,7 @@ for ($i = 65 ; $i < 91; $i++) {
}
print "</A> | ";
}
print " <A href=\"$PHP_SELF?page=$pagenext&begin=$begin&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">Next -></A>\n";
print "</DIV><P>";
print "</div>";
/*
@ -61,10 +59,9 @@ print "</DIV><P>";
*
*/
$bc[1]="bgcolor=\"#90c090\"";
$bc[0]="bgcolor=\"#b0e0b0\"";
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email ";
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc";
if (strlen($stcomm)) {
@ -98,12 +95,12 @@ if ($result) {
$sortorder="DESC";
}
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<td>Action</td><TD>Nom</TD>";
print "<TD>Prénom</TD>";
print "<TD>email</TD>";
print "<TD colspan=\"2\"><a href=\"contact.php3?sortfield=lower(s.nom)&sortorder=$sortorder&begin=$begin\">Societe</a></td>";
print '<TD align="center">Statut</TD><td>&nbsp;</td>';
print "<TR class=\"liste_titre\">";
print "<TD>Nom</TD>";
print "<TD>Prénom</TD><td>";
print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin);
print "</td><TD>email</TD>";
print '<TD>Téléphone</TD><td>&nbsp;</td>';
print "</TR>\n";
$var=True;
while ($i < $num) {
@ -113,16 +110,14 @@ if ($result) {
print "<TR $bc[$var]>";
print "<TD>[&nbsp;<a href=\"index.php3?socid=$obj->idp\">T</A>&nbsp;|&nbsp;";
print "<a href=\"index.php3?socid=$obj->idp\">E</A>&nbsp;|&nbsp;";
print "<a href=\"index.php3?socid=$obj->idp\">F</A>&nbsp;]";
print "<TD>$obj->name</TD>";
print "<TD>$obj->firstname</TD>";
print '<TD><a href="contact.php3?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;';
print "<a href=\"index.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print "<TD>$obj->email&nbsp;</TD>\n";
print '<TD><a href="contact.php3?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a></td>';
print "<TD><a href=\"index.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print '<TD align="center">'.$obj->stcomm.'</TD>';
print '<td><a href="actioncomm.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a>&nbsp;</td>';
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n";
print "</TR>\n";
$i++;

View File

@ -21,10 +21,15 @@
*/
require("./pre.inc.php3");
require("../contact.class.php3");
require("../societe.class.php3");
require("../lib/webcal.class.php3");
require("cactioncomm.class.php3");
require("actioncomm.class.php3");
require("../todocomm.class.php3");
llxHeader();
$db = new Db();
if ($sortorder == "") {
$sortorder="ASC";
}
@ -32,10 +37,46 @@ if ($sortfield == "") {
$sortfield="nom";
}
if ($action=='add_action') {
/*
* Vient de actioncomm.php3
*
*/
$actioncomm = new ActionComm($db);
$actioncomm->date = $date;
$actioncomm->type = $actionid;
$actioncomm->contact = $contactid;
$actioncomm->societe = $socid;
$actioncomm->note = $note;
$actioncomm->add($user);
$societe = new Societe($db);
$societe->fetch($socid);
$todo = new TodoComm($db);
$todo->date = mktime(12,0,0,$remonth, $reday, $reyear);
$todo->libelle = $todo_label;
$todo->societe = $societe->id;
$todo->contact = $contactid;
$todo->note = $todo_note;
$todo->add($user);
$webcal = new Webcal();
$webcal->add($user, $todo->date, $societe->nom, $todo->libelle);
}
if ($action == 'attribute_prefix') {
$societe = new Societe($db, $socid);
$societe->attribute_prefix($db, $socid);
//$prefix_attrib = soc_attribute_prefix($db, $socid);
}
if ($action == 'recontact') {
@ -138,18 +179,18 @@ if ($socid > 0) {
print "<table width=\"100%\" border=\"0\" cellspacing=\"1\">\n";
print "<tr><td><div class=\"titre\">Fiche client : $objsoc->nom</div></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"bookmark.php3?socidp=$objsoc->idp&action=add\">[Bookmark]</a></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"projet/fiche.php3?socidp=$objsoc->idp&action=create\">[Projet]</a></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\"><a href=\"addpropal.php3?socidp=$objsoc->idp&action=create\">[Propal]</a></td>";
print "<td align=\"center\"><a href=\"bookmark.php3?socidp=$objsoc->idp&action=add\">[Bookmark]</a></td>";
print "<td align=\"center\"><a href=\"projet/fiche.php3?socidp=$objsoc->idp&action=create\">[Projet]</a></td>";
print "<td align=\"center\"><a href=\"addpropal.php3?socidp=$objsoc->idp&action=create\">[Propal]</a></td>";
print "<td><a href=\"socnote.php3?socid=$objsoc->idp\">Notes</a></td>";
print "<td bgcolor=\"#e0E0E0\" align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
print "<td align=\"center\">[<a href=\"../soc.php3?socid=$objsoc->idp&action=edit\">Editer</a>]</td>";
print "</tr></table>";
/*
*
*
*/
print "<hr>";
print "<table width=\"100%\" border=0><tr>\n";
print "<td valign=\"top\">";
print "<table cellspacing=\"0\" border=\"1\" width=\"100%\">";
@ -177,58 +218,11 @@ if ($socid > 0) {
*/
print "</td>\n";
print '<td valign="top" width="50%">';
print '<table border=0 width="100%" cellspacing=0 bgcolor=#e0e0e0>';
print "<tr><td>Créée le</td><td align=center><b>" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "</b></td></tr>";
print '<tr><td colspan="2"><hr>Statut commercial</td></tr>';
print '<tr><td colspan="2">';
/*
*
* Liste des statuts commerciaux
*
*/
$limliste = 5 ;
print "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2>\n";
$sql = "SELECT a.id, ".$db->pdate("a.datel")." as da, c.libelle, a.author ";
$sql .= " FROM socstatutlog as a, c_stcomm as c WHERE a.fk_soc = $objsoc->idp AND c.id=a.fk_statut ORDER by a.datel DESC";
if ( $db->query($sql) ) {
$i = 0 ; $num = $db->num_rows(); $tag = True;
while ($i < $num && $i < $limliste) {
$obj = $db->fetch_object( $i);
if ($tag) {
print "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
print "<td>$obj->libelle</td>";
print "<td>$obj->author</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
$db->free();
if ($num > $limliste) {
print "<tr><td>suite ...</td></tr>";
}
} else {
print $db->error();
}
print "</table>";
print '</td></tr>';
/*
*
*/
print '</table>';
print '</td></tr>';
/*
*
*/
print "<tr><td valign=\"top\">";
/*
*
* Propales
*
*/
$var=!$var;
print "<TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"1\">";
@ -260,19 +254,20 @@ if ($socid > 0) {
/*
* Factures
*/
$var=!$var;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND s.idp = $objsoc->idp ORDER BY f.datef DESC";
if ( $db->query($sql) ) {
$num = $db->num_rows(); $i = 0;
if ($num > 0) {
print "<tr $bc2[$var]>";
print "<td colspan=\"3\"><a href=\"../compta/index.php3?socidp=$objsoc->idp\">liste des factures ($num)</td></tr>";
print "<tr $bc[$var]>";
print "<td colspan=\"4\"><a href=\"../compta/index.php3?socidp=$objsoc->idp\">liste des factures ($num)</td></tr>";
}
while ($i < $num && $i < 2) {
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc2[$var]>";
print "<TR $bc[$var]>";
print "<TD><a href=\"../compta/facture.php3?facid=$objp->facid\">$objp->facnumber</a></TD>\n";
if ($objp->df > 0 ) {
print "<TD align=\"right\">".strftime("%d %B %Y",$objp->df)."</TD>\n";
@ -292,6 +287,15 @@ if ($socid > 0) {
}
print "</table>";
print '</td></tr>';
/*
*
*/
print "<tr><td valign=\"top\">";
print "</td><td valign=\"top\">";
/*
*
@ -402,7 +406,8 @@ if ($socid > 0) {
} else {
print "<tr>";
}
print "<td>$obj->firstname $obj->name";
print '<td><a href="actioncomm.php3?action=create&actionid=5&contactid='.$obj->idp.'&socid='.$objsoc->idp.'">'.$obj->firstname.' '. $obj->name.'</a>&nbsp;</td>';
if ($obj->note) {
print "<br><b>".nl2br($obj->note);
}
@ -439,16 +444,13 @@ if ($socid > 0) {
if ( $db->query($sql) ) {
print "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2>\n";
print '<tr><td><a href="actioncomm.php3?socid='.$objsoc->idp.'">Actions</a></td></tr>';
$i = 0 ; $num = $db->num_rows(); $tag = True;
$i = 0 ; $num = $db->num_rows();
while ($i < $num) {
$var = !$var;
$obj = $db->fetch_object( $i);
if ($tag) {
print "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
print "<tr $bc[$var]>";
if ($oldyear == strftime("%Y",$obj->da) ) {
print '<td align="center">|</td>';
@ -467,6 +469,8 @@ if ($socid > 0) {
print "<TD>" .strftime("%d",$obj->da)."</TD>\n";
print "<TD>" .strftime("%H:%M",$obj->da)."</TD>\n";
print '<td width="10%">&nbsp;</td>';
if ($obj->propalrowid) {
print '<td width="40%"><a href="propal.php3?propalid='.$obj->propalrowid.'">'.$obj->libelle.'</a></td>';
} else {
@ -488,7 +492,6 @@ if ($socid > 0) {
print '<td width="20%"><a href="../user.php3">'.$obj->code.'</a></td>';
print "</tr>\n";
$i++;
$tag = !$tag;
}
print "</table>";
@ -510,95 +513,7 @@ if ($socid > 0) {
*
*
*/
print "<HR noshade>";
print "<form action=\"index.php3?socid=$objsoc->idp\" method=\"post\">";
print "<input type=\"hidden\" name=\"action\" value=\"recontact\">";
$strmonth[1] = "Janvier";
$strmonth[2] = "F&eacute;vrier";
$strmonth[3] = "Mars";
$strmonth[4] = "Avril";
$strmonth[5] = "Mai";
$strmonth[6] = "Juin";
$strmonth[7] = "Juillet";
$strmonth[8] = "Ao&ucirc;t";
$strmonth[9] = "Septembre";
$strmonth[10] = "Octobre";
$strmonth[11] = "Novembre";
$strmonth[12] = "D&eacute;cembre";
$smonth = 1;
$syear = date("Y", time());
print "A recontacter : ";
print "<select name=\"reday\">";
for ($day = 1 ; $day < $sday + 32 ; $day++) {
print "<option value=\"$day\">$day";
}
print "</select>";
$cmonth = date("n", time());
print "<select name=\"remonth\">";
for ($month = $smonth ; $month < $smonth + 12 ; $month++) {
if ($month == $cmonth) {
print "<option value=\"$month\" SELECTED>" . $strmonth[$month];
} else {
print "<option value=\"$month\">" . $strmonth[$month];
}
}
print "</select>";
print "<select name=\"reyear\">";
for ($year = $syear ; $year < $syear + 5 ; $year++) {
print "<option value=\"$year\">$year";
}
print "</select>";
print "<input type=\"submit\" value=\"Ajouter\">";
print "</form>\n";
/*
*
*/
print "<form action=\"index.php3?socid=$objsoc->idp\" method=\"post\">";
print "<input type=\"hidden\" name=\"action\" value=\"stcomm\">";
print "<input type=\"hidden\" name=\"oldstcomm\" value=\"$objsoc->fk_stcomm\">";
$sql = "SELECT st.id, st.libelle FROM c_stcomm as st ORDER BY id";
$result = $db->query($sql);
print "<select name=\"stcommid\">\n";
print "<option value=\"null\" SELECTED>\n";
if ($result) {
$num = $db->num_rows();
$i = 0 ;
while ($i < $num) {
$objse = $db->fetch_object( $i);
print "<option value=\"$objse->id\"";
if ($objse->id == $objsoc->fk_stcomm) { print " SELECTED"; }
print ">$objse->libelle\n";
$i++;
}
}
print "</select>\n";
$sql = "SELECT st.id, st.libelle FROM c_actioncomm as st ORDER BY id";
$result = $db->query($sql);
print "<select name=\"actioncommid\">\n";
print "<option value=\"0\" SELECTED>\n";
if ($result) {
$num = $db->num_rows();
$i = 0 ;
while ($i < $num) {
$objse = $db->fetch_object($i);
print "<option value=\"$objse->id\">$objse->libelle\n";
$i++;
}
}
print "</select>\n";
print "<input type=\"text\" name=\"dateaction\" size=\"16\" value=\"$dac\">";
print "<input type=\"submit\" value=\"Update\">";
print "</form>\n";
@ -645,13 +560,8 @@ if ($socid > 0) {
}
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<TD valign=\"center\">Société";
print '<a href="index.php3?sortfield=lower(s.nom)&sortorder=asc&begin='.$begin.'">';
print '<img src="/theme/'.$conf->theme.'/img/1downarrow.png" border="0"></a>';
print '<a href="index.php3?sortfield=lower(s.nom)&sortorder=desc&begin='.$begin.'">';
print '<img src="/theme/'.$conf->theme.'/img/1uparrow.png" border="0"></a>';
print "<TD valign=\"center\">";
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><TD>Ville</TD>";
print "<TD>email</TD>";
print "<TD align=\"center\">Statut</TD><td>&nbsp;</td><td colspan=\"2\">&nbsp;</td>";
@ -680,7 +590,7 @@ if ($socid > 0) {
print "</TABLE>";
$db->free();
} else {
print $db->error();
print $db->error() . ' ' . $sql;
}
}
$db->close();

View File

@ -30,80 +30,29 @@ function llxHeader($head = "", $urlp = "") {
*/
top_menu($head);
print "<TR><TD valign=\"top\" align=\"right\" class=\"barre\">";
$menu = new Menu();
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
$menu->add("/comm/index.php3", "Clients");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."index.php3\">Clients</A></div>\n";
print "<A href=\"".$urlp."../soc.php3?&action=create\">Nouvelle société</A><BR>\n";
print "<A href=\"".$urlp."contact.php3\">Contacts</A><BR><br>\n";
print "<A href=\"".$urlp."recontact.php3\">A Recontacter</A><BR>\n";
print "</TD></TR>";
$menu->add_submenu("../soc.php3?&action=create", "Nouvelle société");
$menu->add_submenu("contact.php3", "Contacts");
$menu->add("actioncomm.php3", "Actions");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre_select" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'propal.php3">Propal</A></div>';
print '<A href="'.$urlp.'propal.php3?viewstatut=0">Brouillon</A><br>';
print '<A href="'.$urlp.'propal.php3?viewstatut=1">Ouvertes</A>';
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../compta/">Factures</A></div>';
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../product/">Produits</A></div>';
print '<div align="center"><A href="'.$urlp.'../service/">Services</A></div>';
print "</td></tr>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="projet/">Projets</A></div>';
print "</td></tr>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."index.php3\">Societes</A></CENTER>\n";
print "<form action=\"index.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
$menu->add("/comm/propal.php3", "Propales");
print "<CENTER><A href=\"".$urlp."contact.php3\">Contacts</A></CENTER>\n";
print "<form action=\"".$urlp."contact.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print "</form>";
$menu->add_submenu("propal.php3?viewstatut=0", "Brouillons");
$menu->add_submenu("propal.php3?viewstatut=1", "Ouvertes");
print "</td></tr>";
$menu->add("/product/", "Produits");
print "</table>";
$menu->add("/service/", "Services");
print "</td>";
$menu->add("projet/", "Projets");
left_menu($menu->liste);
print "<TD valign=\"top\" width=\"85%\">\n";
}
/*
* $Id$
* $Source$
*/
?>

View File

@ -217,27 +217,27 @@ $dbh->disconnect if $dbh;
#
#
#
print "Generate dvi file<br>\n";
system("cd $outputdir/ ; latex $numpropale.tex ");
#print "Generate dvi file<br>\n";
system("cd $outputdir/ ; latex $numpropale.tex > /dev/null");
#
#
#
if ($do_pdf) {
print "<p>Generate pdf file<br>\n";
#print "<p>Generate pdf file<br>\n";
system("cd $outputdir/ ; pdflatex $numpropale.tex > /dev/null");
}
#
#
#
if ($do_ps) {
print "Generate ps file\n";
#print "Generate ps file\n";
system("cd $outputdir/ ; dvips $numpropale.dvi -o $numpropale.ps > /dev/null");
}
#
# $outputdir/$numpropale.tex
#
if ($do_fax) {
print "Generate fax file\n";
#print "Generate fax file\n";
system("gs -q -sDEVICE=tiffg3 -dNOPAUSE -sOutputFile=$outputdir/$numpropale.%03d $outputdir/$numpropale.ps </dev/null");
}
Sys::Syslog::syslog('info', 'End propale '.$idpropal);

View File

@ -31,6 +31,7 @@ class Propal {
var $datep;
var $remise;
var $products;
var $products_qty;
var $note;
var $price;
@ -40,11 +41,19 @@ class Propal {
$this->socidp = $soc_idp;
$this->products = array();
}
Function add_product($idproduct) {
/*
*
*
*
*/
Function add_product($idproduct, $qty) {
if ($idproduct > 0) {
$i = sizeof($this->products);
$this->products[$i] = $idproduct;
if (!$qty) {
$qty = 1 ;
}
$this->products_qty[$i] = $qty;
}
}
/*
@ -53,31 +62,11 @@ class Propal {
*
*/
Function create() {
/*
* Total des produits a ajouter
*/
$sql = "SELECT sum(price) FROM llx_product ";
$sql .= " WHERE rowid in (";
for ($i = 0 ; $i < sizeof($this->products) ; $i++) {
$sql .= $this->products[$i] . ",";
}
$sql = substr($sql, 0, strlen($sql)-1) . ");";
if ( $this->db->query($sql) ) {
$cprice = $this->db->result(0, 0);
$this->db->free();
}
/*
* Calcul TVA, Remise
*/
$totalht = $cprice - $this->remise;
$tva = tva($totalht);
$total = $totalht + $tva;
/*
* Insertion dans la base
*/
$sql = "INSERT INTO llx_propal (fk_soc, fk_soc_contact, price, remise, tva, total, datep, datec, ref, fk_user_author, note) ";
$sql .= " VALUES ($this->socidp, $this->contactid, $cprice, $this->remise, $tva, $total, $this->datep, now(), '$this->ref', $this->author, '$this->note')";
$sql .= " VALUES ($this->socidp, $this->contactid, 0, $this->remise, 0,0, $this->datep, now(), '$this->ref', $this->author, '$this->note')";
$sqlok = 0;
if ( $this->db->query($sql) ) {
@ -95,15 +84,19 @@ class Propal {
for ($i = 0 ; $i < sizeof($this->products) ; $i++) {
$prod = new Product($this->db, $this->products[$i]);
$prod->fetch();
$prod->fetch($this->products[$i]);
$sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, price) VALUES ";
$sql .= " ($propalid,". $this->products[$i].", $prod->price) ; ";
$sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, qty, price) VALUES ";
$sql .= " ($propalid,". $this->products[$i].",". $this->products_qty[$i].", $prod->price) ; ";
if (! $this->db->query($sql) ) {
print $sql . '<br>' . $this->db->error() .'<br>';
}
}
/*
*
*/
$this->update_price($this->id);
/*
* Affectation au projet
*/
@ -120,6 +113,46 @@ class Propal {
}
return $this->id;
}
/*
*
*
*/
Function update_price($rowid) {
/*
* Remise
*/
$sql = "SELECT remise FROM llx_propal WHERE rowid = $rowid";
if ( $this->db->query($sql) ) {
$remise = $this->db->result(0, 0);
$this->db->free();
/*
* Total des produits a ajouter
*/
$sql = "SELECT sum(price * qty) FROM llx_propaldet WHERE fk_propal = $rowid";
if ( $this->db->query($sql) ) {
$cprice = $this->db->result(0, 0);
$this->db->free();
/*
* Calcul TVA, Remise
*/
$totalht = $cprice - $this->remise;
$tva = tva($totalht);
$total = $totalht + $tva;
/*
*
*/
$sql = "UPDATE llx_propal set price=$cprice, tva=$tva, total=$total WHERE rowid = $rowid";
if ( $this->db->query($sql) ) {
}
}
}
}
/*
*
*

View File

@ -184,7 +184,7 @@ if ($propalid) {
/*
* Produits
*/
$sql = "SELECT p.label as product, p.ref, pt.price";
$sql = "SELECT p.label as product, p.ref, pt.price, pt.qty";
$sql .= " FROM llx_propaldet as pt, llx_product as p WHERE pt.fk_product = p.rowid AND pt.fk_propal = $propalid";
$result = $db->query($sql);
@ -194,7 +194,7 @@ if ($propalid) {
print "<p><b>Produits</b><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
print "<TR bgcolor=\"orange\">";
print "<td>Réf</td><td>Produit</td>";
print "<td align=\"right\">Prix</TD><td>&nbsp;</td>";
print "<td align=\"right\">Prix</TD><td align=\"center\">Qté.</td>";
print "</TR>\n";
$var=True;
@ -204,7 +204,7 @@ if ($propalid) {
print "<TR $bc[$var]>";
print "<TD>[$objp->ref]</TD>\n";
print "<TD>$objp->product</TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD><td>euros</td>\n";
print "<TD align=\"right\">".price($objp->price)."</TD><td align=\"center\">".$objp->qty."</td>\n";
print "</tr>";
$total = $total + $objp->price;
$i++;
@ -536,7 +536,7 @@ if ($propalid) {
print '<TR class="liste_titre">';
print "<TD>Réf</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TD>Société</td>";
print "<TD align=\"right\" colspan=\"2\">Date</TD>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"center\">Statut <a href=\"$PHP_SELF?viewstatut=$objp->statutid\">";

View File

@ -21,7 +21,7 @@
*/
require("./pre.inc.php3");
//require("../../www/lib/company.class.php3");
/*
*
*/
@ -32,16 +32,6 @@ if ($sortorder == "") {
$sortorder="ASC";
}
$active["1"] = "Offres en ligne";
$active["-1"] = "Moderation";
$active["-2"] = "Refusées";
$active["0"] = "Rédaction";
$active["-3"] = "Désactivées";
$active["-4"] = "Supprimées";
$yn["t"] = "oui";
$yn["f"] = "non";
if ($action == 'stcomm') {
$sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid";
$result = $db->query($sql);
@ -58,170 +48,29 @@ if ($action == 'stcomm') {
if ($socid > 0) {
$soc = new Company($db, $socid);
$soc->fetch();
$soc = new Societe($db, $socid);
$soc->fetch($socid);
/*
*
*/
$sql = "SELECT s.idp, s.nom,".$db->pdate("s.datec")." as dc,".$db->pdate("s.datem")." as dm,".$db->pdate("s.datea")." as da, s.intern, s.cjn, s.c_nom, s.c_prenom, s.c_tel, s.c_mail, s.tel, s.fax, s.fplus, s.cjn, s.viewed, st.libelle as stcomm, s.fk_stcomm, s.url,s.cp,s.ville, s.note FROM societe as s, c_stcomm as st ";
$sql .= " WHERE s.fk_stcomm=st.id";
$sql .= " AND s.idp = $socid";
print '<div class="titre">'.$soc->nom.'</div>';
print '<table border="1" width="100%" cellspacing="0" cellpadding="3">';
print "<tr><td>";
print "<form method=\"post\" action=\"index.php3?socid=$soc->id\">";
print "<input type=\"hidden\" name=\"action\" value=\"note\">";
print "<textarea name=\"note\" cols=\"60\" rows=\"10\">$soc->note</textarea><br>";
print "<input type=\"submit\">";
print "</form></td></tr>";
print "<tr><td>Notes actuelles</td></tr>";
print "<tr><td>".nl2br($soc->note)."</td></tr>";
print "</table>";
$result = $db->query($sql);
if ($result) {
$objsoc = $db->fetch_object($result , 0);
print "<table width=\"100%\" border=0><tr>\n";
print "<td bgcolor=\"white\" colspan=\"2\"><big>N° $objsoc->idp - $soc->nom - [$soc->stcomm]</big></td></tr>" ;
print "<tr>";
print "<td valign=\"top\">";
print "tel : $soc->tel<br>";
print "fax : $soc->fax<br>";
print "$soc->cp $soc->ville<br>";
if ($objsoc->url) {
print "<a href=\"http://$soc->url\">$soc->url</a><br>";
}
print "<br>Contact : <br><b>$soc->c_nom $soc->c_prenom</b>";
print "<br>tel : <b>$soc->c_tel</b>";
print "<br>email : <b>$soc->c_mail</b>";
print "</td>\n";
print "<td valign=\"top\"><table border=0 width=\"100%\" cellspacing=0 bgcolor=#e0e0e0>";
print "<tr><td>Créée le</td><td align=center><b>" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "</b></td></tr>";
print "<tr><td>Dernière modif le</td><td align=center><b>" . strftime("%d %b %Y %H:%M", $objsoc->dm) . "</b></td></tr>";
print "<tr><td>Fiche société</td><td align=center><b>".$yn[$objsoc->fplus]."</b></td></tr>" ;
print "<tr><td>Cojonet</td><td align=center><b>".$yn["$objsoc->cjn"]."</b></td></tr>" ;
print "<tr><td>Consult Fiche</td><td align=center><b>$objsoc->viewed</b></td></tr>";
print "<tr><td valign=\"top\"><b>Offres</b>";
print "<hr noshade size=1><table border=0 cellspacing=0>";
$sql = "SELECT count(idp) as cc, active FROM offre WHERE fk_soc = $objsoc->idp GROUP by active ORDER BY active DESC";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows();
while ($i < $num) {
$obj = $db->fetch_object( $i);
print "<tr><td>".$active["$obj->active"] . "</td><td>:</td><td>$obj->cc</tr>";
$i++;
}
print "</table></td>";
print "<td valign=\"top\"><b>Divers</b><hr noshade size=1>";
print "<table cellspacing=0 border=0>";
$sql = "SELECT count(idp) as cc FROM abo_soc WHERE fksoc = $objsoc->idp GROUP by active";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows();
while ($i < $num) {
$obj = $db->fetch_object( $i);
print "<tr><td>Abonnements :</td><td>$obj->cc</td></tr>";
$i++;
}
$sql = "SELECT count(idp) as cc FROM socfollowresume WHERE fk_soc = $objsoc->idp";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows();
while ($i < $num) {
$obj = $db->fetch_object( $i);
print "<tr><td>Cand. suivis :</td><td>$obj->cc</td></tr>";
$i++;
}
$sql = "SELECT count(idp) as cc FROM soccontact WHERE fk_soc = $objsoc->idp";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows();
while ($i < $num) {
$obj = $db->fetch_object( $i);
print "<tr><td>Contacts :</td><td>$obj->cc</td></tr>";
$i++;
}
print "</table></td>\n";
print "</tr>";
print "</table></td></tr>\n";
print "</table>";
print "<hr noshade size=1>";
/*
*
*
*/
print "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2><tr><td valign=\"top\">";
print "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2>";
$sql = "SELECT a.id,".$db->pdate("a.datel")." as da, c.libelle, a.author FROM socstatutlog as a, c_stcomm as c WHERE a.fk_soc = $objsoc->idp AND c.id=a.fk_statut ORDER by a.datel DESC";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows(); $tag = True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
if ($tag) {
print "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
print "<td>$obj->libelle</td>";
print "<td>$obj->author</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
print "</table>";
print "</td>";
/*
*
*
*/
print "<td valign=\"top\">";
print "<table width=\"100%\" cellspacing=0 border=0 cellpadding=2>";
$sql = "SELECT a.id,".$db->pdate("a.datea")." as da, c.libelle, a.author FROM actioncomm as a, c_actioncomm as c WHERE a.fk_soc = $objsoc->idp AND c.id=a.fk_action ORDER by a.datea DESC";
$result = $db->query($sql);
$i = 0 ; $num = $db->num_rows(); $tag = True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
if ($tag) {
print "<tr bgcolor=\"e0e0e0\">";
} else {
print "<tr>";
}
print "<td>". strftime("%d %b %Y %H:%M", $obj->da) ."</td>";
print "<td>$obj->libelle</td>";
print "<td>$obj->author</td>";
print "</tr>\n";
$i++;
$tag = !$tag;
}
print "</table>";
print "</td></tr></table>";
print "<table border=0 width=\"100%\" cellspacing=2 bgcolor=#e0e0e0>";
print "<tr><td>";
print "<form method=\"post\" action=\"index.php3?socid=$socid\">";
print "<input type=\"hidden\" name=\"action\" value=\"note\">";
print "<textarea name=\"note\" cols=\"60\" rows=\"10\">$objsoc->note</textarea><br>";
print "<input type=\"submit\">";
print "</form></td></tr>";
print "<tr><td>".nl2br($objsoc->note)."</td></tr>";
print "</table>";
} else {
print $db->error();
}
}
$db->free();
$db->close();
llxFooter();

View File

@ -22,13 +22,9 @@
require("./pre.inc.php3");
llxHeader();
print '<div class="titre">Chiffre d\'affaire par société</div>';
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$db = new Db();
if ($sortfield == "") {
$sortfield="lower(p.label)";
}
@ -68,9 +64,8 @@ function liste($db, $paye) {
if ($num > 0) {
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TR class=\"liste_titre\">";
print "<TD>Société</td>";
print "<TD align=\"right\">Montant</TD><td>&nbsp;</td>";
print "<TD align=\"right\">Moyenne</TD>";
print "</TR>\n";
@ -79,7 +74,7 @@ function liste($db, $paye) {
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD>[<a href=\"$PHP_SELF?socidp=$objp->idp\">Filtre</a>]</TD>\n";
print "<TD><a href=\"../comm/index.php3?socid=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD align=\"right\">".price($objp->ca)."</TD><td>&nbsp;</td>\n";
@ -89,8 +84,8 @@ function liste($db, $paye) {
print "</TR>\n";
$i++;
}
print "<tr><td></td><td align=\"right\"><b>Total : ".francs($total)." FF</b></td>";
print "<td align=\"right\"><b>Total : ".price($total)."</b></td><td>euros HT</td>";
print "<tr>";
print "<td colspan=\"2\" align=\"right\"><b>Total : ".price($total)."</b></td><td>euros HT</td>";
print "<td align=\"right\"><b>Moyenne : ".price($total/ $i)."</b></td></tr>";
print "</TABLE>";
}
@ -100,6 +95,8 @@ function liste($db, $paye) {
}
}
print_barre_liste("Chiffre d'affaire par société", $page, $PHP_SELF);
print "<P>";
liste($db, 0);
print "<P>";

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
@ -20,14 +21,11 @@
*/
require("./pre.inc.php3");
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$a = setlocale("LC_TIME", "FRENCH");
function get_ca_propal ($db, $year, $socidp) {
$sql = "SELECT sum(f.price) as sum FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep, '%Y') = $year ";
$sql = "SELECT sum(f.price - f.remise) as sum FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep, '%Y') = $year ";
if ($socidp) {
$sql .= " AND f.fk_soc = $socidp";
}
@ -61,7 +59,7 @@ function get_ca ($db, $year, $socidp) {
function propals ($db, $year, $month) {
global $bc;
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price - p.remise as price, p.ref,".$db->pdate("p.datep")." as dp, c.label as statut, c.id as statutid";
$sql .= " FROM societe as s, llx_propal as p, c_propalst as c WHERE p.fk_soc = s.idp AND p.fk_statut = c.id";
$sql .= " AND c.id in (1,2)";
$sql .= " AND date_format(p.datep, '%Y') = $year ";
@ -70,7 +68,6 @@ function propals ($db, $year, $month) {
$sql .= " ORDER BY p.fk_statut";
$result = $db->query($sql);
$num = $db->num_rows();
$i = 0;
@ -82,42 +79,42 @@ function propals ($db, $year, $month) {
while ($i < $num) {
$objp = $db->fetch_object( $i);
if ($objp->statut <> $oldstatut ) {
$oldstatut = $objp->statut;
if ($objp->statut <> $oldstatut ) {
$oldstatut = $objp->statut;
if ($i > 0) {
print "<tr><td align=\"right\" colspan=\"4\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
}
$subtotal = 0;
if ($i > 0) {
print "<tr><td align=\"right\" colspan=\"4\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
print "<TR bgcolor=\"#e0e0e0\">";
print "<TD>Societe</td>";
print "<TD>Réf</TD>";
print "<TD align=\"right\">Date</TD>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"center\">Statut</TD>";
print "</TR>\n";
$var=True;
}
$subtotal = 0;
print "<TR bgcolor=\"#e0e0e0\">";
print "<TD>Societe</td>";
print "<TD>Réf</TD>";
print "<TD align=\"right\">Date</TD>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"center\">Statut</TD>";
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"comp.php3?socidp=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD><a href=\"../comm/propal.php3?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
print "<TD align=\"right\">".strftime("%d %B %Y",$objp->dp)."</TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
print "<TD align=\"center\">$objp->statut</TD>\n";
print "</TR>\n";
$var=True;
}
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"comp.php3?socidp=$objp->idp\">$objp->nom</a></TD>\n";
print "<TD><a href=\"../comm/propal.php3?propalid=$objp->propalid\">$objp->ref</a></TD>\n";
print "<TD align=\"right\">".strftime("%d %B %Y",$objp->dp)."</TD>\n";
print "<TD align=\"right\">".price($objp->price)."</TD>\n";
print "<TD align=\"center\">$objp->statut</TD>\n";
print "</TR>\n";
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
$total = $total + $objp->price;
$subtotal = $subtotal + $objp->price;
$i++;
}
print "<tr><td align=\"right\" colspan=\"4\">Total : <b>".price($subtotal)."</b></td>\n";
print "<td align=\"left\">Euros HT</td></tr>\n";
@ -131,8 +128,7 @@ function propals ($db, $year, $month) {
function factures ($db, $year, $month, $paye) {
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
global $bc;
$sql = "SELECT s.nom, s.idp, f.facnumber, f.amount,".$db->pdate("f.datef")." as df, f.paye, f.rowid as facid ";
$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp AND f.paye = $paye";
@ -190,15 +186,14 @@ function factures ($db, $year, $month, $paye) {
function pt ($db, $sql, $year) {
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
global $bc;
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
$i = 0; $total = 0 ;
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>";
print "<td align=\"right\">Montant</td></tr>\n";
$var=True;
@ -261,7 +256,7 @@ function pt ($db, $sql, $year) {
}
function ppt ($db, $year, $socidp) {
global $bc;
print "<table width=\"100%\">";
print "<tr><td valign=\"top\" width=\"30%\">";
@ -272,7 +267,7 @@ function ppt ($db, $year, $socidp) {
print "<tr><td valign=\"top\" width=\"30%\">";
$sql = "SELECT sum(f.price) as sum, round(date_format(f.datep,'%m')) as dm";
$sql = "SELECT sum(f.price - f.remise) as sum, round(date_format(f.datep,'%m')) as dm";
$sql .= " FROM llx_propal as f WHERE fk_statut in (1,2) AND date_format(f.datep,'%Y') = $year ";
if ($socidp) {
@ -298,12 +293,11 @@ function ppt ($db, $year, $socidp) {
print "</td><td valign=\"top\" width=\"30%\">";
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<TD>Mois</TD>";
print "<TD align=\"right\">Montant</TD>";
print "</TR>\n";
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$var = 1 ;
for ($b = 1 ; $b <= 12 ; $b++) {
$var=!$var;

View File

@ -28,8 +28,6 @@ if ($sortorder == "") {
$sortfield="lower(s.nom)";
$sortorder="ASC";
}
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$yn["1"] = "oui";
$yn["0"] = "non";
@ -95,7 +93,7 @@ if ($facid > 0) {
print "<tr><td>Montant</td><td align=\"right\"><b>".price($obj->amount)."</b></td><td>euros HT</td></tr>";
print "<tr><td>TVA</td><td align=\"right\">".tva($obj->amount)."</td><td>euros</td></tr>";
print "<tr><td>Total</td><td align=\"right\">".price($obj->total)."</td><td>euros TTC</td></tr>";
print "<tr><td><small>soit</small></td><td align=\"right\"><small>".francs(inctva($obj->amount))."</small></td><td><small>francs</small></td></tr>";
print "</tr>";
print "</table>";
@ -115,7 +113,7 @@ if ($facid > 0) {
$i = 0; $total = 0;
print "<p><b>Paiements</b>";
echo '<TABLE border="1" width="100%" cellspacing="0" cellpadding="3">';
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<td>Date</td>";
print "<td>Type</td>";
print "<td align=\"right\">Montant</TD><td>&nbsp;</td>";
@ -163,7 +161,7 @@ if ($facid > 0) {
} else {
print "<td align=\"center\" width=\"25%\">-</td>";
}
if ($obj->statut == 1 && $resteapayer == 0 && $obj->paye == 0) {
if ($obj->statut == 1 && abs($resteapayer == 0) && $obj->paye == 0) {
print "<td align=\"center\" bgcolor=\"#e0e0e0\" width=\"25%\">[<a href=\"$PHP_SELF?facid=$facid&action=payed\">Classer 'Payée'</a>]</td>";
} else {
print "<td align=\"center\" width=\"25%\">-</td>";
@ -225,7 +223,7 @@ if ($facid > 0) {
$i = 0; $total = 0;
print "<p><b>Proposition(s) commerciale(s) associée(s)</b>";
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<td>Num</td>";
print "<td>Date</td>";
print "<td align=\"right\">Prix</TD>";

View File

@ -68,11 +68,11 @@ if ($result) {
$i = 0;
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print '<TR class="liste_titre">';
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD>Num&eacute;ro</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD>Num&eacute;ro</TD><td>";
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD align=\"right\">Payé</TD>";
print "</TR>\n";
@ -89,9 +89,9 @@ if ($result) {
print '<TR class="liste_titre">';
print "<TD>[<a href=\"$PHP_SELF\">Tous</a>]</td>";
print "<TD>Num&eacute;ro</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Societe</a></td>";
print "<TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD>Num&eacute;ro</TD><td>";
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><TD align=\"right\">Date</TD><TD align=\"right\">Montant</TD>";
print "<TD align=\"right\">Payé</TD></TR>\n";
$sep = 1 ; $j = 0;
$subtotal = 0;

View File

@ -4,10 +4,6 @@
* $Id$
* $Source$
*
* action : - create
* - add
*
*
* 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
@ -23,8 +19,6 @@
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
*
*
*
*
*/
require("./pre.inc.php3");
@ -35,7 +29,6 @@ $db = new Db();
if ($action == 'add') {
$datepaye = $db->idate(mktime(12, 0 , 0, $pmonth, $pday, $pyear));
$author = $GLOBALS["REMOTE_USER"];
$sql = "INSERT INTO llx_paiement (fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note)";
$sql .= " VALUES ($facid, now(), $datepaye,$amount,'$author', $paiementid, '$num_paiement', '$note')";
@ -61,17 +54,32 @@ if ($action == 'add') {
$num = $db->num_rows();
if ($num) {
$obj = $db->fetch_object( 0);
print "Emettre un paiement<p>";
$total = $obj->total;
print_titre("Emettre un paiement");
print "<form action=\"$PHP_SELF\" method=\"post\">";
print "<table cellspacing=0 border=1>";
print '<table cellspacing="0" border="1" width="100%" cellpadding="3">';
print "<tr bgcolor=\"#f0f0f0\"><td colspan=\"3\">Facture</td>";
print "<tr bgcolor=\"#e0e0e0\"><td>Société :</td><td>$obj->nom</td></tr>";
print "<tr bgcolor=\"#e0e0e0\"><td>Numéro :</td><td>$obj->facnumber</td></tr>";
print "<tr bgcolor=\"#e0e0e0\"><td>Société :</td><td>$obj->nom</td></tr>";
print "<tr bgcolor=\"#e0e0e0\"><td>Montant :</td><td align=\"right\">".price($obj->total)." euros TTC</td></tr>";
print "<tr bgcolor=\"#f0f0f0\"><td colspan=\"3\">Paiement</td>";
$sql = "SELECT sum(p.amount) FROM llx_paiement as p WHERE p.fk_facture = $facid;";
$result = $db->query($sql);
if ($result) {
$sumpayed = $db->result(0,0);
$db->free();
}
print '<tr><td>Déjà payé</td><td align="right">'.price($sumpayed).' euros TTC</td></tr>';
print "<input type=\"hidden\" name=\"action\" value=\"add\">";
print "<input type=\"hidden\" name=\"facid\" value=\"$facid\">";
print "<input type=\"hidden\" name=\"facnumber\" value=\"$obj->facnumber\">";
@ -127,12 +135,9 @@ if ($action == 'add') {
print "<td rowspan=\"5\">Commentaires :<br>";
print "<textarea name=\"comment\" wrap=\"soft\" cols=\"30\" rows=\"15\"></textarea></td></tr>";
$author = $GLOBALS["REMOTE_USER"];
print "<input type=\"hidden\" name=\"author\" value=\"$author\">\n";
print "<tr><td>Auteur :</td><td>$author</td></tr>\n";
print "<tr><td>Type :</td><td><select name=\"paiementid\">\n";
$sql = "SELECT id, libelle FROM c_paiement ORDER BY id";
@ -140,8 +145,7 @@ if ($action == 'add') {
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
$i = 0; $total = 0;
$i = 0;
while ($i < $num) {
$objopt = $db->fetch_object( $i);
print "<option value=\"$objopt->id\">$objopt->libelle</option>\n";
@ -151,7 +155,7 @@ if ($action == 'add') {
print "</select><br>";
print "</td></tr>\n";
print "<tr><td>Numéro :</td><td><input name=\"num_paiement\" type=\"text\"><br><em>Num du cheque ou virement</em></td></tr>\n";
print "<tr><td>Montant :</td><td><input name=\"amount\" type=\"text\" value=\"$obj->price\"></td></tr>\n";
print "<tr><td valign=\"top\">Montant :</td><td>Reste à payer : ".price($total - $sumpayed)." euros TTC<br><input name=\"amount\" type=\"text\"></td></tr>\n";
print "<tr><td colspan=\"3\" align=\"center\"><input type=\"submit\" value=\"Enregistrer\"></td></tr>\n";
print "</form>\n";
print "</table>\n";
@ -179,8 +183,6 @@ if ($action == '') {
print "<td>Type</TD>";
print "<td align=\"right\">Montant</TD>";
print "<td>&nbsp;</td>";
print "<td align=\"right\">FF TTC</td>";
print "<td>&nbsp;</td>";
print "</TR>\n";
$var=True;
@ -192,12 +194,12 @@ if ($action == '') {
print "<TD>".strftime("%d %B %Y",$objp->dp)."</TD>\n";
print "<TD>$objp->paiement_type $objp->num_paiement</TD>\n";
print '<TD align="right">'.price($objp->amount).'</TD><td>&nbsp;</td>';
print "<TD align=\"right\">".francs(inctva($objp->amount))."</TD><td>&nbsp;</td>\n";
print "</tr>";
$total = $total + $objp->amount;
$i++;
}
print "<tr><td align=\"right\" colspan=\"4\">Total : <b>$total</b></td><td>Euros HT</td></tr>\n";
print "<tr><td align=\"right\" colspan=\"4\">Total : <b>".price($total)."</b></td><td>Euros HT</td></tr>\n";
print "</table>";
}

View File

@ -21,10 +21,6 @@
*/
require("./pre.inc.php3");
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$a = setlocale("LC_TIME", "FRENCH");
/*
*

View File

@ -21,11 +21,6 @@
*/
require("./pre.inc.php3");
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$a = setlocale("LC_TIME", "FRENCH");
function pt ($db, $sql) {
$result = $db->query($sql);
if ($result) {

View File

@ -22,7 +22,7 @@
require("../main.inc.php3");
function llxHeader($head = "") {
global $PREFIX, $user, $conf;
global $user, $conf;
/*
@ -31,62 +31,28 @@ function llxHeader($head = "") {
*/
top_menu($head);
$menu = new Menu();
print "<TR><TD valign=\"top\" align=\"right\">";
$menu->add("/compta/index.php3","Factures");
$menu->add_submenu("paiement.php3","Paiements");
$menu->add_submenu("fac.php3","admin fac");
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
$menu->add("ca.php3","Chiffres d'affaires");
print '<TR><TD class="barre_select" valign="top" align="right">';
print '<div align="center"><A href="/compta/index.php3">Factures</A></div><p>';
print "<A href=\"paiement.php3\">Paiements</A><BR>\n";
print "<A href=\"fac.php3\">admin fac</A><BR>\n";
print "</td></tr>";
$menu->add_submenu("prev.php3","Prévisionnel");
$menu->add_submenu("comp.php3","Comparatif");
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print "<div align=\"center\">Chiffres d'affaires</div><br>\n";
print "<A href=\"ca.php3\">Réalisé</A><BR>\n";
print "<A href=\"prev.php3\">Prévisionnel</A><BR>\n";
print "<A href=\"comp.php3\">Comparatif</A>\n";
print "</td></tr>";
$menu->add_submenu("casoc.php3","Par société");
$menu->add_submenu("pointmort.php3","Point mort");
$menu->add_submenu("tva.php3","TVA");
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print "<CENTER>Analyses</CENTER><br>\n";
print "<A href=\"casoc.php3\">CA par societe</A><BR>\n";
print "<A href=\"pointmort.php3\">Point mort</A><BR>\n";
print "<A href=\"tva.php3\">TVA</A><BR>\n";
print "</td></tr>";
$menu->add("/comm/propal.php3","Propal");
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print "<A href=\"/comm/propal.php3\">Propal</A><BR>\n";
print "</td></tr>";
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print "<A href=\"bank/index.php3\">Bank</A><BR>\n";
print "</td></tr>";
$menu->add("bank/index.php3","Bank");
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print "<A href=\"/comm/index.php3\">Societes</A>\n";
print "<form action=\"/comm/index.php3\">";
print "<input type=\"text\" name=\"socname\" size=\"8\">";
print "<input type=\"submit\" value=\"nom\">";
print "</form>";
left_menu($menu->liste);
print "<form action=\"/comm/index.php3\">";
print "<input type=\"text\" name=\"socid\" size=\"5\">";
print "<input type=\"submit\" value=\"id\">";
print "</form>";
print "</td></tr>";
print "</table>";
print "</TD>\n<TD valign=\"top\" width=\"85%\">\n";
}
/*
*
*/
// $Id$
// $Source$
?>

View File

@ -21,13 +21,11 @@
*/
require("./pre.inc.php3");
function pt ($db, $sql, $title)
{
$bc[0]='bgcolor="#90c090"';
$bc[1]='bgcolor="#b0e0b0"';
function pt ($db, $sql, $title) {
global $bc;
print '<p><TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<TD>$title</TD>";
print "<TD align=\"right\">Montant</TD>";
@ -79,15 +77,14 @@ if ($sortorder == "") {
}
$in = "(1,2)";
//$in = "(3)";
print "<P>CA Prévisionnel basé sur les propal <b>ouvertes</b> et <b>signées</b>";
print_titre ("CA Prévisionnel basé sur les propal <b>ouvertes</b> et <b>signées</b>");
print '<table width="100%">';
print '<tr><td valign="top">';
$sql = "SELECT sum(f.price) as amount, date_format(f.datep,'%Y-%m') as dm";
$sql = "SELECT sum(f.price - f.remise) as amount, date_format(f.datep,'%Y-%m') as dm";
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
$sql .= " GROUP BY dm DESC";
@ -95,7 +92,7 @@ pt($db, $sql, "Mois");
print '</td><td valign="top">';
$sql = "SELECT sum(f.price) as amount, year(f.datep) as dm";
$sql = "SELECT sum(f.price - f.remise) as amount, year(f.datep) as dm";
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
$sql .= " GROUP BY dm DESC";
@ -103,7 +100,7 @@ pt($db, $sql, "Ann
print "<P>";
$sql = "SELECT sum(f.price) as amount, month(f.datep) as dm";
$sql = "SELECT sum(f.price - f.remise) as amount, month(f.datep) as dm";
$sql .= " FROM llx_propal as f WHERE fk_statut in $in";
$sql .= " GROUP BY dm";

View File

@ -1,5 +1,6 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
@ -20,10 +21,6 @@
*/
require("./pre.inc.php3");
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
$a = setlocale("LC_TIME", "FRENCH");
/*
*
@ -31,15 +28,14 @@ $a = setlocale("LC_TIME", "FRENCH");
*/
function pt ($db, $sql, $date) {
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
global $bc;
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
$i = 0; $total = 0 ;
print "<p><TABLE border=\"1\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TR class=\"liste_titre\">";
print "<TD width=\"60%\">$date</TD>";
print "<TD align=\"right\">Montant</TD>";
print "<td>&nbsp;</td>\n";

View File

@ -46,9 +46,7 @@ class Conf {
$this->years = 2001;
$this->mode = 1 ;
$this->css = "dolibarr.css";
$this->css = "theme/dolibarr/dolibarr.css";
}
}
@ -86,7 +84,7 @@ class WebcalConf {
$this->enabled = 1;
$this->db = new DbConf();
$this->name = "webcal";
$this->db->name = "webcal";
}
}

134
htdocs/fourn/contact.php3 Normal file
View File

@ -0,0 +1,134 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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.
*
*/
require("./pre.inc.php3");
llxHeader();
$db = new Db();
if ($sortorder == "") {
$sortorder="ASC";
}
if ($sortfield == "") {
$sortfield="p.name";
}
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
print_barre_liste("Liste des contacts",$page, $PHP_SELF);
print "<DIV align=\"center\">";
print "| <A href=\"$PHP_SELF?page=$pageprev&stcomm=$stcomm&sortfield=$sortfield&sortorder=$sortorder&aclasser=$aclasser&coord=$coord\">*</A>\n| ";
for ($i = 65 ; $i < 91; $i++) {
print "<A href=\"$PHP_SELF?begin=" . chr($i) . "&stcomm=$stcomm\" class=\"T3\">";
if ($begin == chr($i) ) {
print "<b>-&gt;" . chr($i) . "&lt;-</b>" ;
} else {
print chr($i) ;
}
print "</A> | ";
}
print "</div>";
/*
*
* Mode liste
*
*
*/
$sql = "SELECT s.idp, s.nom, st.libelle as stcomm, p.idp as cidp, p.name, p.firstname, p.email, p.phone ";
$sql .= "FROM societe as s, socpeople as p, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.idp = p.fk_soc";
if (strlen($stcomm)) {
$sql .= " AND s.fk_stcomm=$stcomm";
}
if (strlen($begin)) {
$sql .= " AND upper(p.name) like '$begin%'";
}
if ($contactname) {
$sql .= " AND lower(p.name) like '%".strtolower($contactname)."%'";
$sortfield = "lower(p.name)";
$sortorder = "ASC";
}
if ($socid) {
$sql .= " AND s.idp = $socid";
}
$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset);
$result = $db->query($sql);
if ($result) {
$num = $db->num_rows();
$i = 0;
if ($sortorder == "DESC") {
$sortorder="ASC";
} else {
$sortorder="DESC";
}
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\">";
print "<TD>Nom</TD>";
print "<TD>Prénom</TD><td>";
print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin);
print "</td><TD>email</TD>";
print '<TD>Téléphone</TD><td>&nbsp;</td>';
print "</TR>\n";
$var=True;
while ($i < $num) {
$obj = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD>$obj->name</TD>";
print "<TD>$obj->firstname</TD>";
print '<TD><a href="contact.php3?socid='.$obj->idp.'"><img src="/theme/'.$conf->theme.'/img/filter.png" border="0"></a>&nbsp;';
print "<a href=\"index.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print "<TD>$obj->email&nbsp;</TD>\n";
print '<td><a href="actioncomm.php3?action=create&actionid=1&contactid='.$obj->cidp.'&socid='.$obj->idp.'">'.$obj->phone.'</a>&nbsp;</td>';
print "<TD><a href=\"addpropal.php3?socidp=$obj->idp&setcontact=$obj->cidp&action=create\">[Propal]</A></td>\n";
print "</TR>\n";
$i++;
}
print "</TABLE>";
$db->free();
} else {
print $db->error();
}
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@ -21,7 +21,7 @@
*/
require("./pre.inc.php3");
require("../contact.class.php3");
require("../societe.class.php3");
llxHeader();
$db = new Db();
@ -103,7 +103,7 @@ if ($socid > 0) {
*/
print_barre_liste("Liste des fournisseurs",$page, $PHP_SELF);
$sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.fournisseur=1";
$sql = "SELECT s.idp, s.nom, s.ville,".$db->pdate("s.datec")." as datec, ".$db->pdate("s.datea")." as datea, st.libelle as stcomm, s.prefix_comm FROM societe as s, c_stcomm as st WHERE s.fk_stcomm = st.id AND s.fournisseur=1";
if (strlen($stcomm)) {
$sql .= " AND s.fk_stcomm=$stcomm";
@ -132,11 +132,10 @@ if ($socid > 0) {
$sortorder="DESC";
}
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print '<TR class="liste_titre">';
print "<TD><a href=\"index.php3?sortfield=lower(s.nom)&sortorder=$sortorder&begin=$begin\">Societe</a></td>";
print "<TD>Contact</TD>";
print "<TD>email</TD>";
print "<TD align=\"center\">Statut</TD><td>&nbsp;</td><td colspan=\"2\">&nbsp;</td>";
print '<TR class="liste_titre"><td>';
print_liste_field_titre("Société",$PHP_SELF,"s.nom");
print "</td><TD>Ville</TD>";
print "<td colspan=\"2\">&nbsp;</td>";
print "</TR>\n";
$var=True;
while ($i < $num) {
@ -146,16 +145,11 @@ if ($socid > 0) {
print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php3?socid=$obj->idp\">$obj->nom</A></td>\n";
print "<TD>&nbsp;</TD>\n";
print "<TD>&nbsp;</TD>\n";
print "<TD align=\"center\">$obj->stcomm</TD>\n";
print "<TD>".$obj->ville."</TD>\n";
print "<TD align=\"center\">$obj->prefix_comm&nbsp;</TD>\n";
print "<TD align=\"center\"><a href=\"addpropal.php3?socidp=$obj->idp&action=create\">[Propal]</A></td>\n";
if ($conf->fichinter->enabled) {
print "<TD align=\"center\"><a href=\"../fichinter/fiche.php3?socidp=$obj->idp&action=create\">[Fiche Inter]</A></td>\n";
} else {
print "<TD>&nbsp;</TD>\n";
}
print "</TR>\n";
$i++;
}

View File

@ -31,75 +31,19 @@ function llxHeader($head = "", $urlp = "") {
*/
top_menu($head);
print "<TR><TD valign=\"top\" align=\"right\">";
$menu = new Menu();
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
$menu->add("/comm/index.php3", "Clients");
print '<TR><TD class="barre_select" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."index.php3\">Fournisseur</A></div>\n";
print "<A href=\"".$urlp."../soc.php3?&action=create\">Nouvelle société</A><BR>\n";
print "<A href=\"".$urlp."contact.php3\">Contacts</A><BR><br>\n";
print "</TD></TR>";
$menu->add("/fourn/index.php3", "Fournisseurs");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../compta/">Factures</A></div>';
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../product/">Produits</A></div>';
print '<div align="center"><A href="'.$urlp.'../service/">Services</A></div>';
print "</td></tr>";
/*
*
*/
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."index.php3\">Societes</A></CENTER>\n";
print "<form action=\"index.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<CENTER><A href=\"".$urlp."contact.php3\">Contacts</A></CENTER>\n";
print "<form action=\"".$urlp."contact.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print "</form>";
$menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée");
$menu->add_submenu("contact.php3","Contacts");
print "<form action=\"index.php3\">";
print "Soc : <input type=\"text\" name=\"socid\" size=\"5\">";
print "<input type=\"submit\" value=\"id\">";
print "</form>";
print "</td></tr>";
print "</table>";
print "</td>";
print "<TD valign=\"top\" width=\"85%\">\n";
left_menu($menu->liste);
}
/*
* $Id$
* $Source$
*/
?>

View File

@ -23,10 +23,6 @@ require("./pre.inc.php3");
llxHeader();
$bc[0]="bgcolor=\"#90c090\"";
$bc[1]="bgcolor=\"#b0e0b0\"";
print 'Utilisateur : ' . $user->prenom . ' ' . $user->nom .' ['.$user->code.']';
@ -47,54 +43,77 @@ $db = new Db();
if ($db->ok) {
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<br><br><TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="50%">';
print '<tr><td valign="top" width="30%">';
print "<TABLE border=\"1\" cellspacing=\"0\" cellpadding=\"2\">";
print "<TR bgcolor=\"orange\">";
print "<td>Description</td><td>Valeur</TD>";
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Propositions commerciales</td>";
print "</TR>\n";
$sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 0";
if (valeur($sql)) {
$var=!$var;
print "<tr $bc[$var]><td><a href=\"comm/propal.php3?viewstatut=0\">Propales brouillons</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
print "<tr $bc[$var]><td><a href=\"comm/propal.php3?viewstatut=0\">Broullionsrouillons</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
}
$sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 1";
if (valeur($sql)) {
$var=!$var;
print "<tr $bc[$var]><td><a href=\"comm/propal.php3?viewstatut=1\">Propales ouvertes</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
print "<tr $bc[$var]><td><a href=\"comm/propal.php3?viewstatut=1\">Ouvertes</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
}
print "</table><br>";
/*
* Factures
*
*/
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Factures</td>";
print "</TR>\n";
$sql = "SELECT count(*) FROM llx_facture WHERE paye=0";
if (valeur($sql)) {
$var=!$var;
print "<tr $bc[$var]><td><a href=\"compta/index.php3\">Factures en attente de paiement</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
}
print "</table><br>";
/*
*
*
*/
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="50%">';
/*
*
*
*/
print '</td><td valign="top" width="70%">';
print "<TABLE border=\"1\" cellspacing=\"0\" cellpadding=\"2\">";
print "<TR bgcolor=\"orange\">";
print "<td>Description</td><td>Valeur</TD>";
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Actions a faire</td>";
print "</TR>\n";
$sql = "SELECT count(*) FROM societe WHERE fk_stcomm=2";
$sql = "SELECT datea, label FROM llx_todocomm WHERE fk_user_author = $user->id";
if (valeur($sql)) {
$var=!$var;
print "<tr $bc[$var]><td><a href=\"comm/index.php3?stcomm=2\">Société en cours de contact</a></td><td align=\"right\">".valeur($sql)."</td></tr>";
$i=0;
if ( $db->query($sql) ) {
while ($i < $db->num_rows() ) {
$obj = $db->fetch_object($i);
$var=!$var;
print "<tr $bc[$var]><td>".$obj->datea."</td><td><a href=\"compta/index.php3\">$obj->label</a></td></tr>";
$i++;
}
$db->free();
}
}
print '</table>';
print '</td></tr></table><br>';
print '</td><td valign="top">';
print "</table><br>";
print '</td></tr>';

View File

@ -44,6 +44,15 @@ if ($conf->fichinter->enabled) {
print '<tr><td>output url</td><td>' . $conf->fichinter->outputurl . '</td></tr>';
}
print '<tr><td bgcolor="#e0e0e0" colspan="2">Webcal</td></tr>';
print '<tr><td>type</td><td>' . $conf->webcal->db->type . '</td></tr>';
print '<tr><td>host</td><td>' . $conf->webcal->db->host . '</td></tr>';
print '<tr><td>user</td><td>' . $conf->webcal->db->user . '&nbsp;</td></tr>';
print '<tr><td>pass</td><td>' . $conf->webcal->db->pass . '&nbsp;</td></tr>';
print '<tr><td>Database name</td><td>' . $conf->webcal->db->name . '</td></tr>';
print '</table>';

View File

@ -24,6 +24,17 @@
* $Source$
*
*/
function print_liste_field_titre($name, $file, $field, $begin="") {
global $conf;
print $name."&nbsp;";
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=asc&begin='.$begin.'">';
print '<img src="/theme/'.$conf->theme.'/img/1downarrow.png" border="0"></a>';
print '<a href="'.$file.'?sortfield='.$field.'&sortorder=desc&begin='.$begin.'">';
print '<img src="/theme/'.$conf->theme.'/img/1uparrow.png" border="0"></a>';
}
function print_titre($titre) {
global $conf;
print '<table width="100%" border="0" cellpadding="3" cellspacing="0">';
@ -40,9 +51,9 @@ function print_barre_liste($titre,$page,$file) {
print '<tr><td><div class="titre">'.$titre.'</div></td>';
print '<td align="right">';
if ($page > 0) {
print '<a href="'.$file.'?page='.($page-1).'"><img src="/theme/'.$conf->theme.'/img/1leftarrow.png" border="0"></a>';
print '<a href="'.$file.'?page='.($page-1).'"><img alt="Page précédente" src="/theme/'.$conf->theme.'/img/1leftarrow.png" border="0"></a>';
}
print '<a href="'.$file.'?page='.($page+1).'"><img src="/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>';
print '<a href="'.$file.'?page='.($page+1).'"><img alt="Page suivante" src="/theme/'.$conf->theme.'/img/1rightarrow.png" border="0"></a>';
print '</td></tr></table>';
}
/*
@ -87,9 +98,50 @@ function print_date_select() {
for ($year = $syear ; $year < $syear + 5 ; $year++) {
print "<option value=\"$year\">$year";
}
print "</select>";
print "</select>\n";
}
/*
*
*
*/
function print_heure_select($prefix,$begin=1,$end=23) {
print '<select name="'.$prefix.'hour">';
for ($hour = $begin ; $hour <= $end ; $hour++) {
print "<option value=\"$hour\">$hour";
}
print "</select>&nbsp;H&nbsp;";
print '<select name="'.$prefix.'min">';
for ($min = 0 ; $min < 60 ; $min=$min+5) {
if ($min < 10) {
$min = "0" . $min;
}
print "<option value=\"$min\">$min";
}
print "</select>\n";
}
/*
*
*
*/
function print_duree_select($prefix) {
print '<select name="'.$prefix.'hour">';
print "<option value=\"0\">0";
print "<option value=\"1\" SELECTED>1";
for ($hour = 2 ; $hour < 13 ; $hour++) {
print "<option value=\"$hour\">$hour";
}
print "</select>&nbsp;H&nbsp;";
print '<select name="'.$prefix.'min">';
for ($min = 0 ; $min < 55 ; $min=$min+5) {
print "<option value=\"$min\">$min";
}
print "</select>\n";
}
function price($amount) {

View File

@ -5,8 +5,6 @@
* $Id$
* $Source$
*
* Classe Db
*
* 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
@ -26,36 +24,65 @@
class Db {
var $db, $results, $ok;
Function Db() {
global $conf;
Function Db($type = 'mysql', $host = '', $user = '', $pass = '', $name = '')
{
// print "Name DB : $host, $user, $pass, $name<br>";
global $conf;
if ($host == '') {
$host = $conf->db->host;
}
if ($user == '') {
$user = $conf->db->user;
}
if ($pass == '') {
$pass = $conf->db->pass;
}
if ($name == '') {
$name = $conf->db->name;
}
$this->db = $this->connect($conf->db->host, $conf->db->user, $conf->db->pass);
if (! $this->db) {
print "Db->Db() raté<br>\n";
$this->ok = 0;
return 0;
$this->db = $this->connect($host, $user, $pass);
if (! $this->db) {
print "Db->Db() raté<br>\n";
$this->ok = 0;
return 0;
}
$ret = $this->select_db($name);
$this->ok = 1;
return $ret;
}
$ret = $this->select_db($conf->db->name, $this->db);
$this->ok = 1;
return $ret;
}
/*
*
*/
Function select_db($database) {
return mysql_select_db($database, $this->db);
}
/*
*
*/
Function connect($host, $login, $passwd) {
$this->db = mysql_connect($host, $login, $passwd);
return $this->db;
}
/*
*
*/
Function clone() {
$db2 = new Db("", "", "", "", "");
$db2->db = $this->db;
return $db2;
}
Function connect($host, $login, $passwd) {
$this->db = mysql_connect($host, $login, $passwd);
return $this->db;
}
Function pconnect($host, $login, $passwd) {
$this->db = mysql_pconnect($host, $login, $passwd);
return $this->db;

View File

@ -21,25 +21,35 @@
*/
class Webcal {
var $localdb;
var $heure = -1;
var $duree = 0;
Function Webcal() {
global $conf;
$this->localdb = new Db($conf->webcal->db->type,
$conf->webcal->db->host,
$conf->webcal->db->user,
$conf->webcal->db->pass,
$conf->webcal->db->name);
}
Function add($user, $date, $texte, $desc) {
$db = new Db();
$id = get_next_id($db);
$id = $this->get_next_id();
$cal_id = $id;
$cal_create_by = $user;
$cal_create_by = $user->webcal_login;
$cal_date = strftime('%Y%m%d', $date);
$cal_time = -1;
$cal_time = $this->heure;
$cal_mod_date = strftime('%Y%m%d', time());
$cal_mod_time = strftime('%H%M', time());
$cal_duration = 0;
$cal_duration = $this->duree;
$cal_priority = 2;
$cal_type = "E";
$cal_access = "P";
@ -49,23 +59,38 @@ class Webcal {
$sql = "INSERT INTO webcal_entry (cal_id, cal_create_by,cal_date,cal_time,cal_mod_date, cal_mod_time,cal_duration,cal_priority,cal_type, cal_access, cal_name,cal_description)";
$sql .= " VALUES ($cal_id, '$cal_create_by',$cal_date,$cal_time,$cal_mod_date, $cal_mod_time,cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description');";
$sql .= " VALUES ($cal_id, '$cal_create_by', $cal_date, $cal_time,$cal_mod_date, $cal_mod_time, $cal_duration,$cal_priority,'$cal_type', '$cal_access', '$cal_name','$cal_description');";
$db->query($sql);
if ( $this->localdb->query($sql) ) {
$db->close();
$sql = "INSERT INTO webcal_entry_user (cal_id, cal_login, cal_status)";
$sql .= " VALUES ($cal_id, '$cal_create_by', 'A')";
if ( $this->localdb->query($sql) ) {
} else {
print $this->localdb->error() . '<br>' .$sql;
}
} else {
print $this->localdb->error() . '<br>' .$sql;
}
$this->localdb->close();
}
Function get_next_id($db) {
Function get_next_id() {
$sql = "SELECT max(cal_id) FROM webcal_entry";
if ($db->query($sql)) {
$id = $db->result(0, 0) + 1;
if ($this->localdb->query($sql)) {
$id = $this->localdb->result(0, 0) + 1;
return $id;
} else {
print $this->localdb->error();
}
}
}
?>

View File

@ -28,28 +28,23 @@ require ($GLOBALS["DOCUMENT_ROOT"]."/lib/functions.inc.php3");
require ($GLOBALS["DOCUMENT_ROOT"]."/user.class.php3");
require ($GLOBALS["DOCUMENT_ROOT"]."/lib/product.class.php3");
require ($GLOBALS["DOCUMENT_ROOT"]."/menu.class.php3");
require($GLOBALS["DOCUMENT_ROOT"]."/societe.class.php3");
$conf = new Conf();
$db = new Db();
$user = new User($db);
$user->fetch($GLOBALS["REMOTE_USER"]);
$db->close();
$bc[0]="class=\"impair\"";
$bc[1]="class=\"pair\"";
function llxFooter($foot='') {
print "</TD></TR>";
/*
*
*/
print "</TABLE>\n";
print "$foot<br>";
print '[<a href="http://savannah.gnu.org/bugs/?group_id=1915">Bug report</a>]&nbsp;';
print '[<a href="http://savannah.gnu.org/projects/dolibarr/">Source Code</a>]&nbsp;';
print "</BODY></HTML>";
}
$a = setlocale("LC_TIME", "FRENCH");
function top_menu($head) {
global $user, $conf;
@ -60,7 +55,7 @@ function top_menu($head) {
print '<LINK REL="stylesheet" TYPE="text/css" HREF="/'.$conf->css.'">';
print "</HEAD>\n";
print '<BODY BGCOLOR="#c0c0c0" TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">';
print '<BODY TOPMARGIN="0" BOTTOMMARGIN="0" LEFTMARGIN="0" RIGHTMARGIN="0" MARGINHEIGHT="0" MARGINWIDTH="0">';
/*
* Barre superieure
*
@ -89,7 +84,9 @@ function top_menu($head) {
print '<TD width="15%" class="menu" align="center">-</TD>';
print '<TD width="15%" class="menu" align="center">-</TD>';
print '<TD width="15%" class="menu" align="center">';
print '<a class="menu" href="'.$conf->webcal->url.'">Calendrier</a>';
print '</TD>';
print '<TD width="15%" class="menu" align="center">-</TD>';
print '<TD width="10%" class="menu" align="center">'.$user->code.'</td>';
@ -101,9 +98,73 @@ function top_menu($head) {
* Table principale
*
*/
print '<TABLE border="0" width="100%">';
print '<TABLE border="0" width="100%" cellspacing="0" cellpadding="3">';
print "<TR><TD valign=\"top\" align=\"right\">";
}
function left_menu($menu) {
global $conf;
/*
* Colonne de gauche
*
*/
print '<TABLE border="0" width="100%" bgcolor="#000000" cellspacing="0" cellpadding="0">';
print '<tr><td>';
print '<TABLE border="0" width="100%" cellspacing="1" cellpadding="4">';
for ($i = 0 ; $i < sizeof($menu) ; $i++) {
print "<TR><TD class=\"barre\" valign=\"top\">";
print '<A class="menu" href="'.$menu[$i][0].'">'.$menu[$i][1].'</a>';
for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2) {
print '<br>&nbsp;-&nbsp;<a class="submenu" href="'.$menu[$i][$j].'">'.$menu[$i][$j+1].'</A>';
}
print '</td></tr>';
}
print "<TR><TD class=\"barre\" valign=\"top\" align=\"right\">";
print '<A class="menu" href="/comm/index.php3">Societes</A>';
print '<form action="/comm/index.php3">';
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print '<A class="menu" href="/comm/contact.php3">Contacts</A>';
print '<form action="/comm/contact.php3">';
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print '</form>';
print '</td></tr>';
print '</table></td></tr></table>';
/*
*
*
*/
print "</TD>\n<TD valign=\"top\" width=\"85%\">\n";
}
function llxFooter($foot='') {
print "</TD></TR>";
/*
*
*/
print "</TABLE>\n";
print "$foot<br>";
print '[<a href="http://savannah.gnu.org/bugs/?group_id=1915">Bug report</a>]&nbsp;';
print '[<a href="http://savannah.gnu.org/projects/dolibarr/">Source Code</a>]&nbsp;';
print "</BODY></HTML>";
}
?>

52
htdocs/menu.class.php3 Normal file
View File

@ -0,0 +1,52 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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.
*
*/
class Menu {
var $liste;
Function Menu() {
$this->liste = array();
}
Function add($url, $titre) {
$i = sizeof($this->liste);
$this->liste[$i][0] = $url;
$this->liste[$i][1] = $titre;
}
Function add_submenu($url, $titre) {
$i = sizeof($this->liste) - 1;
$j = sizeof($this->liste[$i]);
$this->liste[$i][$j] = $url;
$this->liste[$i][$j+1] = $titre;
}
}

View File

@ -22,6 +22,7 @@
require ("./main.inc.php3");
function llxHeader($head = "") {
global $user, $conf;
@ -30,77 +31,36 @@ function llxHeader($head = "") {
*
*/
top_menu($head);
print "<TR><TD valign=\"top\" align=\"right\">";
/*
* Colonne de gauche
*
*/
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print "<TR><TD valign=\"top\" align=\"right\">";
print "<div align=\"center\"><A href=\"/comm/index.php3\">Clients</A></div>\n";
print '</td></tr>';
$menu = new Menu();
print "<TR><TD valign=\"top\" align=\"right\">";
print "<div align=\"center\"><A href=\"/fourn/index.php3\">Fournisseurs</A></div>\n";
print '</td></tr>';
$menu->add("/comm/index.php3", "Commercial");
$menu->add_submenu("/comm/index.php3", "Clients");
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><A href=\"/comm/propal.php3\">Propales</A></center>\n";
print '</td></tr>';
$menu->add_submenu("/comm/propal.php3", "Propales");
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><A href=\"/compta/\">Factures</center></A>\n";
print '</td></tr>';
$menu->add("/compta/", "Comptabilité");
if ($conf->fichinter->enabled) {
$menu->add_submenu("/compta/", "Factures");
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><A href=\"/fichinter/\">Fiches d'intervention</center></A>\n";
print '</td></tr>';
if ($conf->fichinter->enabled ) {
$menu->add("/fichinter/", "Fiches d'intervention");
}
print "<TR><TD valign=\"top\" align=\"right\">";
print "<center><A href=\"/product/\">Produits</center></A>\n";
$menu->add("/fourn/index.php3", "Fournisseurs");
print "<center><A href=\"/service/\">Services</center></A>\n";
print '</td></tr>';
$menu->add("/product/", "Produits");
$menu->add("/service/", "Services");
print "<TR><TD valign=\"top\" align=\"right\">";
print '<div align="center"><A href="user/index.php3">Utilisateurs</div></A>';
print '</td></tr>';
$menu->add("/user/", "Utilisateurs");
print '<TR><TD valign="top" align="center">';
$menu->add("/info.php3", "Configuration");
print '<A href="comm/index.php3">Societes</A>';
print '<form action="comm/index.php3">';
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print '<A href="comm/contact.php3">Contacts</A>';
print '<form action="comm/contact.php3">';
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print '</form>';
print '</td></tr>';
print "<TR><TD valign=\"top\" align=\"right\">";
print "<A href=\"info.php3\">Configuration</A><br>";
print '</td></tr></table>';
/*
*
*
*/
print "</TD>\n<TD valign=\"top\" width=\"85%\">\n";
left_menu($menu->liste);
}
?>

View File

@ -30,81 +30,24 @@ function llxHeader($head = "", $urlp = "") {
*/
top_menu($head);
$menu = new Menu();
print "<TABLE border=\"1\" width=\"100%\" cellpadding=\"0\">";
print "<TR><TD valign=\"top\" align=\"right\">";
$menu->add("/product/index.php3", "Produits");
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
print '<TR><TD class="barre" valign="top" align="right">';
print "<center><b>" . $conf->db->name . " - " . $user->code ."</B></center>";
print "<A href=\"".$urlp."../\">Accueil</A><br>";
print "<A href=\"".$urlp."bookmark.php3\">Bookmark</A>";
print "</td></tr>";
$menu->add("/service/index.php3", "Services");
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."index.php3\">Societe</A></CENTER>\n";
print "<A href=\"".$urlp."contact.php3\">Contact</A><BR>\n";
print "</TD></TR>";
$menu->add("/comm/index.php3", "Clients");
print '<TR><TD class="barre_select" valign="top" align="right">';
print "<div align=\"center\"><A href=\"index.php3\">Produits</A></div>";
print "</TD></TR>";
$menu->add("/fourn/index.php3", "Fournisseurs");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."../comm/actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'propal.php3">Propal</A></div>';
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print '<div align="center"><A href="'.$urlp.'../compta/\">Factures</A></div>';
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societes</A></CENTER>\n";
print "<form action=\"../comm/index.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<CENTER><A href=\"".$urlp."contact.php3\">Contacts</A></CENTER>\n";
print "<form action=\"".$urlp."contact.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print "</form>";
$menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée");
$menu->add_submenu("contact.php3","Contacts");
print "<form action=\"index.php3\">";
print "Soc : <input type=\"text\" name=\"socid\" size=\"5\">";
print "<input type=\"submit\" value=\"id\">";
print "</form>";
print "</td></tr>";
print "</table>";
print "</td>";
left_menu($menu->liste);
print "<TD valign=\"top\" width=\"85%\">\n";
}
/*
* $Id$
* $Source$
*/
?>

View File

@ -66,7 +66,7 @@ if ($action == 'update') {
if ($action == 'create') {
print '<div class="titre">Nouveau service</div><br>';
print_titre("Nouveau service");
print '<form action="'.$PHP_SELF.'" method="post">';
print '<input type="hidden" name="action" value="add">';
print '<table border="1" cellpadding="3" cellspacing="0">';

View File

@ -26,7 +26,7 @@ llxHeader();
$db = new Db();
if ($sortfield == "") {
$sortfield="lower(p.label),p.price";
$sortfield="lower(p.ref)";
}
if ($sortorder == "") {
$sortorder="ASC";
@ -35,10 +35,8 @@ if ($sortorder == "") {
if ($page == -1) { $page = 0 ; }
$limit = $conf->liste_limit;
$offset = $limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
print '<div class="titre">Liste des services</div><br>';
print_barre_liste("Liste des services", $page, $PHP_SELF);
/*
*
@ -46,21 +44,20 @@ print '<div class="titre">Liste des services</div><br>';
*
*/
$now = strftime ("%Y-%m-%d %H:%M", time());
$sql = "SELECT p.rowid, p.label, p.price, p.duration,p.ref FROM llx_service as p";
$sql .= " WHERE p.fin_comm >= '$now'";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TH>Réf</TH>";
print "<TH><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></th>";
print "<TH align=\"right\">Prix</th>";
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\"><td>";
print_liste_field_titre("Réf",$PHP_SELF, "p.ref");
print "</td><td>";
print_liste_field_titre("Libellé",$PHP_SELF, "p.label");
print "</td><td align=\"right\">Prix</td>";
print "</TR>\n";
$var=True;
while ($i < $num) {
@ -80,38 +77,6 @@ if ( $db->query($sql) ) {
}
$sql = "SELECT p.rowid, p.label, p.fin_comm, p.price, p.duration,p.ref FROM llx_service as p";
$sql .= " WHERE p.fin_comm < '$now'";
$sql .= " ORDER BY $sortfield $sortorder ";
$sql .= $db->plimit( $limit ,$offset);
if ( $db->query($sql) ) {
$num = $db->num_rows();
$i = 0;
print "<p><TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR bgcolor=\"orange\">";
print "<TD>Réf</TD>";
print "<TD><a href=\"$PHP_SELF?sortfield=lower(p.label)&sortorder=ASC\">Nom</a></td>";
print "<TD align=\"right\">Prix</TD>";
print "<TD align=\"right\">Fin</TD>";
print "</TR>\n";
$var=True;
while ($i < $num) {
$objp = $db->fetch_object( $i);
$var=!$var;
print "<TR $bc[$var]>";
print "<TD><a href=\"fiche.php3?id=$objp->rowid\">$objp->ref</a></TD>\n";
print "<TD>$objp->label</TD>\n";
print '<TD align="right">'.price($objp->price).'</TD>';
print "<TD align=\"right\">$objp->fin_comm</TD>\n";
print "</TR>\n";
$i++;
}
print "</TABLE>";
$db->free();
} else {
print $this->db->error() . ' in ' . $sql;
}

View File

@ -30,67 +30,22 @@ function llxHeader($head = "", $urlp = "") {
*/
top_menu($head);
$menu = new Menu();
print "<TR><TD valign=\"top\" align=\"right\">";
$menu->add("/product/index.php3", "Produits");
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
$menu->add("/service/index.php3", "Services");
$menu->add("/comm/index.php3", "Clients");
$menu->add("/fourn/index.php3", "Fournisseurs");
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societe</A></CENTER>\n";
print "<A href=\"".$urlp."contact.php3\">Contact</A><BR>\n";
print "</TD></TR>";
$menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée");
$menu->add_submenu("contact.php3","Contacts");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print "<center><A href=\"/product/\">Produits</center></A>\n";
print "</TD></TR>";
print '<TR><TD class="barre_select" valign="top" align="right">';
print '<div align="center"><A href="/service/">Services</A></div><br>';
print '<a href="fiche.php3?action=create">Nouveau service</a>';
print '</td></tr>';
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societes</A></CENTER>\n";
print "<form action=\"../comm/index.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<CENTER><A href=\"".$urlp."contact.php3\">Contacts</A></CENTER>\n";
print "<form action=\"".$urlp."contact.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<form action=\"index.php3\">";
print "Soc : <input type=\"text\" name=\"socid\" size=\"5\">";
print "<input type=\"submit\" value=\"id\">";
print "</form>";
print "</td></tr>";
print "</table>";
print "</td>";
print "<TD valign=\"top\" width=\"85%\">\n";
left_menu($menu->liste);
}
/*
* $Id$
* $Source$
*/
?>

View File

@ -37,6 +37,8 @@ class Societe {
var $client;
var $note;
Function Societe($DB, $id=0) {
global $config;
@ -84,7 +86,9 @@ class Societe {
*
*
*/
Function fetch() {
Function fetch($socid) {
$this->id = $socid;
$sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,";
@ -110,6 +114,7 @@ class Societe {
$this->ville = $obj->ville;
$this->siren = $obj->siren;
$this->note = $obj->note;
}
$this->db->free();

View File

@ -0,0 +1,81 @@
<?PHP
/* Copyright (C) 2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
*
* 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.
*
*/
class TodoComm {
var $id;
var $db;
var $date;
var $libelle;
var $user;
var $creator;
var $societe;
var $contact;
var $note;
Function TodoComm($DB) {
$this->db = $DB;
}
/*
*
*
*
*/
Function add($user) {
$sqldate = $this->db->idate($this->date);
$sql = "INSERT INTO llx_todocomm (datea, label, fk_soc, fk_user_author, fk_contact, note) ";
$sql .= " VALUES ('$sqldate', '$this->libelle', $this->societe, $user->id, $this->contact, '$this->note')";
if ($this->db->query($sql) ) {
}
}
/*
*
*
*
*/
Function fetch($db, $id) {
$sql = "SELECT label FROM llx_todocomm WHERE rowid=$id;";
if ($db->query($sql) ) {
if ($db->num_rows()) {
$obj = $db->fetch_object(0);
$this->id = $rowid;
$this->libelle = $obj->label;
$this->note = $obj->note;
$db->free();
}
} else {
print $db->error();
}
}
}
?>

View File

@ -30,59 +30,27 @@ function llxHeader($head = "", $urlp = "") {
*/
top_menu($head);
$menu = new Menu();
print "<TR><TD valign=\"top\" align=\"right\">";
$menu->add("/user/", "Utilisateurs");
print "<TABLE border=\"1\" cellspacing=\"0\" width=\"100%\" cellpadding=\"3\">";
$menu->add("/info.php3", "Configuration");
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societe</A></CENTER>\n";
print "<A href=\"".$urlp."contact.php3\">Contact</A><BR>\n";
print "</TD></TR>";
$menu->add("/product/index.php3", "Produits");
$menu->add("/service/index.php3", "Services");
$menu->add("/comm/index.php3", "Clients");
$menu->add("/fourn/index.php3", "Fournisseurs");
print '<TR><TD class="barre" valign="top" align="right">';
print "<div align=\"center\"><A href=\"".$urlp."actioncomm.php3\">Actions</A></div>\n";
print "</TD></TR>";
/*
*
*/
print '<TR><TD class="barre" valign="top" align="right">';
print "<center><A href=\"/product/\">Produits</center></A>\n";
print "</TD></TR>";
$menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée");
$menu->add_submenu("contact.php3","Contacts");
print '<TR><TD class="barre" valign="top" align="right">';
print "<CENTER><A href=\"".$urlp."../comm/index.php3\">Societes</A></CENTER>\n";
print "<form action=\"../comm/index.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="soc">';
print '<input type="text" name="socname" size="8">&nbsp;';
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<CENTER><A href=\"".$urlp."contact.php3\">Contacts</A></CENTER>\n";
print "<form action=\"".$urlp."contact.php3\">";
print '<input type="hidden" name="mode" value="search">';
print '<input type="hidden" name="mode-search" value="contact">';
print "<input type=\"text\" name=\"contactname\" size=\"8\">&nbsp;";
print "<input type=\"submit\" value=\"go\">";
print "</form>";
print "<form action=\"index.php3\">";
print "Soc : <input type=\"text\" name=\"socid\" size=\"5\">";
print "<input type=\"submit\" value=\"id\">";
print "</form>";
print "</td></tr>";
print "</table>";
print "</td>";
print "<TD valign=\"top\" width=\"85%\">\n";
left_menu($menu->liste);
}
?>

View File

@ -26,3 +26,5 @@ BASE=dolibarr
dev:
$(MYSQL) $(BASE) < data_dev.sql
$(MYSQL) $(BASE) < propal_dev.sql
$(MYSQL) $(BASE) < facture_dev.sql

View File

@ -27,6 +27,7 @@ insert into c_actioncomm (id,libelle) values ( 1, 'Appel T
insert into c_actioncomm (id,libelle) values ( 2, 'Envoi Fax');
insert into c_actioncomm (id,libelle) values ( 3, 'Envoi propal par mail');
insert into c_actioncomm (id,libelle) values ( 4, 'Envoi d\'un email');
insert into c_actioncomm (id,libelle) values ( 5, 'Rendez-vous');
insert into c_actioncomm (id,libelle) values ( 9, 'Envoi Facture');
insert into c_actioncomm (id,libelle) values (10, 'Relance effectuée');
insert into c_actioncomm (id,libelle) values (11, 'Clôture');

View File

@ -29,105 +29,101 @@ insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,a
values ('Quiedeville','Rodolphe','RQ','rodo','rodo',1,1,1,'rodo');
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,webcal_login)
values ('demo','demo','demo','demo','demo',1,1,'demo');
values ('demo','demo','DEMO','demo','demo',1,0,'demo');
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,webcal_login)
values ('demo1','demo','demo1','demo1','demo',1,1,'demo1');
values ('demo1','demo1','DM1','demo1','demo',1,0,'demo1');
insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,webcal_login)
values ('demo2','demo','demo2','demo2','demo',1,1,'demo2');
values ('demo2','demo2','DM2','demo2','demo',1,0,'demo2');
--
-- Societe
--
delete from societe;
insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm, fournisseur)
values ('Lolix',now(),'75001','Paris','01 40 15 03 18','01 40 15 06 18',1,'LO',1);
values ('Bolix SA',now(),'56350','Allaire','01 40 15 03 18','01 40 15 06 18',1,'LO',1);
insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm)
values ('Doli Inc.',now(),'56400','Auray','01 40 15 03 18','01 40 15 06 18',1,'DO');
values ('Cumulo',now(),'56610','Arradon','01 40 15 03 18','01 40 15 06 18',1,'CU');
insert into societe (nom,cp,ville,tel,fax,client)
values ('Easter-Eggs','75013','Paris','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client, prefix_comm)
values ('Doli INC.','29300','Arzano','01 55 55 03 18','01 55 55 55 55',1,'DO');
insert into societe (nom,cp,ville,tel,fax,client, prefix_comm,url)
values ('Foo SARL','22300','Ploubezre','01 55 55 03 18','01 55 55 55 55',1,'FOO','www.gnu.org');
insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm)
values ('Alphinfo',now(),'75001','Paris','01 40 15 03 18','01 40 15 06 18',1,'AP');
values ('Talphinfo',now(),'29400','Bodilis','01 40 15 03 18','01 40 15 06 18',1,'AP');
insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm)
values ('Alpha',now(),'75001','Loctudy','01 40 15 03 18','01 40 15 06 18',1,'AL');
values ('Valphanix',now(),'29820','Bohars','01 40 15 03 18','01 40 15 06 18',1,'AL');
insert into societe (nom,cp,ville,tel,fax,client,url)
values ('Turin','29890','Brignogan-Plage','01 55 55 03 18','01 55 55 55 55',1,'http://www.ot-brignogan-plage.fr/');
insert into societe (nom,cp,ville,tel,fax,client)
values ('Turin','75013','Montpellier','01 55 55 03 18','01 55 55 55 55',1);
values ('Yratin SA','29660','Carantec','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client)
values ('Bratin SA','75013','Strasbourg','01 55 55 03 18','01 55 55 55 55',1);
values ('Raggos SARL','29233','Cléder','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client)
values ('Eaggos SARL','75013','Auray','01 55 55 03 18','01 55 55 55 55',1);
values ('Pruitosa','29870','Coat-Méal','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client)
values ('Pruitosa','75013','Lorient','01 55 55 03 18','01 55 55 55 55',1);
values ('Stratus','29120','Combrit','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client)
values ('ZXP Tune','75013','Vannes','01 55 55 03 18','01 55 55 55 55',1);
values ('Nimbus','29490','Guipavas','01 55 55 03 18','01 55 55 55 55',1);
insert into societe (nom,cp,ville,tel,fax,client)
values ('Iono','22110','Rostrenen','01 55 55 03 18','01 55 55 55 55',1);
--
-- Contact
--
delete from socpeople;
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (1,'Durand','Paul','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (1,'Tourin','Pierre','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (1,'Patrick','Paul','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (1,'Myriam','Isabelle','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (10,1,'Victoire','Paul','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (11,1,'Tourin','Pierre','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (12,1,'Patrick','Paul','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (13,1,'Myriam','Isabelle','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (2,'Corin','Arnaud','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (3,'Phil','Breizh','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (fk_soc, name, firstname, phone,fax,email)
values (3,'Marie','Jeanne','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (20,2,'Corin','Arnaud','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (30,3,'Phil','Breizh','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (31,3,'Marie','Jeanne','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
insert into socpeople (idp,fk_soc, name, firstname, phone,fax,email)
values (41,4,'Alix','Victor','01 40 15 03 18','01 40 15 06 18','dev@lafrere.net');
--
--
-- Produits
--
--
delete from llx_product;
insert into llx_product (ref, label, description, price, duration)
values ('CC-2M','Compilo','Compilateur GCC',10,'1 mois');
insert into llx_product (ref, label, description, price, duration)
values ('CC-2M','Config Alpha','Configurations a base de proc alpha',1000,'1 mois');
--
-- Propale
--
delete from llx_propal;
insert into llx_propal values (1,1,1,0,'PR-LO-020403','2002-04-03 13:44:04','2002-04-03 15:45:29',NULL,'2002-04-03',2,2,NULL,1,1010,0,197.96,1207.96,'');
insert into llx_propal values (2,1,1,0,'PR-LO-020303','2002-03-03 13:44:04','2002-03-03 15:45:29',NULL,'2002-03-03',2,2,NULL,1,400,0,78.4,478.40,'');
values ('CRRJ452M','Câble Réseaux RJ45 2m','Câble Réseaux RJ45 2m',10,'1 mois');
insert into llx_propal values (3,1,1,0,'PR-LO-010303','2001-03-03 13:44:04','2001-03-03 15:45:29',NULL,'2001-03-03',2,2,NULL,3,400,0,78.4,478.40,'');
insert into llx_propal values (4,2,1,0,'PR-DO-010303','2001-03-03 13:44:04','2001-03-03 15:45:29',NULL,'2001-03-03',2,2,NULL,2,400,0,78.4,478.40,'');
insert into llx_propal values (5,1,1,0,'PR-LO-010301','2001-03-01 13:44:04','2001-03-01 15:45:29',NULL,'2001-03-01',2,2,NULL,2,400,0,78.4,478.40,'');
insert into llx_propal values (6,1,1,0,'PR-LO-020301','2002-03-01 13:44:04','2002-03-01 15:45:29',NULL,'2002-03-01',2,2,NULL,2,400,0,78.4,478.40,'');
insert into llx_propal values (7,1,1,0,'PR-LO-010307','2001-07-01 13:44:04','2001-07-01 15:45:29',NULL,'2001-07-01',2,2,NULL,2,4000,0,784,4784,'');
--
-- Factures
--
delete from llx_facture;
INSERT INTO llx_facture VALUES (1,'F-LO-020502',1,'2002-05-06 18:28:34','2002-05-02',1,400,0,78.4,478.4,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture VALUES (2,'F-LO-020310',1,'2002-05-06 18:29:37','2002-03-10',1,4000,0,784,4784,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture VALUES (3,'F-LO-020506',1,'2002-05-06 18:33:37','2002-05-06',0,400,0,78.4,478.4,0,'rodo',NULL,NULL,NULL,'');
--
-- Paiements
--
delete from llx_paiement;
INSERT INTO llx_paiement VALUES (1,1,'2002-05-06 18:28:54','2002-05-06 12:00:00',478.4,'rodo',0,'4322222','');
INSERT INTO llx_paiement VALUES (2,2,'2002-05-06 18:30:03','2002-04-06 12:00:00',2500,'rodo',0,'3245','');
INSERT INTO llx_paiement VALUES (3,2,'2002-05-06 18:32:59','2002-05-02 12:00:00',2284,'rodo',0,'87645','');
insert into llx_product (ref, label, description, price, duration)
values ('3COMSW8','Switch Cisco 8 ports 100Mbits','Switch Cisco 8 ports 100Mbits',1000,'1 mois');
insert into llx_product (ref, label, description, price, duration)
values ('ALPH','Station Alpha Serie 3w','Configuration Alpha',9750,'1 mois');
insert into llx_product (ref, label, description, price, duration)
values ('HUB8-10','Hub 8 ports 10Mbits','Hub 8 ports',750,'1 mois');
insert into llx_product (ref, label, description, price, duration)
values ('PB-16','Pan. Brass. 16','Panneau de brassage extensible, incluant 1 barre de 16 prises',650,'1 mois');
insert into llx_product (ref, label, description, price, duration)
values ('PB-32','Pan. Brass. 32','Panneau de brassage extensible, incluant 2 barres de 16 prises',1200,'1 mois');
--
--
@ -162,30 +158,69 @@ values ('2001-03-05',1,1,1,1);
--
--
insert into societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (20,'Bouleau','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'BTP');
insert into societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (101,'Cerisier','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'CER');
values (20,'Bouleau','22800','Le Foeil','01 55 55 03 18','01 55 55 55 55',1,'BTP');
insert into societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (100,'Chêne','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'DEL');
values (101,'Cerisier','22290','Goudelin','01 55 55 03 18','01 55 55 55 55',1,'CER');
insert into societe (idp,nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values (100,'Chêne','22330','Le Gouray','01 55 55 03 18','01 55 55 55 55',1,'DEL');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm,datec)
values ('Peuplier','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'JP',now());
values ('Peuplier','22300','Lanmérin','01 55 55 03 18','01 55 55 55 55',1,'JP',now());
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm,datec)
values ('Poirier','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'PO',now());
values ('Poirier','22290','Lannebert','01 55 55 03 18','01 55 55 55 55',1,'PO',now());
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Orme','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'ORM');
values ('Orme','22400','Noyal','01 55 55 03 18','01 55 55 55 55',1,'ORM');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Pin','27500','Pont-Audemer','01 55 55 03 18','01 55 55 55 55',1,'PIN');
values ('Pin','22200','Pabu','01 55 55 03 18','01 55 55 55 55',1,'PIN');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Merisier','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'IKE');
values ('Merisier','22510','Penguily','01 55 55 03 18','01 55 55 55 55',1,'IKE');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Hêtre','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'CAS');
values ('Hêtre','22480','Peumerit-Quintin','01 55 55 03 18','01 55 55 55 55',1,'CAS');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Saule','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'ME');
values ('Saule','22800','Quintin','01 55 55 03 18','01 55 55 55 55',1,'ME');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Poirier','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'CEG');
values ('Poirier','22940','Plaintel','01 55 55 03 18','01 55 55 55 55',1,'CEG');
insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm)
values ('Tek','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'LMT');
values ('Tek','22300','Rospez','01 55 55 03 18','01 55 55 55 55',1,'LMT');
--
--
--
--
delete from llx_service;
insert into llx_service values ( 1,now(),now(),'FDEVC1','Forfait Dev, CAT. 1','',500,NULL,now(),NULL,2,2);
insert into llx_service values ( 2,now(),now(),'FDEVC2','Forfait Dev, CAT. 2','',700,NULL,now(),NULL,2,2);
insert into llx_service values ( 3,now(),now(),'FDEVC3','Forfait Dev, CAT. 3','',900,NULL,now(),NULL,2,2);
insert into llx_service values ( 4,now(),now(),'FADMC1','Forfait Adm, CAT. 1','',600,NULL,now(),NULL,2,2);
insert into llx_service values ( 5,now(),now(),'FADMC2','Forfait Adm, CAT. 2','',800,NULL,now(),NULL,2,2);
insert into llx_service values ( 6,now(),now(),'FAUDC1','Forfait Aud, CAT. 2','',800,NULL,now(),NULL,2,2);
insert into llx_service values ( 7,now(),now(),'FAUDC2','Forfait Aud, CAT. 3','',1000,NULL,now(),NULL,2,2);
insert into llx_service values ( 8,now(),now(),'RDEVC1','Régie Dev, CAT. 1','',400,NULL,now(),NULL,2,2);
insert into llx_service values ( 9,now(),now(),'RDEVC2','Régie Dev, CAT. 2','',600,NULL,now(),NULL,2,2);
insert into llx_service values (10,now(),now(),'RDEVC3','Régie Dev, CAT. 3','',800,NULL,now(),NULL,2,2);
insert into llx_service values (11,now(),now(),'RADMC1','Régie Adm, CAT. 1','',500,NULL,now(),NULL,2,2);
insert into llx_service values (12,now(),now(),'RADMC2','Régie Adm, CAT. 2','',700,NULL,now(),NULL,2,2);
insert into llx_service values (13,now(),now(),'RAUDC1','Régie Aud, CAT. 2','',700,NULL,now(),NULL,2,2);
insert into llx_service values (14,now(),now(),'RAUDC2','Régie Aud, CAT. 3','',900,NULL,now(),NULL,2,2);
delete from llx_propal;
delete from llx_propaldet;
delete from llx_facture;
delete from llx_paiement;

View File

@ -0,0 +1,44 @@
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
---------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_paiement'
--
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (1,1,'2002-05-09 03:05:03','2002-05-09 12:00:00',11960,'rodo',0,'321654654','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (2,2,'2002-05-09 03:18:10','2002-04-12 12:00:00',500,'rodo',0,'255555','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (3,2,'2002-05-09 03:18:32','2002-05-02 12:00:00',588.36,'rodo',0,'25555','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (4,3,'2002-05-09 03:21:43','2002-03-30 12:00:00',11.96,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (5,4,'2002-05-09 03:23:47','2002-02-20 12:00:00',11960,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (6,5,'2002-05-09 03:37:05','2002-02-09 12:00:00',23.92,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (7,6,'2002-05-09 03:40:58','2002-05-09 12:00:00',35.88,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (8,8,'2002-05-09 14:44:56','2002-03-12 12:00:00',5000,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (9,7,'2002-05-09 14:49:51','2002-05-09 12:00:00',23920,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (10,8,'2002-05-09 15:00:35','2002-05-09 12:00:00',9483.56,'rodo',0,'','');
INSERT INTO llx_paiement (rowid, fk_facture, datec, datep, amount, author, fk_paiement, num_paiement, note) VALUES (11,9,'2002-05-09 15:02:36','2002-05-09 12:00:00',43355,'rodo',0,'','');
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
---------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_facture'
--
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (1,'F-BO-020509',1,'2002-05-09 03:04:48','2002-05-09',1,10000,0,1960,11960,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (2,'F-DO-020410',3,'2002-05-09 03:17:44','2002-04-10',1,910,100,178.36,1088.36,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (3,'F-BO-020314',1,'2002-05-09 03:21:25','2002-03-14',1,10,0,1.96,11.96,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (4,'F-CU-020215',2,'2002-05-09 03:23:31','2002-02-15',1,10000,0,1960,11960,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (5,'F-BO-020117',1,'2002-05-09 03:36:43','2002-01-17',1,20,0,3.92,23.92,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (6,'F-BO-020119',1,'2002-05-09 03:40:26','2002-05-09',1,30,0,5.88,35.88,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (7,'F-CU-020509',2,'2002-05-09 03:46:54','2002-05-09',1,20000,0,3920,23920,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (8,'F-FOO-020309',4,'2002-05-09 14:44:34','2002-03-09',1,12110,0,2373.56,14483.56,1,'rodo',NULL,NULL,NULL,'');
INSERT INTO llx_facture (rowid, facnumber, fk_soc, datec, datef, paye, amount, remise, tva, total, fk_statut, author, fk_user, fk_user_author, fk_user_valid, note) VALUES (9,'F-CU-020509.1',2,'2002-05-09 15:02:08','2002-05-09',1,36250,0,7105,43355,1,'rodo',NULL,NULL,NULL,'');

58
mysql/data/propal_dev.sql Normal file
View File

@ -0,0 +1,58 @@
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
---------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_propal'
--
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (1,1,10,0,'PR-BO-020509','2002-05-09 03:04:29','2002-05-09 03:04:37','2002-05-09 03:04:42','2002-05-09',1,1,1,2,10000,0,1960,11960,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (2,1,11,0,'PR-BO-020111','2002-05-09 03:08:33','2002-05-09 03:36:25','2002-05-09 03:36:29','2002-01-11',1,1,1,2,20,0,3.92,23.92,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (3,1,11,0,'PR-BO-020113','2002-05-09 03:08:50','2002-05-09 03:40:09','2002-05-09 03:40:13','2002-01-13',1,1,1,2,30,0,5.88,35.88,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (4,1,11,0,'PR-BO-020313','2002-05-09 03:09:13','2002-05-09 03:21:06','2002-05-09 03:21:10','2002-03-13',1,1,1,2,10,0,1.96,11.96,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (5,1,11,0,'PR-BO-020313.1','2002-05-09 03:09:28','2002-05-09 03:42:09','2002-05-09 03:42:15','2002-03-13',1,1,1,3,20,0,3.92,23.92,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (6,3,30,0,'PR-DO-020404','2002-05-09 03:16:26','2002-05-09 03:17:04','2002-05-09 03:17:13','2002-04-04',1,1,1,3,1010,0,197.96,1207.96,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (7,3,30,0,'PR-DO-020405','2002-05-09 03:16:51','2002-05-09 03:17:24','2002-05-09 03:17:28','2002-04-05',1,1,1,2,1010,100,178.36,1088.36,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (8,2,20,0,'PR-CU-020202','2002-05-09 03:22:49','2002-05-09 03:23:00','2002-05-09 03:23:05','2002-02-02',1,1,1,2,10000,0,1960,11960,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (9,2,20,0,'PR-CU-020409','2002-05-09 03:46:39','2002-05-09 03:46:45','2002-05-09 03:46:50','2002-04-09',1,1,1,2,20000,0,3920,23920,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (10,4,41,0,'PR-FOO-020509','2002-05-09 14:43:47','2002-05-09 15:07:19','2002-05-09 15:07:23','2002-05-09',1,1,1,2,12110,0,2373.56,14483.56,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (11,4,41,0,'PR-FOO-020304','2002-05-09 14:44:08','2002-05-09 14:44:18','2002-05-09 14:44:22','2002-03-04',1,1,1,2,12110,0,2373.56,14483.56,'----------\r\n');
INSERT INTO llx_propal (rowid, fk_soc, fk_soc_contact, fk_projet, ref, datec, date_valid, date_cloture, datep, fk_user_author, fk_user_valid, fk_user_cloture, fk_statut, price, remise, tva, total, note) VALUES (12,2,20,0,'PR-CU-020509','2002-05-09 15:01:37','2002-05-09 15:01:45','2002-05-09 15:01:49','2002-05-09',1,1,1,2,36250,0,7105,43355,'----------\r\n');
-- MySQL dump 8.21
--
-- Host: localhost Database: dolibarr
---------------------------------------------------------
-- Server version 3.23.49-log
--
-- Dumping data for table 'llx_propaldet'
--
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (1,1,2,10,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (2,2,1,2,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (3,3,1,3,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (4,4,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (5,5,1,2,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (6,6,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (7,6,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (8,7,1,1,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (9,7,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (10,8,2,10,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (11,9,2,20,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (12,10,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (13,10,3,1,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (14,10,1,16,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (15,10,6,1,1200);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (16,11,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (17,11,3,1,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (18,11,1,16,10);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (19,11,6,1,1200);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (20,12,3,3,9750);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (21,12,2,1,1000);
INSERT INTO llx_propaldet (rowid, fk_propal, fk_product, qty, price) VALUES (22,12,6,5,1200);

View File

@ -54,6 +54,7 @@ create:
$(MYSQL) $(BASE) < societe.sql
$(MYSQL) $(BASE) < socpeople.sql
$(MYSQL) $(BASE) < socstatutlog.sql
$(MYSQL) $(BASE) < llx_todocomm.sql
drop:
$(MYSQL) $(BASE) < drop.sql

View File

@ -101,6 +101,8 @@ drop table if exists llx_service;
drop table if exists llx_soc_recontact;
drop table if exists llx_todocomm;
drop table if exists llx_user;
drop table if exists llx_ventes;
@ -127,30 +129,3 @@ drop table if exists soc_recontact;
drop table if exists socpeople;
drop table if exists soc_ssii;
drop table if exists soc_rescontact_byweek;
drop table if exists soc_resviewed_byweek;
drop table if exists socmessage ;
drop table if exists somenews;
drop table if exists stat_base ;
drop table if exists stat_abo ;
drop table if exists stat_cat;
drop table if exists stat_subs;
drop table if exists statcv ;
drop table if exists statcv_day;
drop table if exists statof ;
drop table if exists statof_day;

View File

@ -25,5 +25,6 @@ create table llx_propaldet
rowid integer AUTO_INCREMENT PRIMARY KEY,
fk_propal integer,
fk_product integer,
qty smallint,
price real
);

View File

@ -0,0 +1,37 @@
-- ========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
--
-- $Id$
-- $Source$
--
--
-- 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.
--
-- Actions commerciales a effectuer
--
-- ========================================================================
create table llx_todocomm
(
id integer AUTO_INCREMENT PRIMARY KEY,
datea datetime, -- date de l'action
label varchar(50), -- libelle de l'action
fk_user_action integer, -- id de la personne qui doit effectuer l'action
fk_user_author integer, -- id auteur de l'action
fk_soc integer, -- id de la societe auquel est rattachee l'action
fk_contact integer, -- id du contact sur laquelle l'action
-- doit etre effectuee
note text
);