2
0
forked from Wavyzz/dolibarr
This commit is contained in:
Rodolphe Quiedeville
2002-06-19 11:16:45 +00:00
parent 46ac68b04c
commit 9997a1e9b1
14 changed files with 1680 additions and 171 deletions

View File

@@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
/* /*

View File

@@ -0,0 +1,107 @@
<?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $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 '<TABLE border="0" width="100%" cellspacing="0" cellpadding="4">';
print '<tr><td valign="top" width="30%">';
print '<TABLE border="0" cellspacing="0" cellpadding="3" width="100%">';
print "<TR class=\"liste_titre\">";
print "<td colspan=\"2\">Factures</td>";
print "</TR>\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 "<tr $bc[$var]>";
print '<td>'.$obj->nom.'</td><td>'.price($obj->total).'</td>';
print '</tr>';
$i++;
}
} else {
print "<tr><td>".$db->error()."</td></tr>";
}
print "</table><br>";
/*
*
*
*/
print '</td></tr>';
print '</table>';
$db->close();
llxFooter("<em>Derni&egrave;re modification $Date$ r&eacute;vision $Revision$</em>");
?>

View File

@@ -359,6 +359,7 @@ if ($action == 'create') {
$result = $db->query($sql); $result = $db->query($sql);
if ($result) { if ($result) {
$num = $db->num_rows(); $num = $db->num_rows();
if ($num) {
$i = 0; $total = 0; $i = 0; $total = 0;
print "<p><b>Proposition(s) commerciale(s) associ<63>e(s)</b>"; print "<p><b>Proposition(s) commerciale(s) associ<63>e(s)</b>";
print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="4">'; print '<TABLE border="1" width="100%" cellspacing="0" cellpadding="4">';
@@ -382,6 +383,7 @@ if ($action == 'create') {
} }
print "<tr><td align=\"right\" colspan=\"3\">Total : <b>".price($total)."</b> $_MONNAIE HT</td></tr>\n"; print "<tr><td align=\"right\" colspan=\"3\">Total : <b>".price($total)."</b> $_MONNAIE HT</td></tr>\n";
print "</table>"; print "</table>";
}
} else { } else {
print $db->error(); print $db->error();
} }

View File

@@ -37,7 +37,7 @@ function llxHeader($head = "") {
$menu->add_submenu("paiement.php3","Paiements"); $menu->add_submenu("paiement.php3","Paiements");
// $menu->add_submenu("fac.php3","admin fac"); // $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_submenu("sociales/","Prestations sociales");
$menu->add("ca.php3","Chiffres d'affaires"); $menu->add("ca.php3","Chiffres d'affaires");

View File

@@ -55,7 +55,7 @@ if ($action == 'del_bookmark') {
$result = $db->query($sql); $result = $db->query($sql);
} }
print_titre("Charges $year"); print_titre("Charges sociales $year");
/* /*
* *
@@ -64,7 +64,9 @@ print_titre("Charges $year");
print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">"; print "<TABLE border=\"0\" width=\"100%\" cellspacing=\"0\" cellpadding=\"4\">";
print "<TR class=\"liste_titre\">"; print "<TR class=\"liste_titre\">";
print '<td>Echeance</td><td>P<>riode</td><TD colspan="2">Charges</td><td align="right">Montant</td><td>&nbsp;</td>'; print '<td>Echeance</td><td>P<>riode</td><td colspan="2">';
print_liste_field_titre("Charges",$PHP_SELF,"c.libelle");
print '</td><td align="right">Montant</td><td>&nbsp;</td>';
print "</TR>\n"; print "</TR>\n";

View File

@@ -1,8 +1,5 @@
<?PHP <?PHP
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
*
* $Id$
* $Source$
* *
* This program is free software; you can redistribute it and/or modify * 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 * 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 * along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* *
* $Id$
* $Source$
*
*/ */
require("./pre.inc.php3"); require("./pre.inc.php3");
require("../../tva.class.php3"); require("../../tva.class.php3");

File diff suppressed because it is too large Load Diff

View File

