diff --git a/htdocs/comm/actioncomm.class.php3 b/htdocs/comm/actioncomm.class.php3 index e179ca00579..5c2fcf349ba 100644 --- a/htdocs/comm/actioncomm.class.php3 +++ b/htdocs/comm/actioncomm.class.php3 @@ -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(); } } } diff --git a/htdocs/comm/actioncomm.php3 b/htdocs/comm/actioncomm.php3 index 4510f3142d8..c328d361e25 100644 --- a/htdocs/comm/actioncomm.php3 +++ b/htdocs/comm/actioncomm.php3 @@ -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 '
'; + print ''; - print ''; - print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; - print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; - print ''; + print ''; + + print ''; + + print '
Rendez-vous
Société'; + print ''.$societe->nom.'
Contact'.$contact->fullname.'
Date'; + print_date_select(); + print '
Heure'; + print_heure_select("heure",8,20); + print '
Durée'; + print_duree_select("duree"); + print '
Action effectuée
Commentaire'; + print '
'; - print 'Action'.$caction->libelle.''; - print 'Société'.$societe->nom.''; - print 'Contact'.$contact->fullname.''; - print 'Date'.strftime('%d %B %Y %H:%M',time()).''; - print 'Commentaire'; - print ''; + } + /* + *Autre action + * + * + */ + else + { - print '
Prochaine Action à faire
'; + print '
'; + print ''; - print 'Date'; - print_date_select(); - print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; + + print ''; + + print ''; + print ''; + print ''; + print ''; + print ''; + + print ''; - print ''; - - - print ''; - - print '
Action effectuée
Action'.$caction->libelle.'
Société'; + print ''.$societe->nom.'
Contact'.$contact->fullname.'
Date'.strftime('%d %B %Y %H:%M',time()).'
Commentaire'; + print '
Prochaine Action à faire
Commentaire'; - print '
'; - $limit = 10; - print '

Vos 10 dernières actions'; + print 'Date'; + print_date_select(); + print ''; + print 'Action'; + print 'Commentaire'; + print ''; + + print ''; + + print ''; + + } } /* * @@ -114,14 +197,17 @@ if ($action=='create' && $actionid && $contactid) { * */ if ($id) { + $act = new ActionComm($db); + $act->fetch($id); + print ''; - print ''; + print ''; print ''; print ''; print ''; print ''; print ''; + print nl2br($act->note).''; print '
Action'.$libelle.'
Action'.$act->type.'
Société'.$nom.'Contact'.$fullname.'
Auteur'.$fullname.'Date'.strftime('%d %B %Y %H:%M',time()).'
Commentaire'; - print '
'; $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 "

"; - print ""; + print "
"; + print ''; print ''; - print ''; - print ""; + print ""; print "\n"; $var=True; while ($i < $num) { $obj = $db->fetch_object( $i); - if ($i == 0) { - print ""; - print ''; - print "\n"; - print ""; - print "\n"; - } + $var=!$var; - if (!$var) { - $bc=$bc1; - } else { - $bc=$bc2; - } - print ""; - print "\n"; - - print "\n"; - print ''; - print "\n"; - - print ""; - print "\n"; + print ""; + print "\n"; print ''; print "\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 "
DateSocieteNoteAction
Auteursocidp\">$obj->societe 
" .strftime("%Y %b %d %H:%M",$obj->da)."socidp\">$obj->societe'.nl2br($obj->note).' 
$obj->firstname $obj->name
" .strftime("%Y %b %d %H:%M",$obj->da)."'.$obj->libelle.'
"; $db->free(); + } else { + print $db->error() . '
' . $sql; } } else { - print '

Liste des actions commerciales effectuées
'; + 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 "

"; - print ""; + print ''; print ''; print ''; print ''; @@ -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 ""; + print ""; if ($oldyear == strftime("%Y",$obj->da) ) { print ''; @@ -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 "\n"; print "\n"; - print "\n"; + + print ''; print ''; print "\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 "
DateSociétéAction
|" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)."socidp\">$obj->societe'; + + print ' '.$obj->societe.''.$obj->libelle.'$obj->code
"; $db->free(); + } else { + print $db->error() . ' ' . $sql ; } - - } $db->close(); diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index 8dcf71e7c2e..a5e879acd46 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -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 $objsoc->nom"); 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 "


Génération du PDF

"; + // print "


Génération du PDF

"; //$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 "

command : $command
"; - print $output; + //print "

command : $command
"; + //print $output; + + + // Header("Location: propal.php3?propalid=$id"); + } else { print $db->error(); } } + +llxHeader(); + +print_titre("Nouvelle proposition commerciale pour $objsoc->nom"); + + /* * * Creation d'une nouvelle propale @@ -111,7 +112,9 @@ if ($action == 'create') { } print "

"; - print '\n
'; + print ""; + + print '"; - print ""; - print ''; print "\n"; /* @@ -245,12 +246,20 @@ if ($action == 'create') { print "
'; $strmonth[1] = "Janvier"; $strmonth[2] = "Février"; @@ -158,8 +161,6 @@ if ($action == 'create') { } print "
Auteur'.$user->fullname.'
Num
"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print ""; + print "\n"; + + print ""; + print "\n"; + + print ""; + print "\n"; + + print ""; + print "\n"; + + print "\n"; print "
Service/Produits
Remise :
Service/Produits
Remise :
"; /* * 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 "

"; - print ""; - print ""; + print ""; + print ""; print ""; print ""; print ""; @@ -303,22 +309,25 @@ if ( $db->query($sql) ) { print "\n"; print "\n"; print "\n"; - + print "\n"; print "\n"; print "\n"; - + $total = $total + $objp->price; - + $i++; } - print ""; + print ""; print "
Societe
SociétéNumStatutDateidp\">$objp->nompropalid\">$objp->ref$objp->lst".strftime("%d %B %Y",$objp->dp)."".price($objp->price)." 
Total : ".francs($total)." FFTotal : ".price($total)."euros
Total : ".price($total)."euros
"; $db->free(); } else { print $db->error(); print "

