diff --git a/htdocs/comm/addpropal.php3 b/htdocs/comm/addpropal.php3 index bb4efa4f920..d543ffdbaa8 100644 --- a/htdocs/comm/addpropal.php3 +++ b/htdocs/comm/addpropal.php3 @@ -49,7 +49,7 @@ print ""; print ""; if ($action == 'add') { - $propal = new Propal($socidp); + $propal = new Propal($db, $socidp); $propal->remise = $remise; $propal->datep = $db->idate(mktime(12, 1 , 1, $pmonth, $pday, $pyear)); @@ -67,24 +67,27 @@ if ($action == 'add') { $propal->add_product($idprod3); $propal->add_product($idprod4); - $sqlok = $propal->create($db); + $id = $propal->create(); /* * * Generation * */ - if ($sqlok) { + if ($id) { print "
Génération du PDF

"; - $command = "export DBI_DSN=\"".$GLOBALS["DBI"]."\" "; - $command .= " ; ../../scripts/propal-tex.pl --propal=$propalid --pdf --gljroot=" . $GLOBALS["GLJ_ROOT"] ; + //$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo"; - //$command .= " ; ../../scripts/fax-tex.pl --propal=$propalid --gljroot=" . $GLOBALS["GLJ_ROOT"] ; + $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(); } @@ -158,8 +161,8 @@ if ($action == 'create') { print ""; print ""; - $author = $GLOBALS["REMOTE_USER"]; - print "Auteur$author"; + + print 'Auteur'.$user->fullname.''; print "Num\n"; /* * diff --git a/htdocs/comm/facture.php3 b/htdocs/comm/facture.php3 index 48616d11d66..24ad3b65897 100644 --- a/htdocs/comm/facture.php3 +++ b/htdocs/comm/facture.php3 @@ -21,7 +21,7 @@ */ require("./pre.inc.php3"); -require("../lib/functions.inc.php3"); + llxHeader(); $db = new Db(); $author = $GLOBALS["REMOTE_USER"]; diff --git a/htdocs/comm/index.php3 b/htdocs/comm/index.php3 index b3dec4b7267..7dc6a469d63 100644 --- a/htdocs/comm/index.php3 +++ b/htdocs/comm/index.php3 @@ -112,37 +112,19 @@ print "

"; * * */ -if ($mode == 'search') -{ - if ($mode-search == 'soc') - { - $sql = "SELECT s.idp FROM societe as s, c_stcomm as st "; - $sql .= " WHERE s.fk_stcomm = st.id AND s.datea IS NOT NULL"; - - if ($socname) - { - $sql .= " AND lower(s.nom) like '%".strtolower($socname)."%'"; - $sortfield = "lower(s.nom)"; - $sortorder = "ASC"; - } +if ($mode == 'search') { + if ($mode-search == 'soc') { + $sql = "SELECT s.idp FROM societe as s "; + $sql .= " WHERE lower(s.nom) like '%".strtolower($socname)."%'"; + } - - $result = $db->query($sql); - if ($result) - { - if ( $db->num_rows() == 1) - { - $obj = $db->fetch_object(0); - $socid = $obj->idp; - } - $db->free(); - } + if ( $db->query($sql) ) { + if ( $db->num_rows() == 1) { + $obj = $db->fetch_object(0); + $socid = $obj->idp; } - else - { - - } - + $db->free(); + } } diff --git a/htdocs/comm/propal-tex.pl b/htdocs/comm/propal-tex.pl new file mode 100755 index 00000000000..3f8946f1e79 --- /dev/null +++ b/htdocs/comm/propal-tex.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 db = $DB ; $this->socidp = $soc_idp; $this->products = array(); } @@ -50,7 +52,7 @@ class Propal { * * */ - Function create($db) { + Function create() { /* * Total des produits a ajouter */ @@ -61,9 +63,9 @@ class Propal { } $sql = substr($sql, 0, strlen($sql)-1) . ");"; - if ( $db->query($sql) ) { - $cprice = $db->result(0, 0); - $db->free(); + if ( $this->db->query($sql) ) { + $cprice = $this->db->result(0, 0); + $this->db->free(); } /* * Calcul TVA, Remise @@ -78,25 +80,28 @@ class Propal { $sql .= " VALUES ($this->socidp, $this->contactid, $cprice, $this->remise, $tva, $total, $this->datep, now(), '$this->ref', $this->author, '$this->note')"; $sqlok = 0; - if ( $db->query($sql) ) { + if ( $this->db->query($sql) ) { + + $this->id = $this->db->last_insert_id(); + $sql = "SELECT rowid FROM llx_propal WHERE ref='$this->ref';"; - if ( $db->query($sql) ) { + if ( $this->db->query($sql) ) { /* * Insertion du detail des produits dans la base */ - if ( $db->num_rows() ) { - $propalid = $db->result( 0, 0); - $db->free(); + if ( $this->db->num_rows() ) { + $propalid = $this->db->result( 0, 0); + $this->db->free(); for ($i = 0 ; $i < sizeof($this->products) ; $i++) { - $prod = new Product($db, $this->products[$i]); + $prod = new Product($this->db, $this->products[$i]); $prod->fetch(); $sql = "INSERT INTO llx_propaldet (fk_propal, fk_product, price) VALUES "; $sql .= " ($propalid,". $this->products[$i].", $prod->price) ; "; - if (! $db->query($sql) ) { - print $sql . '
' . $db->error() .'
'; + if (! $this->db->query($sql) ) { + print $sql . '
' . $this->db->error() .'
'; } } /* @@ -104,23 +109,22 @@ class Propal { */ if ($this->projetidp) { $sql = "UPDATE llx_propal SET fk_projet=$this->projetidp WHERE ref='$this->ref';"; - $db->query($sql); + $this->db->query($sql); } } } else { - print $db->error() . '
'.$sql; + print $this->db->error() . '
'.$sql; } } else { - print $db->error() . '
'.$sql; + print $this->db->error() . '
'.$sql; } - return 1; + return $this->id; } /* * * * */ - Function fetch($db, $rowid) { $sql = "SELECT ref,price,".$db->pdate(datep)."as dp FROM llx_propal WHERE rowid=$rowid;"; @@ -140,6 +144,45 @@ class Propal { print $db->error(); } } + /* + * + * + * + */ + Function valid($userid) { + $sql = "UPDATE llx_propal SET fk_statut = 1, date_valid=now(), fk_user_valid=$userid"; + $sql .= " WHERE rowid = $this->id;"; + + if ($this->db->query($sql) ) { + return 1; + } else { + print $this->db->error() . ' in ' . $sql; + } + } + /* + * + * + * + */ + Function cloture($userid, $statut, $note) { + $sql = "UPDATE llx_propal SET fk_statut = $statut, note = '$note', date_cloture=now(), fk_user_cloture=$userid"; + + $sql .= " WHERE rowid = $this->id;"; + + if ($this->db->query($sql) ) { + return 1; + } else { + print $this->db->error() . ' in ' . $sql; + } + } + + + + + + + + } ?> diff --git a/htdocs/comm/propal.php3 b/htdocs/comm/propal.php3 index 21d89836ca6..b5ea62b6851 100644 --- a/htdocs/comm/propal.php3 +++ b/htdocs/comm/propal.php3 @@ -26,17 +26,17 @@ require("../lib/CMailFile.class.php3"); * Modules optionnels */ require("projet/project.class.php3"); +require("./propal.class.php3"); /* * */ -$author = $GLOBALS["REMOTE_USER"]; - llxHeader(); + print ""; print ""; if ($socidp) { -print ""; +print ""; } print ""; print ""; @@ -65,8 +65,13 @@ $pageprev = $page - 1; $pagenext = $page + 1; if ($action == 'setstatut') { - $sql = "UPDATE llx_propal SET fk_statut = $statut, note = '$note' WHERE rowid = $propalid"; - $result = $db->query($sql); + /* + * Cloture de la propale + */ + $propal = new Propal($db); + $propal->id = $propalid; + $propal->cloture($user->id, $statut, $note); + } elseif ( $action == 'delete' ) { $sql = "DELETE FROM llx_propal WHERE rowid = $propalid;"; if ( $db->query($sql) ) { @@ -88,17 +93,15 @@ if ($action == 'setstatut') { if ($propalid) { if ($valid == 1) { - $sql = "SELECT p.fk_soc, p.fk_projet,p.price, p.ref,".$db->pdate("p.datep")." as dp, p.author"; + $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 ); - $sql = "UPDATE llx_propal SET fk_statut = 1 WHERE rowid = $propalid;"; - if (! $db->query($sql) ) { - print $db->error(); - } - + $propal = new Propal($db); + $propal->id = $propalid; + $propal->valid($user->id); } else { print $db->error(); } @@ -106,16 +109,10 @@ if ($propalid) { /* * */ - $sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.author, p.note, x.firstname, x.name, x.fax, x.phone, x.email"; + $sql = "SELECT s.nom, s.idp, p.price, p.fk_projet,p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.note, x.firstname, x.name, x.fax, x.phone, x.email, p.fk_user_author, p.fk_user_valid, p.fk_user_cloture, p.datec, p.date_valid, p.date_cloture"; $sql .= " FROM societe as s, llx_propal as p, c_propalst as c, socpeople as x"; $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND x.idp = p.fk_soc_contact AND p.rowid = $propalid"; - - /* $sql = "SELECT s.nom, s.idp, p.price, p.remise, p.tva, p.total, p.ref,".$db->pdate("p.datep")." as dp, c.id as statut, c.label as lst, p.author, p.note, x.firstname, x.name, x.fax, x.phone, x.email"; - * $sql .= " FROM societe as s, llx_propal as p, c_propalst as c"; - * $sql .= " WHERE p.fk_soc = s.idp AND p.fk_statut = c.id AND p.rowid = $propalid"; - */ - $result = $db->query($sql); if ( $result ) { @@ -154,7 +151,10 @@ if ($propalid) { /* * */ - print ""; + print ''; $totalht = $obj->price - $obj->remise ; @@ -195,7 +195,7 @@ if ($propalid) { print "
Propositions commercialesNouvelle Propal[Nouvelle Propal]ListeCA Prévisionnel
Auteur$obj->author
Auteur'; + $author = new User($db, $obj->fk_user_author); + $author->fetch(''); + print $author->fullname.'
"; - $file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/propal/$obj->ref/$obj->ref.pdf"; + $file = $conf->propal->outputdir. "/$obj->ref/$obj->ref.pdf"; if (file_exists($file)) { print ""; } - $file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/propal/$obj->ref/$obj->ref.ps"; + $file = $conf->propal->outputdir . "/$obj->ref/$obj->ref.ps"; if (file_exists($file)) { print ""; print ""; } - print ""; + print ''; $file = $GLOBALS["GLJ_ROOT"] . "/www-sys/doc/propale/$obj->ref/FAX-$obj->ref.ps"; if (file_exists($file)) { @@ -447,6 +447,24 @@ if ($propalid) { print "

$sql"; } + $validor = new User($db, $obj->fk_user_valid); + $validor->fetch(''); + $cloturor = new User($db, $obj->fk_user_cloture); + $cloturor->fetch(''); + + print '

Propale PDFref/$obj->ref.pdf\">$obj->ref.pdf
Propale Postscriptref/$obj->ref.ps\">$obj->ref.ps
(ref/\">liste...)
(liste...)
'; + 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.' 
'; + } else { print $db->error(); print "

$sql"; diff --git a/htdocs/conf/conf.class.php3.sample b/htdocs/conf/conf.class.php3.sample index 5285021f5d1..fae56cef45f 100644 --- a/htdocs/conf/conf.class.php3.sample +++ b/htdocs/conf/conf.class.php3.sample @@ -42,7 +42,7 @@ class Conf { class PropalConf { Function PropalConf() { - $this->templatesdir = "/home/www/dolibarr/dolibarr/templates"; + $this->templatesdir = "/home/www/dolibarr/dolibarr/templates/propal/default"; $this->outputdir = "/home/www/dolibarr/dolibarr/htdocs/document/propal"; /* * Without ended slash diff --git a/htdocs/index.php3 b/htdocs/index.php3 index 37ddbea712b..b4338894938 100644 --- a/htdocs/index.php3 +++ b/htdocs/index.php3 @@ -61,20 +61,21 @@ if ($db->ok) { print "DescriptionValeur"; print "\n"; + $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 0"; if (valeur($sql)) { $var=!$var; - $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 0"; print "Propales brouillons".valeur($sql).""; } + $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 1"; if (valeur($sql)) { $var=!$var; - $sql = "SELECT count(*) FROM llx_propal WHERE fk_statut = 1"; print "Propales ouvertes".valeur($sql).""; } + + $sql = "SELECT count(*) FROM llx_facture WHERE paye=0"; if (valeur($sql)) { $var=!$var; - $sql = "SELECT count(*) FROM llx_facture WHERE paye=0"; print "Factures en attente de paiement".valeur($sql).""; } diff --git a/htdocs/info.php3 b/htdocs/info.php3 index e958bb2caf7..d9f97076769 100644 --- a/htdocs/info.php3 +++ b/htdocs/info.php3 @@ -24,13 +24,20 @@ require("./pre.inc.php3"); llxHeader(); print ''; -print ''; - +print ''; print ''; -print ''; -print ''; +print ''; +print ''; print ''; + +print ''; +print ''; +print ''; +print ''; + + + print '
Database
Database
host' . $conf->db->host . '
user' . $conf->db->user . '
pass' . $conf->db->pass . '
user' . $conf->db->user . ' 
pass' . $conf->db->pass . ' 
Database name' . $conf->db->name . '
Propale
templates' . $conf->propal->templatesdir . '
output dir' . $conf->propal->outputdir . '
output url' . $conf->propal->outputurl . '
'; diff --git a/mysql/tables/llx_propal.sql b/mysql/tables/llx_propal.sql index 098c4b7b286..92b015cb1df 100644 --- a/mysql/tables/llx_propal.sql +++ b/mysql/tables/llx_propal.sql @@ -3,6 +3,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_propal @@ -12,10 +27,20 @@ create table llx_propal fk_soc_contact integer, fk_projet integer default 0, -- projet auquel est rattache la propale ref varchar(30) NOT NULL, -- propal number - datec datetime, -- date de creation de l'enregistrement + + datec datetime, -- date de creation + date_valid datetime, -- date de validation + date_cloture datetime, -- date de cloture + datep date, -- date de la propal - author varchar(30), + fk_user_author integer, -- createur de la propale + + fk_user_valid integer, -- valideur de la propale + + fk_user_cloture integer, -- cloture de la propale signee ou non signee + + fk_statut smallint default 0, price real default 0, remise real default 0, diff --git a/templates/propal/default/body.tex b/templates/propal/default/body.tex new file mode 100644 index 00000000000..f8efd53f1fb --- /dev/null +++ b/templates/propal/default/body.tex @@ -0,0 +1,9 @@ +\multicolumn{1}{|c|}{#REF#} & + +#LABEL# +& +\multicolumn{1}{|c|}{#QTY#} & +\multicolumn{1}{|r|}{#PU#} & +\multicolumn{1}{|r|}{#PRICE#} \\ +\hline + diff --git a/templates/propal/default/header.tex b/templates/propal/default/header.tex new file mode 100644 index 00000000000..f2712d45499 --- /dev/null +++ b/templates/propal/default/header.tex @@ -0,0 +1,104 @@ +% +% header.tex +% +% $Id$ +% $Source$ +\documentclass[a4paper]{article} +\usepackage{fancyhdr, hhline} +\usepackage[francais]{layout} +% +\usepackage[T1]{fontenc} +\usepackage[french]{babel} +% +% +\newcommand{\aquatre}{ + + \setlength{\topmargin}{0pt} + \setlength{\textheight}{21cm} + + \setlength{\headheight}{30pt} + + \setlength{\headsep}{30pt} + + \setlength{\parindent}{1cm} + \setlength{\parskip}{0.2cm} + + \setlength{\oddsidemargin}{0pt} + \setlength{\evensidemargin}{0pt} + + \setlength{\textwidth}{480pt} + + + \setlength{\marginparwidth}{0pt} + \setlength{\marginparsep}{0pt} +} +% Definitions des commandes +% +\cfoot{} +% +% Debut du document +% +\aquatre + +%\lhead{\begin{tabular}{|p{9cm}p{6cm}}\textsf{{\LARGE Lolix SA}} +%&\\\textsf{8, rue de Valois} & \textsf{T\'el : +33 1 40 15 03 18} +%\\\textsf{75001 Paris} & \textsf{Fax : +33 1 40 15 06 18} +%\\\textsf{SIREN : 432073666} &\\\end{tabular}} + +\lhead{\textsf{{\LARGE Societe SA}}\\\textsf{Travaillons Libre}\\http://www.www.com/} + +\renewcommand{\headrulewidth}{1.0pt} +\pagestyle{fancy} +% +% Redefinition des font en type 1 (voir page 218) +% +\renewcommand{\sfdefault}{phv} +\renewcommand{\rmdefault}{ptm} +\renewcommand{\ttdefault}{pcr} + +\begin{document} +%\layout +\begin{flushright} +\begin{tabular}{p{220pt}|p{220pt}|} +\hhline{~-} +Societe SA & \\ +SA au capital de 40 000 euros & \textbf{\Large #SOCIETE#} \\ +R.C.S. : Paris B 999 999 999 & {\large #DESTINATAIRE#} \\ + & {\large #ADRESSE1#} \\ +8 rue de Valois, 75001 Paris & {\large #ADRESSE2#} \\ +Tél (33) 1 01 01 01 01 - Fax (33) 1 01 01 01 18 & {\large #VILLE#} \\ +email : email@eamil.com & \\ +\hhline{~-} +\end{tabular} +\end{flushright} + +\begin{center} +\begin{tabular}{c} +\\ +\\ +\textbf{\LARGE PROPOSITION COMMERCIALE} +\\ +\\ +\end{tabular} +\end{center} + +\begin{flushleft} +\begin{tabular}{p{9cm}} +\\ +Proposition numéro : \textbf{#NUMPROPALE#} \\ +\end{tabular} +\end{flushleft} + +\large{} + +\begin{center} + +\begin{tabular}{|p{2cm}|p{7cm}|p{2cm}|p{2cm}|p{2cm}|} +\hline +\multicolumn{1}{|c|}{\textbf{Réf}} & +\multicolumn{1}{|c|}{\textbf{Désignation}} & +\multicolumn{1}{|c|}{\textbf{Qté}} & +\multicolumn{1}{|r|}{\textbf{P.U.}} & +\multicolumn{1}{|r|}{\textbf{Total}} \\ +\hline +