From 08cf1bceae21de6287df7767ffa962cf848fbe03 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Fri, 3 May 2002 23:01:45 +0000 Subject: [PATCH] . --- htdocs/comm/actioncomm.php3 | 18 +- htdocs/comm/bookmark.php3 | 8 +- htdocs/comm/index.php3 | 102 +++++---- htdocs/comm/pre.inc.php3 | 23 +-- htdocs/comm/propal.class.php3 | 17 +- htdocs/comm/propal.php3 | 144 +++++++------ htdocs/compta/casoc.php3 | 2 +- htdocs/compta/facture.php3 | 4 +- htdocs/compta/index.php3 | 2 +- htdocs/compta/pre.inc.php3 | 19 +- htdocs/fichinter/fiche.php3 | 286 ++++++++++++++++++++++++++ htdocs/fichinter/fichinter.class.php3 | 112 ++++++++++ htdocs/fichinter/index.php3 | 2 + htdocs/fichinter/pre.inc.php3 | 111 ++++++++++ htdocs/fichinter/tex-fichinter.pl | 251 ++++++++++++++++++++++ htdocs/index.php3 | 21 -- htdocs/lib/webcal.class.php3 | 4 +- htdocs/main.inc.php3 | 38 +++- htdocs/pre.inc.php3 | 59 +++--- htdocs/soc.php3 | 19 +- htdocs/societe.class.php3 | 33 ++- mysql/data/data_dev.sql | 8 +- mysql/tables/actioncomm.sql | 15 ++ mysql/tables/c_actioncomm.sql | 15 ++ mysql/tables/c_effectif.sql | 15 ++ mysql/tables/c_paiement.sql | 15 ++ mysql/tables/c_pays.sql | 15 ++ mysql/tables/c_propalst.sql | 15 ++ mysql/tables/c_stcomm.sql | 15 ++ mysql/tables/c_typent.sql | 15 ++ mysql/tables/drop.sql | 45 +--- mysql/tables/llx_bank.sql | 15 ++ mysql/tables/llx_bank_account.sql | 15 ++ mysql/tables/llx_bank_categ.sql | 15 ++ mysql/tables/llx_bank_class.sql | 15 ++ mysql/tables/llx_bookmark.sql | 15 ++ mysql/tables/llx_fa_pr.sql | 15 ++ mysql/tables/llx_facturedet.sql | 15 ++ mysql/tables/llx_paiement.sql | 15 ++ mysql/tables/llx_pointmort.sql | 15 ++ mysql/tables/llx_product.sql | 3 - mysql/tables/llx_propaldet.sql | 17 ++ mysql/tables/llx_service.sql | 3 +- mysql/tables/llx_soc_recontact.sql | 16 ++ mysql/tables/llx_ventes.sql | 17 ++ mysql/tables/soc_events.sql | 17 ++ mysql/tables/socpeople.sql | 14 ++ mysql/tables/socstatutlog.sql | 17 ++ 48 files changed, 1375 insertions(+), 312 deletions(-) create mode 100644 htdocs/fichinter/fiche.php3 create mode 100644 htdocs/fichinter/fichinter.class.php3 create mode 100644 htdocs/fichinter/pre.inc.php3 create mode 100755 htdocs/fichinter/tex-fichinter.pl diff --git a/htdocs/comm/actioncomm.php3 b/htdocs/comm/actioncomm.php3 index 3ec46d0ecf7..62145d8c495 100644 --- a/htdocs/comm/actioncomm.php3 +++ b/htdocs/comm/actioncomm.php3 @@ -40,10 +40,6 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -print "< Prev\n| "; -print " Next >\n"; - - $bc1="bgcolor=\"#90c090\""; $bc2="bgcolor=\"#b0e0b0\""; /* @@ -86,14 +82,16 @@ if ($action=='create' && $actionid && $contactid) { print ''; print ''; - print ''; - print ''; - print ''; - print ''; + print ''; + print ''; + print ''; print ''; - print ''; - print ''; + + print ''; + + print ''; print '
Action'.$caction->libelle.'
Société'.$societe->nom.'Contact'.$contact->fullname.'
Auteur'.$user->fullname.'
Action'.$caction->libelle.'
Société'.$societe->nom.'
Contact'.$contact->fullname.'
Date'.strftime('%d %B %Y %H:%M',time()).'
Commentaire'; + print '
Commentaire'; print '
A recontacter le'.$contact->fullname.'
'; $limit = 10; diff --git a/htdocs/comm/bookmark.php3 b/htdocs/comm/bookmark.php3 index 015b8d7a09e..0d75b1b451c 100644 --- a/htdocs/comm/bookmark.php3 +++ b/htdocs/comm/bookmark.php3 @@ -30,9 +30,7 @@ if ($sortfield == "") { $sortfield="idp"; } -$cr["t"] = "Cab. Recrut."; -$cr["f"] = "-"; -$cr[""] = "????"; + $yn["t"] = "oui"; $yn["f"] = "non"; @@ -57,9 +55,9 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -print "Bookmark

"; +print '

Bookmark
'; -$sql = "SELECT s.idp, s.nom, cabrecrut,".$db->pdate("b.dateb")." as dateb, s.c_nom,s.c_prenom, s.cjn,st.libelle as stcomm, b.rowid as bid, b.author"; +$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, st.libelle as stcomm, b.rowid as bid, b.author"; $sql .= " FROM societe as s, c_stcomm as st, llx_bookmark as b"; $sql .= " WHERE b.fk_soc = s.idp AND s.fk_stcomm = st.id AND s.datea is not null"; diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index 7dc6a469d63..2a82b2e6359 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -91,22 +91,7 @@ $offset = $limit * $page ; $pageprev = $page - 1; $pagenext = $page + 1; -print "
"; -print "<- Prev\n| "; -print "*\n| "; -for ($i = 65 ; $i < 91; $i++) { - print ""; - - if ($begin == chr($i) ) { - print "->" . chr($i) . "<-" ; - } else { - print chr($i) ; - } - print " | "; -} -print " Next ->\n"; -print "

"; /* * Recherche * @@ -130,6 +115,7 @@ if ($mode == 'search') { /* + * * Mode fiche * * @@ -158,52 +144,13 @@ if ($socid > 0) { if ($errmesg) { print "$errmesg
"; } - 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"; /* * */ print "\n"; - print ""; + print ""; print ""; print ""; print ""; @@ -610,6 +557,50 @@ if ($socid > 0) { /* * */ + + 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"; + + + } } else { print $db->error() . "
" . $sql; @@ -621,6 +612,7 @@ if ($socid > 0) { * * */ + print '
Liste des clients
'; $bc[1]="bgcolor=\"#90c090\""; $bc[0]="bgcolor=\"#b0e0b0\""; diff --git a/htdocs/comm/pre.inc.php3 b/htdocs/comm/pre.inc.php3 index 81fb45d4c57..b3851eb1d56 100644 --- a/htdocs/comm/pre.inc.php3 +++ b/htdocs/comm/pre.inc.php3 @@ -22,22 +22,15 @@ require("../main.inc.php3"); function llxHeader($head = "", $urlp = "") { - global $PREFIX, $user, $conf; + global $user, $conf; - print "\n$head\n\n"; - ?> - - \n"; - print ""; - - print ""; - print ""; - print ""; - print ""; - print ""; - print "
N° $objsoc->idp - $objsoc->nom - [$objsoc->stcomm]
Fiche client : $objsoc->nom
idp&action=add\">[Bookmark]idp&action=create\">[Projet]idp&action=create\">[Propal]
" . $GLOBALS["MAIN_TITLE"] . "TechniqueCommercialComptaStats
\n"; + /* + * + * + */ + top_menu($head); + print ""; print ""; print "'; + print ''; + + print ''; + print ''; + print '
"; @@ -50,7 +43,7 @@ function llxHeader($head = "", $urlp = "") { print "
"; - print "
Sociétés
\n"; + print "
Clients
\n"; print "Nouvelle société
\n"; print "Contacts

\n"; print "A Recontacter
\n"; diff --git a/htdocs/comm/propal.class.php3 b/htdocs/comm/propal.class.php3 index 23a3309f1ad..5d51aa6007f 100644 --- a/htdocs/comm/propal.class.php3 +++ b/htdocs/comm/propal.class.php3 @@ -125,23 +125,24 @@ class Propal { * * */ - Function fetch($db, $rowid) { + Function fetch($rowid) { - $sql = "SELECT ref,price,".$db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; + $sql = "SELECT ref,price,remise,".$this->db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; - 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; + $this->remise = $obj->remise; - $db->free(); + $this->db->free(); } } else { - print $db->error(); + print $this->db->error(); } } /* @@ -151,7 +152,7 @@ class Propal { */ Function valid($userid) { $sql = "UPDATE llx_propal SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid"; - $sql .= " WHERE rowid = $this->id;"; + $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; if ($this->db->query($sql) ) { return 1; diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index afc1c544245..b353c147960 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -34,15 +34,6 @@ require("./actioncomm.class.php3"); llxHeader(); -print ""; -print ""; -if ($socidp) { -print ""; -} -print ""; -print ""; -print ""; -print "
Propositions commerciales[Nouvelle Propal]ListeCA PrévisionnelPropal Signées
"; $bc[0]="bgcolor=\"#90c090\""; $bc[1]="bgcolor=\"#b0e0b0\""; @@ -91,22 +82,26 @@ if ($action == 'setstatut') { $propalid = 0; $brouillon = 1; } - +/* + * + * Mode fiche + * + * + */ if ($propalid) { - if ($valid == 1) { - $sql = "SELECT p.fk_soc, p.fk_projet,p.price, p.ref,".$db->pdate("p.datep")." as dp"; - $sql .= " FROM llx_propal as p WHERE p.rowid = $propalid"; - - if ( $db->query($sql) ) { - $obj = $db->fetch_object( 0 ); + $propal = new Propal($db); + $propal->fetch($propalid); - $propal = new Propal($db); - $propal->id = $propalid; - $propal->valid($user->id); - } else { - print $db->error(); - } + + if ($valid == 1) { + $propal->valid($user->id); } + /* + * + */ + print ""; + print ""; + print "
Proposition commerciale : $propal->ref
"; /* * */ @@ -123,61 +118,52 @@ if ($propalid) { $color1 = "#e0e0e0"; - print ""; + print "
"; - print ""; - print ""; + print ""; + print ""; // + + print ''; + if ($obj->fk_projet) { $projet = new Project(); $projet->fetch($db,$obj->fk_projet); - print ''; } - print ""; + print ""; /* * */ - print ""; - print ""; - print ""; - /* - * - */ - print "\n"; - print ""; - print ""; + print ""; + /* + * + */ + + print ""; + + /* + * + */ + + $totalht = $propal->price - $propal->remise ; + + print ""; /* * */ print ''; + print $author->fullname.''; - $totalht = $obj->price - $obj->remise ; - - print ""; /* * */ - print ""; - - print ""; - print ""; - - print ""; - print ""; - print ""; - print ""; - /* - * - */ - print ""; + print ""; if ($obj->statut == 0) { print ""; } elseif ($obj->statut == 1) { @@ -462,24 +448,32 @@ if ($propalid) { print "Num rows = " . $db->num_rows(); print "

$sql"; } + /* + * Voir le suivi des actions + * + * + * + */ + if ($suivi) { + $validor = new User($db, $obj->fk_user_valid); + $validor->fetch(''); + $cloturor = new User($db, $obj->fk_user_cloture); + $cloturor->fetch(''); + + print '

Sociétéidp\">$obj->nomidp\">Autres propalesNote :
". nl2br($obj->note)."
Sociétéidp\">$obj->nomidp\">Autres propalesNote :
". nl2br($obj->note)."
date'.strftime("%A %d %B %Y",$obj->dp).'
Projet'; + print '
Projet'; print ''; print $projet->title.'
Destinataire$obj->firstname $obj->name <$obj->email>
Destinataire$obj->firstname $obj->name <$obj->email>
Numéro$obj->refMontant HT".price($obj->price)."euros
date".strftime("%A %d %B %Y",$obj->dp)."Remise".price($obj->remise)."euros
Montant HT".price($obj->price)." euros
Remise".price($obj->remise)." euros
Total HT".price($totalht)." euros
Auteur'; $author = new User($db, $obj->fk_user_author); $author->fetch(''); - print $author->fullname.'
Total HT".price($totalht)."euros "; - print "soit ".francs($totalht)." francs
 TVA".price($obj->tva)."euros
 Total TTC".price($obj->total)."euros "; - print "soit ".francs($obj->total)." francs
Statut :$obj->lst
Statut :$obj->lst[Valider]
'; + print ''; + print ''; + print ''; - $validor = new User($db, $obj->fk_user_valid); - $validor->fetch(''); - $cloturor = new User($db, $obj->fk_user_cloture); - $cloturor->fetch(''); - - print '
 NomDate
Création'.$author->fullname.''.$obj->datec.'
'; - print ''; - print ''; - print ''; - - print ''; - print ''; - - print ''; - print ''; - - print '
 NomDate
Création'.$author->fullname.''.$obj->datec.'
Validation'.$validor->fullname.' '.$obj->date_valid.' 
Cloture'.$cloturor->fullname.' '.$obj->date_cloture.' 
'; + print '
Validation'.$validor->fullname.' '.$obj->date_valid.' 
Cloture'.$cloturor->fullname.' '.$obj->date_cloture.' 
'; + } else { + print '

Voir le suivi des actions '; + } } else { print $db->error(); @@ -496,12 +490,14 @@ if ($propalid) { /* * * - * Liste des propales + * Mode Liste des propales * * */ + print ""; + print ""; + print "
Propositions commerciales
"; - print "

"; $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"; diff --git a/htdocs/compta/casoc.php3 b/htdocs/compta/casoc.php3 index cc80af60e46..aeb35653289 100644 --- a/htdocs/compta/casoc.php3 +++ b/htdocs/compta/casoc.php3 @@ -22,7 +22,7 @@ require("./pre.inc.php3"); llxHeader(); -print "Chiffres d'affaire par société"; +print '

Chiffre d\'affaire par société
'; $bc[0]="bgcolor=\"#90c090\""; $bc[1]="bgcolor=\"#b0e0b0\""; diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 36984d82a69..d8aa79fed50 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -77,7 +77,7 @@ if ($facid > 0) { print ""; print ""; - print ""; + print ''; print "\n"; print ""; print "
Facture $facid [reload]
Facture : '.$obj->facnumber.'
socidp\">Autres factures de $obj->socnom
"; @@ -86,7 +86,7 @@ if ($facid > 0) { */ print ""; print ""; - print ""; + print "\n"; print ""; print ""; diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 98c47da676d..06870c7b75e 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -22,7 +22,7 @@ require("./pre.inc.php3"); llxHeader(); -print "Factures émises"; +print '
Factures émises
'; $bc[0]="bgcolor=\"#90c090\""; $bc[1]="bgcolor=\"#b0e0b0\""; diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 45d1a3e4988..0ed65c11afc 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -24,19 +24,14 @@ require("../main.inc.php3"); function llxHeader($head = "") { global $PREFIX, $user, $conf; - print "\n$head\n\n"; - ?> - - \n"; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "
Sociétésocidp\">$obj->socnom
Numéro$obj->facnumber
date".strftime("%A %d %B %Y",$obj->df)."
Auteur$obj->author
Statut$obj->statut
" . $GLOBALS["MAIN_TITLE"] . "TechniqueCommercialComptaStats
\n"; + /* + * + * + */ + top_menu($head); + + print ""; print ""; - print ""; - - print ""; - - print ''; - } else { - print 'Commercial'; - } - - - - print ""; - print ""; - print "
"; diff --git a/htdocs/fichinter/fiche.php3 b/htdocs/fichinter/fiche.php3 new file mode 100644 index 00000000000..cde5aa8afeb --- /dev/null +++ b/htdocs/fichinter/fiche.php3 @@ -0,0 +1,286 @@ + + * + * $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("./fichinter.class.php3"); + +$db = new Db(); + +$sql = "SELECT s.nom, s.idp, s.prefix_comm FROM societe as s WHERE s.idp = $socidp;"; + +$result = $db->query($sql); +if ($result) { + if ( $db->num_rows() ) { + $objsoc = $db->fetch_object(0); + } + $db->free(); +} +$bc[0]="bgcolor=\"#90c090\""; +$bc[1]="bgcolor=\"#b0e0b0\""; + +llxHeader(); +/* + * Traitements des actions + * + * + */ + +if ($action == 'valid') { + $fichinter = new Fichinter($db); + $fichinter->id = $id; + $fichinter->valid($user->id); +} + +if ($action == 'add') { + $fichinter = new Fichinter($db); + + $fichinter->date = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear)); + + $fichinter->projetidp = $projetidp; + + $fichinter->author = $user->id; + $fichinter->note = $note; + + $fichinter->ref = $ref; + + $id = $fichinter->create(); + + /* + * + * Generation + * + */ + if ($id) { + print "
Génération du PDF

"; + + //$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo"; + + $gljroot = "/home/www/dolibarr/dolibarr/htdocs"; + + $command = "export DBI_DSN=\"dbi:mysql:dbname=".$conf->db->name.":host=localhost\" "; + $command .= " ; ./propal-tex.pl --propal=".$id ." --pdf --output=".$conf->propal->outputdir; + $command .= " --templates=".$conf->propal->templatesdir; + + $output = system($command); + print "

command : $command
"; + print $output; + } else { + print $db->error(); + } +} +/* + * Mode creation + * Creation d'une nouvelle propale + * + */ +if ($action == 'create') { + if ( $objsoc->prefix_comm ) { + + $numpr = "FI-" . $objsoc->prefix_comm . "-" . strftime("%y%m%d", time()); + + $sql = "SELECT count(*) FROM llx_propal WHERE ref like '$numpr%'"; + + if ( $db->query($sql) ) { + $num = $db->result(0, 0); + $db->free(); + if ($num > 0) { + $numpr .= "." . ($num + 1); + } + } + + 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 ''; + print ""; + + print ""; + + print "\n"; + + /* + * + * Projet associé + * + */ + print ''; + + + print ''; + print "'; + + print ''; + print "
Date"; + $cday = date("d", time()); + print ""; + $cmonth = date("n", time()); + print ""; + + print "
Numéro
Projet'; + if ($numprojet==0) { + print 'Cette société n\'a pas de projet. '; + print 'Créer un projet'; + } + print '
Commentaires"; + print '
'; + print ""; + print '
"; + + print "
"; + + print "
"; + } else { + print "Vous devez d'abord associer un prefixe commercial a cette societe" ; + } +} +/* + * Mode Fiche + * Affichage de la fiche d'intervention + * + * + */ + +if ($id) { + + $fichinter = new Fichinter($db); + $fichinter->fetch($id); + + print ''; + print ''; + + print ''; + + print ''; + + + print ''; + print "'; + + if ($fichinter->statut == 0) { + + print ''; + + } + + print "
Date'.strftime("%A %d %B %Y",$fichinter->date).'
Numéro'.$fichinter->ref.'
Projet 
Commentaires"; + print nl2br($fichinter->note); + print '
ActionValider
"; + +} + +/* + * + * Liste des fiches + * + */ +$sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut"; +$sql .= " FROM societe as s, llx_fichinter as f "; +$sql .= " WHERE f.fk_soc = s.idp "; +$sql .= " ORDER BY f.datei DESC ;"; + +if ( $db->query($sql) ) { + $num = $db->num_rows(); + $i = 0; + print "

"; + 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 "\n"; + print "\n"; + + print "\n"; + + $i++; + } + + print "
NumSocieteDateStatut
fichid\">$objp->refidp\">$objp->nom".strftime("%d %B %Y",$objp->dp)."$objp->fk_statut
"; + $db->free(); +} else { + print $db->error(); + print "

$sql"; +} +$db->close(); +llxFooter(); +?> diff --git a/htdocs/fichinter/fichinter.class.php3 b/htdocs/fichinter/fichinter.class.php3 new file mode 100644 index 00000000000..b55c50a87cb --- /dev/null +++ b/htdocs/fichinter/fichinter.class.php3 @@ -0,0 +1,112 @@ + + * + * $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 Fichinter { + var $id; + var $db; + var $socidp; + var $author; + var $ref; + var $date; + var $note; + + + Function Fichinter($DB, $soc_idp="") { + $this->db = $DB ; + $this->socidp = $soc_idp; + $this->products = array(); + } + + Function add_product($idproduct) { + if ($idproduct > 0) { + $i = sizeof($this->products); + $this->products[$i] = $idproduct; + } + } + /* + * + * + * + */ + Function create() { + /* + * Insertion dans la base + */ + $sql = "INSERT INTO llx_fichinter (fk_soc, datei, datec, ref, fk_user_author, note) "; + $sql .= " VALUES ($this->socidp, $this->date, now(), '$this->ref', $this->author, '$this->note')"; + $sqlok = 0; + + if (! $this->db->query($sql) ) { + + print $this->db->error() . '
'.$sql; + } + return 1; + } + /* + * + * + * + */ + Function fetch($rowid) { + + $sql = "SELECT ref,note,fk_statut,".$this->db->pdate(datei)."as di FROM llx_fichinter WHERE rowid=$rowid;"; + + if ($this->db->query($sql) ) { + if ($this->db->num_rows()) { + $obj = $this->db->fetch_object(0); + + $this->id = $rowid; + $this->date = $obj->di; + $this->ref = $obj->ref; + $this->note = $obj->note; + $this->statut = $obj->fk_statut; + + $this->db->free(); + } + } else { + print $this->db->error(); + } + } + /* + * + * + * + */ + Function valid($userid) { + $sql = "UPDATE llx_fichinter SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid"; + $sql .= " WHERE rowid = $this->id AND fk_statut = 0 ;"; + + if ($this->db->query($sql) ) { + return 1; + } else { + print $this->db->error() . ' in ' . $sql; + } + } + /* + * + * + * + */ + +} +?> + diff --git a/htdocs/fichinter/index.php3 b/htdocs/fichinter/index.php3 index 8c8e82ad8b1..75498fe010d 100644 --- a/htdocs/fichinter/index.php3 +++ b/htdocs/fichinter/index.php3 @@ -36,6 +36,8 @@ $bc[1]="bgcolor=\"#b0e0b0\""; $bc2[0]="bgcolor=\"#c9f000\""; $bc2[1]="bgcolor=\"#b9e000\""; +print '

Liste des fiches d\'intervention

'; + $sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut"; $sql .= " FROM societe as s, llx_fichinter as f "; $sql .= " WHERE f.fk_soc = s.idp "; diff --git a/htdocs/fichinter/pre.inc.php3 b/htdocs/fichinter/pre.inc.php3 new file mode 100644 index 00000000000..34e51c95ac8 --- /dev/null +++ b/htdocs/fichinter/pre.inc.php3 @@ -0,0 +1,111 @@ + + * + * $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 "'; diff --git a/htdocs/lib/webcal.class.php3 b/htdocs/lib/webcal.class.php3 index cdb5ed3259e..26d7f2a8e24 100644 --- a/htdocs/lib/webcal.class.php3 +++ b/htdocs/lib/webcal.class.php3 @@ -27,7 +27,7 @@ class Webcal { } - Function add($user, $texte, $desc) { + Function add($user, $date, $texte, $desc) { $db = new Db(); @@ -35,7 +35,7 @@ class Webcal { $cal_id = $id; $cal_create_by = $user; - $cal_date = strftime('%Y%m%d'); + $cal_date = strftime('%Y%m%d', $date); $cal_time = -1; $cal_mod_date = strftime('%Y%m%d', time()); $cal_mod_time = strftime('%H%M', time()); diff --git a/htdocs/main.inc.php3 b/htdocs/main.inc.php3 index e88f3a31d57..4ef2ba0f852 100644 --- a/htdocs/main.inc.php3 +++ b/htdocs/main.inc.php3 @@ -28,9 +28,6 @@ require ($GLOBALS["DOCUMENT_ROOT"]."/lib/functions.inc.php3"); require ($GLOBALS["DOCUMENT_ROOT"]."/user.class.php3"); require ($GLOBALS["DOCUMENT_ROOT"]."/lib/product.class.php3"); - - - $conf = new Conf(); @@ -50,5 +47,40 @@ function llxFooter($foot='') { print ""; } +function top_menu($head) { + global $user, $conf; + + print ""; + print $head; + print "\n"; + print ''; + print "\n"; + + print ''; + + + print "
"; + + print ""; + print ""; + print ""; + + + print ''; + + /* + * + */ + print '"; + /* + * + */ + print ""; + /* + * + */ + + /* + * + */ + print ""; + + print "
"; + print "
" . $conf->db->name . " - " . $user->code ."
"; + print "Accueil
"; + print "Bookmark"; + print "
"; + + print "
Clients
\n"; + print "Nouvelle société
\n"; + print "Contacts

\n"; + print "
'; + print "
Fiches d'intervention
\n"; + 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/fichinter/tex-fichinter.pl b/htdocs/fichinter/tex-fichinter.pl new file mode 100755 index 00000000000..3f8946f1e79 --- /dev/null +++ b/htdocs/fichinter/tex-fichinter.pl @@ -0,0 +1,251 @@ +#!/usr/bin/perl + +# Copyright (C) 2000-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. +# or see http://www.gnu.org/ + +use strict; +use POSIX; +use DBI; +use Sys::Syslog qw(:DEFAULT setlogsock); +use Getopt::Long; + Getopt::Long::Configure("bundling"); + +Sys::Syslog::setlogsock('unix'); +Sys::Syslog::openlog($0, 'pid', 'daemon'); + + + +my($debug, $verbose, $bgcolor, $idpropal, $do_fax, $do_pdf, $do_ps, + $templatesdir, $outputdir) = (0,0); + +exit unless GetOptions("propal=i" =>\$idpropal, + "fax" =>\$do_fax, + "templates=s" =>\$templatesdir, + "output=s" =>\$outputdir, + "ps" =>\$do_ps, + "pdf" =>\$do_pdf, + "v+" =>\$verbose); + +Sys::Syslog::syslog('info', 'Start propale '.$idpropal); +Sys::Syslog::syslog('info', '['.$idpropal.'] Start'); +my $DEBUG = 1; + +my $mdir = "$outputdir"; +unless (-d $mdir) { + mkdir($mdir,0777) || die "cannot mkdir " . $mdir . ": $!"; +} +print "Output in : $outputdir\n" if $verbose > 1; +# +# +# Fetch datas +# +Sys::Syslog::syslog('info', '['.$idpropal.'] Fetch data'); +my ($numpropale, $societe, $date, $ville, $destinataire, $price, $remise, $tva, $total); + +my $dbh = DBI->connect("","","") || die $DBI::errstr ; + +my $sql = "SELECT p.rowid, p.ref, s.nom, s.cp, s.ville, unix_timestamp(p.datep) as dp, c.name, c.firstname"; +$sql .= " ,p.price, p.remise, p.tva, p.total"; +$sql .= " FROM llx_propal as p, societe as s , socpeople as c"; +$sql .= " WHERE s.idp = p.fk_soc AND p.fk_soc_contact = c.idp AND p.rowid = $idpropal"; + +my $sth = $dbh->prepare("$sql") || die $dbh->errstr ; +if ( $sth->execute ) { + + if (! $sth->rows ) { + $sth->finish; + $dbh->disconnect if $dbh; + print "\n" . $dbh->errstr; + print "\n$sql\n"; + exit ; + } + + while (my $hsr = $sth->fetchrow_hashref ) { + $numpropale = $hsr->{"ref"}; + $societe = $hsr->{"nom"}; + $destinataire = $hsr->{"firstname"} . " " . $hsr->{"name"}; + $date = $hsr->{"dp"}; + $ville = $hsr->{"cp"} . " " . $hsr->{"ville"}; + + $price = $hsr->{"price"}; + $remise = $hsr->{"remise"}; + $tva = $hsr->{"tva"}; + $total = $hsr->{"total"}; + } + $sth->finish; +} else { + die $dbh->errstr; +} + +$outputdir .= "/".$numpropale; +Sys::Syslog::syslog('info', '['.$idpropal.'] Outputdir : ' . $outputdir); +unless (-d $outputdir) { + print "Make dir : $outputdir\n" if $verbose > 1; + mkdir($outputdir,0777) || die "cannot mkdir " . $outputdir . ": $!"; +} + +print "Output in : $outputdir\n" if $verbose > 1; + +my $adresse1 = ""; +my $adresse2 = ""; + +# +# +# +my $headerfilename = "$templatesdir/header.tex"; +my $footerfilename = "$templatesdir/footer.tex"; +my $bodyfilename = "$templatesdir/body.tex"; + +unless (open (FC, ">$outputdir/$numpropale.tex") ) { + print "can't write in $outputdir/$numpropale.tex: $!"; + Sys::Syslog::syslog('info', '['.$idpropal.'] ' . $outputdir/$numpropale.'.tex opened'); + Sys::Syslog::syslog('info', '['.$idpropal.'] ' . $!); +} +# +# Header +# +open (FH, "<$headerfilename") || die "can't open $headerfilename: $!"; +while () { + s|\#SOCIETE\#|$societe|g; + s|\#DESTINATAIRE\#|$destinataire|g; + s|\#ADRESSE1\#|$adresse1|g; + s|\#ADRESSE2\#|$adresse2|g; + s|\#VILLE\#|$ville|g; + + s|\#NUMPROPALE\#|$numpropale|g; + s|\#DATE\#|$date|g; + + print FC $_; +} +close (FH); +# +# Body +# +my $totalht = 0; +my ($qty, $ref, $pu, $pricep, $label); +# +my $sql = "SELECT p.price, pr.ref, pr.label, pr.description"; +$sql .= " FROM llx_propaldet as p, llx_product as pr WHERE p.fk_propal = $idpropal AND p.fk_product = pr.rowid"; + + +$sth = $dbh->prepare("$sql") || die $dbh->errstr ; +if ( $sth->execute ) { + while (my $hsr = $sth->fetchrow_hashref ) { + $label = $hsr->{"label"}; + $ref = $hsr->{"ref"}; + $societe = $hsr->{"nom"}; + $qty = 1 ; + + $pu = sprintf("%.2f", $hsr->{"price"}); + $pricep = sprintf("%.2f", $hsr->{"price"}); + + open (FH, "<$bodyfilename") || die "can't open $bodyfilename: $!"; + while () { + s|\#LABEL\#|$hsr->{"description"}|g; + s|\#QTY\#|$qty|g; + s|\#REF\#|$ref|g; + s|\#PU\#|$pu|g; + s|\#PRICE\#|$pricep|g; + print FC $_; + } + close (FH); + } + + $sth->finish; +} +# +# +# +$totalht = $price - $remise ; +my $francsht = $totalht * 6.55957; +my $francsttc = $total * 6.55957; +# +# Footer +# +$price = sprintf("%.2f", $price); +$remise = sprintf("%.2f", $remise); +$totalht = sprintf("%.2f", $totalht); +$tva = sprintf("%.2f", $tva); +$total = sprintf("%.2f", $total); + +$francsttc = sprintf("%.2f", $francsttc); +$francsht = sprintf("%.2f", $francsht); + + +$date = strftime("%d/%m/%Y", localtime($date)); +# +open (FF, "<$footerfilename") || die "can't open $footerfilename: $!"; +while () { + s|\#SOCIETE\#|$societe|g; + + s|\#DATE\#|$date|g; + s|\#TOTALHT\#|$totalht|g; + + s|\#FRANCSHT\#|$francsht|g; + + s|\#REMISEHT\#|$remise|g; + s|\#TVA\#|$tva|g; + s|\#TOTALTTC\#|$total|g; + + s|\#FRANCSTTC\#|$francsttc|g; + + print FC $_; +} +close (FF); + + +close (FC); + +$dbh->disconnect if $dbh; +# +# +# +print "Generate dvi file
\n"; +system("cd $outputdir/ ; latex $numpropale.tex "); +# +# +# +if ($do_pdf) { + print "

Generate pdf file
\n"; + system("cd $outputdir/ ; pdflatex $numpropale.tex > /dev/null"); +} +# +# +# +if ($do_ps) { + 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"; + system("gs -q -sDEVICE=tiffg3 -dNOPAUSE -sOutputFile=$outputdir/$numpropale.%03d $outputdir/$numpropale.ps prenom . ' ' . $user->nom .' ['.$user->code.']'; -print "

"; - - function valeur($sql) { global $db; @@ -102,21 +96,6 @@ if ($db->ok) { print '
'; - print 'Societes'; - print '
'; - print ''; - print ''; - print ' '; - print ""; - print "
"; - - print 'Contacts'; - print '
'; - print ''; - print ''; - print " "; - print ""; - print '
'; print '
\n"; + + print ""; + + print ''; + + print ''; + } else { + print 'Commercial'; + } + + print ''; + print ''; + print ''; + print ''; + + print '
'; + + + +} ?> diff --git a/htdocs/pre.inc.php3 b/htdocs/pre.inc.php3 index 131a2692e35..a38010c3114 100644 --- a/htdocs/pre.inc.php3 +++ b/htdocs/pre.inc.php3 @@ -23,31 +23,14 @@ require ("./main.inc.php3"); function llxHeader($head = "") { - global $PREFIX, $user, $conf; + global $user, $conf; - print "\n$head\n\n"; - ?> - - \n"; - print "

" . $GLOBALS["MAIN_TITLE"] . "-'; - if ($user->comm > 0) { - print 'CommercialCompta-
\n"; + /* + * + * + */ + top_menu($head); + print ""; print "'; print "'; print "'; + if ($conf->fichinter) { + + print "'; + + } + print "'; + print ''; print "
"; @@ -64,13 +47,21 @@ function llxHeader($head = "") { print '
"; - print "
Propal
\n"; + print "
Propales
\n"; print '
"; print "
Factures
\n"; print '
"; + print "
Fiches d'intervention
\n"; + print '
"; print "
Produits
\n"; @@ -82,6 +73,24 @@ function llxHeader($head = "") { print ''; print '
'; + + print 'Societes'; + print '
'; + print ''; + print ''; + print ' '; + print ""; + print "
"; + + print 'Contacts'; + print '
'; + print ''; + print ''; + print " "; + print ""; + print '
'; + print '
"; print "Configuration
"; diff --git a/htdocs/soc.php3 b/htdocs/soc.php3 index 99761680c78..f95e521a346 100644 --- a/htdocs/soc.php3 +++ b/htdocs/soc.php3 @@ -53,6 +53,11 @@ if ($action == 'update') { $soc = new Societe($db); $soc->nom = $nom; + + $soc->adresse = $adresse; + $soc->cp = $cp; + $soc->ville = $ville; + $soc->tel = $tel; $soc->fax = $fax; $soc->url = $url; @@ -66,11 +71,11 @@ if ($action == 'update') { */ if ($action == 'create') { - print 'Nouvelle societe
'; + print '
Nouveau client

'; print '
'; print ''; - print ''; + print '
'; print ''; print ''; print ''; - print ''; + print ''; print '
Nom
Adresse
CP '; @@ -90,11 +95,11 @@ if ($action == 'create') { print '
'; print '
'; } elseif ($action == 'edit') { - print 'Edition de la société
'; + print '
Edition de la société

'; $soc = new Societe($db); $soc->id = $socid; @@ -103,7 +108,7 @@ if ($action == 'create') { print '
'; print ''; - print ''; + print '
'; print ''; print ''; print ''; print ''; - print ''; + print ''; print ''; @@ -140,7 +145,7 @@ if ($action == 'create') { print ''; print ''; - print ''; + print ''; print ''; diff --git a/htdocs/societe.class.php3 b/htdocs/societe.class.php3 index 09776564068..ad90a43d956 100644 --- a/htdocs/societe.class.php3 +++ b/htdocs/societe.class.php3 @@ -27,10 +27,13 @@ class Societe { var $id; var $nom; - + var $adresse; + var $cp; + var $ville; var $tel; var $fax; var $url; + var $siren; var $client; @@ -65,6 +68,7 @@ class Societe { $sql = "UPDATE societe "; $sql .= " SET nom = '" . trim($this->nom) ."'"; + $sql .= ",address = '" . trim($this->adresse) ."'"; $sql .= ",cp = '" . trim($this->cp) ."'"; $sql .= ",ville = '" . trim($this->ville) ."'"; $sql .= ",tel = '" . trim($this->tel) ."'"; @@ -82,20 +86,18 @@ class Societe { */ Function fetch() { - $sql = "SELECT s.idp, s.nom,".$this->db->pdate("s.datec")." as dc,".$this->db->pdate("s.datem")." as dm,".$this->db->pdate("s.datea")." as da, s.intern, s.cjn, "; + $sql = "SELECT s.idp, s.nom, s.address,".$this->db->pdate("s.datec")." as dc,"; - $sql .= " 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"; + $sql .= " s.tel, s.fax, s.url,s.cp,s.ville, s.note, s.siren"; - $sql .= " FROM societe as s, c_stcomm as st "; - $sql .= " WHERE s.fk_stcomm = st.id"; - - $sql .= " AND s.idp = ".$this->id; + $sql .= " FROM societe as s"; + $sql .= " WHERE s.idp = ".$this->id; $result = $this->db->query($sql); if ($result) { if ($this->db->num_rows()) { - $obj = $this->db->fetch_object($result , 0); + $obj = $this->db->fetch_object(0); $this->nom = $obj->nom; @@ -103,23 +105,16 @@ class Societe { $this->fax = $obj->fax; $this->url = $obj->url; + $this->adresse = $obj->address; $this->cp = $obj->cp; $this->ville = $obj->ville; - - $this->cjn = $obj->cjn; - - $this->viewed = $obj->viewed; - - $this->stcomm = $obj->stcomm; - - $this->c_nom = $obj->c_nom; - $this->c_prenom = $obj->c_prenom; - $this->c_tel = $obj->c_tel; - $this->c_fax = $obj->c_fax; + $this->siren = $obj->siren; } $this->db->free(); + } else { + print $this->db->error(); } } /* diff --git a/mysql/data/data_dev.sql b/mysql/data/data_dev.sql index 5ee4c9f9485..1e6bd57a32f 100644 --- a/mysql/data/data_dev.sql +++ b/mysql/data/data_dev.sql @@ -30,14 +30,14 @@ insert into llx_user (name,firstname,code,login,pass,module_comm,module_compta) values ('demo','demo','demo','demo','demo',1,1); delete from societe; -insert into societe (nom,datec,cp,ville,tel,fax, client) -values ('Lolix',now(),'75001','Paris','01 40 15 03 18','01 40 15 06 18',1); +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,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,fournisseur) -values ('JPG','75013','Paris','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'); delete from llx_product; insert into llx_product (ref, label, description, price, duration) diff --git a/mysql/tables/actioncomm.sql b/mysql/tables/actioncomm.sql index 5af18b25506..c61b7e942d5 100644 --- a/mysql/tables/actioncomm.sql +++ b/mysql/tables/actioncomm.sql @@ -4,6 +4,21 @@ -- $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 -- -- ======================================================================== diff --git a/mysql/tables/c_actioncomm.sql b/mysql/tables/c_actioncomm.sql index 462f32b9747..2dec65f9e3c 100644 --- a/mysql/tables/c_actioncomm.sql +++ b/mysql/tables/c_actioncomm.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_actioncomm diff --git a/mysql/tables/c_effectif.sql b/mysql/tables/c_effectif.sql index c34a0c2c80a..b97558f8602 100644 --- a/mysql/tables/c_effectif.sql +++ b/mysql/tables/c_effectif.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_effectif diff --git a/mysql/tables/c_paiement.sql b/mysql/tables/c_paiement.sql index 05725badb74..3fa1482f976 100644 --- a/mysql/tables/c_paiement.sql +++ b/mysql/tables/c_paiement.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_paiement ( diff --git a/mysql/tables/c_pays.sql b/mysql/tables/c_pays.sql index 5783378fa71..f07fa97c26a 100644 --- a/mysql/tables/c_pays.sql +++ b/mysql/tables/c_pays.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_pays diff --git a/mysql/tables/c_propalst.sql b/mysql/tables/c_propalst.sql index 723759cc6f9..9b3998486a5 100644 --- a/mysql/tables/c_propalst.sql +++ b/mysql/tables/c_propalst.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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 c_propalst diff --git a/mysql/tables/c_stcomm.sql b/mysql/tables/c_stcomm.sql index 01b6d4be459..175ec28a856 100644 --- a/mysql/tables/c_stcomm.sql +++ b/mysql/tables/c_stcomm.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_stcomm diff --git a/mysql/tables/c_typent.sql b/mysql/tables/c_typent.sql index 7d6ee53a188..bd8c1fda4bf 100644 --- a/mysql/tables/c_typent.sql +++ b/mysql/tables/c_typent.sql @@ -1,6 +1,21 @@ -- ======================================================================== -- $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 c_typent diff --git a/mysql/tables/drop.sql b/mysql/tables/drop.sql index 512ee49beb9..d077742a886 100644 --- a/mysql/tables/drop.sql +++ b/mysql/tables/drop.sql @@ -19,10 +19,6 @@ -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- -drop table if exists abo_can; - -drop table if exists abo_soc; - drop table if exists actioncomm; drop table if exists bots; @@ -67,42 +63,10 @@ drop table if exists c_prestatype ; drop table if exists c_propalst ; -drop table if exists c_quality; - -drop table if exists c_region ; - -drop table if exists c_secteur ; - -drop table if exists c_sex; - -drop table if exists c_situation ; - -drop table if exists c_stage_type; - drop table if exists c_stcomm; drop table if exists c_typent ; -drop table if exists c_skilltype ; - -drop table if exists candidat; - -drop table if exists communique; - -drop table if exists diplome ; - -drop table if exists expe; - -drop table if exists followbots; - -drop table if exists indy; - -drop table if exists known; - -drop table if exists lang ; - -drop table if exists langoffre ; - drop table if exists llx_bank; drop table if exists llx_bank_account; @@ -117,6 +81,8 @@ drop table if exists llx_fa_pr; drop table if exists llx_facture; +drop table if exists llx_fichinter; + drop table if exists llx_paiement; drop table if exists llx_pointmort; @@ -211,11 +177,4 @@ drop table if exists statof ; drop table if exists statof_day; -drop table if exists tchcontrib; - -drop table if exists tchcorres; - -drop table if exists tchsociete; - -drop table if exists savannah_projects; diff --git a/mysql/tables/llx_bank.sql b/mysql/tables/llx_bank.sql index ddcd5622c9f..69692d3fdcf 100644 --- a/mysql/tables/llx_bank.sql +++ b/mysql/tables/llx_bank.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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. +-- -- =================================================================== diff --git a/mysql/tables/llx_bank_account.sql b/mysql/tables/llx_bank_account.sql index 4dbd03dcace..58a60984df7 100644 --- a/mysql/tables/llx_bank_account.sql +++ b/mysql/tables/llx_bank_account.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_bank_account diff --git a/mysql/tables/llx_bank_categ.sql b/mysql/tables/llx_bank_categ.sql index 0432c9648c5..b1bc039f3ed 100644 --- a/mysql/tables/llx_bank_categ.sql +++ b/mysql/tables/llx_bank_categ.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_bank_categ diff --git a/mysql/tables/llx_bank_class.sql b/mysql/tables/llx_bank_class.sql index c0475e51ec5..9a61a72e740 100644 --- a/mysql/tables/llx_bank_class.sql +++ b/mysql/tables/llx_bank_class.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_bank_class diff --git a/mysql/tables/llx_bookmark.sql b/mysql/tables/llx_bookmark.sql index 62f37ad4c16..62de5c45e38 100644 --- a/mysql/tables/llx_bookmark.sql +++ b/mysql/tables/llx_bookmark.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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. +-- -- =================================================================== diff --git a/mysql/tables/llx_fa_pr.sql b/mysql/tables/llx_fa_pr.sql index cb27caf673c..650824fb4bf 100644 --- a/mysql/tables/llx_fa_pr.sql +++ b/mysql/tables/llx_fa_pr.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_fa_pr diff --git a/mysql/tables/llx_facturedet.sql b/mysql/tables/llx_facturedet.sql index f183ed2b2ea..416c7ca9f44 100644 --- a/mysql/tables/llx_facturedet.sql +++ b/mysql/tables/llx_facturedet.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_facturedet diff --git a/mysql/tables/llx_paiement.sql b/mysql/tables/llx_paiement.sql index bf26fd010fc..60415206bad 100644 --- a/mysql/tables/llx_paiement.sql +++ b/mysql/tables/llx_paiement.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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. +-- -- =================================================================== diff --git a/mysql/tables/llx_pointmort.sql b/mysql/tables/llx_pointmort.sql index c2833d13dd1..c97d44fc0fe 100644 --- a/mysql/tables/llx_pointmort.sql +++ b/mysql/tables/llx_pointmort.sql @@ -1,6 +1,21 @@ -- =================================================================== -- $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_pointmort diff --git a/mysql/tables/llx_product.sql b/mysql/tables/llx_product.sql index a5cdae5351f..0d1925b72da 100644 --- a/mysql/tables/llx_product.sql +++ b/mysql/tables/llx_product.sql @@ -2,9 +2,6 @@ -- $Id$ -- $Source$ -- --- $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 diff --git a/mysql/tables/llx_propaldet.sql b/mysql/tables/llx_propaldet.sql index eccf0a492a1..2ca6b8320cf 100644 --- a/mysql/tables/llx_propaldet.sql +++ b/mysql/tables/llx_propaldet.sql @@ -1,6 +1,23 @@ -- =================================================================== +-- 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. +-- -- =================================================================== create table llx_propaldet diff --git a/mysql/tables/llx_service.sql b/mysql/tables/llx_service.sql index a072ad98c3f..1ee3f423dba 100644 --- a/mysql/tables/llx_service.sql +++ b/mysql/tables/llx_service.sql @@ -1,6 +1,5 @@ -- =================================================================== --- $Id$ --- $Source$ +-- Copyright (C) 2002 Rodolphe Quiedeville -- -- $Id$ -- $Source$ diff --git a/mysql/tables/llx_soc_recontact.sql b/mysql/tables/llx_soc_recontact.sql index 408778430e8..60acb7772fe 100644 --- a/mysql/tables/llx_soc_recontact.sql +++ b/mysql/tables/llx_soc_recontact.sql @@ -1,7 +1,23 @@ -- =================================================================== +-- 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. +-- -- Societes a recontacter -- -- =================================================================== diff --git a/mysql/tables/llx_ventes.sql b/mysql/tables/llx_ventes.sql index 93635be5582..e8b119c307b 100644 --- a/mysql/tables/llx_ventes.sql +++ b/mysql/tables/llx_ventes.sql @@ -1,6 +1,23 @@ -- =================================================================== +-- 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. +-- -- =================================================================== create table llx_ventes diff --git a/mysql/tables/soc_events.sql b/mysql/tables/soc_events.sql index cbc0fdbe46b..6c3b2cc7f6e 100644 --- a/mysql/tables/soc_events.sql +++ b/mysql/tables/soc_events.sql @@ -1,6 +1,23 @@ -- ======================================================================== +-- 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. +-- -- ======================================================================== create table soc_events diff --git a/mysql/tables/socpeople.sql b/mysql/tables/socpeople.sql index 2a6398da436..cf43d8d1289 100644 --- a/mysql/tables/socpeople.sql +++ b/mysql/tables/socpeople.sql @@ -1,8 +1,22 @@ -- ============================================================================ -- 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 socpeople diff --git a/mysql/tables/socstatutlog.sql b/mysql/tables/socstatutlog.sql index 68df444af76..a4fe4d2dab1 100644 --- a/mysql/tables/socstatutlog.sql +++ b/mysql/tables/socstatutlog.sql @@ -1,7 +1,24 @@ -- ======================================================================== +-- Copyright (C) 2002 Rodolphe Quiedeville +-- -- SGBD : PostgreSQL 6.5.3 -- $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 socstatutlog (
Nom
Adresse
CP '; @@ -111,7 +116,7 @@ if ($action == 'create') { print '
Tel
Fax
Web
Webhttp://
Siren
Tel'.$soc->tel.'
Fax'.$soc->fax.'
Web'.$soc->url.'
Webhttp://'.$soc->url.'
Siren