$sql"; } +/* + * + */ $db->close(); llxFooter("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 index c3e73093efb..17e064918b6 100644 --- a/htdocs/comm/contact.php3 +++ b/htdocs/comm/contact.php3 @@ -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 "

"; -print "<- Prev\n| "; -print "*\n| "; +print "| *\n| "; for ($i = 65 ; $i < 91; $i++) { print ""; @@ -50,8 +49,7 @@ for ($i = 65 ; $i < 91; $i++) { } print " | "; } -print " Next ->\n"; -print "

"; +print ""; /* @@ -61,10 +59,9 @@ print "

"; * */ -$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 "

"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ''; + print ""; + print ""; + print ""; + print ''; print "\n"; $var=True; while ($i < $num) { @@ -113,16 +110,14 @@ if ($result) { print ""; - print ""; print ""; + + print '\n"; print "\n"; - print ''; - print "\n"; - print ''; + print ''; + print "\n"; print "\n"; $i++; diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index 672f83698b8..5dbcbee8db9 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -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 "
ActionNomPrénomemailSocieteStatut 
NomPrénom"; + print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin); + print "emailTéléphone 
idp\">T | "; - print "idp\">E | "; - print "idp\">F ]"; - print "$obj->name$obj->firstname '; + print "idp\">$obj->nom$obj->email idp\">$obj->nom'.$obj->stcomm.''.$obj->phone.' idp&setcontact=$obj->cidp&action=create\">[Propal]
\n"; print ""; - print ""; - print ""; - print ""; + print ""; + print ""; + print ""; print ""; - print ""; + print ""; print "
Fiche client : $objsoc->nom
idp&action=add\">[Bookmark]idp&action=create\">[Projet]idp&action=create\">[Propal]idp&action=add\">[Bookmark]idp&action=create\">[Projet]idp&action=create\">[Propal]idp\">Notes[idp&action=edit\">Editer][idp&action=edit\">Editer]
"; /* * * */ - print "


"; + print "\n"; print ""; + $menu->add("projet/", "Projets"); + left_menu($menu->liste); - print "\n'; - print ''; + print ''; print ''; print ''; @@ -101,9 +98,73 @@ function top_menu($head) { * Table principale * */ - print '
"; print ""; @@ -177,58 +218,11 @@ if ($socid > 0) { */ print "\n"; print ''; - /* - * - */ - print "'; + /* + * + */ + print ""; } - print "'; + if ($obj->note) { print "
".nl2br($obj->note); } @@ -439,16 +444,13 @@ if ($socid > 0) { if ( $db->query($sql) ) { print "
'; - print ''; - print ""; - - print ''; - print ''; - /* - * - */ - print '
Créée le" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "

Statut commercial
'; - /* - * - * Liste des statuts commerciaux - * - */ - $limliste = 5 ; - print "\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 ""; - } else { - print ""; - } - print ""; - print ""; - print ""; - print "\n"; - $i++; - $tag = !$tag; - } - $db->free(); - if ($num > $limliste) { - print ""; - } - } else { - print $db->error(); - } - print "
". strftime("%d %b %Y %H:%M", $obj->da) ."$obj->libelle$obj->author
suite ...
"; - print '
'; - print '
"; /* + * * Propales + * */ $var=!$var; print ""; @@ -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 ""; - print ""; + print ""; + print ""; } while ($i < $num && $i < 2) { $objp = $db->fetch_object( $i); $var=!$var; - print ""; + print ""; print "\n"; if ($objp->df > 0 ) { print "\n"; @@ -292,6 +287,15 @@ if ($socid > 0) { } print "
idp\">liste des factures ($num)
idp\">liste des factures ($num)
facid\">$objp->facnumber".strftime("%d %B %Y",$objp->df)."
"; + + + print '
"; + + print ""; /* * @@ -402,7 +406,8 @@ if ($socid > 0) { } else { print "
$obj->firstname $obj->name"; + print ''.$obj->firstname.' '. $obj->name.' 
\n"; - print ''; - $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 ""; - } else { - print ""; - } + print ""; if ($oldyear == strftime("%Y",$obj->da) ) { print ''; @@ -467,6 +469,8 @@ if ($socid > 0) { print "\n"; print "\n"; + print ''; + if ($obj->propalrowid) { print ''; } else { @@ -488,7 +492,6 @@ if ($socid > 0) { print ''; print "\n"; $i++; - $tag = !$tag; } print "
Actions
|" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)." '.$obj->libelle.''.$obj->code.'
"; @@ -510,95 +513,7 @@ if ($socid > 0) { * * */ - print "
"; - print "idp\" method=\"post\">"; - print ""; - $strmonth[1] = "Janvier"; - $strmonth[2] = "Février"; - $strmonth[3] = "Mars"; - $strmonth[4] = "Avril"; - $strmonth[5] = "Mai"; - $strmonth[6] = "Juin"; - $strmonth[7] = "Juillet"; - $strmonth[8] = "Août"; - $strmonth[9] = "Septembre"; - $strmonth[10] = "Octobre"; - $strmonth[11] = "Novembre"; - $strmonth[12] = "Décembre"; - - $smonth = 1; - $syear = date("Y", time()); - print "A recontacter : "; - print ""; - $cmonth = date("n", time()); - print ""; - - print ""; - print ""; - print "\n"; - - /* - * - */ - - print "
idp\" method=\"post\">"; - print ""; - print "fk_stcomm\">"; - - $sql = "SELECT st.id, st.libelle FROM c_stcomm as st ORDER BY id"; - $result = $db->query($sql); - print "\n"; - $sql = "SELECT st.id, st.libelle FROM c_actioncomm as st ORDER BY id"; - $result = $db->query($sql); - print "\n"; - - print ""; - print ""; - print "
\n"; @@ -645,13 +560,8 @@ if ($socid > 0) { } print ""; print ''; - print ""; print ""; print ""; @@ -680,7 +590,7 @@ if ($socid > 0) { print "
Société"; - - print ''; - print ''; - print ''; - print ''; - + print ""; + print_liste_field_titre("Société",$PHP_SELF,"s.nom"); print "VilleemailStatut  
"; $db->free(); } else { - print $db->error(); + print $db->error() . ' ' . $sql; } } $db->close(); diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index dfe7c20bd4d..ed490ff133e 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -30,80 +30,29 @@ function llxHeader($head = "", $urlp = "") { */ top_menu($head); - print "
"; + $menu = new Menu(); - print ""; + $menu->add("/comm/index.php3", "Clients"); - print '"; + $menu->add_submenu("../soc.php3?&action=create", "Nouvelle société"); + $menu->add_submenu("contact.php3", "Contacts"); + $menu->add("actioncomm.php3", "Actions"); - print '"; - /* - * - */ - print '"; - /* - * - */ - print '"; - /* - * - */ - print '"; - /* - * - */ - print '"; - /* - * - */ - print '"; + $menu->add("/product/", "Produits"); - print "
'; - print "\n"; - print "Nouvelle société
\n"; - print "Contacts

\n"; - print "A Recontacter
\n"; - print "
'; - print "\n"; - print "
'; - print ''; - print 'Brouillon
'; - print 'Ouvertes'; - print "
'; - print ''; - print "
'; - print ''; - print ''; - print "
'; - print ''; - print "
'; - print "
Societes
\n"; - print "
"; - print ''; - print ''; - print ' '; - print ""; - print "
"; + $menu->add("/comm/propal.php3", "Propales"); - print "
Contacts
\n"; - print "
"; - print ''; - print ''; - print " "; - print ""; - print "
"; + $menu->add_submenu("propal.php3?viewstatut=0", "Brouillons"); + $menu->add_submenu("propal.php3?viewstatut=1", "Ouvertes"); - print "
"; + $menu->add("/service/", "Services"); - print "
\n"; } -/* - * $Id$ - * $Source$ - */ + ?> diff --git a/htdocs/comm/propal-tex.pl b/htdocs/comm/propal-tex.pl index 3f8946f1e79..1c185a2aed4 100755 --- a/htdocs/comm/propal-tex.pl +++ b/htdocs/comm/propal-tex.pl @@ -217,27 +217,27 @@ $dbh->disconnect if $dbh; # # # -print "Generate dvi file
\n"; -system("cd $outputdir/ ; latex $numpropale.tex "); +#print "Generate dvi file
\n"; +system("cd $outputdir/ ; latex $numpropale.tex > /dev/null"); # # # if ($do_pdf) { - print "

Generate pdf file
\n"; + #print "

Generate pdf file
\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 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 . '
' . $this->db->error() .'
'; } } + /* + * + */ + $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) ) { + + } + } + } + + } + /* * * diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 81ce8934c43..040c7abf0d9 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -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 "

Produits"; print ""; print ""; - print ""; + print ""; print "\n"; $var=True; @@ -204,7 +204,7 @@ if ($propalid) { print ""; print "\n"; print "\n"; - print "\n"; + print "\n"; print ""; $total = $total + $objp->price; $i++; @@ -536,7 +536,7 @@ if ($propalid) { print ''; print ""; - print ""; + print ""; print ""; print ""; print "\n"; + print "\n"; + } + $subtotal = 0; - if ($i > 0) { - print "\n"; - print "\n"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $var=True; } - $subtotal = 0; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; + + $var=!$var; + print ""; + + print "\n"; + + print "\n"; + + print "\n"; + + print "\n"; + print "\n"; print "\n"; - $var=True; - } - - $var=!$var; - print ""; - - print "\n"; - - print "\n"; - - print "\n"; - - print "\n"; - print "\n"; - print "\n"; - - $total = $total + $objp->price; - $subtotal = $subtotal + $objp->price; - - $i++; + + $total = $total + $objp->price; + $subtotal = $subtotal + $objp->price; + + $i++; } print "\n"; print "\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 "

RéfProduitPrix PrixQté.
[$objp->ref]$objp->product".price($objp->price)."euros".price($objp->price)."".$objp->qty."
RéfSocieteSociétéDatePrixStatut statutid\">"; diff --git a/htdocs/comm/socnote.php3 b/htdocs/comm/socnote.php3 index 8652fc49d16..350062076b6 100644 --- a/htdocs/comm/socnote.php3 +++ b/htdocs/comm/socnote.php3 @@ -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 '
'.$soc->nom.'
'; + + + print ''; + print ""; + print ""; + print ""; + print "
"; + print "
id\">"; + print ""; + print "
"; + print ""; + print "
Notes actuelles
".nl2br($soc->note)."
"; - $result = $db->query($sql); - - if ($result) { - $objsoc = $db->fetch_object($result , 0); - - - - print "\n"; - - print "" ; - - print ""; - - print "\n"; - print "\n"; - print "
N° $objsoc->idp - $soc->nom - [$soc->stcomm]
"; - print "tel : $soc->tel
"; - print "fax : $soc->fax
"; - print "$soc->cp $soc->ville
"; - if ($objsoc->url) { - print "url\">$soc->url
"; - } - print "
Contact :
$soc->c_nom $soc->c_prenom"; - print "
tel : $soc->c_tel"; - print "
email : $soc->c_mail"; - - - print "
"; - print ""; - print ""; - print "" ; - print "" ; - print ""; - print ""; - - print "\n"; - print ""; - - print "
Créée le" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "
Dernière modif le" . strftime("%d %b %Y %H:%M", $objsoc->dm) . "
Fiche société".$yn[$objsoc->fplus]."
Cojonet".$yn["$objsoc->cjn"]."
Consult Fiche$objsoc->viewed
Offres"; - - print "
"; - $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 ""; - $i++; - } - print "
".$active["$obj->active"] . ":$obj->cc
Divers
"; - print ""; - $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 ""; - $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 ""; - $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 ""; - $i++; - } - - print "
Abonnements :$obj->cc
Cand. suivis :$obj->cc
Contacts :$obj->cc
"; - - print "
"; - /* - * - * - */ - print ""; - /* - * - * - */ - print "
"; - print ""; - - $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 ""; - } else { - print ""; - } - print ""; - print ""; - print ""; - print "\n"; - $i++; - $tag = !$tag; - } - print "
". strftime("%d %b %Y %H:%M", $obj->da) ."$obj->libelle$obj->author
"; - - print "
"; - - print ""; - - $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 ""; - } else { - print ""; - } - print ""; - print ""; - print ""; - print "\n"; - $i++; - $tag = !$tag; - } - print "
". strftime("%d %b %Y %H:%M", $obj->da) ."$obj->libelle$obj->author
"; - - - print "
"; - - - print ""; - print ""; - print ""; - print "
"; - print "
"; - print ""; - print "
"; - print ""; - print "
".nl2br($objsoc->note)."
"; - - } else { - print $db->error(); - } } -$db->free(); + $db->close(); llxFooter(); diff --git a/htdocs/compta/casoc.php3 b/htdocs/compta/casoc.php3 index aeb35653289..cfef43e9d3b 100644 --- a/htdocs/compta/casoc.php3 +++ b/htdocs/compta/casoc.php3 @@ -22,13 +22,9 @@ require("./pre.inc.php3"); llxHeader(); -print '
Chiffre d\'affaire par société
'; - -$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 "

"; - print ""; - print ""; - print ""; + print ""; + print ""; print ""; print ""; print "\n"; @@ -79,7 +74,7 @@ function liste($db, $paye) { $objp = $db->fetch_object( $i); $var=!$var; print ""; - print "\n"; + print "\n"; print "\n"; @@ -89,8 +84,8 @@ function liste($db, $paye) { print "\n"; $i++; } - print ""; - print ""; + print ""; + print ""; print ""; print "
[Tous]Societe
SociétéMontant Moyenne
[idp\">Filtre]idp\">$objp->nom".price($objp->ca)." 
Total : ".francs($total)." FFTotal : ".price($total)."euros HT
Total : ".price($total)."euros HTMoyenne : ".price($total/ $i)."
"; } @@ -100,6 +95,8 @@ function liste($db, $paye) { } } +print_barre_liste("Chiffre d'affaire par société", $page, $PHP_SELF); + print "

"; liste($db, 0); print "

"; diff --git a/htdocs/compta/comp.php3 b/htdocs/compta/comp.php3 index 5dccf06a569..4bd05d8dcf8 100644 --- a/htdocs/compta/comp.php3 +++ b/htdocs/compta/comp.php3 @@ -1,5 +1,6 @@ + * * $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 "

Total : ".price($subtotal)."Euros HT
Total : ".price($subtotal)."Euros HT
SocieteRéfDatePrixStatut
SocieteRéfDatePrixStatut
idp\">$objp->nompropalid\">$objp->ref".strftime("%d %B %Y",$objp->dp)."".price($objp->price)."$objp->statut
idp\">$objp->nompropalid\">$objp->ref".strftime("%d %B %Y",$objp->dp)."".price($objp->price)."$objp->statut
Total : ".price($subtotal)."Euros HT
"; - print ""; + print ""; print ""; print "\n"; $var=True; @@ -261,7 +256,7 @@ function pt ($db, $sql, $year) { } function ppt ($db, $year, $socidp) { - + global $bc; print "
MoisMontant
"; print ""; print ""; print ""; - print ""; - print ""; print "\n"; $var=True; @@ -192,12 +194,12 @@ if ($action == '') { print "\n"; print "\n"; print ''; - print "\n"; + print ""; $total = $total + $objp->amount; $i++; } - print "\n"; + print "\n"; print "
"; @@ -272,7 +267,7 @@ function ppt ($db, $year, $socidp) { print "
"; - $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 ""; print "

"; - print ""; + print ""; print ""; print ""; print "\n"; - $bc[0]="bgcolor=\"#90c090\""; - $bc[1]="bgcolor=\"#b0e0b0\""; + $var = 1 ; for ($b = 1 ; $b <= 12 ; $b++) { $var=!$var; diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index d8aa79fed50..4f499b03d16 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -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 ""; print ""; print ""; - print ""; + print ""; print "
MoisMontant
Montant".price($obj->amount)."euros HT
TVA".tva($obj->amount)."euros
Total".price($obj->total)."euros TTC
soit".francs(inctva($obj->amount))."francs
"; @@ -115,7 +113,7 @@ if ($facid > 0) { $i = 0; $total = 0; print "

Paiements"; echo ''; - print ""; + print ""; print ""; print ""; print ""; @@ -163,7 +161,7 @@ if ($facid > 0) { } else { print ""; } - if ($obj->statut == 1 && $resteapayer == 0 && $obj->paye == 0) { + if ($obj->statut == 1 && abs($resteapayer == 0) && $obj->paye == 0) { print ""; } else { print ""; @@ -225,7 +223,7 @@ if ($facid > 0) { $i = 0; $total = 0; print "

Proposition(s) commerciale(s) associée(s)"; print '

DateTypeMontant -[Classer 'Payée']-
'; - print ""; + print ""; print ""; print ""; print ""; diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 84eaef4b3ff..2122460ca0b 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -68,11 +68,11 @@ if ($result) { $i = 0; print "
NumDatePrix
"; - print ''; + print ''; print ""; - print ""; - print ""; - print ""; + print ""; print ""; print "\n"; @@ -89,9 +89,9 @@ if ($result) { print ''; print ""; - print ""; - print ""; - print ""; + print ""; print "\n"; $sep = 1 ; $j = 0; $subtotal = 0; diff --git a/htdocs/compta/paiement.php3 b/htdocs/compta/paiement.php3 index 17a340fbf1d..04ea8278aaa 100644 --- a/htdocs/compta/paiement.php3 +++ b/htdocs/compta/paiement.php3 @@ -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

"; + + $total = $obj->total; + + print_titre("Emettre un paiement"); print "
"; - print "

[Tous]NuméroSocieteDateMontantNuméro"; + print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print "DateMontantPayé
[Tous]NuméroSocieteDateMontantNuméro"; + print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print "DateMontantPayé
"; + print '
'; print ""; - print ""; print ""; + print ""; + print ""; + + print ""; + $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 ''; + + print ""; print ""; print "facnumber\">"; @@ -127,12 +135,9 @@ if ($action == 'add') { print ""; - $author = $GLOBALS["REMOTE_USER"]; print "\n"; - print "\n"; - print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; print "
Facture
Société :$obj->nom
Numéro :$obj->facnumber
Société :$obj->nom
Montant :".price($obj->total)." euros TTC
Paiement
Déjà payé'.price($sumpayed).' euros TTC
Commentaires :
"; print "
Auteur :$author
Type :
"; print "
Numéro :
Num du cheque ou virement
Montant :price\">
Montant :Reste à payer : ".price($total - $sumpayed)." euros TTC
\n"; @@ -179,8 +183,6 @@ if ($action == '') { print "

TypeMontant FF TTC 
".strftime("%d %B %Y",$objp->dp)."$objp->paiement_type $objp->num_paiement'.price($objp->amount).' ".francs(inctva($objp->amount))." 
Total : $totalEuros HT
Total : ".price($total)."Euros HT
"; } diff --git a/htdocs/compta/pmt.php3 b/htdocs/compta/pmt.php3 index ff6ea96208f..66ee5f21b2d 100644 --- a/htdocs/compta/pmt.php3 +++ b/htdocs/compta/pmt.php3 @@ -21,10 +21,6 @@ */ require("./pre.inc.php3"); -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; - -$a = setlocale("LC_TIME", "FRENCH"); /* * diff --git a/htdocs/compta/pointmort.php3 b/htdocs/compta/pointmort.php3 index f155de7ded0..54c72eb5321 100644 --- a/htdocs/compta/pointmort.php3 +++ b/htdocs/compta/pointmort.php3 @@ -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) { diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index b2b9f7a3b6f..dd908ac4762 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -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 "

"; + $menu->add("/compta/index.php3","Factures"); + $menu->add_submenu("paiement.php3","Paiements"); + $menu->add_submenu("fac.php3","admin fac"); - print ""; + $menu->add("ca.php3","Chiffres d'affaires"); - print '"; + $menu->add_submenu("prev.php3","Prévisionnel"); + $menu->add_submenu("comp.php3","Comparatif"); - print ""; + $menu->add_submenu("casoc.php3","Par société"); + $menu->add_submenu("pointmort.php3","Point mort"); + $menu->add_submenu("tva.php3","TVA"); - print ""; + $menu->add("/comm/propal.php3","Propal"); - print ""; - - print ""; + $menu->add("bank/index.php3","Bank"); - print ""; - - print "
'; - print '

'; - print "Paiements
\n"; - print "admin fac
\n"; - print "

"; - print "
Chiffres d'affaires

\n"; - print "Réalisé
\n"; - print "Prévisionnel
\n"; - print "Comparatif\n"; - print "
"; - print "
Analyses

\n"; - print "CA par societe
\n"; - print "Point mort
\n"; - print "TVA
\n"; - print "
"; - print "Propal
\n"; - print "
"; - print "Bank
\n"; - print "
"; - print "Societes\n"; - print "
"; - print ""; - print ""; - print "
"; + left_menu($menu->liste); - print "
"; - print ""; - print ""; - print "
"; - print "
"; - - - print "
\n"; } -/* - * - */ -// $Id$ -// $Source$ ?> diff --git a/htdocs/compta/prev.php3 b/htdocs/compta/prev.php3 index 0dce40f8dfd..00a243dc5d5 100644 --- a/htdocs/compta/prev.php3 +++ b/htdocs/compta/prev.php3 @@ -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 '

'; - print ""; + print ""; print ""; print ""; @@ -79,15 +77,14 @@ if ($sortorder == "") { } $in = "(1,2)"; -//$in = "(3)"; -print "

CA Prévisionnel basé sur les propal ouvertes et signées"; +print_titre ("CA Prévisionnel basé sur les propal ouvertes et signées"); print '

$titleMontant
'; print '"; - /* - * - */ - print "
'; -$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 ''; -$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 "

"; -$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"; diff --git a/htdocs/compta/tva.php3 b/htdocs/compta/tva.php3 index e549696df15..accc128a2d9 100644 --- a/htdocs/compta/tva.php3 +++ b/htdocs/compta/tva.php3 @@ -1,5 +1,6 @@ + * * $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 "

"; - print ""; + print ""; print ""; print ""; print "\n"; diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index 46c35ad540e..8b0dafa62f2 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -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"; } } diff --git a/htdocs/fourn/contact.php3 b/htdocs/fourn/contact.php3 new file mode 100644 index 00000000000..17e064918b6 --- /dev/null +++ b/htdocs/fourn/contact.php3 @@ -0,0 +1,134 @@ + + * + * $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 "
"; + +print "| *\n| "; +for ($i = 65 ; $i < 91; $i++) { + print ""; + + if ($begin == chr($i) ) { + print "->" . chr($i) . "<-" ; + } else { + print chr($i) ; + } + print " | "; +} +print "
"; + + +/* + * + * 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 "

$dateMontant 
"; + print ""; + print ""; + print ""; + print ''; + print "\n"; + $var=True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + + $var=!$var; + + print ""; + + print ""; + print ""; + + print '\n"; + print "\n"; + print ''; + + print "\n"; + print "\n"; + $i++; + } + print "
NomPrénom"; + print_liste_field_titre("Société",$PHP_SELF,"lower(s.nom)", $begin); + print "emailTéléphone 
$obj->name$obj->firstname '; + print "idp\">$obj->nom$obj->email '.$obj->phone.' idp&setcontact=$obj->cidp&action=create\">[Propal]
"; + $db->free(); +} else { + print $db->error(); +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/fourn/index.php3 b/htdocs/fourn/index.php3 index 5c44d364d3f..ed362269d49 100644 --- a/htdocs/fourn/index.php3 +++ b/htdocs/fourn/index.php3 @@ -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 "