@@ -91,22 +91,22 @@ if ($action == 'update') {
*/ */
if ($action == 'generate') { if ($action == 'generate') {
if ($id) { if ($id) {
print "<hr><b>G<>n<EFBFBD>ration du PDF</b><p>";
//$DBI = "dbi:mysql:dbname=lolixdev:host=espy:user=rodo"; //$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 = '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 .= " ; ./tex-fichinter.pl --fichinter=".$id ;
$command .= " --pdf --ps"; $command .= " --pdf --ps -vv --html";
$command .= " --output=" .$conf->fichinter->outputdir; $command .= " --output=" .$conf->fichinter->outputdir;
$command .= " --templates=" .$conf->fichinter->templatesdir; $command .= " --templates=" .$conf->fichinter->templatesdir;
$output = system($command); $output = system($command);
print "<p>command : <b>$command<br>";
print $output; print $output;
print "<p>command : <b>$command<br>";
} else { } else {
print $db->error(); print $db->error();
} }
@@ -375,19 +375,24 @@ if ($id) {
print nl2br($fichinter->note); print nl2br($fichinter->note);
print '</td></tr>'; print '</td></tr>';
print '<tr><td>Documents</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'">liste...</a>'; print '<tr><td>Documents</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'">liste...</a></td></tr>';
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf"; $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.pdf";
if (file_exists($file)) { if (file_exists($file)) {
print '<br>PDF : <a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.pdf">'.$fichinter->ref.'.pdf</a>'; print '<tr><td>PDF</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.pdf">'.$fichinter->ref.'.pdf</a></td></tr>';
} }
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.ps"; $file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.ps";
if (file_exists($file)) { if (file_exists($file)) {
print '<tr><td>PS</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.ps">'.$fichinter->ref.'.ps</a></td></tr>';
print '<br>PS : <a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.ps">'.$fichinter->ref.'.ps</a><br>';
} }
$file = $conf->fichinter->outputdir . "/$fichinter->ref/$fichinter->ref.tex";
if (file_exists($file)) {
print '<tr><td>tex</td><td><a href="'.$conf->fichinter->outputurl.'/'.$fichinter->ref.'/'.$fichinter->ref.'.tex">'.$fichinter->ref.'.tex</a></td></tr>';
}
print '</td></tr>'; print '</td></tr>';
print "</table>"; print "</table>";

View File

@@ -34,26 +34,28 @@ Sys::Syslog::openlog($0, 'pid', 'daemon');
my($debug, $verbose, $bgcolor, $idfiche, $do_fax, $do_pdf, $do_ps, my($html, $debug, $verbose, $idfiche, $do_pdf, $do_ps, $templatesdir, $outputdir) = (0,0);
$templatesdir, $outputdir) = (0,0);
exit unless GetOptions("fichinter=i" =>\$idfiche, exit unless GetOptions("fichinter=i" =>\$idfiche,
"fax" =>\$do_fax,
"templates=s" =>\$templatesdir, "templates=s" =>\$templatesdir,
"output=s" =>\$outputdir, "output=s" =>\$outputdir,
"ps" =>\$do_ps, "ps" =>\$do_ps,
"pdf" =>\$do_pdf, "pdf" =>\$do_pdf,
"html" =>\$html,
"v+" =>\$verbose); "v+" =>\$verbose);
Sys::Syslog::syslog('info', 'Start Fiche Inter '.$idfiche); Sys::Syslog::syslog('info', 'Start Fiche Inter '.$idfiche);
Sys::Syslog::syslog('info', '['.$idfiche.'] Start'); Sys::Syslog::syslog('info', '['.$idfiche.'] Start');
my $DEBUG = 1; my $DEBUG = 1;
my $mdir = "$outputdir"; my $mdir = "$outputdir";
unless (-d $mdir) { unless (-d $mdir) {
mkdir($mdir,0777) || die "cannot mkdir " . $mdir . ": $!"; mkdir($mdir,0777) || die "cannot mkdir " . $mdir . ": $!";
} }
print "Output in : $outputdir\n" if $verbose > 1; print "Output in : $outputdir\n" if $verbose > 1;
print "<br>\n" if ($verbose > 1 && $html);
# #
# #
# Fetch datas # Fetch datas
@@ -94,6 +96,7 @@ if ( $sth->execute ) {
} }
$outputdir .= "/".$numfiche; $outputdir .= "/".$numfiche;
Sys::Syslog::syslog('info', '['.$idfiche.'] Outputdir : ' . $outputdir); Sys::Syslog::syslog('info', '['.$idfiche.'] Outputdir : ' . $outputdir);
unless (-d $outputdir) { unless (-d $outputdir) {
print "Make dir : $outputdir\n" if $verbose > 1; print "Make dir : $outputdir\n" if $verbose > 1;
@@ -101,6 +104,7 @@ unless (-d $outputdir) {
} }
print "Output in : $outputdir\n" if $verbose > 1; print "Output in : $outputdir\n" if $verbose > 1;
print "<br>\n" if ($verbose > 1 && $html);
# #
# Decoupage de l'adresse en 2 lignes # Decoupage de l'adresse en 2 lignes
# #
@@ -114,6 +118,7 @@ if (/^(.*)\n(.*)/) {
print "|$adresse2|\n"; print "|$adresse2|\n";
} }
print "|$address|\n"; print "|$address|\n";
print "<br>\n" if ($verbose > 1 && $html);
# #
# #
@@ -166,10 +171,7 @@ while (<FH>) {
} }
close (FH); close (FH);
print FC "\n"; print FC "\n";
while ($line < 15) {
print FC "\\\\\n";
$line++;
}
# #
# Footer # Footer
@@ -188,42 +190,44 @@ while (<FH>) {
} }
close (FH); close (FH);
#
#
#
close (FC); close (FC);
$dbh->disconnect if $dbh; $dbh->disconnect if $dbh;
# #
system("cd $outputdir/ ; recode -d iso8859-1..ltex < $numfiche.tex > recode-$numfiche.tex"); #
# # Generation des documents
#
print "Generate dvi file<br>\n";
system("cd $outputdir/ ; latex recode-$numfiche.tex ");
#
# #
# #
if (-r "$outputdir/$numfiche.tex" ) {
system("cd $outputdir/ ; recode -d iso8859-1..ltex < $numfiche.tex > recode-$numfiche.tex");
print "<p>Generate pdf file<br>\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 </dev/null");
} }
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 "<p>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(); Sys::Syslog::closelog();

