diff --git a/INSTALL b/INSTALL index 2eb4b265f77..be90c1a2d32 100644 --- a/INSTALL +++ b/INSTALL @@ -17,4 +17,30 @@ Configuration : Apache : - un fichier httpd.conf.sample est fournit vous pouvez vous en - servir pour configurer votre serveur \ No newline at end of file + servir pour configurer votre serveur + +Installation +------------ + Base de données : + + Vous trouverez un fichier Makefile dans le repertoire mysql/ +qui contient toutes les commandes pour creer la base, les tables et +les data. + + 'make create' cree la base de donnee 'dolibarr' vous pouvez +changer le nom de la base avec la commande 'make create +BASE=autrenom', pensez a executer 'make create' avec un utilisateur +ayant les droits de creation de base. Les droits sur la base sont cree +en meme temps, si vous souhaitez les changer vous pouvez editer le +fichier Makefile. + + + 'make table' cree les tables + + 'make load' charge les donnees necessaire dans les tables de +constantes. + + 'make dev' charge un ensemble de donnees de test + + Une fois ces 3 commandes passees votre base de donnees est +pretes a etre utilisee. \ No newline at end of file diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index d543ffdbaa8..8dcf71e7c2e 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -43,10 +43,8 @@ $yn["f"] = "non"; llxHeader(); -print ""; -print ""; -print ""; -print "
Propositions commerciales pour $objsoc->nom
"; +print_titre("Propositions commerciales pour $objsoc->nom"); + if ($action == 'add') { $propal = new Propal($db, $socidp); @@ -322,5 +320,5 @@ if ( $db->query($sql) ) { print "

$sql"; } $db->close(); -llxFooter(); +llxFooter("Dernière modification $Date$ révision $Revision$"); ?> diff --git a/htdocs/comm/contact.php3 b/htdocs/comm/contact.php3 index cece16fcad2..c3e73093efb 100644 --- a/htdocs/comm/contact.php3 +++ b/htdocs/comm/contact.php3 @@ -55,8 +55,8 @@ print "