"; - print ''; - print ""; - print ""; - print ""; - print ""; + print '"; + print ""; print "\n"; $var=True; while ($i < $num) { @@ -146,16 +145,11 @@ if ($socid > 0) { print ""; print "\n"; - print "\n"; - print "\n"; - print "\n"; + print "\n"; + print "\n"; - print "\n"; - if ($conf->fichinter->enabled) { - print "\n"; - } else { - print "\n"; - } + + print "\n"; $i++; } diff --git a/htdocs/fourn/pre.inc.php3 b/htdocs/fourn/pre.inc.php3 index d9616fd5479..d8b543ce4a2 100644 --- a/htdocs/fourn/pre.inc.php3 +++ b/htdocs/fourn/pre.inc.php3 @@ -31,75 +31,19 @@ function llxHeader($head = "", $urlp = "") { */ top_menu($head); - print ""; - - - print "'; diff --git a/htdocs/info.php3 b/htdocs/info.php3 index 75a1dfcf5e4..e995db2b5c9 100644 --- a/htdocs/info.php3 +++ b/htdocs/info.php3 @@ -44,6 +44,15 @@ if ($conf->fichinter->enabled) { print ''; } + +print ''; +print ''; +print ''; +print ''; +print ''; +print ''; + + print '
SocieteContactemailStatut  
'; + print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print "Ville 
idp\">$obj->nom  $obj->stcomm".$obj->ville."$obj->prefix_comm idp&action=create\">[Propal]idp&action=create\">[Fiche Inter] 
"; + $menu = new Menu(); - print ""; + $menu->add("/comm/index.php3", "Clients"); - print '"; + $menu->add("/fourn/index.php3", "Fournisseurs"); - print '"; - /* - * - */ - - print '"; - /* - * - */ - print '"; - /* - * - */ - /* - * - */ - print '"; - - print "
'; - print "\n"; - print "Nouvelle société
\n"; - print "Contacts

\n"; - - print "
'; - print "\n"; - print "
'; - print ''; - print "
'; - print ''; - print ''; - print "
'; - print "
Societes
\n"; - print "
"; - print ''; - print ''; - print ' '; - print ""; - print "
"; - - print "
Contacts
\n"; - print "
"; - print ''; - print ''; - print " "; - print ""; - print "
"; + $menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée"); + $menu->add_submenu("contact.php3","Contacts"); - print "
"; - print "Soc : "; - print ""; - print "
"; - print "
"; - - print "
\n"; + left_menu($menu->liste); } -/* - * $Id$ - * $Source$ - */ + ?> diff --git a/htdocs/index.php3 b/htdocs/index.php3 index 0db27a28f9f..df373b68065 100644 --- a/htdocs/index.php3 +++ b/htdocs/index.php3 @@ -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 ''; + print '

'; - print '
'; + print '
'; - print ""; - print ""; - print ""; + print '
DescriptionValeur
'; + print ""; + print ""; print "\n"; $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 0"; if (valeur($sql)) { $var=!$var; - print ""; + print ""; } $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 1"; if (valeur($sql)) { $var=!$var; - print ""; + print ""; } + + print "
Propositions commerciales
Propales brouillons".valeur($sql)."
Broullionsrouillons".valeur($sql)."
Propales ouvertes".valeur($sql)."
Ouvertes".valeur($sql)."

"; + /* + * Factures + * + */ + print ''; + print ""; + print ""; + print "\n"; + + $sql = "SELECT count(*) FROM llx_facture WHERE paye=0"; if (valeur($sql)) { $var=!$var; print ""; } print "
Factures
Factures en attente de paiement".valeur($sql)."

"; + /* + * + * + */ - print ''; - print '
'; + /* + * + * + */ + print ''; - print ""; - print ""; - print ""; + print '
DescriptionValeur
'; + print ""; + print ""; print "\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 ""; + $i=0; + if ( $db->query($sql) ) { + while ($i < $db->num_rows() ) { + $obj = $db->fetch_object($i); + $var=!$var; + + print ""; + $i++; + } + $db->free(); + } } - - print '
Actions a faire
Société en cours de contact".valeur($sql)."
".$obj->datea."$obj->label
'; - print '

'; - - - print '
'; - + print "

"; print '
output url' . $conf->fichinter->outputurl . '
Webcal
type' . $conf->webcal->db->type . '
host' . $conf->webcal->db->host . '
user' . $conf->webcal->db->user . ' 
pass' . $conf->webcal->db->pass . ' 
Database name' . $conf->webcal->db->name . '
'; diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3 index 876f35a5a6a..26f91947fd1 100644 --- a/htdocs/lib/functions.inc.php3 +++ b/htdocs/lib/functions.inc.php3 @@ -24,6 +24,17 @@ * $Source$ * */ +function print_liste_field_titre($name, $file, $field, $begin="") { + global $conf; + + print $name." "; + print ''; + print ''; + print ''; + print ''; + +} + function print_titre($titre) { global $conf; print ''; @@ -40,9 +51,9 @@ function print_barre_liste($titre,$page,$file) { print ''; print '
'.$titre.'
'; if ($page > 0) { - print ''; + print 'Page précédente'; } - print ''; + print 'Page suivante'; print '
'; } /* @@ -87,9 +98,50 @@ function print_date_select() { for ($year = $syear ; $year < $syear + 5 ; $year++) { print "

\n"; - print "$foot
"; - print '[Bug report] '; - print '[Source Code] '; - print ""; -} +$a = setlocale("LC_TIME", "FRENCH"); function top_menu($head) { global $user, $conf; @@ -60,7 +55,7 @@ function top_menu($head) { print ''; print "\n"; - print ''; + print ''; /* * Barre superieure * @@ -89,7 +84,9 @@ function top_menu($head) { print '

'; + print '
'; + + print "\n"; + /* + * + */ + print "
"; +} + +function left_menu($menu) { + global $conf; + /* + * Colonne de gauche + * + */ + print ''; + print '
'; + print ''; + + + for ($i = 0 ; $i < sizeof($menu) ; $i++) { + + print "'; + + } + + print "'; + + print '
"; + print ''.$menu[$i][1].''; + + for ($j = 2 ; $j < sizeof($menu[$i]) - 1 ; $j = $j +2) { + print '
 - '.$menu[$i][$j+1].''; + } + print '
