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

View File

@ -5,7 +5,6 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* 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
@ -190,10 +189,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$propal->duree_validite = $_POST['duree_validite']; $propal->duree_validite = $_POST['duree_validite'];
$propal->cond_reglement_id = $_POST['cond_reglement_id']; $propal->cond_reglement_id = $_POST['cond_reglement_id'];
$propal->mode_reglement_id = $_POST['mode_reglement_id']; $propal->mode_reglement_id = $_POST['mode_reglement_id'];
if($_POST['remise_percent']>0) $propal->remise_percent = $_POST['remise_percent'];
$propal->remise_percent = $_POST['remise_percent'];
else
$propal->remise_percent = 0;
$propal->remise_absolue = $_POST['remise_absolue']; $propal->remise_absolue = $_POST['remise_absolue'];
$propal->socid = $_POST['socid']; $propal->socid = $_POST['socid'];
$propal->contactid = $_POST['contactidp']; $propal->contactid = $_POST['contactidp'];
@ -619,12 +615,6 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
$info_bits=0; $info_bits=0;
if ($tva_npr) $info_bits |= 0x01; if ($tva_npr) $info_bits |= 0x01;
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
// Insert line // Insert line
$result=$propal->addline( $result=$propal->addline(
$_POST['propalid'], $_POST['propalid'],
@ -633,7 +623,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer)
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$_POST['idprod'], $_POST['idprod'],
$remise_percent, $_POST['remise_percent'],
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$info_bits $info_bits
@ -672,17 +662,10 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
$vat_rate=$_POST['tva_tx']; $vat_rate=$_POST['tva_tx'];
$vat_rate=eregi_replace('\*','',$vat_rate); $vat_rate=eregi_replace('\*','',$vat_rate);
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$result = $propal->updateline($_POST['lineid'], $result = $propal->updateline($_POST['lineid'],
$_POST['subprice'], $_POST['subprice'],
$_POST['qty'], $_POST['qty'],
$remise_percent, $_POST['remise_percent'],
$vat_rate, $vat_rate,
$_POST['desc'], $_POST['desc'],
'HT', 'HT',
@ -744,15 +727,9 @@ if ($_POST["action"] == 'setconditions')
if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->propale->creer) if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->propale->creer)
{ {
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$propal = new Propal($db); $propal = new Propal($db);
$propal->fetch($_REQUEST['propalid']); $propal->fetch($_REQUEST['propalid']);
$result = $propal->set_remise_percent($user, $remise_percent); $result = $propal->set_remise_percent($user, $_POST['remise_percent']);
$_GET['propalid']=$_REQUEST['propalid']; $_GET['propalid']=$_REQUEST['propalid'];
} }

View File

@ -1,7 +1,6 @@
<?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
@ -39,16 +38,9 @@ $langs->load("bills");
if ($_POST["action"] == 'setremise') if ($_POST["action"] == 'setremise')
{ {
// Define remise
if ($_POST['remise']>0)
$remise=$_POST['remise'];
else
$remise=0;
$soc = New Societe($db); $soc = New Societe($db);
$soc->fetch($_GET["id"]); $soc->fetch($_GET["id"]);
$result=$soc->set_remise_client($remise,$_POST["note"],$user); $result=$soc->set_remise_client($_POST["remise"],$_POST["note"],$user);
if ($result > 0) if ($result > 0)
{ {

View File

@ -4,7 +4,6 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2008 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* 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
@ -275,15 +274,9 @@ if ($_POST['action'] == 'setconditions' && $user->rights->commande->creer)
if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer) if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer)
{ {
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$commande = new Commande($db); $commande = new Commande($db);
$commande->fetch($_REQUEST['id']); $commande->fetch($_REQUEST['id']);
$result = $commande->set_remise($user, $remise_percent); $result = $commande->set_remise($user, $_POST['remise_percent']);
$_GET['id']=$_REQUEST['id']; $_GET['id']=$_REQUEST['id'];
} }
@ -367,12 +360,6 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
$info_bits=0; $info_bits=0;
if ($tva_npr) $info_bits |= 0x01; if ($tva_npr) $info_bits |= 0x01;
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
// Insert line // Insert line
$result = $commande->addline( $result = $commande->addline(
$_POST['id'], $_POST['id'],
@ -381,7 +368,7 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer)
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$_POST['idprod'], $_POST['idprod'],
$remise_percent, $_POST['remise_percent'],
$info_bits, $info_bits,
'', '',
$price_base_type, $price_base_type,
@ -420,17 +407,11 @@ if ($_POST['action'] == 'updateligne' && $user->rights->commande->creer && $_POS
$vat_rate=$_POST['tva_tx']; $vat_rate=$_POST['tva_tx'];
$vat_rate=eregi_replace('\*','',$vat_rate); $vat_rate=eregi_replace('\*','',$vat_rate);
// Define elremise_percent
if ($_POST['elremise_percent']>0)
$elremise_percent=$_POST['elremise_percent'];
else
$elremise_percent=0;
$result = $commande->updateline($_POST['elrowid'], $result = $commande->updateline($_POST['elrowid'],
$_POST['eldesc'], $_POST['eldesc'],
$_POST['pu'], $_POST['pu'],
$_POST['qty'], $_POST['qty'],
$elremise_percent, $_POST['elremise_percent'],
$vat_rate, $vat_rate,
'HT', 'HT',
$info_bits $info_bits

View File

@ -5,7 +5,6 @@
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com> * Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr>
* 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
@ -204,15 +203,9 @@ if ($_POST['action'] == 'setconditions')
if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer) if ($_REQUEST['action'] == 'setremisepercent' && $user->rights->facture->creer)
{ {
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$fac = new Facture($db); $fac = new Facture($db);
$fac->fetch($_REQUEST['facid']); $fac->fetch($_REQUEST['facid']);
$result = $fac->set_remise($user, $remise_percent); $result = $fac->set_remise($user, $_POST['remise_percent']);
$_GET['facid']=$_REQUEST['facid']; $_GET['facid']=$_REQUEST['facid'];
} }
@ -445,12 +438,6 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facture->socid=$_POST['socid']; $facture->socid=$_POST['socid'];
$facture->fetch_client(); $facture->fetch_client();
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$db->begin(); $db->begin();
// Facture remplacement // Facture remplacement
@ -484,7 +471,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facture->cond_reglement_id = $_POST['cond_reglement_id']; $facture->cond_reglement_id = $_POST['cond_reglement_id'];
$facture->mode_reglement_id = $_POST['mode_reglement_id']; $facture->mode_reglement_id = $_POST['mode_reglement_id'];
$facture->remise_absolue = $_POST['remise_absolue']; $facture->remise_absolue = $_POST['remise_absolue'];
$facture->remise_percent = $remise_percent; $facture->remise_percent = $_POST['remise_percent'];
// Propriétés particulieres a facture de remplacement // Propriétés particulieres a facture de remplacement
$facture->fk_facture_source = $_POST['fac_replacement']; $facture->fk_facture_source = $_POST['fac_replacement'];
@ -528,7 +515,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facture->cond_reglement_id = 0; $facture->cond_reglement_id = 0;
$facture->mode_reglement_id = $_POST['mode_reglement_id']; $facture->mode_reglement_id = $_POST['mode_reglement_id'];
$facture->remise_absolue = $_POST['remise_absolue']; $facture->remise_absolue = $_POST['remise_absolue'];
$facture->remise_percent = $remise_percent; $facture->remise_percent = $_POST['remise_percent'];
// Propriétés particulieres a facture avoir // Propriétés particulieres a facture avoir
$facture->fk_facture_source = $_POST['fac_avoir']; $facture->fk_facture_source = $_POST['fac_avoir'];
@ -585,7 +572,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
$facture->mode_reglement_id = $_POST['mode_reglement_id']; $facture->mode_reglement_id = $_POST['mode_reglement_id'];
$facture->amount = $_POST['amount']; $facture->amount = $_POST['amount'];
$facture->remise_absolue = $_POST['remise_absolue']; $facture->remise_absolue = $_POST['remise_absolue'];
$facture->remise_percent = $remise_percent; $facture->remise_percent = $_POST['remise_percent'];
if (! $_POST['propalid'] && ! $_POST['commandeid'] && ! $_POST['contratid']) if (! $_POST['propalid'] && ! $_POST['commandeid'] && ! $_POST['contratid'])
{ {
@ -601,12 +588,7 @@ if ($_POST['action'] == 'add' && $user->rights->facture->creer)
if ($_POST['date_end'.$i.'year'] && $_POST['date_end'.$i.'month'] && $_POST['date_end'.$i.'day']) { if ($_POST['date_end'.$i.'year'] && $_POST['date_end'.$i.'month'] && $_POST['date_end'.$i.'day']) {
$endday=$_POST['date_end'.$i.'year'].'-'.$_POST['date_end'.$i.'month'].'-'.$_POST['date_end'.$i.'day']; $endday=$_POST['date_end'.$i.'year'].'-'.$_POST['date_end'.$i.'month'].'-'.$_POST['date_end'.$i.'day'];
} }
// Define remise_percent $facture->add_product($_POST['idprod'.$i],$_POST['qty'.$i],$_POST['remise_percent'.$i],$startday,$endday);
if ($_POST['remise_percent'.$i]>0)
$remise_percent_i=$_POST['remise_percent'.$i];
else
$remise_percent_i=0;
$facture->add_product($_POST['idprod'.$i],$_POST['qty'.$i],$remise_percent_i,$startday,$endday);
} }
} }
@ -895,12 +877,6 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
$info_bits=0; $info_bits=0;
if ($tva_npr) $info_bits |= 0x01; if ($tva_npr) $info_bits |= 0x01;
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
// Insert line // Insert line
$result = $fac->addline( $result = $fac->addline(
$_POST['facid'], $_POST['facid'],
@ -909,7 +885,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') &&
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$_POST['idprod'], $_POST['idprod'],
$remise_percent, $_POST['remise_percent'],
$date_start, $date_start,
$date_end, $date_end,
0, 0,
@ -959,17 +935,11 @@ if ($_POST['action'] == 'updateligne' && $user->rights->facture->creer && $_POST
$vat_rate=$_POST['tva_tx']; $vat_rate=$_POST['tva_tx'];
$vat_rate=eregi_replace('\*','',$vat_rate); $vat_rate=eregi_replace('\*','',$vat_rate);
// Define remise_percent
if ($_POST['remise_percent']>0)
$remise_percent=$_POST['remise_percent'];
else
$remise_percent=0;
$result = $fac->updateline($_POST['rowid'], $result = $fac->updateline($_POST['rowid'],
$_POST['desc'], $_POST['desc'],
$_POST['price'], $_POST['price'],
$_POST['qty'], $_POST['qty'],
$remise_percent, $_POST['remise_percent'],
$date_start, $date_start,
$date_end, $date_end,
$vat_rate, $vat_rate,