From 9997a1e9b11a4c0bb0e5965e80984a90d0e1e22a Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 19 Jun 2002 11:16:45 +0000 Subject: [PATCH] . --- htdocs/compta/bank/index.php3 | 6 +- htdocs/compta/charges/index.php3 | 107 ++ htdocs/compta/facture.php3 | 44 +- htdocs/compta/pre.inc.php3 | 2 +- htdocs/compta/sociales/index.php3 | 6 +- htdocs/compta/tva/index.php3 | 6 +- htdocs/compta/voyage/voyage.php3 | 1554 +++++++++++++++++++++++++++-- htdocs/fichinter/fiche.php3 | 25 +- htdocs/fichinter/tex-fichinter.pl | 76 +- htdocs/lib/functions.inc.php3 | 1 - htdocs/service/fiche.php3 | 10 +- htdocs/service/pre.inc.php3 | 2 + mysql/tables/c_paiement.sql | 6 +- mysql/tables/llx_facture.sql | 6 +- 14 files changed, 1680 insertions(+), 171 deletions(-) create mode 100644 htdocs/compta/charges/index.php3 diff --git a/htdocs/compta/bank/index.php3 b/htdocs/compta/bank/index.php3 index bbbcae6ca49..218a5e71929 100644 --- a/htdocs/compta/bank/index.php3 +++ b/htdocs/compta/bank/index.php3 @@ -1,8 +1,5 @@ - * - * $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 @@ -18,6 +15,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ /* diff --git a/htdocs/compta/charges/index.php3 b/htdocs/compta/charges/index.php3 new file mode 100644 index 00000000000..c8204822486 --- /dev/null +++ b/htdocs/compta/charges/index.php3 @@ -0,0 +1,107 @@ + + * + * $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(); + +function valeur($sql) { + global $db; + if ( $db->query($sql) ) { + if ( $db->num_rows() ) { + $valeur = $db->result(0,0); + } + $db->free(); + } + return $valeur; +} +/* + * + */ +$db = new Db(); + + +if ($action == 'add_bookmark') { + $sql = "INSERT INTO llx_bookmark (fk_soc, dateb, fk_user) VALUES ($socidp, now(),".$user->id.");"; + if (! $db->query($sql) ) { + print $db->error(); + } +} + +if ($action == 'del_bookmark') { + $sql = "DELETE FROM llx_bookmark WHERE rowid=$bid"; + $result = $db->query($sql); +} + +print_titre("Charges"); + +print ''; + +print ''; + +print '
'; + + +print ''; +print ""; +print ""; +print "\n"; + +$sql = "SELECT c.libelle as nom, sum(s.amount) as total"; +$sql .= " FROM c_chargesociales as c, llx_chargesociales as s"; +$sql .= " WHERE s.fk_type = c.id AND s.paye = 1"; +$sql .= " GROUP BY lower(c.libelle) ASC"; + +if ( $db->query($sql) ) { + $num = $db->num_rows(); + $i = 0; + + while ($i < $num) { + $obj = $db->fetch_object( $i); + $var = !$var; + print ""; + print ''; + print ''; + $i++; + } +} else { + print ""; +} + + +print "
Factures
'.$obj->nom.''.price($obj->total).'
".$db->error()."

"; + + +/* + * + * + */ + + + +print '
'; + +$db->close(); + +llxFooter("Dernière modification $Date$ révision $Revision$"); +?> diff --git a/htdocs/compta/facture.php3 b/htdocs/compta/facture.php3 index 061acb2f34c..91342abacd2 100644 --- a/htdocs/compta/facture.php3 +++ b/htdocs/compta/facture.php3 @@ -359,29 +359,31 @@ if ($action == 'create') { $result = $db->query($sql); if ($result) { $num = $db->num_rows(); - $i = 0; $total = 0; - print "

Proposition(s) commerciale(s) associée(s)"; - print ''; - print ""; - print ""; - print ""; - print ""; - print "\n"; + if ($num) { + $i = 0; $total = 0; + print "

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

NumDatePrix
'; + print ""; + print ""; + print ""; + print ""; + print "\n"; - $var=True; - while ($i < $num) { - $objp = $db->fetch_object( $i); - $var=!$var; - print ""; - print "\n"; - print "\n"; - print ''; - print ""; - $total = $total + $objp->price; - $i++; + $var=True; + while ($i < $num) { + $objp = $db->fetch_object( $i); + $var=!$var; + print ""; + print "\n"; + print "\n"; + print ''; + print ""; + $total = $total + $objp->price; + $i++; + } + print "\n"; + print "
NumDatePrix
propalid\">$objp->ref".strftime("%d %B %Y",$objp->dp)."'.price($objp->price).'
propalid\">$objp->ref".strftime("%d %B %Y",$objp->dp)."'.price($objp->price).'
Total : ".price($total)." $_MONNAIE HT
"; } - print "Total : ".price($total)." $_MONNAIE HT\n"; - print ""; } else { print $db->error(); } diff --git a/htdocs/compta/pre.inc.php3 b/htdocs/compta/pre.inc.php3 index 1d373fecb19..1dafc8e15a1 100644 --- a/htdocs/compta/pre.inc.php3 +++ b/htdocs/compta/pre.inc.php3 @@ -37,7 +37,7 @@ function llxHeader($head = "") { $menu->add_submenu("paiement.php3","Paiements"); // $menu->add_submenu("fac.php3","admin fac"); - $menu->add("charges.php3","Charges"); + $menu->add("charges/index.php3","Charges"); $menu->add_submenu("sociales/","Prestations sociales"); $menu->add("ca.php3","Chiffres d'affaires"); diff --git a/htdocs/compta/sociales/index.php3 b/htdocs/compta/sociales/index.php3 index 120fecd36f7..9172b886431 100644 --- a/htdocs/compta/sociales/index.php3 +++ b/htdocs/compta/sociales/index.php3 @@ -55,7 +55,7 @@ if ($action == 'del_bookmark') { $result = $db->query($sql); } -print_titre("Charges $year"); +print_titre("Charges sociales $year"); /* * @@ -64,7 +64,9 @@ print_titre("Charges $year"); print ""; print ""; -print ''; +print ''; print "\n"; diff --git a/htdocs/compta/tva/index.php3 b/htdocs/compta/tva/index.php3 index e8bafe5825b..57801c9f9d5 100644 --- a/htdocs/compta/tva/index.php3 +++ b/htdocs/compta/tva/index.php3 @@ -1,8 +1,5 @@ - * - * $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 @@ -18,6 +15,9 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + * $Id$ + * $Source$ + * */ require("./pre.inc.php3"); require("../../tva.class.php3"); diff --git a/htdocs/compta/voyage/voyage.php3 b/htdocs/compta/voyage/voyage.php3 index d336f97ddd4..02481e70914 100644 --- a/htdocs/compta/voyage/voyage.php3 +++ b/htdocs/compta/voyage/voyage.php3 @@ -26,106 +26,1494 @@ llxHeader(); $db = new Db(); ?> - - - - - - - - - - - -
EcheancePériodeChargesMontant EcheancePériode'; +print_liste_field_titre("Charges",$PHP_SELF,"c.libelle"); +print 'Montant 
- -
-

- - - - + + + + + + + + + + + + + + + +
Au départ de :
 A destination de :
 
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Départ:Paris + + + + Lieu d'Arrivée:Auray + + + + + + + Trajet direct uniquement + +  
+ + + + + + + + + + + + + + + +
+
+
+
+
+ + + + +
+ + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Aller *   +

+ +
  + + + + + + + + +
Train partant
Train arrivant
+
 entre  +  et  +
+
+
+ + + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Retour   +

+ +
  + + + + + + + + + +
Train partant
Train arrivant
+
 entre  +  et  +
+
+
+ + + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + + +

+
+ +

+
+   +
+ + + + + + + +

+ Passagers
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1
  + + Grand Voyageurn° 29090106
2
  + + Grand Voyageurn° 29090106
+
+ + + + + + + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + + + + + +

+ Confort
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Classe + + + + 2nde classe + +   + + + + 1ère classe + +  
Fumeur + + + + Oui + +   + + + + Non + +   + + + + Indifférent + +  
Réservation (1) + + + + Oui + +   + + + + Non + +  
+
+ + + + + + + + + + +
Ajoutez des services (couloir-fenêtre, restauration, etc.)Ajoutez des services (couloir-fenêtre, restauration, etc.)
  
+ +
+ + + + + + + + + + + + + +
+ + + + + + + + + + + + + + + - + + + + + + -

+ Pays de réception ou de retrait des billets +
+
+ + Valider +
-
-

- +
+ + + close(); diff --git a/htdocs/fichinter/fiche.php3 b/htdocs/fichinter/fiche.php3 index 35f80a68be2..d72c11796f6 100644 --- a/htdocs/fichinter/fiche.php3 +++ b/htdocs/fichinter/fiche.php3 @@ -91,22 +91,22 @@ if ($action == 'update') { */ if ($action == 'generate') { 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 LC_TIME=fr_FR ; export DBI_DSN="dbi:'.$conf->db->type.':dbname='.$conf->db->name.':host='.$conf->db->host.'"'; $command .= " ; ./tex-fichinter.pl --fichinter=".$id ; - $command .= " --pdf --ps"; + $command .= " --pdf --ps -vv --html"; $command .= " --output=" .$conf->fichinter->outputdir; $command .= " --templates=" .$conf->fichinter->templatesdir; $output = system($command); - print "

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

command : $command
"; + } else { print $db->error(); } @@ -375,19 +375,24 @@ if ($id) { print nl2br($fichinter->note); print ''; - print 'Documentsliste...'; + print 'Documentsliste...'; $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf"; if (file_exists($file)) { - print '
PDF : '.$fichinter->ref.'.pdf'; + print 'PDF'.$fichinter->ref.'.pdf'; } $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.ps"; - if (file_exists($file)) { - - print '
PS : '.$fichinter->ref.'.ps
'; + if (file_exists($file)) { + print 'PS'.$fichinter->ref.'.ps'; } + $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.tex"; + if (file_exists($file)) { + print 'tex'.$fichinter->ref.'.tex'; + } + + print ''; print ""; diff --git a/htdocs/fichinter/tex-fichinter.pl b/htdocs/fichinter/tex-fichinter.pl index 105230a4998..e287503d5ad 100755 --- a/htdocs/fichinter/tex-fichinter.pl +++ b/htdocs/fichinter/tex-fichinter.pl @@ -34,26 +34,28 @@ Sys::Syslog::openlog($0, 'pid', 'daemon'); -my($debug, $verbose, $bgcolor, $idfiche, $do_fax, $do_pdf, $do_ps, - $templatesdir, $outputdir) = (0,0); +my($html, $debug, $verbose, $idfiche, $do_pdf, $do_ps, $templatesdir, $outputdir) = (0,0); exit unless GetOptions("fichinter=i" =>\$idfiche, - "fax" =>\$do_fax, "templates=s" =>\$templatesdir, "output=s" =>\$outputdir, "ps" =>\$do_ps, "pdf" =>\$do_pdf, + "html" =>\$html, "v+" =>\$verbose); Sys::Syslog::syslog('info', 'Start Fiche Inter '.$idfiche); Sys::Syslog::syslog('info', '['.$idfiche.'] 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; +print "
\n" if ($verbose > 1 && $html); # # # Fetch datas @@ -94,6 +96,7 @@ if ( $sth->execute ) { } $outputdir .= "/".$numfiche; + Sys::Syslog::syslog('info', '['.$idfiche.'] Outputdir : ' . $outputdir); unless (-d $outputdir) { print "Make dir : $outputdir\n" if $verbose > 1; @@ -101,6 +104,7 @@ unless (-d $outputdir) { } print "Output in : $outputdir\n" if $verbose > 1; +print "
\n" if ($verbose > 1 && $html); # # Decoupage de l'adresse en 2 lignes # @@ -114,6 +118,7 @@ if (/^(.*)\n(.*)/) { print "|$adresse2|\n"; } print "|$address|\n"; +print "
\n" if ($verbose > 1 && $html); # # @@ -166,10 +171,7 @@ while () { } close (FH); print FC "\n"; -while ($line < 15) { - print FC "\\\\\n"; - $line++; -} + # # Footer @@ -188,42 +190,44 @@ while () { } close (FH); - -# -# -# - - close (FC); $dbh->disconnect if $dbh; # -system("cd $outputdir/ ; recode -d iso8859-1..ltex < $numfiche.tex > recode-$numfiche.tex"); -# -# -print "Generate dvi file
\n"; -system("cd $outputdir/ ; latex recode-$numfiche.tex "); -# +# +# Generation des documents # # +if (-r "$outputdir/$numfiche.tex" ) { - - - -print "

Generate pdf file
\n"; -system("cd $outputdir/ ; pdflatex recode-$numfiche.tex > /dev/null"); -system("cd $outputdir/ ; mv recode-$numfiche.pdf $numfiche.pdf > /dev/null"); - -print "Generate ps file\n"; -system("cd $outputdir/ ; dvips recode-$numfiche.dvi -o $numfiche.ps "); - -# -# $outputdir/$numfiche.tex -# -if ($do_fax) { - print "Generate fax file\n"; - system("gs -q -sDEVICE=tiffg3 -dNOPAUSE -sOutputFile=$outputdir/$numfiche.%03d $outputdir/$numfiche.ps recode-$numfiche.tex"); } -Sys::Syslog::syslog('info', 'End propale '.$idfiche); +# +# +if (-r "$outputdir/recode-$numfiche.tex") { + print "Generate dvi file\n"; + system("cd $outputdir/ ; latex recode-$numfiche.tex "); +} +# +# +# + + +print "

Generate pdf file\n"; +if (-r "$outputdir/recode-$numfiche.tex") { + system("cd $outputdir/ ; pdflatex recode-$numfiche.tex > /dev/null"); +} + +if (-r "$outputdir/recode-$numfiche.tex") { + system("cd $outputdir/ ; mv recode-$numfiche.pdf $numfiche.pdf > /dev/null"); +} + +if (-r "$outputdir/recode-$numfiche.dvi") { + print "Generate ps file\n"; + system("cd $outputdir/ ; dvips recode-$numfiche.dvi -o $numfiche.ps "); +} + + +Sys::Syslog::syslog('info', 'End ficheinter '.$idfiche); Sys::Syslog::closelog(); diff --git a/htdocs/lib/functions.inc.php3 b/htdocs/lib/functions.inc.php3 index 72b96e30301..4961d07e388 100644 --- a/htdocs/lib/functions.inc.php3 +++ b/htdocs/lib/functions.inc.php3 @@ -154,7 +154,6 @@ function print_duree_select($prefix) { } function price($amount) { - return number_format($amount, 2, '.', ' '); //return sprintf("%.2f", $amount); } diff --git a/htdocs/service/fiche.php3 b/htdocs/service/fiche.php3 index f74666da733..510a69954a8 100644 --- a/htdocs/service/fiche.php3 +++ b/htdocs/service/fiche.php3 @@ -131,14 +131,14 @@ if ($action == 'create') { print ''; - print '
'; + print '
'; - print ''; + print ''; - print ''; + print ''; - print ''; - print ''; + print ''; + print ''; print ''; print '
Barre d\'action-[Editer][Editer][Date de debut][Date de fin][Date de debut][Date de fin]-

'; diff --git a/htdocs/service/pre.inc.php3 b/htdocs/service/pre.inc.php3 index bdee93342a4..cd281e9010b 100644 --- a/htdocs/service/pre.inc.php3 +++ b/htdocs/service/pre.inc.php3 @@ -36,6 +36,8 @@ function llxHeader($head = "", $urlp = "") { $menu->add("/service/index.php3", "Services"); + $menu->add_submenu("/service/fiche.php3?action=create", "Nouveau"); + $menu->add("/comm/index.php3", "Clients"); $menu->add("/fourn/index.php3", "Fournisseurs"); diff --git a/mysql/tables/c_paiement.sql b/mysql/tables/c_paiement.sql index a8030b9f5b3..01d8b906141 100644 --- a/mysql/tables/c_paiement.sql +++ b/mysql/tables/c_paiement.sql @@ -1,9 +1,6 @@ -- ======================================================================== -- 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 @@ -18,6 +15,9 @@ -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- +-- $Id$ +-- $Source$ +-- -- ======================================================================== create table c_paiement ( diff --git a/mysql/tables/llx_facture.sql b/mysql/tables/llx_facture.sql index 82cd5d30ac0..67dae2dd06b 100644 --- a/mysql/tables/llx_facture.sql +++ b/mysql/tables/llx_facture.sql @@ -1,8 +1,5 @@ -- =========================================================================== -- 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 @@ -18,6 +15,9 @@ -- along with this program; if not, write to the Free Software -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- +-- $Id$ +-- $Source$ +-- -- =========================================================================== create table llx_facture