"; + print 'Societes'; + print '
'; + print ''; + print ''; + print ' '; + print ""; + print "
"; + + print 'Contacts'; + print '
'; + print ''; + print ''; + print " "; + print ""; + print '
'; + print '
'; + /* + * + * + */ + print "
\n"; } +function llxFooter($foot='') { + print "
\n"; + print "$foot
"; + print '[Bug report] '; + print '[Source Code] '; + print ""; +} + + ?> diff --git a/htdocs/menu.class.php3 b/htdocs/menu.class.php3 new file mode 100644 index 00000000000..f448e4d517c --- /dev/null +++ b/htdocs/menu.class.php3 @@ -0,0 +1,52 @@ + + * + * $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; + + } + + +} diff --git a/htdocs/pre.inc.php3 b/htdocs/pre.inc.php3 index 271bbad2a52..80958b585ad 100644 --- a/htdocs/pre.inc.php3 +++ b/htdocs/pre.inc.php3 @@ -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 "
"; - /* - * Colonne de gauche - * - */ - print ""; - print "'; + $menu = new Menu(); - print "'; + $menu->add("/comm/index.php3", "Commercial"); + $menu->add_submenu("/comm/index.php3", "Clients"); - print "'; + $menu->add_submenu("/comm/propal.php3", "Propales"); - print "'; + $menu->add("/compta/", "Comptabilité"); - if ($conf->fichinter->enabled) { + $menu->add_submenu("/compta/", "Factures"); - print "'; + if ($conf->fichinter->enabled ) { + + $menu->add("/fichinter/", "Fiches d'intervention"); } - print "'; + $menu->add("/product/", "Produits"); + $menu->add("/service/", "Services"); - print "'; + $menu->add("/user/", "Utilisateurs"); - print ''; - - print "
"; - print "\n"; - print '
"; - print "\n"; - print '
"; - print "
Propales
\n"; - print '
"; - print "
Factures
\n"; - print '
"; - print "
Fiches d'intervention
\n"; - print '
"; - print "
Produits
\n"; + $menu->add("/fourn/index.php3", "Fournisseurs"); - print "
Services
\n"; - print '
"; - print ''; - print '
'; + $menu->add("/info.php3", "Configuration"); - print 'Societes'; - print '
'; - print ''; - print ''; - print ' '; - print ""; - print "
"; - - print 'Contacts'; - print '
'; - print ''; - print ''; - print " "; - print ""; - print '
'; - print '
"; - print "Configuration
"; - print '
'; - /* - * - * - */ - print "
\n"; + left_menu($menu->liste); } ?> diff --git a/htdocs/product/pre.inc.php3 b/htdocs/product/pre.inc.php3 index 249fdb6e1fe..e345a14f005 100644 --- a/htdocs/product/pre.inc.php3 +++ b/htdocs/product/pre.inc.php3 @@ -30,81 +30,24 @@ function llxHeader($head = "", $urlp = "") { */ top_menu($head); + $menu = new Menu(); - print ""; - print ""; + left_menu($menu->liste); + - print ""; - - - print ""; - - - print "
"; + $menu->add("/product/index.php3", "Produits"); - print ""; - print '"; + $menu->add("/service/index.php3", "Services"); - print '"; + $menu->add("/comm/index.php3", "Clients"); - print '"; + $menu->add("/fourn/index.php3", "Fournisseurs"); - print '"; - /* - * - */ - print '"; - /* - * - */ - print '"; - /* - * - */ - - print '"; - - print "
'; - print "
" . $conf->db->name . " - " . $user->code ."
"; - print "Accueil
"; - print "Bookmark"; - print "
'; - print "
Societe
\n"; - print "Contact
\n"; - print "
'; - print ""; - print "
'; - print "\n"; - print "
'; - print ''; - print "
'; - print ''; - print "
'; - print "
Societes
\n"; - print "
"; - print ''; - print ''; - print ' '; - print ""; - print "
"; - - print "
Contacts
\n"; - print "
"; - print ''; - print ''; - print " "; - print ""; - print "
"; + $menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée"); + $menu->add_submenu("contact.php3","Contacts"); - print "
"; - print "Soc : "; - print ""; - print "
"; - print "
"; - - print "
\n"; } - - -/* - * $Id$ - * $Source$ - */ ?> diff --git a/htdocs/service/fiche.php3 b/htdocs/service/fiche.php3 index f2cad9958a8..f74666da733 100644 --- a/htdocs/service/fiche.php3 +++ b/htdocs/service/fiche.php3 @@ -66,7 +66,7 @@ if ($action == 'update') { if ($action == 'create') { - print '
Nouveau service

