Annulation modif

This commit is contained in:
Laurent Destailleur 2008-08-12 18:20:18 +00:00
parent 7132585be1
commit 478503967e
4 changed files with 7707 additions and 7787 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1,184 +1,176 @@
<?PHP <?PHP
/* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2006 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2008 Raphael Bertrand (Resultic) <raphael.bertrand@resultic.fr> *
* * 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 * (at your option) any later version.
* (at your option) any later version. *
* * This program is distributed in the hope that it will be useful,
* This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of
* but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details.
* GNU General Public License for more details. *
* * You should have received a copy of the GNU General Public License
* You should have received a copy of the GNU General Public License * 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$
* $Id$ * $Source$
* $Source$ */
*/
/**
/** \file htdocs/comm/remise.php
\file htdocs/comm/remise.php \ingroup commercial
\ingroup commercial \brief Onglet remise de la societe
\brief Onglet remise de la societe \version $Revision$
\version $Revision$ */
*/
require_once("./pre.inc.php");
require_once("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php");
require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
require_once(DOL_DOCUMENT_ROOT."/contact.class.php");
$langs->load("companies");
$langs->load("companies"); $langs->load("orders");
$langs->load("orders"); $langs->load("bills");
$langs->load("bills");
if ($_POST["action"] == 'setremise')
if ($_POST["action"] == 'setremise') {
{ $soc = New Societe($db);
$soc->fetch($_GET["id"]);
// Define remise $result=$soc->set_remise_client($_POST["remise"],$_POST["note"],$user);
if ($_POST['remise']>0)
$remise=$_POST['remise']; if ($result > 0)
else {
$remise=0; Header("Location: remise.php?id=".$_GET["id"]);
exit;
$soc = New Societe($db); }
$soc->fetch($_GET["id"]); else
$result=$soc->set_remise_client($remise,$_POST["note"],$user); {
$errmesg=$soc->error;
if ($result > 0) }
{ }
Header("Location: remise.php?id=".$_GET["id"]);
exit;
} llxHeader();
else
{ $_socid = $_GET["id"];
$errmesg=$soc->error;
}
} // Sécurité si un client essaye d'accéder à une autre fiche que la sienne
if ($user->societe_id > 0)
{
llxHeader(); $_socid = $user->societe_id;
}
$_socid = $_GET["id"];
/*********************************************************************************
// Sécurité si un client essaye d'accéder à une autre fiche que la sienne *
if ($user->societe_id > 0) * Mode fiche
{ *
$_socid = $user->societe_id; *********************************************************************************/
} if ($_socid > 0)
{
// On recupere les donnees societes par l'objet
/********************************************************************************* $objsoc = new Societe($db);
* $objsoc->id=$_socid;
* Mode fiche $objsoc->fetch($_socid,$to);
*
*********************************************************************************/ if ($errmesg)
if ($_socid > 0) {
{ print '<div class="error">'.$errmesg.'</div><br>';
// On recupere les donnees societes par l'objet }
$objsoc = new Societe($db);
$objsoc->id=$_socid; /*
$objsoc->fetch($_socid,$to); * Affichage onglets
*/
if ($errmesg) $head = societe_prepare_head($objsoc);
{
print '<div class="error">'.$errmesg.'</div><br>'; dolibarr_fiche_head($head, 'relativediscount', $objsoc->nom);
}
/* /*
* Affichage onglets *
*/ *
$head = societe_prepare_head($objsoc); */
print '<form method="POST" action="remise.php?id='.$objsoc->id.'">';
dolibarr_fiche_head($head, 'relativediscount', $objsoc->nom); print '<input type="hidden" name="action" value="setremise">';
print '<table width="100%" border="0">';
print '<tr><td valign="top">';
/* print '<table class="border" width="100%">';
*
* // Remise
*/ print '<tr><td colspan="2" width="25%">';
print '<form method="POST" action="remise.php?id='.$objsoc->id.'">'; print $langs->trans("CustomerRelativeDiscount").'</td><td colspan="2">'.$objsoc->remise_client."%</td></tr>";
print '<input type="hidden" name="action" value="setremise">';
print '<table width="100%" border="0">'; // Nouvelle valeur
print '<tr><td valign="top">'; print '<tr><td colspan="2">';
print '<table class="border" width="100%">'; print $langs->trans("NewValue").'</td><td colspan="2"><input type="text" size="5" name="remise" value="'.$objsoc->remise_client.'">%</td></tr>';
// Remise // Motif/Note
print '<tr><td colspan="2" width="25%">'; print '<tr><td colspan="2" width="25%">';
print $langs->trans("CustomerRelativeDiscount").'</td><td colspan="2">'.$objsoc->remise_client."%</td></tr>"; print $langs->trans("NoteReason").'</td><td colspan="2"><input type="text" size="60" name="note" value=""></td></tr>';
// Nouvelle valeur print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>';
print '<tr><td colspan="2">';
print $langs->trans("NewValue").'</td><td colspan="2"><input type="text" size="5" name="remise" value="'.$objsoc->remise_client.'">%</td></tr>'; print "</table>";
print "</td></tr>";
// Motif/Note print '</table>';
print '<tr><td colspan="2" width="25%">'; print "</form>";
print $langs->trans("NoteReason").'</td><td colspan="2"><input type="text" size="60" name="note" value=""></td></tr>';
print "</div>\n";
print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Modify").'"></td></tr>'; print '<br>';
print "</table>";
print "</td></tr>"; /*
print '</table>'; * Liste de l'historique des avoirs
print "</form>"; */
$sql = "SELECT rc.rowid,rc.remise_client,rc.note,".$db->pdate("rc.datec")." as dc,";
print "</div>\n"; $sql.= " u.login, u.rowid as user_id";
print '<br>'; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u";
$sql.= " WHERE rc.fk_soc =". $objsoc->id;
$sql.= " AND u.rowid = rc.fk_user_author";
/* $sql.= " ORDER BY rc.datec DESC";
* Liste de l'historique des avoirs
*/ $resql=$db->query($sql);
$sql = "SELECT rc.rowid,rc.remise_client,rc.note,".$db->pdate("rc.datec")." as dc,"; if ($resql)
$sql.= " u.login, u.rowid as user_id"; {
$sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; print '<table class="noborder" width="100%">';
$sql.= " WHERE rc.fk_soc =". $objsoc->id; $tag = !$tag;
$sql.= " AND u.rowid = rc.fk_user_author"; print '<tr class="liste_titre">';
$sql.= " ORDER BY rc.datec DESC"; print '<td width="160">'.$langs->trans("Date").'</td>';
print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>';
$resql=$db->query($sql); print '<td align="left">'.$langs->trans("NoteReason").'</td>';
if ($resql) print '<td align="center">'.$langs->trans("User").'</td>';
{ print '</tr>';
print '<table class="noborder" width="100%">'; $i = 0 ;
$tag = !$tag; $num = $db->num_rows($resql);
print '<tr class="liste_titre">';
print '<td width="160">'.$langs->trans("Date").'</td>'; while ($i < $num )
print '<td width="160" align="center">'.$langs->trans("CustomerRelativeDiscountShort").'</td>'; {
print '<td align="left">'.$langs->trans("NoteReason").'</td>'; $obj = $db->fetch_object($resql);
print '<td align="center">'.$langs->trans("User").'</td>'; $tag = !$tag;
print '</tr>'; print '<tr '.$bc[$tag].'>';
$i = 0 ; print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>';
$num = $db->num_rows($resql); print '<td align="center">'.$obj->remise_client.' %</td>';
print '<td align="left">'.$obj->note.'</td>';
while ($i < $num ) print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>';
{ print '</tr>';
$obj = $db->fetch_object($resql); $i++;
$tag = !$tag; }
print '<tr '.$bc[$tag].'>'; $db->free($resql);
print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>'; print "</table>";
print '<td align="center">'.$obj->remise_client.' %</td>'; }
print '<td align="left">'.$obj->note.'</td>'; else
print '<td align="center"><a href="'.DOL_URL_ROOT.'/user/fiche.php?id='.$obj->user_id.'">'.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'</a></td>'; {
print '</tr>'; dolibarr_print_error($db);
$i++; }
}
$db->free($resql); }
print "</table>";
} $db->close();
else
{ llxFooter('$Date$ - $Revision$');
dolibarr_print_error($db); ?>
}
}
$db->close();
llxFooter('$Date$ - $Revision$');
?>

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff