diff --git a/ChangeLog b/ChangeLog index 2c596f72f49acf27ecf22ec0da4bb2b1f0e392b3..0f4b84f464d115af09a0ea7413cc062d6246a683 100644 --- a/ChangeLog +++ b/ChangeLog @@ -21,6 +21,7 @@ For users: back. - Fix: Category of a bank transaction was not saved. - Fix: Clicktodial plugin works correctly now +- Fix: Multiprices features works correctly. For translators: - Added ca_ES language files diff --git a/build/exe/doliwamp/doliwamp.iss b/build/exe/doliwamp/doliwamp.iss index 4ed152795f9eacc074e212f2974784e9763fe982..9535fb685e9f18f137dee81facbc60b97b486247 100644 --- a/build/exe/doliwamp/doliwamp.iss +++ b/build/exe/doliwamp/doliwamp.iss @@ -16,10 +16,10 @@ [Setup] ; ----- Change this ----- AppName=DoliWamp -; DoliWamp x.x or DoliWamp x.x-dev or DoliWamp x.x-beta -AppVerName=DoliWamp 2.6-dev -; DoliWamp x.x or DoliWamp x.x-dev or DoliWamp x.x-beta -OutputBaseFilename=DoliWamp 2.6-dev +; DoliWamp-x.x or DoliWamp-x.x-dev or DoliWamp-x.x-beta +AppVerName=DoliWamp-2.5.1-beta +; DoliWamp-x.x or DoliWamp-x.x-dev or DoliWamp-x.x-beta +OutputBaseFilename=DoliWamp-2.5.1-beta ; Define full path from wich all relative path are defined ; You must modify this to put here your dolibarr root directory SourceDir=E:\Mes Developpements\dolibarr diff --git a/htdocs/admin/produit.php b/htdocs/admin/produit.php index 909a676e3182efe963e2b941bdd611c5ea7c97e6..696194fcc87d81c648c9251d405aa9026a9d402b 100644 --- a/htdocs/admin/produit.php +++ b/htdocs/admin/produit.php @@ -175,7 +175,7 @@ print '</form>'; // multiprix nombre de prix a proposer -if($conf->global->PRODUIT_MULTIPRICES == 1) +if($conf->global->PRODUIT_MULTIPRICES) { $var=!$var; print "<form method=\"post\" action=\"produit.php\">"; diff --git a/htdocs/comm/addpropal.php b/htdocs/comm/addpropal.php index 0f3ee6b9381ca6526893e3d26e90b577a04cae25..d867a647fe6434a01da4485e855829a713e059f2 100644 --- a/htdocs/comm/addpropal.php +++ b/htdocs/comm/addpropal.php @@ -270,7 +270,7 @@ if ($_GET["action"] == 'create') { print '<tr><td>'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) $html->select_produits('',"idprod".$i,'',$conf->produit->limit_size,$soc->price_level); else $html->select_produits('',"idprod".$i,'',$conf->produit->limit_size); diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index 4b3f206a056aa1b666c914c6cf716561a0d067aa..8c26eb1267ad8ca7a1a22538312e7264b7ac2507 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -1,6 +1,6 @@ <?PHP /* Copyright (C) 2001-2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> - * Copyright (C) 2004-2007 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2004-2009 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2006 Andre Cianfarani <acianfa@free.fr> * * This program is free software; you can redistribute it and/or modify @@ -16,65 +16,65 @@ * 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$ */ /** - \file htdocs/comm/multiprix.php - \ingroup commercial - \brief Onglet choix du niveau de prix - \version $Revision$ -*/ - + \file htdocs/comm/multiprix.php + \ingroup commercial + \brief Onglet choix du niveau de prix + \version $Id$ + */ + require_once("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT."/lib/company.lib.php"); require_once(DOL_DOCUMENT_ROOT."/contact.class.php"); - $langs->load("orders"); $langs->load("companies"); +$_socid = $_GET["id"]; +// Security check +if ($user->societe_id > 0) +{ + $_socid = $user->societe_id; +} + + +/* + * Actions + */ if ($_POST["action"] == 'setpricelevel') { - $soc = New Societe($db); - $soc->fetch($_GET["id"]); - $soc->set_price_level($_POST["price_level"],$user); - - Header("Location: multiprix.php?id=".$_GET["id"]); - exit; -} + $soc = New Societe($db); + $soc->fetch($_GET["id"]); + $soc->set_price_level($_POST["price_level"],$user); + Header("Location: multiprix.php?id=".$_GET["id"]); + exit; +} -llxHeader(); -$_socid = $_GET["id"]; +/* + * View + */ +llxHeader(); -// Sécurité si un client essaye d'accéder à une autre fiche que la sienne -if ($user->societe_id > 0) -{ - $_socid = $user->societe_id; -} +$userstatic=new User($db); -/********************************************************************************* - * - * Mode fiche - * - *********************************************************************************/ if ($_socid > 0) { // On recupere les donnees societes par l'objet $objsoc = new Societe($db); $objsoc->id=$_socid; $objsoc->fetch($_socid,$to); - + if ($errmesg) { print '<div class="error">'.$errmesg.'</div><br>'; } - + /* * Affichage onglets @@ -82,83 +82,85 @@ if ($_socid > 0) $head = societe_prepare_head($objsoc); - dolibarr_fiche_head($head, 'customer', $objsoc->nom); + dolibarr_fiche_head($head, 'customer', $langs->trans("ThirdParty")); - print '<form method="POST" action="multiprix.php?id='.$objsoc->id.'">'; - print '<input type="hidden" name="action" value="setpricelevel">'; - print '<table width="100%" border="0">'; - print '<tr><td valign="top">'; - print '<table class="border" width="100%">'; + print '<form method="POST" action="multiprix.php?id='.$objsoc->id.'">'; + print '<input type="hidden" name="action" value="setpricelevel">'; + print '<table width="100%" border="0">'; + print '<tr><td valign="top">'; + print '<table class="border" width="100%">'; - print '<tr><td colspan="2" width="25%">'; - print $langs->trans("PriceLevel").'</td><td colspan="2">'.$objsoc->price_level."</td></tr>"; + print '<tr><td colspan="2" width="25%">'; + print $langs->trans("PriceLevel").'</td><td colspan="2">'.$objsoc->price_level."</td></tr>"; - print '<tr><td colspan="2">'; - print $langs->trans("NewValue").'</td><td colspan="2">'; - print '<select name="price_level">'; + print '<tr><td colspan="2">'; + print $langs->trans("NewValue").'</td><td colspan="2">'; + print '<select name="price_level" class="flat">'; for($i=1;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) { - print '<option value="'.$i.'"' ; - if($i == $objsoc->price_level) - print 'selected'; - print '>'.$i.'</option>'; + print '<option value="'.$i.'"' ; + if($i == $objsoc->price_level) + print 'selected'; + print '>'.$i.'</option>'; } print '</select>'; print '</td></tr>'; - print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; - - print "</table>"; - print "</form>"; - - print "</td>\n"; - - - print "</td></tr>"; - print "</table></div>\n"; - print '<br>'; - - - /* - * Liste de l'historique des remises - */ - $sql = "SELECT rc.rowid,rc.price_level,".$db->pdate("rc.datec")." as dc, u.login"; - $sql .= " FROM ".MAIN_DB_PREFIX."societe_prices 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"; - - $resql=$db->query($sql); - if ($resql) - { - print '<table class="noborder" width="100%">'; - $tag = !$tag; - print '<tr class="liste_titre">'; - print '<td>'.$langs->trans("Date").'</td>'; - print '<td>'.$langs->trans("PriceLevel").'</td>'; - print '<td>'.$langs->trans("User").'</td>'; - print '</tr>'; - $i = 0 ; - $num = $db->num_rows($resql); - - while ($i < $num ) - { - $obj = $db->fetch_object($resql); - $tag = !$tag; - print '<tr '.$bc[$tag].'>'; - print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>'; - print '<td>'.$obj->price_level.' </td>'; - print '<td>'.$obj->login.'</td>'; - print '</tr>'; - $i++; - } - $db->free($resql); + print '<tr><td colspan="4" align="center"><input type="submit" class="button" value="'.$langs->trans("Save").'"></td></tr>'; + print "</table>"; - } - else - { - dolibarr_print_error($db); - } + print "</form>"; + + print "</td>\n"; + + + print "</td></tr>"; + print "</table></div>\n"; + print '<br>'; + + + /* + * Liste de l'historique des remises + */ + $sql = "SELECT rc.rowid,rc.price_level,".$db->pdate("rc.datec")." as dc, u.rowid as uid, u.login"; + $sql .= " FROM ".MAIN_DB_PREFIX."societe_prices 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"; + + $resql=$db->query($sql); + if ($resql) + { + print '<table class="noborder" width="100%">'; + $tag = !$tag; + print '<tr class="liste_titre">'; + print '<td>'.$langs->trans("Date").'</td>'; + print '<td>'.$langs->trans("PriceLevel").'</td>'; + print '<td align="right">'.$langs->trans("User").'</td>'; + print '</tr>'; + $i = 0 ; + $num = $db->num_rows($resql); + + while ($i < $num ) + { + $obj = $db->fetch_object($resql); + $tag = !$tag; + print '<tr '.$bc[$tag].'>'; + print '<td>'.dolibarr_print_date($obj->dc,"dayhour").'</td>'; + print '<td>'.$obj->price_level.' </td>'; + $userstatic->id=$obj->uid; + $userstatic->nom=$obj->login; + print '<td align="right">'.$userstatic->getNomUrl(1).'</td>'; + print '</tr>'; + $i++; + } + $db->free($resql); + print "</table>"; + } + else + { + dolibarr_print_error($db); + } } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 20fc071dfeddca5aef3d200f1602d1648aea9a91..60ae2c7ec5fd46d0f7dc1644c8afb02c5357ac75 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -597,7 +597,7 @@ if ($_POST['action'] == "addligne" && $user->rights->propale->creer) $tva_npr = get_default_npr($mysoc,$propal->client,$prod->tva_tx); // On defini prix unitaire - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$propal->client->price_level]; $pu_ttc = $prod->multiprices_ttc[$propal->client->price_level]; @@ -1592,7 +1592,7 @@ if ($_GET['propalid'] > 0) print '<tr '.$bc[$var].'>'; print '<td '.$colspan.'>'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { $html->select_produits('','idprod','',$conf->produit->limit_size,$societe->price_level); } diff --git a/htdocs/commande/commande.class.php b/htdocs/commande/commande.class.php index efa78320e5976e3d8cf4c56e551bfb2f4ebb3fbe..ba8badc5b7f99d50bc6efd5e95a79f00b4c105ff 100644 --- a/htdocs/commande/commande.class.php +++ b/htdocs/commande/commande.class.php @@ -769,7 +769,7 @@ class Commande extends CommonObject $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) $price = $prod->multiprices[$this->client->price_level]; else $price = $prod->price; diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index 393e91828198fcf42a7ecc0e080f76dff5af0bd4..59342688df63c63210bf909d041b0f8469f5f26a 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -334,7 +334,7 @@ if ($_POST['action'] == 'addligne' && $user->rights->commande->creer) $tva_tx = get_default_tva($mysoc,$commande->client,$prod->tva_tx); // multiprix - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$commande->client->price_level]; $pu_ttc = $prod->multiprices_ttc[$commande->client->price_level]; @@ -1038,7 +1038,7 @@ if ($_GET['action'] == 'create' && $user->rights->commande->creer) { print '<tr><td>'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level); else print $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); @@ -1791,7 +1791,7 @@ else print '<tr '.$bc[$var].'>'; print '<td colspan="3">'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { $html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level); } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index db76fdd926f1053154d282a9058f3cceba6a1982..6571ad504e194f24bdf0ebcd52ffe04cceb65ef8 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -874,7 +874,7 @@ if (($_POST['action'] == 'addligne' || $_POST['action'] == 'addligne_predef') && $tva_npr = get_default_npr($mysoc,$fac->client,$prod->tva_tx); // On defini prix unitaire - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$fac->client->price_level]; $pu_ttc = $prod->multiprices_ttc[$fac->client->price_level]; @@ -1714,7 +1714,7 @@ if ($_GET['action'] == 'create') print '<tr>'; print '<td>'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size,$soc->price_level); else $html->select_produits('','idprod'.$i,'',$conf->produit->limit_size); @@ -2864,7 +2864,7 @@ else print '<tr '.$bc[$var].'>'; print '<td colspan="3">'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { $html->select_produits('','idprod','',$conf->produit->limit_size,$soc->price_level); } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 23042510f056bff1d98ce5f3f02e1296f89e83d3..8a9913b337b81a403cfe1c1288dca36058477063 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -226,7 +226,7 @@ if ($_POST["action"] == 'addligne' && $user->rights->contrat->creer) $tva_npr = get_default_npr($mysoc,$contrat->client,$prod->tva_npr); // On defini prix unitaire - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$contrat->client->price_level]; $pu_ttc = $prod->multiprices_ttc[$contrat->client->price_level]; @@ -1179,7 +1179,7 @@ else print "<tr $bc[$var]>"; print '<td colspan="3">'; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) $form->select_produits('','p_idprod',1,$conf->produit->limit_size,$contrat->societe->price_level); else $form->select_produits('','p_idprod',1,$conf->produit->limit_size); diff --git a/htdocs/facture.class.php b/htdocs/facture.class.php index 9ea2cafce9dd13b19c1041b11954c92b828c0705..47813d4a02985be7b1a9e233b4e3d8e3a7b06aaf 100644 --- a/htdocs/facture.class.php +++ b/htdocs/facture.class.php @@ -1457,7 +1457,7 @@ class Facture extends CommonObject $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) $price = $prod->multiprices[$this->client->price_level]; else $price = $prod->price; diff --git a/htdocs/install/inc.php b/htdocs/install/inc.php index 30c981e087b48b91e6522d74ec3601fda9ad8f06..be08f68a6e2f65227eff35f65d72de737a44a68c 100644 --- a/htdocs/install/inc.php +++ b/htdocs/install/inc.php @@ -2,7 +2,7 @@ /* Copyright (C) 2004 Rodolphe Quiedeville <rodolphe@quiedeville.org> * Copyright (C) 2004 Benoit Mortier <benoit.mortier@opensides.be> * Copyright (C) 2004 Sebastien DiCintio <sdicintio@ressource-toi.org> - * Copyright (C) 2007-2008 Laurent Destailleur <eldy@users.sourceforge.net> + * Copyright (C) 2007-2009 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 @@ -24,7 +24,7 @@ \version $Id$ */ -define('DOL_VERSION','2.6-dev'); // Also defined in htdocs/master.inc.php +define('DOL_VERSION','2.5.1-beta'); // Also defined in htdocs/master.inc.php require_once('../translate.class.php'); require_once('../lib/functions.lib.php'); diff --git a/htdocs/master.inc.php b/htdocs/master.inc.php index 90a3e93373c12624807f7df8b93662981d844bfd..d89b93a9b979e7031990e491b2f3ce23378a787a 100644 --- a/htdocs/master.inc.php +++ b/htdocs/master.inc.php @@ -30,7 +30,7 @@ * \version $Id$ */ -define('DOL_VERSION','2.6-dev'); // Also defined in htdocs/install/inc.php +define('DOL_VERSION','2.5.1-beta'); // Also defined in htdocs/install/inc.php define('EURO',chr(128)); // La fonction clearstatcache ne doit pas etre appel�e de mani�re globale car ralenti. diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index 8fdf02a4822465800296c647f98d4cf54ea0b3a2..1fa901e47c663aeb86c394a0e0f46c80460bb839 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -106,7 +106,7 @@ if ($_POST["action"] == 'add' && $user->rights->produit->creer) $product->volume_units = $_POST["volume_units"]; $product->finished = $_POST["finished"]; // MultiPrix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) { @@ -316,7 +316,7 @@ if ($_POST["action"] == 'addinpropal') $price_base_type = 'HT'; // multiprix - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$soc->price_level]; $pu_ttc = $prod->multiprices_ttc[$soc->price_level]; @@ -395,7 +395,7 @@ if ($_POST["action"] == 'addincommande') $tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx); // multiprix - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$soc->price_level]; $pu_ttc = $prod->multiprices_ttc[$soc->price_level]; @@ -475,7 +475,7 @@ if ($_POST["action"] == 'addinfacture' && $user->rights->facture->creer) $tva_tx = get_default_tva($mysoc,$soc,$prod->tva_tx); // multiprix - if ($conf->global->PRODUIT_MULTIPRICES == 1) + if ($conf->global->PRODUIT_MULTIPRICES) { $pu_ht = $prod->multiprices[$soc->price_level]; $pu_ttc = $prod->multiprices_ttc[$soc->price_level]; @@ -687,7 +687,7 @@ if ($_GET["action"] == 'create' && $user->rights->produit->creer) print '<br>'; print '<table class="border" width="100%">'; - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { print '<tr><td>'.$langs->trans("SellingPrice").' 1</td>'; print '<td><input name="price" size="10" value="'.$product->price.'">'; diff --git a/htdocs/propal.class.php b/htdocs/propal.class.php index 7d88f162ec498e2b70e4d02dc72a73fc1b7f8351..16279733644f62fba003b69d6c6f64bd18d8a953 100644 --- a/htdocs/propal.class.php +++ b/htdocs/propal.class.php @@ -149,7 +149,7 @@ class Propal extends CommonObject $tva_tx = get_default_tva($mysoc,$this->client,$prod->tva_tx); // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { $price = $prod->multiprices[$this->client->price_level]; } diff --git a/htdocs/societe.class.php b/htdocs/societe.class.php index e83cd576f879ea7413e2605c8ea12d725a98d558..1a337f452bbb5fef70534d47c7e99fb14c323ce0 100644 --- a/htdocs/societe.class.php +++ b/htdocs/societe.class.php @@ -501,7 +501,7 @@ class Societe extends CommonObject } $sql = 'SELECT s.rowid, s.nom, s.address,'.$this->db->pdate('s.datec').' as dc, s.prefix_comm'; - if($conf->global->PRODUIT_MULTIPRICES == 1) $sql .= ', s.price_level'; + if($conf->global->PRODUIT_MULTIPRICES) $sql .= ', s.price_level'; $sql .= ','. $this->db->pdate('s.tms').' as date_update'; $sql .= ', s.tel, s.fax, s.email, s.url, s.cp, s.ville, s.note, s.client, s.fournisseur'; $sql .= ', s.siren, s.siret, s.ape, s.idprof4'; @@ -605,7 +605,7 @@ class Societe extends CommonObject $this->rubrique = $obj->rubrique; $this->note = $obj->note; // multiprix - if($conf->global->PRODUIT_MULTIPRICES == 1) $this->price_level = $obj->price_level; + $this->price_level = $obj->price_level; $result = 1; }