'; + print_titre("Nouveau service"); print '
'; print ''; print ''; diff --git a/htdocs/service/index.php3 b/htdocs/service/index.php3 index 3be5dfdd113..a3f5a20970a 100644 --- a/htdocs/service/index.php3 +++ b/htdocs/service/index.php3 @@ -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 '
Liste des services

'; +print_barre_liste("Liste des services", $page, $PHP_SELF); /* * @@ -46,21 +44,20 @@ print '
Liste des services

'; * */ -$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 "

"; - print ""; - print ""; - print ""; - print ""; + print "
RéfNomPrix
"; + print ""; print "\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 "

"; + print_liste_field_titre("Réf",$PHP_SELF, "p.ref"); + print ""; + print_liste_field_titre("Libellé",$PHP_SELF, "p.label"); + print "Prix
"; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print ''; - print "\n"; - print "\n"; - $i++; - } - print "
RéfNomPrixFin
rowid\">$objp->ref$objp->label'.price($objp->price).'$objp->fin_comm
"; - $db->free(); -} else { - print $this->db->error() . ' in ' . $sql; -} diff --git a/htdocs/service/pre.inc.php3 b/htdocs/service/pre.inc.php3 index f7c82475660..bdee93342a4 100644 --- a/htdocs/service/pre.inc.php3 +++ b/htdocs/service/pre.inc.php3 @@ -30,67 +30,22 @@ function llxHeader($head = "", $urlp = "") { */ top_menu($head); + $menu = new Menu(); - print "
"; + $menu->add("/product/index.php3", "Produits"); - print ""; + $menu->add("/service/index.php3", "Services"); + + $menu->add("/comm/index.php3", "Clients"); + + $menu->add("/fourn/index.php3", "Fournisseurs"); - print '"; + $menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée"); + $menu->add_submenu("contact.php3","Contacts"); - print '"; - /* - * - */ - print '"; - - print ''; - - print '"; - - print "
'; - print "
Societe
\n"; - print "Contact
\n"; - print "
'; - print "\n"; - print "
'; - print "
Produits
\n"; - print "
'; - print '
'; - print 'Nouveau service'; - print '
'; - print "
Societes
\n"; - print ""; - print ''; - print ''; - print ' '; - print ""; - print ""; - - print "
Contacts
\n"; - print "
"; - print ''; - print ''; - print " "; - print ""; - print "
"; - - - print "
"; - print "Soc : "; - print ""; - print "
"; - print "
"; - - print "
\n"; + left_menu($menu->liste); } -/* - * $Id$ - * $Source$ - */ ?> diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index ad90a43d956..bbb1e65eaf7 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -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(); diff --git a/htdocs/todocomm.class.php3 b/htdocs/todocomm.class.php3 new file mode 100644 index 00000000000..0b4f0f883fa --- /dev/null +++ b/htdocs/todocomm.class.php3 @@ -0,0 +1,81 @@ + + * + * $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(); + } + } +} +?> + diff --git a/htdocs/user/pre.inc.php3 b/htdocs/user/pre.inc.php3 index b257c5372c0..d4083249a0e 100644 --- a/htdocs/user/pre.inc.php3 +++ b/htdocs/user/pre.inc.php3 @@ -30,59 +30,27 @@ function llxHeader($head = "", $urlp = "") { */ top_menu($head); + $menu = new Menu(); - print "
"; + $menu->add("/user/", "Utilisateurs"); - print ""; + $menu->add("/info.php3", "Configuration"); - print '"; + $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 '"; - /* - * - */ - print '"; + $menu->add_submenu("/soc.php3?&action=create","Nouvelle sociétée"); + $menu->add_submenu("contact.php3","Contacts"); - print '"; - - print "
'; - print "
Societe
\n"; - print "Contact
\n"; - print "
'; - print "\n"; - print "
'; - print "
Produits
\n"; - print "
'; - print "
Societes
\n"; - print "
"; - print ''; - print ''; - print ' '; - print ""; - print "
"; - - print "
Contacts
\n"; - print "
"; - print ''; - print ''; - print " "; - print ""; - print "
"; - - - print "
"; - print "Soc : "; - print ""; - print "
"; - print "
"; - - print "
\n"; + left_menu($menu->liste); } ?> diff --git a/mysql/data/Makefile b/mysql/data/Makefile index fe37bfd7903..08dcb19902d 100644 --- a/mysql/data/Makefile +++ b/mysql/data/Makefile @@ -26,3 +26,5 @@ BASE=dolibarr dev: $(MYSQL) $(BASE) < data_dev.sql + $(MYSQL) $(BASE) < propal_dev.sql + $(MYSQL) $(BASE) < facture_dev.sql \ No newline at end of file diff --git a/mysql/data/data.sql b/mysql/data/data.sql index 5e13667e92e..b22eba3b3e4 100644 --- a/mysql/data/data.sql +++ b/mysql/data/data.sql @@ -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'); diff --git a/mysql/data/data_dev.sql b/mysql/data/data_dev.sql index 55f34431750..8e027e2b194 100644 --- a/mysql/data/data_dev.sql +++ b/mysql/data/data_dev.sql @@ -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; \ No newline at end of file diff --git a/mysql/data/facture_dev.sql b/mysql/data/facture_dev.sql new file mode 100644 index 00000000000..8ca6b9f6a08 --- /dev/null +++ b/mysql/data/facture_dev.sql @@ -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,''); + diff --git a/mysql/data/propal_dev.sql b/mysql/data/propal_dev.sql new file mode 100644 index 00000000000..5d4cb89de31 --- /dev/null +++ b/mysql/data/propal_dev.sql @@ -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); + diff --git a/mysql/tables/Makefile b/mysql/tables/Makefile index f5c24ca8415..3ece695c045 100644 --- a/mysql/tables/Makefile +++ b/mysql/tables/Makefile @@ -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 diff --git a/mysql/tables/drop.sql b/mysql/tables/drop.sql index 08d0912ed1e..70089dc1857 100644 --- a/mysql/tables/drop.sql +++ b/mysql/tables/drop.sql @@ -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; - - diff --git a/mysql/tables/llx_propaldet.sql b/mysql/tables/llx_propaldet.sql index 2ca6b8320cf..a9af9242401 100644 --- a/mysql/tables/llx_propaldet.sql +++ b/mysql/tables/llx_propaldet.sql @@ -25,5 +25,6 @@ create table llx_propaldet rowid integer AUTO_INCREMENT PRIMARY KEY, fk_propal integer, fk_product integer, + qty smallint, price real ); diff --git a/mysql/tables/llx_todocomm.sql b/mysql/tables/llx_todocomm.sql new file mode 100644 index 00000000000..1762bede56f --- /dev/null +++ b/mysql/tables/llx_todocomm.sql @@ -0,0 +1,37 @@ +-- ======================================================================== +-- Copyright (C) 2001-2002 Rodolphe Quiedeville +-- +-- $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 +); +