View File

@@ -154,7 +154,6 @@ function print_duree_select($prefix) {
} }
function price($amount) { function price($amount) {
return number_format($amount, 2, '.', ' '); return number_format($amount, 2, '.', ' ');
//return sprintf("%.2f", $amount); //return sprintf("%.2f", $amount);
} }

View File

@@ -131,14 +131,14 @@ if ($action == 'create') {
print '</table>'; print '</table>';
print '<br><table width="100%" border="1" cellspacing="0" cellpadding="0">'; print '<br><table width="100%" border="1" cellspacing="0" cellpadding="3">';
print '<td width="20%">Barre d\'action</td>'; print '<td width="20%" align="center">-</td>';
print '<td width="20%" bgcolor="#e0E0E0" align="center">[<a href="fiche.php3?action=edit&id='.$id.'">Editer</a>]</td>'; print '<td width="20%" align="center">[<a href="fiche.php3?action=edit&id='.$id.'">Editer</a>]</td>';
print '<td width="20%" bgcolor="#e0E0E0" align="center">[<a href="fiche.php3?action=datedeb&id='.$id.'">Date de debut</a>]</td>'; print '<td width="20%" align="center">[<a href="fiche.php3?action=datedeb&id='.$id.'">Date de debut</a>]</td>';
print '<td width="20%" bgcolor="#e0E0E0" align="center">[<a href="fiche.php3?action=datefin&id='.$id.'">Date de fin</a>]</td>'; print '<td width="20%" align="center">[<a href="fiche.php3?action=datefin&id='.$id.'">Date de fin</a>]</td>';
print '<td width="20%" align="center">-</td>'; print '<td width="20%" align="center">-</td>';
print '</table><br>'; print '</table><br>';

View File

@@ -36,6 +36,8 @@ function llxHeader($head = "", $urlp = "") {
$menu->add("/service/index.php3", "Services"); $menu->add("/service/index.php3", "Services");
$menu->add_submenu("/service/fiche.php3?action=create", "Nouveau");
$menu->add("/comm/index.php3", "Clients"); $menu->add("/comm/index.php3", "Clients");
$menu->add("/fourn/index.php3", "Fournisseurs"); $menu->add("/fourn/index.php3", "Fournisseurs");

View File

@@ -1,9 +1,6 @@
-- ======================================================================== -- ========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- --
-- $Id$
-- $Source$
--
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or -- 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 -- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-- --
-- $Id$
-- $Source$
--
-- ======================================================================== -- ========================================================================
create table c_paiement create table c_paiement
( (

View File

@@ -1,9 +1,6 @@
-- =========================================================================== -- ===========================================================================
-- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org> -- Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
-- --
-- $Id$
-- $Source$
--
-- This program is free software; you can redistribute it and/or modify -- 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 -- it under the terms of the GNU General Public License as published by
-- the Free Software Foundation; either version 2 of the License, or -- 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 -- along with this program; if not, write to the Free Software
-- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. -- Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
-- --
-- $Id$
-- $Source$
--
-- =========================================================================== -- ===========================================================================
create table llx_facture create table llx_facture