forked from Wavyzz/dolibarr
102 lines
2.0 KiB
PHP
102 lines
2.0 KiB
PHP
<?PHP
|
|
/* Copyright (C) 2003 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
|
*
|
|
* 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");
|
|
|
|
$user->getrights('facture');
|
|
if (!$user->rights->facture->lire)
|
|
accessforbidden();
|
|
|
|
require("../../facture.class.php");
|
|
require("../../propal.class.php");
|
|
|
|
llxHeader();
|
|
|
|
/*
|
|
* Sécurité accés client
|
|
*/
|
|
if ($user->societe_id > 0)
|
|
{
|
|
$action = '';
|
|
$socidp = $user->societe_id;
|
|
}
|
|
/*
|
|
*
|
|
*/
|
|
print_titre("Mise à jour système");
|
|
$err = 0;
|
|
/*
|
|
* Factures
|
|
*/
|
|
$sql = "SELECT rowid FROM llx_facture";
|
|
if ($db->query($sql))
|
|
{
|
|
$num = $db->num_rows();
|
|
$i = 0;
|
|
while ($i < $num)
|
|
{
|
|
$row = $db->fetch_row($i);
|
|
$facture = new Facture($db);
|
|
if ( $facture->fetch($row[0]) )
|
|
{
|
|
if ( $facture->updateprice($row[0]) > 0 )
|
|
{
|
|
print "(ok $row[0])";
|
|
}
|
|
else
|
|
{
|
|
print "Erreur #2";
|
|
$err++;
|
|
}
|
|
}
|
|
else
|
|
{
|
|
print "Erreur #3";
|
|
$err++;
|
|
}
|
|
$i++;
|
|
}
|
|
$db->free();
|
|
}
|
|
else
|
|
{
|
|
print "Erreur #1";
|
|
$err++;
|
|
}
|
|
|
|
$sql = "DELETE FROM llx_const WHERE name = 'MAIN_NEED_UPDATE'";
|
|
if (! $db->query($sql))
|
|
{
|
|
print "Erreur #100";
|
|
$err++;
|
|
}
|
|
|
|
$db->close();
|
|
|
|
|
|
if ($err == 0)
|
|
{
|
|
print "<p><b>Votre système a été mise à jour avec succés.</b>";
|
|
}
|
|
|
|
llxFooter("<em>Dernière modification $Date$ révision $Revision$</em>");
|
|
?>
|