From c987130203c9c9de33d2752cb82befb0d8721d6e Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 13 Dec 2006 12:18:26 +0000 Subject: [PATCH] Desactivation du script Il reste fonctionnel mais ne fais rien pour les install avec auto cvs update --- scripts/cron/stock-valorisation.php | 48 +++++++++++++++++------------ 1 file changed, 28 insertions(+), 20 deletions(-) diff --git a/scripts/cron/stock-valorisation.php b/scripts/cron/stock-valorisation.php index 99836f8fa8f..f6b79fe0845 100644 --- a/scripts/cron/stock-valorisation.php +++ b/scripts/cron/stock-valorisation.php @@ -21,6 +21,11 @@ * * Calcul la valorisation du stock * + * + * CE SCRIPT EST OBSOLETE NE PLUS L'UTILISER + * + * CONSERVE DANS LE CVS POUR QUELQUES TEMPS + * */ require ("../../htdocs/master.inc.php"); @@ -41,31 +46,34 @@ for ($i = 1 ; $i < sizeof($argv) ; $i++) $verbose = 3; } } + +dolibarr_syslog("CRON-SCRIPT stock-valorisation.php Ce script est obsolete ne plus utiliser"); + /* * * + $sql = "SELECT e.rowid as ref, sum(ps.reel * p.price) as valo"; + $sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,".MAIN_DB_PREFIX."product_stock as ps,".MAIN_DB_PREFIX."product as p"; + $sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = p.rowid"; + $sql .= " GROUP BY e.rowid"; + $resql = $db->query($sql) ; + if ($resql) + { + while ($row = $db->fetch_row($resql)) + { + $sqli = "INSERT INTO ".MAIN_DB_PREFIX."entrepot_valorisation"; + $sqli .= " VALUES (now(),$row[0],$row[1])"; + $resqli = $db->query($sqli); + } + $db->free($resql); + } + else + { + print $sql; + } + * */ -$sql = "SELECT e.rowid as ref, sum(ps.reel * p.price) as valo"; -$sql .= " FROM ".MAIN_DB_PREFIX."entrepot as e,".MAIN_DB_PREFIX."product_stock as ps,".MAIN_DB_PREFIX."product as p"; -$sql .= " WHERE ps.fk_entrepot = e.rowid AND ps.fk_product = p.rowid"; -$sql .= " GROUP BY e.rowid"; -$resql = $db->query($sql) ; -if ($resql) -{ - while ($row = $db->fetch_row($resql)) - { - $sqli = "INSERT INTO ".MAIN_DB_PREFIX."entrepot_valorisation"; - $sqli .= " VALUES (now(),$row[0],$row[1])"; - - $resqli = $db->query($sqli); - } - $db->free($resql); -} -else -{ - print $sql; -} ?>