Qual: Suppression fichiers obsoletes et non utilisees
This commit is contained in:
parent
8624c38fd0
commit
2bae5c522c
@ -1,139 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2002 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* $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.php");
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
print "Point mort";
|
||||
|
||||
|
||||
|
||||
if ($action == 'update') {
|
||||
$datepm = mktime(12, 0 , 0, $pmonth, 1, $pyear);
|
||||
|
||||
$sql = "DELETE FROM ".MAIN_DB_PREFIX."pointmort WHERE int(month) = $datepm ;";
|
||||
$sql .= "INSERT INTO ".MAIN_DB_PREFIX."pointmort VALUES ($datepm, $pm)";
|
||||
$result = $db->query($sql);
|
||||
}
|
||||
|
||||
|
||||
|
||||
print "<table border=\"0\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<tr><td valign=\"top\">";
|
||||
|
||||
$sql = "SELECT amount, int(month) as dm FROM ".MAIN_DB_PREFIX."pointmort ORDER BY month DESC";
|
||||
|
||||
$result = $db->query($sql);
|
||||
|
||||
if ($result) {
|
||||
|
||||
print "<table class=\"noborder\">";
|
||||
print "<tr bgcolor=\"orange\">";
|
||||
print "<td>".$langs->trans("Month")."</td>";
|
||||
print "<td align=\"right\">".$langs->trans("Amount")."</td>";
|
||||
print "</tr>\n";
|
||||
|
||||
$bc[0]="bgcolor=\"#90c090\"";
|
||||
$bc[1]="bgcolor=\"#b0e0b0\"";
|
||||
$var = 1 ;
|
||||
|
||||
$i = 0;
|
||||
$num = $db->num_rows();
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
$var=!$var;
|
||||
|
||||
print "<tr $bc[$var]>";
|
||||
|
||||
print "<td>".strftime("%Y %B",$obj->dm)."</td>\n";
|
||||
print "<td align=\"right\">$obj->amount</td>\n";
|
||||
|
||||
|
||||
print "</tr>\n";
|
||||
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
print "</td><td valign=\"top\">";
|
||||
|
||||
print '<form action="pmt.php" method="post">';
|
||||
print "<input type=\"hidden\" name=\"action\" value=\"update\">";
|
||||
|
||||
$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";
|
||||
|
||||
print "Date :";
|
||||
$cmonth = date("n", time());
|
||||
print "<select name=\"pmonth\">";
|
||||
for ($month = 1 ; $month <= 12 ; $month++) {
|
||||
if ($month == $cmonth) {
|
||||
print "<option value=\"$month\" selected=\"true\">" . $strmonth[$month];
|
||||
} else {
|
||||
print "<option value=\"$month\">" . $strmonth[$month];
|
||||
}
|
||||
}
|
||||
print "</select>";
|
||||
|
||||
print "<select name=\"pyear\">";
|
||||
$syear = date("Y", time() ) ;
|
||||
print "<option value=\"".($syear-1)."\">".($syear-1);
|
||||
print "<option value=\"$syear\" selected=\"true\">$syear";
|
||||
|
||||
for ($year = $syear +1 ; $year < $syear + 5 ; $year++) {
|
||||
print "<option value=\"$year\">$year";
|
||||
}
|
||||
print "</select><br>";
|
||||
|
||||
print "Valeur : <input type=\"text\" name=\"pm\"><br>";
|
||||
print "<input type=\"submit\" value=\"Mettre a jour\">";
|
||||
print "</form>";
|
||||
|
||||
|
||||
|
||||
|
||||
print "</td></tr></table>";
|
||||
|
||||
$db->close();
|
||||
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
@ -1,180 +0,0 @@
|
||||
<?php
|
||||
/* Copyright (C) 2001-2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
*
|
||||
* 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.
|
||||
*
|
||||
* $Id$
|
||||
* $Source$
|
||||
*
|
||||
*/
|
||||
require("./pre.inc.php");
|
||||
|
||||
function pt ($db, $sql) {
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0;
|
||||
$total = 0 ;
|
||||
$month = 1 ;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$ca[$obj->dm] = $obj->sum;
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
return $ca;
|
||||
}
|
||||
}
|
||||
|
||||
function pm ($db) {
|
||||
$sql = "SELECT amount, date_format('%Y%m',month) as dm FROM ".MAIN_DB_PREFIX."pointmort";
|
||||
$result = $db->query($sql);
|
||||
if ($result) {
|
||||
$num = $db->num_rows();
|
||||
$i = 0; $total = 0 ;
|
||||
|
||||
$month = 1 ;
|
||||
while ($i < $num) {
|
||||
$obj = $db->fetch_object($result);
|
||||
|
||||
$ca[$obj->dm] = $obj->amount;
|
||||
|
||||
print $obj->dm ."=". $obj->amount ."<br>";
|
||||
|
||||
$i++;
|
||||
}
|
||||
|
||||
$db->free();
|
||||
return $ca;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function ppt ($db) {
|
||||
|
||||
$sql = "SELECT sum(f.amount), date_format(f.datef,'%Y%m') as dm";
|
||||
$sql .= " FROM ".MAIN_DB_PREFIX."facture as f WHERE f.paye = 1";
|
||||
$sql .= " GROUP BY dm";
|
||||
|
||||
$ca = pt($db, $sql);
|
||||
$ptmt = pm($db);
|
||||
|
||||
|
||||
print "<TABLE class=\"border\" width=\"100%\" cellspacing=\"0\" cellpadding=\"3\">";
|
||||
print "<TR class=\"liste_titre\">";
|
||||
print "<TD> </TD>";
|
||||
print "<TD>".$langs->trans("Month")."</TD>";
|
||||
print "<TD align=\"right\">CA</TD>";
|
||||
print "<TD align=\"right\">Point mort</TD>";
|
||||
print "<TD align=\"right\">Delta</TD>";
|
||||
print "<TD align=\"right\">Somme</TD>";
|
||||
print "<TD align=\"right\">Somme par an</TD>";
|
||||
print "<TD align=\"right\">Somme / nb mois</TD>";
|
||||
print "<TD align=\"right\">Ecart</TD>";
|
||||
print "</TR>\n";
|
||||
$bc[0]="bgcolor=\"#90c090\"";
|
||||
$bc[1]="bgcolor=\"#b0e0b0\"";
|
||||
$var = 1 ;
|
||||
$pmt = 0 ;
|
||||
$subpmt = 0 ; $totalca = 0 ;
|
||||
$totalpm = 0;
|
||||
$xdate = mktime(0, 0, 0, 7 , 1, 2000);
|
||||
$oldyear = 0;
|
||||
$i = 1;
|
||||
while ($xdate < time()) {
|
||||
if ($oldyear <> date("Y",$xdate)) {
|
||||
$oldyear = date("Y",$xdate);
|
||||
$subpmt = 0 ;
|
||||
print '<TR><td> </td><td>'.$oldyear.'</td>';
|
||||
print '<td colspan="7" align="center"> </td></tr>';
|
||||
}
|
||||
|
||||
$var=!$var;
|
||||
|
||||
print "<TR $bc[$var]><td>$i</td>";
|
||||
print "<TD>".strftime("%Y %B", $xdate)."</TD>\n";
|
||||
|
||||
$b = strftime("%Y", $xdate) . strftime("%m", $xdate);
|
||||
$totalca = $ca[$b] + $totalca;
|
||||
$totalpm = $ptmt[$b] + $totalpm;
|
||||
$pm = $ca[$b] - $ptmt[$b];
|
||||
$pmt = $pmt + $pm;
|
||||
$subpmt = $subpmt + $pm;
|
||||
|
||||
if ($ca[$b]) {
|
||||
print "<TD align=\"right\">".$ca[$b]."</TD>\n";
|
||||
} else {
|
||||
print "<TD align=\"right\">0</TD>\n";
|
||||
}
|
||||
|
||||
print "<TD align=\"right\">".$ptmt[$b]."</TD>\n";
|
||||
if ($pm > 0) {
|
||||
print "<TD align=\"right\"><b>+$pm</b></TD>\n";
|
||||
} else {
|
||||
print "<TD align=\"right\">$pm</TD>\n";
|
||||
}
|
||||
print "<TD align=\"right\">$pmt</TD>\n";
|
||||
print "<TD align=\"right\">$subpmt</TD>\n";
|
||||
|
||||
$pmbymonth = round($pmt/$i);
|
||||
|
||||
print "<TD align=\"right\">$pmbymonth</TD>\n";
|
||||
|
||||
$pmbymdelta = ($pmbymonth - $pmbymontha);
|
||||
|
||||
if ( $pmbymdelta > 0 ) {
|
||||
print "<TD align=\"right\"><b> +$pmbymdelta</b></TD>\n";
|
||||
} else {
|
||||
print "<TD align=\"right\">$pmbymdelta</TD>\n";
|
||||
}
|
||||
|
||||
$pmbymontha = $pmbymonth;
|
||||
|
||||
print "</TR>\n";
|
||||
|
||||
$xdate = mktime(0, 0, 0, date("m", $xdate + (33 * 24 * 3600)), 1 , date("Y", $xdate + (33 * 24 * 3600))) ;
|
||||
$i++;
|
||||
}
|
||||
print "<tr><td colspan=\"2\" align=\"right\">Totaux:</td><td align=\"right\">$totalca</td>";
|
||||
print "<td align=\"right\">$totalpm</td><td align=\"right\" bgcolor=\"#f0f0f0\">$pmt</td>";
|
||||
print "<td colspan=\"4\"> </td></tr>";
|
||||
print "</table>";
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
*
|
||||
*/
|
||||
|
||||
llxHeader();
|
||||
|
||||
print "<b>Point mort</b>";
|
||||
|
||||
ppt($db, 0);
|
||||
|
||||
|
||||
print "<br><br><br><table cellspacing=0 border=1 cellpadding=3>";
|
||||
print "<tr><td bgcolor=\"#e0e0e0\"><a href=\"pmt.php\">Paramétrer le point mort</a></td></tr>";
|
||||
print "</table>";
|
||||
|
||||
|
||||
$db->close();
|
||||
|
||||
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
||||
?>
|
||||
Loading…
Reference in New Issue
Block a user