"; /* - * Mode liste * + * Mode liste * * */ @@ -81,6 +81,10 @@ if ($contactname) { $sortorder = "ASC"; } +if ($socid) { + $sql .= " AND s.idp = $socid"; +} + $sql .= " ORDER BY $sortfield $sortorder " . $db->plimit( $limit, $offset); $result = $db->query($sql); @@ -98,7 +102,7 @@ if ($result) { print "ActionNom"; print "Prénom"; print "email"; - print "Societe"; + print "Societe"; print 'Statut '; print "\n"; $var=True; @@ -116,6 +120,7 @@ if ($result) { print "$obj->name"; print "$obj->firstname"; print "$obj->email \n"; + print ''; print "idp\">$obj->nom\n"; print ''.$obj->stcomm.''; print "idp&setcontact=$obj->cidp&action=create\">[Propal]\n"; diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index 0bef4c0c060..672f83698b8 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -31,19 +31,6 @@ if ($sortorder == "") { if ($sortfield == "") { $sortfield="nom"; } -$bc[0]="bgcolor=\"#c0f0c0\""; -$bc[1]="bgcolor=\"#b0e0b0\""; -$bc2[0]="bgcolor=\"#c9f000\""; -$bc2[1]="bgcolor=\"#b9e000\""; - - -$yn["t"] = "oui"; -$yn["f"] = "non"; -$yn["1"] = "oui"; -$yn["0"] = "non"; - -$deacmeth["b"] = "robots"; -$deacmeth["m"] = "manuelle"; if ($action == 'attribute_prefix') { $societe = new Societe($db, $socid); @@ -86,7 +73,7 @@ if ($action == 'stcomm') { } } if ($page == -1) { $page = 0 ; } -$limit = 26; +$limit = $conf->liste_limit; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -155,8 +142,6 @@ if ($socid > 0) { print "idp&action=create\">[Projet]"; print "idp&action=create\">[Propal]"; print "idp\">Notes"; - print "idp\">Contacts"; - print "idp\">Fiche Technique"; print "[idp&action=edit\">Editer]"; print ""; /* @@ -628,12 +613,9 @@ if ($socid > 0) { * * */ - print '

Liste des clients
'; + print_barre_liste("Liste des clients", $page, $PHP_SELF); - $bc[1]="bgcolor=\"#90c090\""; - $bc[0]="bgcolor=\"#b0e0b0\""; - - $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.client=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.client=1"; if (strlen($stcomm)) { $sql .= " AND s.fk_stcomm=$stcomm"; @@ -661,11 +643,16 @@ if ($socid > 0) { } else { $sortorder="DESC"; } - print "

"; - print ""; - print ""; - print ""; - print ""; + print "
IdSocieteContact
"; + print ''; + print ""; print ""; print ""; print "\n"; @@ -676,9 +663,8 @@ if ($socid > 0) { $var=!$var; print ""; - print ""; print "\n"; - print "\n"; + print "\n"; print "\n"; print "\n"; print "\n"; diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index 5a98f0174a5..dfe7c20bd4d 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -24,23 +24,15 @@ require("../main.inc.php3"); function llxHeader($head = "", $urlp = "") { global $user, $conf; - /* * * */ top_menu($head); - - print "
Société"; + + print ''; + print ''; + print ''; + print ''; + + print "VilleemailStatut  
$obj->idpidp\">$obj->nom ".$obj->ville."  $obj->stcomm$obj->prefix_comm 
"; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print "
"; + print "
"; print ""; - print ""; print '"; print "
"; - print "
" . $conf->db->name . " - " . $user->code ."
"; - print "Accueil
"; - print "Bookmark"; - print "
'; print "\n"; @@ -100,11 +92,6 @@ function llxHeader($head = "", $urlp = "") { print ""; print ""; - - print "
"; - print "Soc : "; - print ""; - print "
"; print "
"; diff --git a/htdocs/comm/projet/pre.inc.php3 b/htdocs/comm/projet/pre.inc.php3 index 9261aef1ed9..7ce27bf37b7 100644 --- a/htdocs/comm/projet/pre.inc.php3 +++ b/htdocs/comm/projet/pre.inc.php3 @@ -23,32 +23,17 @@ require ("../../main.inc.php3"); function llxHeader($head = "", $urlp = "") { - global $PREFIX, $user; + global $conf, $user; - print "\n$head\n\n"; - ?> - - \n"; - print "
" . $GLOBALS["MAIN_TITLE"] . "TechniqueCommercialComptaStats
\n"; - - print ""; print "
"; print ""; - print ""; /* * */ diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index e77df81858a..81ce8934c43 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -34,10 +34,6 @@ require("./actioncomm.class.php3"); llxHeader(); - -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; - $db = new Db(); if ($sortfield == "") { @@ -522,7 +518,7 @@ if ($propalid) { if ( $db->query($sql) ) { $num = $db->num_rows(); $i = 0; - print "

"; - print "
" . $GLOBALS["dbname"] . " - " . $user->code ."
"; - print "Accueil
"; - print "Bookmark"; - print "
"; + print "
"; $oldstatut = -1; $subtotal = 0; @@ -533,25 +529,24 @@ if ($propalid) { $oldstatut = $objp->statut; if ($i > 0) { - print "\n"; + print "\n"; print "\n"; } $subtotal = 0; - print ""; - print ""; + print ''; print ""; print ""; print ""; print ""; - print ""; + print "'; print "\n"; $var=True; } $var=!$var; print ""; - print "\n"; print "\n"; print "\n"; @@ -572,9 +567,7 @@ if ($propalid) { print " "; print strftime("%B",$objp->dp)."\n"; print " "; - print strftime("%Y",$objp->dp)."\n"; - - //print "\n"; + print strftime("%Y",$objp->dp)."\n"; print "\n"; print "\n"; @@ -585,11 +578,11 @@ if ($propalid) { $i++; } - print "\n"; + print "\n"; print "\n"; - print ""; + print ""; print ""; print ""; print "
Total : ".price($subtotal)."
Total : ".price($subtotal)."Euros HT
[Tous]
RéfSocieteDatePrixStatut [statutid\">Filtre]Statut statutid\">"; + print '
[idp\">Filtre]propalid\">$objp->refidp\">$objp->nom".strftime("%d %B %Y",$objp->dp)."".price($objp->price)."$objp->statut
Total : ".price($subtotal)."
Total : ".price($subtotal)."Euros HT
$i propalesSoit : ".francs($total)." FF HT
$i propalesTotal : ".price($total)."Euros HT
"; diff --git a/htdocs/compta/ca.php3 b/htdocs/compta/ca.php3 index 419e47b673f..73b867b87bb 100644 --- a/htdocs/compta/ca.php3 +++ b/htdocs/compta/ca.php3 @@ -22,15 +22,15 @@ require("./pre.inc.php3"); function pt ($db, $sql, $date) { - $bc[0]="bgcolor=\"#90c090\""; - $bc[1]="bgcolor=\"#b0e0b0\""; + $bc[0]="class=\"pair\""; + $bc[1]="class=\"impair\""; $result = $db->query($sql); if ($result) { $num = $db->num_rows(); $i = 0; $total = 0 ; - print "

"; - print ""; + print "

"; + print ""; print ""; print ""; print "\n"; @@ -49,7 +49,6 @@ function pt ($db, $sql, $date) { $i++; } print ''; - print ''; print "
$dateMontant 
Total :'.price($total).'euros HT
Total :'.francs($total).'Francs HT
"; $db->free(); @@ -71,7 +70,7 @@ if ($sortorder == "") { } -print "Chiffres d'affaires en euros HT

"; +print_titre("Chiffres d'affaires en euros HT"); print ""; print "
"; diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 06870c7b75e..84eaef4b3ff 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -22,10 +22,7 @@ require("./pre.inc.php3"); llxHeader(); -print '
Factures émises
'; -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; $db = new Db(); if ($sortfield == "") { @@ -39,18 +36,18 @@ $yn["t"] = "oui"; $yn["f"] = "non"; if ($page == -1) { $page = 0 ; } -$limit = 26; +$limit = $conf->limit_liste; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -print "

Brouillons

"; +print_barre_liste("Factures",$page,$PHP_SELF); $sep = 0; $sept = 0; $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.fk_statut = 0"; +$sql .= " FROM societe as s,llx_facture as f WHERE f.fk_soc = s.idp"; if ($socidp) { $sql .= " AND s.idp = $socidp"; @@ -71,12 +68,12 @@ if ($result) { $i = 0; print ""; - print ""; + print ''; print ""; print ""; print ""; print ""; - print ""; + print ""; print "\n"; if ($num > 0) { @@ -87,17 +84,15 @@ if ($result) { if ($objp->paye && !$sep) { print ""; - print ""; - print ""; + print " "; + print ""; - print ""; + print ''; print ""; print ""; print ""; print ""; - print ""; - print "\n"; + print "\n"; $sep = 1 ; $j = 0; $subtotal = 0; } @@ -129,7 +124,7 @@ if ($result) { $total = $total + $objp->amount; $subtotal = $subtotal + $objp->amount; print "\n"; - print "\n"; + print "\n"; $i++; $j++; @@ -137,15 +132,11 @@ if ($result) { } } if ($i == 0) { $i=1; } if ($j == 0) { $j=1; } - print ""; - print ""; - print ""; + print ""; + print ""; - print ""; - print ""; - print ""; + print ""; + print ""; print "
[Tous]NuméroSocieteDateMontantPayéMoyennePayé
$i factures"; - print "Total : ".francs($total)." FFSous Total : ".price($total)."euros HTMoyenne : ".price($total / ($i+1))."
Sous Total : ".price($total)."euros HT
[Tous]NuméroSocieteDateMontantPayéMoyenne
Payé
".$yn[$objp->paye]."".price($subtotal / ($j + 1))."
$j factures"; - print "Total : ".francs($subtotal)." FFSous Total : ".price($subtotal)."euros HTMoyenne : ".price($subtotal/ $j)."
$j factures Sous Total : ".price($subtotal)."euros HT
$i factures"; - print "Total : ".francs($total)." FFTotal : ".price($total)."euros HTMoyenne : ".price($total/ $i)."
$i factures Total : ".price($total)."euros HT
"; $db->free(); @@ -153,122 +144,6 @@ if ($result) { print $db->error(); } -/* - * - * - * - */ -print "

Validées
"; - -$sep = 0; -$sept = 0; -$subtotal=0; - -$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.fk_statut > 0"; - -if ($socidp) { - $sql .= " AND s.idp = $socidp"; -} - -if ($month > 0) { - $sql .= " AND date_part('month', date(f.datef)) = $month"; -} -if ($year > 0) { - $sql .= " AND date_part('year', date(f.datef)) = $year"; -} - -$sql .= " ORDER BY f.paye, f.datef DESC "; - -$result = $db->query($sql); -if ($result) { - $num = $db->num_rows(); - - $l=0; - $k=0; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $var=True; - if ($num > 0) { - while ($l < $num) { - $objp = $db->fetch_object( $l); - $var=!$var; - - if ($objp->paye && !$sep) { - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "\n"; - $sep = 1 ; $k = 0; - $subtotal = 0; - } - - print ""; - print "\n"; - print "\n"; - print "\n"; - - if ($objp->df > 0 ) { - print "\n"; - } else { - print "\n"; - } - - print "\n"; - - $yn[1] = "oui"; - $yn[0] = "non"; - - $total = $total + $objp->amount; - $subtotal = $subtotal + $objp->amount; - print "\n"; - print "\n"; - print "\n"; - $l++; - $k++; - - } - } - if ($l == 0) { $l=1; } if ($k == 0) { $k=1; } - print ""; - print ""; - print ""; - - print ""; - print ""; - print ""; - - print "
[Tous]NuméroSocieteDateMontantPayéMoyenne
$l factures"; - print "Total : ".francs($total)." FFSous Total : ".price($total)."euros HTMoyenne : ".price($total / ($l+1))."
[Tous]NuméroSocieteDateMontantPayéMoyenne
[idp\">Filtre]facid\">$objp->facnumberidp\">$objp->nom"; - $y = strftime("%Y",$objp->df); - $m = strftime("%m",$objp->df); - - print strftime("%d",$objp->df)."\n"; - print " "; - print strftime("%B",$objp->df)."\n"; - print " "; - print strftime("%Y",$objp->df)."!!!".price($objp->amount)."".$yn[$objp->paye]."".price($subtotal / ($k + 1))."
$k factures"; - print "Total : ".francs($subtotal)." FFSous Total : ".price($subtotal)."euros HTMoyenne : ".price($subtotal/ $k)."
".($l+$i)." factures"; - print "Total : ".francs($total)." FFTotal : ".price($total)."euros HTMoyenne : ".price($total/ ($l+$i))."
"; - $db->free(); -} else { - print $db->error(); -} - - $db->close(); diff --git a/htdocs/compta/paiement.php3 b/htdocs/compta/paiement.php3 index e8ef7090fd2..17a340fbf1d 100644 --- a/htdocs/compta/paiement.php3 +++ b/htdocs/compta/paiement.php3 @@ -29,10 +29,8 @@ require("./pre.inc.php3"); llxHeader(); -$db = new Db(); -$bc[0]="bgcolor=\"#90c090\""; -$bc[1]="bgcolor=\"#b0e0b0\""; +$db = new Db(); if ($action == 'add') { @@ -171,8 +169,11 @@ if ($action == '') { if ($result) { $num = $db->num_rows(); $i = 0; $total = 0; - print "

Paiements"; - print ""; + + print_barre_liste("Paiements", $page, $PHP_SELF); + print "
"; + + print ''; print ""; print ""; print ""; diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 0ed65c11afc..b2b9f7a3b6f 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -32,50 +32,40 @@ function llxHeader($head = "") { top_menu($head); - - print "
FactureDateType
"; print "'; + print '
"; print ""; - print ""; - - print '"; - print ""; - print ""; - print ""; - print ""; - print ""; + + + print ""; /* @@ -57,28 +61,47 @@ function top_menu($head) { print "\n"; print ''; + /* + * Barre superieure + * + */ - - print "
"; - print "
" . $conf->db->name . " - " . $user->code ."
"; - print "Accueil"; - - print "
'; + print '
'; print '

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

"; - print "
Chiffres d'affaires

\n"; + print "
"; + print "
Chiffres d'affaires

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

\n"; print "CA par societe
\n"; print "Point mort
\n"; print "TVA
\n"; print "
"; + print "
"; print "Propal
\n"; print "
"; + print "
"; print "Bank
\n"; print "
"; + print "
"; print "Societes\n"; print "
"; print ""; diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index 1aae5673c38..46c35ad540e 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -28,6 +28,10 @@ class Conf { Function Conf() { + $this->theme = "dolibarr"; + + $this->liste_limit = 10; + $this->db = new DbConf(); $this->propal = new PropalConf(); diff --git a/htdocs/fourn/fiche.php3 b/htdocs/fourn/fiche.php3 new file mode 100644 index 00000000000..66769f701d0 --- /dev/null +++ b/htdocs/fourn/fiche.php3 @@ -0,0 +1,462 @@ + + * + * $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"); +require("../contact.class.php3"); +require("../societe.class.php3"); + +llxHeader(); +$db = new Db(); +if ($sortorder == "") { + $sortorder="ASC"; +} +if ($sortfield == "") { + $sortfield="nom"; +} +$bc[0]="bgcolor=\"#c0f0c0\""; +$bc[1]="bgcolor=\"#b0e0b0\""; +$bc2[0]="bgcolor=\"#c9f000\""; +$bc2[1]="bgcolor=\"#b9e000\""; + + +$yn["t"] = "oui"; +$yn["f"] = "non"; +$yn["1"] = "oui"; +$yn["0"] = "non"; + +$deacmeth["b"] = "robots"; +$deacmeth["m"] = "manuelle"; + +if ($action == 'attribute_prefix') { + $societe = new Societe($db, $socid); + $societe->attribute_prefix($db, $socid); + //$prefix_attrib = soc_attribute_prefix($db, $socid); +} + +if ($action == 'recontact') { + $dr = mktime(0, 0, 0, $remonth, $reday, $reyear); + $sql = "INSERT INTO llx_soc_recontact (fk_soc, datere, author) VALUES ($socid, $dr,'". $GLOBALS["REMOTE_USER"]."')"; + $result = $db->query($sql); +} + +if ($action == 'note') { + $sql = "UPDATE societe SET note='$note' WHERE idp=$socid"; + $result = $db->query($sql); +} + +if ($action == 'stcomm') { + if ($stcommid <> 'null' && $stcommid <> $oldstcomm) { + $sql = "INSERT INTO socstatutlog (datel, fk_soc, fk_statut, author) "; + $sql .= " VALUES ('$dateaction',$socid,$stcommid,'" . $GLOBALS["REMOTE_USER"] . "')"; + $result = @$db->query($sql); + + if ($result) { + $sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid"; + $result = $db->query($sql); + } else { + $errmesg = "ERREUR DE DATE !"; + } + } + + if ($actioncommid) { + $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; + $result = @$db->query($sql); + + if (!$result) { + $errmesg = "ERREUR DE DATE !"; + } + } +} +if ($page == -1) { $page = 0 ; } +$limit = 26; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + + +/* + * Recherche + * + * + */ +if ($mode == 'search') { + if ($mode-search == 'soc') { + $sql = "SELECT s.idp FROM societe as s "; + $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; + } + + if ( $db->query($sql) ) { + if ( $db->num_rows() == 1) { + $obj = $db->fetch_object(0); + $socid = $obj->idp; + } + $db->free(); + } +} +/* + * + * Mode fiche + * + * + */ +if ($socid > 0) { + $societe = new Societe($db, $socid); + + + $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; + $sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id"; + + if ($to == 'next') { + $sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; + } elseif ($to == 'prev') { + $sql .= " AND s.idp < $socid ORDER BY idp DESC LIMIT 1"; + } else { + $sql .= " AND s.idp = $socid"; + } + + $result = $db->query($sql); + + if ($result) { + $objsoc = $db->fetch_object(0); + + $dac = strftime("%Y-%m-%d %H:%M", time()); + if ($errmesg) { + print "$errmesg
"; + } + + /* + * + */ + print "\n"; + + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
Fiche fournisseur : $objsoc->nom
idp&action=add\">[Bookmark]idp&action=create\">[Projet]idp&action=create\">[Propal]idp\">Notesidp\">Contacts[idp&action=edit\">Editer]
"; + /* + * + * + */ + + print "
"; + print "\n"; + print "\n"; + print ''; + /* + * + */ + print ""; + print "
"; + print ""; + + print ""; + print ""; + print ""; + + print ""; + print ""; + + print ""; + + print "
Type $objsoc->typentEffectif$objsoc->effectif
Tel $objsoc->tel fax$objsoc->fax 
Ville".nl2br($objsoc->address)."
$objsoc->cp $objsoc->ville
sirensiren\">$objsoc->siren prefix"; + if ($objsoc->prefix_comm) { + print $objsoc->prefix_comm; + } else { + print "[idp&action=attribute_prefix\">Attribuer]"; + } + + print "
Siteurl\">$objsoc->url 
"; + + /* + * + */ + print "
'; + print ''; + print ""; + /* + * + */ + print '
Créée le" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "
'; + print '
"; + + /* + * Propales + */ + $var=!$var; + print ""; + $sql = "SELECT s.nom, s.idp, p.rowid as propalid, p.price, p.ref, p.remise, ".$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 s.idp = $objsoc->idp ORDER BY p.datep DESC"; + + if ( $db->query($sql) ) { + $num = $db->num_rows(); + if ($num >0 ) { + print ""; + } + $i = 0; $now = time(); $lim = 3600 * 24 * 15 ; + while ($i < $num && $i < 2) { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print "\n"; + $i++; + } + $db->free(); + } + /* + * Factures + */ + $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 ""; + } + + while ($i < $num && $i < 2) { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + if ($objp->df > 0 ) { + print "\n"; + } else { + print "\n"; + } + print "\n"; + $paye[1] = "payée"; + $paye[0] = "non payée"; + print "\n"; + print "\n"; + $i++; + } + $db->free(); + } else { + print $db->error(); + } + print "
idp\">liste des propales ($num)
propalid\">$objp->ref\n"; + if ( ($now - $objp->dp) > $lim && $objp->statutid == 1 ) { + print " > 15 jours"; + } + print "".strftime("%d %B %Y",$objp->dp)."".price($objp->price - $objp->remise)."$objp->statut
idp\">liste des factures ($num)
facid\">$objp->facnumber".strftime("%d %B %Y",$objp->df)."!!!".number_format($objp->amount, 2, ',', ' ')."".$paye[$objp->paye]."
"; + + print "
"; + /* + * + * Liste des projets associés + * + */ + $sql = "SELECT p.rowid,p.title,p.ref,".$db->pdate("p.dateo")." as do"; + $sql .= " FROM llx_projet as p WHERE p.fk_soc = $objsoc->idp"; + if ( $db->query($sql) ) { + print ""; + $i = 0 ; + $num = $db->num_rows(); + if ($num > 0) { + $tag = !$tag; print ""; + print ""; + } + while ($i < $num && $i < 5) { + $obj = $db->fetch_object( $i); + $tag = !$tag; + print ""; + print ''; + + print ""; + $i++; + } + $db->free(); + print "
idp\">liste des projets ($num)
'.$obj->title.'".strftime("%d %b %Y", $obj->do) ."
"; + } else { + print $db->error(); + } + + /* + * + * + */ + print "
\n"; + /* + * + * + * + */ + if ($action == 'changevalue') { + + print "
"; + print "idp\" method=\"post\">"; + print ""; + print "Cette société est un cabinet de recrutement : "; + print ""; + print ""; + print "
\n"; + } else { + /* + * + * Liste des contacts + * + */ + print ""; + + print ""; + print ''; + print ""; + print ""; + + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note FROM socpeople as p WHERE p.fk_soc = $objsoc->idp ORDER by p.datec"; + $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 ''; + print ''; + print ""; + print "\n"; + $i++; + $tag = !$tag; + } + print "
Prénom NomPosteTélFaxEmailidp&action=addcontact\">Ajouter
$obj->firstname $obj->name"; + if ($obj->note) { + print "
".nl2br($obj->note); + } + print "
$obj->poste '.$obj->phone.' '.$obj->fax.' '.$obj->email.' idp&action=editcontact&contactid=$obj->idp\">Modifier
"; + + print "\n
\n"; + /* + * + */ + print ''; + print ''; + print '
'; + /* + * + * Listes des actions + * + */ + $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " WHERE a.fk_soc = $objsoc->idp "; + $sql .= " AND u.rowid = a.fk_user_author"; + $sql .= " AND c.id=a.fk_action "; + $sql .= " ORDER BY a.datea DESC, a.id DESC"; + + if ( $db->query($sql) ) { + print "\n"; + print ''; + + $i = 0 ; $num = $db->num_rows(); $tag = True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + if ($tag) { + print ""; + } else { + print ""; + } + + if ($oldyear == strftime("%Y",$obj->da) ) { + print ''; + } else { + print "\n"; + $oldyear = strftime("%Y",$obj->da); + } + + if ($oldmonth == strftime("%Y%b",$obj->da) ) { + print ''; + } else { + print "\n"; + $oldmonth = strftime("%Y%b",$obj->da); + } + + print "\n"; + print "\n"; + + if ($obj->propalrowid) { + print ''; + } else { + print ''; + } + /* + * Contact pour cette action + * + */ + if ($obj->fk_contact) { + $contact = new Contact($db); + $contact->fetch($obj->fk_contact); + print ''; + } else { + print ''; + } + /* + */ + print ''; + print "\n"; + $i++; + $tag = !$tag; + } + print "
Actions
|" .strftime("%Y",$obj->da)."|" .strftime("%b",$obj->da)."" .strftime("%d",$obj->da)."" .strftime("%H:%M",$obj->da)."'.$obj->libelle.''.$obj->libelle.''.$contact->fullname.' '.$obj->code.'
"; + + $db->free(); + } else { + print $db->error(); + } + print "
"; + /* + * + * Notes sur la societe + * + */ + print ''; + print ""; + print "
".nl2br($objsoc->note)."
"; + + + + } + } else { + print $db->error() . "
" . $sql; + } +} else { + print "Erreur"; +} +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/fourn/index.php3 b/htdocs/fourn/index.php3 new file mode 100644 index 00000000000..5c44d364d3f --- /dev/null +++ b/htdocs/fourn/index.php3 @@ -0,0 +1,171 @@ + + * + * $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"); +require("../contact.class.php3"); +require("../societe.class.php3"); + +llxHeader(); +$db = new Db(); +if ($sortorder == "") { + $sortorder="ASC"; +} +if ($sortfield == "") { + $sortfield="nom"; +} + +if ($action == 'note') { + $sql = "UPDATE societe SET note='$note' WHERE idp=$socid"; + $result = $db->query($sql); +} + +if ($action == 'stcomm') { + if ($stcommid <> 'null' && $stcommid <> $oldstcomm) { + $sql = "INSERT INTO socstatutlog (datel, fk_soc, fk_statut, author) "; + $sql .= " VALUES ('$dateaction',$socid,$stcommid,'" . $GLOBALS["REMOTE_USER"] . "')"; + $result = @$db->query($sql); + + if ($result) { + $sql = "UPDATE societe SET fk_stcomm=$stcommid WHERE idp=$socid"; + $result = $db->query($sql); + } else { + $errmesg = "ERREUR DE DATE !"; + } + } + + if ($actioncommid) { + $sql = "INSERT INTO actioncomm (datea, fk_action, fk_soc, fk_user_author) VALUES ('$dateaction',$actioncommid,$socid,'" . $user->id . "')"; + $result = @$db->query($sql); + + if (!$result) { + $errmesg = "ERREUR DE DATE !"; + } + } +} +if ($page == -1) { $page = 0 ; } +$limit = $conf->liste_limit; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + + +/* + * Recherche + * + * + */ +if ($mode == 'search') { + if ($mode-search == 'soc') { + $sql = "SELECT s.idp FROM societe as s "; + $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; + } + + if ( $db->query($sql) ) { + if ( $db->num_rows() == 1) { + $obj = $db->fetch_object(0); + $socid = $obj->idp; + } + $db->free(); + } +} +/* + * + * Mode fiche + * + * + */ +if ($socid > 0) { + +} else { + /* + * Mode Liste + * + * + * + */ + 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"; + + if (strlen($stcomm)) { + $sql .= " AND s.fk_stcomm=$stcomm"; + } + + if (strlen($begin)) { + $sql .= " AND upper(s.nom) like '$begin%'"; + } + + if ($socname) { + $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; + $sortfield = "lower(s.nom)"; + $sortorder = "ASC"; + } + + $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 "

"; + print ''; + print ""; + print ""; + print ""; + print ""; + print "\n"; + $var=True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + + $var=!$var; + + print ""; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + print "\n"; + if ($conf->fichinter->enabled) { + print "\n"; + } else { + print "\n"; + } + print "\n"; + $i++; + } + print "
SocieteContactemailStatut  
idp\">$obj->nom  $obj->stcomm$obj->prefix_comm idp&action=create\">[Propal]idp&action=create\">[Fiche Inter] 
"; + $db->free(); + } else { + print $db->error(); + } +} +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/fourn/people.php3 b/htdocs/fourn/people.php3 new file mode 100644 index 00000000000..97084da9e1a --- /dev/null +++ b/htdocs/fourn/people.php3 @@ -0,0 +1,271 @@ + + * + * $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"); + +$db = new Db(); +if ($sortorder == "") { + $sortfield="lower(s.nom)"; + $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"; +$deacmeth["b"] = "robots"; + +if ($action == 'add') { + + $email = trim($email); + + if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { + $sql = "INSERT INTO socpeople (datec, fk_soc,name, firstname, poste, phone,fax,email) "; + $sql .= " VALUES (now(),$socid,'$name','$firstname','$poste','$phone','$fax','$email')"; + $result = $db->query($sql); + if ($result) { + Header("Location: fiche.php3?socid=$socid"); + } + } +} +if ($action == 'update') { + if (strlen(trim($name)) + strlen(trim($firstname)) > 0) { + + $email = trim($email); + + $sql = "UPDATE socpeople set name='$name', firstname='$firstname', poste='$poste', phone='$phone',fax='$fax',email='$email', note='$note'"; + $sql .= " WHERE idp=$contactid"; + $result = $db->query($sql); + if ($result) { + Header("Location: fiche.php3?socid=$socid"); + } + } +} + +llxHeader(); + +if ($page == -1) { $page = 0 ; } +$limit = 26; +$offset = $limit * $page ; +$pageprev = $page - 1; +$pagenext = $page + 1; + +if ($socid > 0) { + + $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, 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"; + + if ($to == 'next') { + $sql .= " AND s.idp > $socid ORDER BY idp ASC LIMIT 1"; + } else { + $sql .= " AND s.idp = $socid"; + } + + $result = $db->query($sql); + + if ($result) { + $objsoc = $db->fetch_object( 0); + + /* + * + * + */ + print "\n"; + print ""; + print ""; + print '
Contacts pour la société : idp\">$objsoc->nom
[Ajouter un contact]
'; + + print "


"; + print "\n"; + print "\n"; + print "\n"; + print "
"; + print "tel : $objsoc->tel
"; + print "fax : $objsoc->fax
"; + print "$objsoc->cp $objsoc->ville
"; + if ($objsoc->url) { + print "url\">$objsoc->url
"; + } + + print "
"; + print ""; + + print "
Créée le" . strftime("%d %b %Y %H:%M", $objsoc->dc) . "
"; + + /* + * + */ + + + print ""; + print ""; + print "
".nl2br($objsoc->note)."
"; + + $bc1="bgcolor=\"#c0f0c0\""; + $bc3="bgcolor=\"#90c090\""; + $bc2="bgcolor=\"#b0e0b0\""; + } else { + print $db->error(); + } + + print "

"; + + print ""; + print ""; + print ""; + + $sql = "SELECT p.name, p.firstname, p.poste, p.phone, p.fax, p.email "; + $sql .= " FROM socpeople as p WHERE p.fk_soc = $objsoc->idp"; + + if ($contactid) { + $sql .= " AND p.idp = $contactid"; + } + $sql .= " ORDER by p.datec"; + $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 ""; + print ""; + print "\n"; + $i++; + $tag = !$tag; + } + print "
Prénom NomPosteTelFaxEmail
$obj->firstname $obj->name$obj->poste $obj->phone $obj->fax email\">$obj->email 
"; + + + if ($action == 'addcontact') { + print "

"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print "
Ajouter le contact
NomPrenom
Poste
TelFax
Email
"; + print ""; + print "
"; + } + /* + * + * Edition du contact + * + */ + if ($action == 'editcontact') { + $sql = "SELECT p.idp, p.name, p.firstname, p.poste, p.phone, p.fax, p.email, p.note"; + $sql .= " FROM socpeople as p WHERE p.idp = $contactid"; + $result = $db->query($sql); + $num = $db->num_rows(); + if ( $num >0 ) { + $obj = $db->fetch_object( 0); + } + + print "
"; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ""; + print ''; + print "
Numéro$obj->idp
Nomname\">Prenomfirstname\">
Posteposte\">
Telphone\">Faxfax\">
Emailemail\">
Note
"; + print ""; + print "
"; + } + + /* + * + * + */ + print "

"; + + print ""; + print ""; + + + $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql .= " FROM actioncomm as a, c_actioncomm as c, llx_user as u "; + $sql .= " WHERE a.fk_soc = $objsoc->idp "; + $sql .= " AND u.rowid = a.fk_user_author"; + $sql .= " AND c.id=a.fk_action "; + + if ($contactid) { + $sql .= " AND fk_contact = $contactid"; + } + $sql .= " ORDER BY a.datea DESC, a.id DESC"; + + if ( $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 ""; + if ($obj->propalrowid) { + print ""; + } else { + print ""; + } + + print ""; + print "\n"; + $i++; + $tag = !$tag; + } + } else { + print ''; + } + print "
ActionFaxEmail
". strftime("%d %b %Y %H:%M", $obj->da) ."propalrowid\">$obj->libelle$obj->libelle$obj->code 
' . $db->error() . '
"; + + + + +} else { + print "Error"; +} +$db->free(); +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/fourn/pre.inc.php3 b/htdocs/fourn/pre.inc.php3 new file mode 100644 index 00000000000..d9616fd5479 --- /dev/null +++ b/htdocs/fourn/pre.inc.php3 @@ -0,0 +1,105 @@ + + * + * $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("../main.inc.php3"); + +function llxHeader($head = "", $urlp = "") { + global $user, $conf; + + + /* + * + * + */ + top_menu($head); + + print "

"; + + print ""; + + print '"; + + + 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 "
"; + + + print "
"; + print "Soc : "; + print ""; + print "
"; + print "
"; + + print "
\n"; +} + +/* + * $Id$ + * $Source$ + */ +?> diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3 index 18126e2862a..876f35a5a6a 100644 --- a/htdocs/lib/functions.inc.php3 +++ b/htdocs/lib/functions.inc.php3 @@ -24,7 +24,31 @@ * $Source$ * */ - +function print_titre($titre) { + global $conf; + print ''; + print ''; + print '
'.$titre.'
'; +} +/* + * + * + */ +function print_barre_liste($titre,$page,$file) { + global $conf; + print ''; + print ''; + print '
'.$titre.'
'; + if ($page > 0) { + print ''; + } + print ''; + print '
'; +} +/* + * + * + */ function print_date_select() { $strmonth[1] = "Janvier"; $strmonth[2] = "Février"; diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index ef1c54135d5..0d2c9a4e380 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -35,6 +35,10 @@ $db = new Db(); $user = new User($db); $user->fetch($GLOBALS["REMOTE_USER"]); +$bc[0]="class=\"impair\""; +$bc[1]="class=\"pair\""; + + function llxFooter($foot='') { print "
\n"; + print '
'; + print '
'; + print ''; print ""; + print ''; - print ''; - - print ''; + print 'Commercial'; } else { - print 'Commercial'; + print '-'; } - print ''; - print ''; - print ''; + print ''; + } else { + print '-'; + } + + + print ''; + print ''; + print ''; + + print ''; print ''; - - print '
'; - + print '
'; + print '
'; + /* + * Table principale + * + */ + print ''; } diff --git a/htdocs/pre.inc.php3 b/htdocs/pre.inc.php3 index 1c42e9b8b89..271bbad2a52 100644 --- a/htdocs/pre.inc.php3 +++ b/htdocs/pre.inc.php3 @@ -31,21 +31,22 @@ function llxHeader($head = "") { */ top_menu($head); - - print "
"; print "
"; /* * Colonne de gauche * */ print ""; + print "'; + print "'; + + print "'; @@ -70,7 +71,7 @@ function llxHeader($head = "") { print "'; print '
"; - - print "
" . $conf->db->name . " - " . $user->code ."
"; - print "Accueil
"; - + print "\n"; print '
"; + print "\n"; + print '
"; print "
Propales
\n"; print '
"; - print ''; + print ''; print '
'; diff --git a/htdocs/service.class.php3 b/htdocs/service.class.php3 index 0f80ab127ca..5953fe32e25 100644 --- a/htdocs/service.class.php3 +++ b/htdocs/service.class.php3 @@ -45,14 +45,14 @@ class Service { * * */ - Function create($userid) { + Function create($user) { - $sql = "INSERT INTO llx_service (datec, fk_user_author) VALUES (now(), $userid)"; + $sql = "INSERT INTO llx_service (datec, fk_user_author) VALUES (now(), ".$user->id.")"; if ($this->db->query($sql) ) { $id = $this->db->last_insert_id(); - if ( $this->update($id, $userid) ) { + if ( $this->update($id, $user) ) { return $id; } } else { @@ -86,7 +86,7 @@ class Service { * * */ - Function start_comm($id, $userid, $datedeb=0) { + Function start_comm($id, $user, $datedeb=0) { $sql = "UPDATE llx_service "; if ($datedeb) { @@ -94,7 +94,7 @@ class Service { } else { $sql .= " SET debut_comm = now()"; } - $sql .= ",fk_user_modif = " . $userid ; + $sql .= ",fk_user_modif = " . $user->id ; $sql .= " WHERE rowid = " . $id; @@ -109,7 +109,7 @@ class Service { * * */ - Function stop_comm($id, $userid, $datefin=0) { + Function stop_comm($id, $user, $datefin=0) { $sql = "UPDATE llx_service "; if ($datefin) { @@ -117,7 +117,7 @@ class Service { } else { $sql .= " SET fin_comm = now()"; } - $sql .= ",fk_user_modif = " . $userid ; + $sql .= ",fk_user_modif = " . $user->id ; $sql .= " WHERE rowid = " . $id; diff --git a/htdocs/service/fiche.php3 b/htdocs/service/fiche.php3 index cebe31df126..f2cad9958a8 100644 --- a/htdocs/service/fiche.php3 +++ b/htdocs/service/fiche.php3 @@ -35,10 +35,10 @@ if ($action == 'add') { $service->price = $price; $service->description = $desc; - $id = $service->create($user->id); + $id = $service->create($user); if ($comm_now && $id) { - $service->start_comm($id, $user->id); + $service->start_comm($id, $user); } } diff --git a/htdocs/service/index.php3 b/htdocs/service/index.php3 index d7832333767..3be5dfdd113 100644 --- a/htdocs/service/index.php3 +++ b/htdocs/service/index.php3 @@ -33,7 +33,7 @@ if ($sortorder == "") { } if ($page == -1) { $page = 0 ; } -$limit = 26; +$limit = $conf->liste_limit; $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; @@ -76,7 +76,7 @@ if ( $db->query($sql) ) { print "
"; $db->free(); } else { - print $this->db->error() . ' in ' . $sql; + print $db->error() . ' in ' . $sql; } diff --git a/htdocs/service/pre.inc.php3 b/htdocs/service/pre.inc.php3 index f4d371982c3..f7c82475660 100644 --- a/htdocs/service/pre.inc.php3 +++ b/htdocs/service/pre.inc.php3 @@ -31,15 +31,10 @@ function llxHeader($head = "", $urlp = "") { top_menu($head); - print ""; print "
"; print ""; - print '"; + print '"; + + + print "
'; - print "
" . $GLOBALS["dbname"] . " - " . $user->code ."
"; - print "Accueil
"; - print "Bookmark"; - print "
'; print "
Societe
\n"; diff --git a/htdocs/theme/dolibarr/dolibarr.css b/htdocs/theme/dolibarr/dolibarr.css new file mode 100644 index 00000000000..6f9a99a02db --- /dev/null +++ b/htdocs/theme/dolibarr/dolibarr.css @@ -0,0 +1,35 @@ +/* Copyright (C) 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. + * + */ + + +TD.barre_select { background: #d9dcc2 } + +TD.barre { background: #e0e0e0 } + +.menu { background: #d9dcc2; font-family: Helvetica, Verdana; font-size: 14px; font-weight: bold; color: #391ff2; text-decoration: none } + +DIV.titre { font-family: Helvetica, Verdana; font-size: 16px; font-weight: bold; color: #101010; text-decoration: none } +/* + * + */ +TR.liste_titre { background: #b0b0b0; font-family: Helvetica, Verdana; font-weight: bold; font-size: 14px; text-decoration: none } +TR.pair { background: #d0d0d0; font-family: Helvetica, Verdana; font-size: 12px; text-decoration: none } +TR.impair { background: #e0e0e0; font-family: Helvetica, Verdana; font-size: 12px; text-decoration: none } diff --git a/htdocs/theme/dolibarr/img/1downarrow.png b/htdocs/theme/dolibarr/img/1downarrow.png new file mode 100644 index 00000000000..f67f46deb3e Binary files /dev/null and b/htdocs/theme/dolibarr/img/1downarrow.png differ diff --git a/htdocs/theme/dolibarr/img/1leftarrow.png b/htdocs/theme/dolibarr/img/1leftarrow.png new file mode 100644 index 00000000000..137115c0397 Binary files /dev/null and b/htdocs/theme/dolibarr/img/1leftarrow.png differ diff --git a/htdocs/theme/dolibarr/img/1rightarrow.png b/htdocs/theme/dolibarr/img/1rightarrow.png new file mode 100644 index 00000000000..fbac1f11294 Binary files /dev/null and b/htdocs/theme/dolibarr/img/1rightarrow.png differ diff --git a/htdocs/theme/dolibarr/img/1uparrow.png b/htdocs/theme/dolibarr/img/1uparrow.png new file mode 100644 index 00000000000..44e54e0cdcf Binary files /dev/null and b/htdocs/theme/dolibarr/img/1uparrow.png differ diff --git a/htdocs/theme/dolibarr/img/filter.png b/htdocs/theme/dolibarr/img/filter.png new file mode 100644 index 00000000000..4baa3a3be8e Binary files /dev/null and b/htdocs/theme/dolibarr/img/filter.png differ diff --git a/htdocs/theme/dolibarr/img/player_start.png b/htdocs/theme/dolibarr/img/player_start.png new file mode 100644 index 00000000000..ccc8bc1b66a Binary files /dev/null and b/htdocs/theme/dolibarr/img/player_start.png differ diff --git a/htdocs/theme/dolibarr/img/start.png b/htdocs/theme/dolibarr/img/start.png new file mode 100644 index 00000000000..9bf7f03ff83 Binary files /dev/null and b/htdocs/theme/dolibarr/img/start.png differ diff --git a/htdocs/user.class.php3 b/htdocs/user.class.php3 index 2e0a665e795..47fb884ba53 100644 --- a/htdocs/user.class.php3 +++ b/htdocs/user.class.php3 @@ -31,8 +31,10 @@ class User { var $code; var $email; var $admin; + var $login; var $comm; var $compta; + var $webcal_login; Function User($DB, $id=0) { @@ -47,9 +49,9 @@ class User { * */ - Function fetch($login) { + Function fetch($login='') { - $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.module_comm, u.module_compta,webcal_login"; + $sql = "SELECT u.rowid, u.name, u.firstname, u.email, u.code, u.admin, u.module_comm, u.module_compta, u.login, u.webcal_login"; $sql .= " FROM llx_user as u"; if ($this->id) { @@ -76,6 +78,10 @@ class User { $this->comm = $obj->module_comm; $this->compta = $obj->module_compta; + + $this->login = $obj->login; + $this->webcal_login = $obj->webcal_login; + } $this->db->free(); diff --git a/htdocs/user/fiche.php3 b/htdocs/user/fiche.php3 new file mode 100644 index 00000000000..5525cff5c41 --- /dev/null +++ b/htdocs/user/fiche.php3 @@ -0,0 +1,179 @@ + + * + * $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"); +require("../service.class.php3"); + +llxHeader(); + +$db = new Db(); + +if ($action == 'add') { + $service = new Service($db); + + $service->ref = $ref; + $service->libelle = $label; + $service->price = $price; + $service->description = $desc; + + $id = $service->create($user->id); + + if ($comm_now && $id) { + $service->start_comm($id, $user->id); + } + +} + +if ($action == 'set_datedeb') { + $service = new Service($db); + $service->start_comm($id, $user->id, $datedeb); +} +if ($action == 'set_datefin') { + $service = new Service($db); + $service->stop_comm($id, $user->id, $datefin); +} + +if ($action == 'update') { + $service = new Service($db); + + $service->ref = $ref; + $service->libelle = $label; + $service->price = $price; + $service->description = $desc; + + $service->update($id, $user); +} +/* + * Nouvel utilisateur + * + * + */ + +if ($action == 'create') { + + print '
Nouveau service

'; + print '
'; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print '"; + + print ''; + print ''; + + print ''; + print ''; + print '
Référence
Libelle
Prix
Description'; + print "
Commercialisé
'; + +} else { + if ($id) { + $fuser = new User($db, $id); + $fuser->fetch(); + + print '
Fiche utilisateur

'; + + print ''; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + + print ''; + print ''; + print ''; + print ''; + + print '
Nom'.$fuser->nom.'Prénom'.$fuser->prenom.'
Login'.$fuser->login.'Pass'.$fuser->pass.'
Webcal Login'.$fuser->webcal_login.'Pass'.$fuser->pass.'
'; + + + print '
'; + + print ''; + print ''; + print ''; + print ''; + print ''; + + + print '
Barre d\'action[Editer]---

'; + /* + * + * Mode edition + * + */ + + if ($action == 'edit') { + print '
Editer la fiche service

'; + print '
'; + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print ''; + print ''; + + print '"; + + print ''; + print ''; + print '
Référence
Libelle
Prix
Description'; + print "
'; + } + + + } + +} + + + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/user/index.php3 b/htdocs/user/index.php3 new file mode 100644 index 00000000000..826b6cdd546 --- /dev/null +++ b/htdocs/user/index.php3 @@ -0,0 +1,71 @@ + + * + * $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(); + +/* + * Mode Liste + * + */ + +$sql = "SELECT u.rowid, u.name, u.firstname, u.code, u.login, u.module_comm, u.module_compta FROM llx_user as u"; +$sql .= " ORDER BY u.name"; + +$result = $db->query($sql); +if ($result) { + $num = $db->num_rows(); + $i = 0; + + print "

"; + print ''; + print ""; + print ""; + print ""; + print ''; + print "\n"; + $var=True; + while ($i < $num) { + $obj = $db->fetch_object( $i); + $var=!$var; + + print ""; + print ''; + print ''; + print ''; + print ''; + print ''; + print ''; + print "\n"; + $i++; + } + print "
PrenomNomcodeloginComm.Compta
'.$obj->firstname.''.$obj->name.''.$obj->code.''.$obj->login.''.$obj->module_comm.''.$obj->module_compta.'
"; + $db->free(); +} else { + print $db->error(); +} + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/user/pre.inc.php3 b/htdocs/user/pre.inc.php3 new file mode 100644 index 00000000000..b257c5372c0 --- /dev/null +++ b/htdocs/user/pre.inc.php3 @@ -0,0 +1,88 @@ + + * + * $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("../main.inc.php3"); + +function llxHeader($head = "", $urlp = "") { + global $user, $conf; + + /* + * + * + */ + top_menu($head); + + + print "

"; + + print ""; + + + print '"; + + + print '"; + /* + * + */ + print '"; + + + 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"; +} + +?> diff --git a/mysql/Makefile b/mysql/Makefile index 2d12710aa53..2cc2a5d8d99 100644 --- a/mysql/Makefile +++ b/mysql/Makefile @@ -1,6 +1,4 @@ # -# General Makefile for Mysql database -# # Copyright (C) 2001-2002 Rodolphe Quiedeville # # $Id$ @@ -20,6 +18,8 @@ # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +# General Makefile for Mysql database +# MYSQL=mysql BASE=dolibarr @@ -79,10 +79,3 @@ createpriv: $(MYSQL) mysql -e "update db set index_priv = 'Y' where db='$(BASE)' ; " $(MYSQL) mysql -e "update db set alter_priv = 'Y' where db='$(BASE)' ; " $(MYSQL) mysql -e "flush privileges ; " - - - -# -# $Id$ -# $Source$ -# \ No newline at end of file diff --git a/mysql/data/Makefile b/mysql/data/Makefile new file mode 100644 index 00000000000..fe37bfd7903 --- /dev/null +++ b/mysql/data/Makefile @@ -0,0 +1,28 @@ +# +# 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. +# +# General Makefile for Mysql database +# + +MYSQL=mysql +BASE=dolibarr + +dev: + $(MYSQL) $(BASE) < data_dev.sql diff --git a/mysql/data/data_dev.sql b/mysql/data/data_dev.sql index df1c9474b40..55f34431750 100644 --- a/mysql/data/data_dev.sql +++ b/mysql/data/data_dev.sql @@ -30,38 +30,67 @@ 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'); + +insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta,webcal_login) +values ('demo1','demo','demo1','demo1','demo',1,1,'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'); -- -- Societe -- delete from societe; -insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm) -values ('Lolix',now(),'75001','Paris','01 40 15 03 18','01 40 15 06 18',1,'LO'); +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); 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'); +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,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'); insert into societe (nom,datec,cp,ville,tel,fax, client, prefix_comm) -values ('Alpha',now(),'75001','Paris','01 40 15 03 18','01 40 15 06 18',1,'AL'); +values ('Alpha',now(),'75001','Loctudy','01 40 15 03 18','01 40 15 06 18',1,'AL'); 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); +values ('Turin','75013','Montpellier','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); + +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); + +insert into societe (nom,cp,ville,tel,fax,client) +values ('Pruitosa','75013','Lorient','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); + + -insert into societe (nom,cp,ville,tel,fax,fournisseur,prefix_comm) -values ('JPG','75013','Paris','01 55 55 03 18','01 55 55 55 55',1,'JP'); -- -- 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 (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'); -- -- -- Produits @@ -85,6 +114,20 @@ insert into llx_propal values (4,2,1,0,'PR-DO-010303','2001-03-03 13:44:04','200 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',''); -- -- @@ -94,7 +137,10 @@ insert into llx_propal values (7,1,1,0,'PR-LO-010307','2001-07-01 13:44:04','200 delete from llx_fichinter; insert into llx_fichinter (fk_soc, ref, datec, date_valid, datei, fk_user_author, fk_user_valid, fk_statut, duree, note) values (1, 'FI-LP-1','2001-12-05','2001-12-05','2001-12-05',1,1,1,4,'Mise à jour de la doc'); - +-- +-- Actions commerciales +-- +delete from actioncomm; insert into actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_contact) values ('2002-04-06',1,1,1,1); insert into actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_contact) @@ -111,3 +157,35 @@ insert into actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_contact) values ('2002-03-04',1,1,1,1); insert into actioncomm (datea, fk_action,fk_soc,fk_user_author,fk_contact) 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'); + +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'); + +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()); +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()); +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'); +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'); +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'); +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'); +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'); +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'); +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'); + + diff --git a/mysql/tables/Makefile b/mysql/tables/Makefile index 396c9d70153..f5c24ca8415 100644 --- a/mysql/tables/Makefile +++ b/mysql/tables/Makefile @@ -29,7 +29,6 @@ create: $(MYSQL) $(BASE) < c_effectif.sql $(MYSQL) $(BASE) < c_paiement.sql $(MYSQL) $(BASE) < c_pays.sql - $(MYSQL) $(BASE) < c_propalst.sql $(MYSQL) $(BASE) < c_stcomm.sql $(MYSQL) $(BASE) < c_typent.sql @@ -40,6 +39,7 @@ create: $(MYSQL) $(BASE) < llx_bookmark.sql $(MYSQL) $(BASE) < llx_fa_pr.sql $(MYSQL) $(BASE) < llx_facture.sql + $(MYSQL) $(BASE) < llx_facture_fourn.sql $(MYSQL) $(BASE) < llx_fichinter.sql $(MYSQL) $(BASE) < llx_paiement.sql $(MYSQL) $(BASE) < llx_pointmort.sql @@ -47,6 +47,7 @@ create: $(MYSQL) $(BASE) < llx_projet.sql $(MYSQL) $(BASE) < llx_propal.sql $(MYSQL) $(BASE) < llx_propaldet.sql + $(MYSQL) $(BASE) < llx_service.sql $(MYSQL) $(BASE) < llx_soc_recontact.sql $(MYSQL) $(BASE) < llx_user.sql $(MYSQL) $(BASE) < llx_ventes.sql diff --git a/mysql/tables/drop.sql b/mysql/tables/drop.sql index d077742a886..08d0912ed1e 100644 --- a/mysql/tables/drop.sql +++ b/mysql/tables/drop.sql @@ -81,6 +81,8 @@ drop table if exists llx_fa_pr; drop table if exists llx_facture; +drop table if exists llx_facture_fourn; + drop table if exists llx_fichinter; drop table if exists llx_paiement; @@ -95,6 +97,8 @@ drop table if exists llx_propal; drop table if exists llx_propaldet; +drop table if exists llx_service; + drop table if exists llx_soc_recontact; drop table if exists llx_user; @@ -103,34 +107,6 @@ drop table if exists llx_ventes; drop table if exists login ; -drop table if exists of_statutlog; - -drop table if exists offre; - -drop table if exists outil ; - -drop table if exists outiloffre; - -drop table if exists poste_resume ; - -drop table if exists typent_resume ; - -drop table if exists rech_cand; - -drop table if exists rech_soc; - -drop table if exists rescontact; - -drop table if exists rescontactinfo; - -drop table if exists resmessage; - -drop table if exists res_appoint; - -drop table if exists res_statutlog; - -drop table if exists secteur_resume ; - drop table if exists socappoint ; drop table if exists soccontact; diff --git a/mysql/tables/llx_facture_fourn.sql b/mysql/tables/llx_facture_fourn.sql new file mode 100644 index 00000000000..2af2a6c21ea --- /dev/null +++ b/mysql/tables/llx_facture_fourn.sql @@ -0,0 +1,43 @@ +-- =========================================================================== +-- 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. +-- +-- =========================================================================== + +create table llx_facture_fourn +( + rowid integer AUTO_INCREMENT PRIMARY KEY, + facnumber varchar(50) NOT NULL, + fk_soc integer NOT NULL, + datec datetime, -- date de creation de la facture + datef date, -- date de la facture + paye smallint default 0 NOT NULL, + amount real default 0 NOT NULL, + remise real default 0, + tva real default 0, + total real default 0, + fk_statut smallint default 0 NOT NULL, + + fk_user_author integer, -- createur de la propale + fk_user_valid integer, -- valideur de la propale + + note text, + + UNIQUE INDEX (facnumber) +); diff --git a/mysql/tables/llx_service.sql b/mysql/tables/llx_service.sql index 1ee3f423dba..7747da5c455 100644 --- a/mysql/tables/llx_service.sql +++ b/mysql/tables/llx_service.sql @@ -32,7 +32,7 @@ create table llx_service duration varchar(32), debut_comm datetime, fin_comm datetime, - fk_user_auhtor integer, + fk_user_author integer, fk_user_modif integer, UNIQUE INDEX(ref)