diff --git a/htdocs/expedition/stats/index.php b/htdocs/expedition/stats/index.php index e58db9ecdf6..af43f2c511f 100644 --- a/htdocs/expedition/stats/index.php +++ b/htdocs/expedition/stats/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -15,17 +15,13 @@ * 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$ - * */ /** \file htdocs/expedition/stats/index.php \ingroup expedition \brief Page des stats expeditions - \version $Revision$ + \version $Id$ */ require("./pre.inc.php"); @@ -59,7 +55,7 @@ if ($db->query($sql)) } $db->free(); -print '
Statistiques effectuées sur les expéditions validées uniquement'; +print '
Statistiques effectuees sur les expeditions validees uniquement'; $db->close(); diff --git a/htdocs/expedition/stats/month.php b/htdocs/expedition/stats/month.php index f9f1bbdba2b..6b1c8b28227 100644 --- a/htdocs/expedition/stats/month.php +++ b/htdocs/expedition/stats/month.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * * 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 @@ -63,7 +63,7 @@ if (! $mesg) } print ''; -print ''; +print ''; print ''; @@ -71,5 +71,5 @@ print '
Nombre d\'expédition par mois
Nombre d expedition par mois'; print ''; print '
'; $db->close(); -llxFooter("Dernière modification $Date$ révision $Revision$"); +llxFooter('$Date$ - $Revision$'); ?> diff --git a/htdocs/product/fiche.php b/htdocs/product/fiche.php index e078fc9b01f..8fdf02a4822 100644 --- a/htdocs/product/fiche.php +++ b/htdocs/product/fiche.php @@ -844,22 +844,9 @@ if ($_GET["id"] || $_GET["ref"]) print ''.$langs->trans("Label").''.$product->libelle.''; // MultiPrix - if($conf->global->PRODUIT_MULTIPRICES == 1) + if($conf->global->PRODUIT_MULTIPRICES) { - print ''.$langs->trans("SellingPrice").' 1'; - - if ($product->price_base_type == 'TTC') - { - print ''.price($product->price_ttc); - } - else - { - print ''.price($product->price); - } - - print ' '.$langs->trans($product->price_base_type); - print ''; - for($i=2;$i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT;$i++) + for ($i=1; $i<=$conf->global->PRODUIT_MULTIPRICES_LIMIT; $i++) { print ''.$langs->trans("SellingPrice").' '.$i.''; @@ -880,13 +867,24 @@ if ($_GET["id"] || $_GET["ref"]) { print ' '.$langs->trans($product->price_base_type); } - print ''; + + // Prix mini + print ''.$langs->trans("MinPrice").' '.$i.''; + if ($product->multiprices_base_type["$i"] == 'TTC') + { + print price($product->multiprices_min_ttc["$i"]).' '.$langs->trans($product->multiprices_base_type["$i"]); + } + else + { + print price($product->multiprices_min["$i"]).' '.$langs->trans($product->multiprices_base_type["$i"]); + } + print ''; } } - // Prix else { + // Prix print ''.$langs->trans("SellingPrice").''; if ($product->price_base_type == 'TTC') { @@ -897,19 +895,19 @@ if ($_GET["id"] || $_GET["ref"]) print price($product->price).' '.$langs->trans($product->price_base_type); } print ''; - } - // Prix mini - print ''.$langs->trans("MinPrice").''; - if ($product->price_base_type == 'TTC') - { - print price($product->price_min_ttc).' '.$langs->trans($product->price_base_type); + // Prix mini + print ''.$langs->trans("MinPrice").''; + if ($product->price_base_type == 'TTC') + { + print price($product->price_min_ttc).' '.$langs->trans($product->price_base_type); + } + else + { + print price($product->price_min).' '.$langs->trans($product->price_base_type); + } + print ''; } - else - { - print price($product->price_min).' '.$langs->trans($product->price_base_type); - } - print ''; // TVA print ''.$langs->trans("VATRate").''.vatrate($product->tva_tx,true).''; diff --git a/htdocs/product/price.php b/htdocs/product/price.php index e3514dd1e9a..39f1f4263ab 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -156,7 +156,7 @@ if ($conf->global->PRODUIT_MULTIPRICES) print ''; // Prix minimum - print ''.$langs->trans("MinPrice").''; + print ''.$langs->trans("MinPrice").' '.$i.''; if ($product->multiprices_base_type["$i"] == 'TTC') { print price($product->multiprices_min_ttc["$i"]).' '.$langs->trans($product->multiprices_base_type["$i"]); @@ -314,7 +314,7 @@ if ($_GET["action"] == 'edit_price' && $user->rights->produit->creer) print ''; print ''; - $text=$langs->trans('MinPrice') ; + $text=$langs->trans('MinPrice').' '.$i; print $html->textwithhelp($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1); if ($product->multiprices_base_type["$i"] == 'TTC') { diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php index f019438f79f..b3ac1485514 100644 --- a/htdocs/product/reassort.php +++ b/htdocs/product/reassort.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005-2006 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -19,11 +19,11 @@ */ /** - \file htdocs/product/reassort.php - \ingroup produit - \brief Page liste des produits ou services - \version $Id$ -*/ + * \file htdocs/product/reassort.php + * \ingroup produit + * \brief Page liste des produits ou services + * \version $Id$ + */ require("./pre.inc.php"); require_once(DOL_DOCUMENT_ROOT.'/product.class.php'); @@ -33,7 +33,7 @@ $langs->load("products"); $langs->load("stocks"); if (!$user->rights->produit->lire) - accessforbidden(); +accessforbidden(); $sref=isset($_GET["sref"])?$_GET["sref"]:$_POST["sref"]; @@ -55,13 +55,13 @@ $offset = $limit * $page ; if (isset($_POST["button_removefilter_x"])) { - $sref=""; - $snom=""; + $sref=""; + $snom=""; } if (isset($_REQUEST['catid'])) { - $catid = $_REQUEST['catid']; + $catid = $_REQUEST['catid']; } @@ -81,51 +81,51 @@ $sql.= ' FROM '.MAIN_DB_PREFIX.'product_stock as s,'; $sql.= ' '.MAIN_DB_PREFIX.'product as p'; if ($catid || ($conf->categorie->enabled && ! $user->rights->categorie->voir)) { - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie_product as cp ON cp.fk_product = p.rowid"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."categorie as c ON cp.fk_categorie = c.rowid"; } if ($_GET["fourn_id"] > 0) { - $fourn_id = $_GET["fourn_id"]; - $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf"; + $fourn_id = $_GET["fourn_id"]; + $sql .= ", ".MAIN_DB_PREFIX."product_fournisseur as pf"; } $sql .= " WHERE p.rowid = s.fk_product"; if ($sall) { - $sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')"; + $sql .= " AND (p.ref like '%".addslashes($sall)."%' OR p.label like '%".addslashes($sall)."%' OR p.description like '%".addslashes($sall)."%' OR p.note like '%".addslashes($sall)."%')"; } if ($type==1) { - $sql .= " AND p.fk_product_type = '1'"; + $sql .= " AND p.fk_product_type = '1'"; } else { - $sql .= " AND p.fk_product_type <> '1'"; + $sql .= " AND p.fk_product_type <> '1'"; } if ($sref) { - $sql .= " AND p.ref like '%".$sref."%'"; + $sql .= " AND p.ref like '%".$sref."%'"; } if ($snom) { - $sql .= " AND p.label like '%".addslashes($snom)."%'"; + $sql .= " AND p.label like '%".addslashes($snom)."%'"; } if (isset($_GET["envente"]) && strlen($_GET["envente"]) > 0) { - $sql .= " AND p.envente = ".$_GET["envente"]; + $sql .= " AND p.envente = ".$_GET["envente"]; } if($catid) { - $sql .= " AND cp.fk_categorie = ".$catid; + $sql .= " AND cp.fk_categorie = ".$catid; } if ($conf->categorie->enabled && !$user->rights->categorie->voir) { - $sql.= ' AND IFNULL(c.visible,1)=1'; + $sql.= ' AND IFNULL(c.visible,1)=1'; } if ($fourn_id > 0) { - $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; + $sql .= " AND p.rowid = pf.fk_product AND pf.fk_soc = ".$fourn_id; } $sql .= " GROUP BY p.rowid"; $sql .= " ORDER BY $sortfield $sortorder "; @@ -134,161 +134,161 @@ $resql = $db->query($sql) ; if ($resql) { - $num = $db->num_rows($resql); + $num = $db->num_rows($resql); - $i = 0; + $i = 0; - if ($num == 1 && ($sall or $snom or $sref)) - { - $objp = $db->fetch_object($resql); - Header("Location: fiche.php?id=$objp->rowid"); - exit; - } - - if (isset($_GET["envente"]) || isset($_POST["envente"])) - { - $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); - } - - if (isset($_GET["type"]) || isset($_POST["type"])) - { - if ($type==1) { $texte = $langs->trans("Services"); } - else { $texte = $langs->trans("Products"); } - } else { - $texte = $langs->trans("ProductsAndServices"); - } - - - llxHeader("","",$texte); - - if ($sref || $snom || $sall || $_POST["search"]) - { - print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"], $sortfield, $sortorder,'',$num); - } - else - { - print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); - } - - if (isset($catid)) - { - print "
"; - $c = new Categorie ($db, $catid); - $ways = $c->print_all_ways(' > ','product/reassort.php'); - print " > ".$ways[0]."
\n"; - print "

"; - } + if ($num == 1 && ($sall or $snom or $sref)) + { + $objp = $db->fetch_object($resql); + Header("Location: fiche.php?id=$objp->rowid"); + exit; + } - print '
'; - print ''; - print ''; - print ''; - - print ''; - - // Lignes des titres - print ""; - print_liste_field_titre($langs->trans("Ref"),"reassort.php", "p.ref","&envente=$envente".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield,$sortorder); - //print_liste_field_titre($langs->trans("TheoreticalStock"),"reassort.php", "stock_theorique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); - if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="center"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); - print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); - print "\n"; + if (isset($_GET["envente"]) || isset($_POST["envente"])) + { + $envente = (isset($_GET["envente"])?$_GET["envente"]:$_POST["envente"]); + } - // Lignes des champs de filtre - print ''; - print ''; - print ''; - if ($conf->service->enabled && $type == 1) - { - print ''; - } - print ''; - print ''; - print ''; + if (isset($_GET["type"]) || isset($_POST["type"])) + { + if ($type==1) { $texte = $langs->trans("Services"); } + else { $texte = $langs->trans("Products"); } + } else { + $texte = $langs->trans("ProductsAndServices"); + } - $product_static=new Product($db); - - $var=True; - while ($i < min($num,$limit)) - { - $objp = $db->fetch_object($resql); - - // Multilangs - if ($conf->global->MAIN_MULTILANGS) // si l'option est active - { - $sql = "SELECT label FROM ".MAIN_DB_PREFIX."product_det"; - $sql.= " WHERE fk_product=".$objp->rowid." AND lang='". $langs->getDefaultLang() ."'"; - $sql.= " LIMIT 1"; - $result = $db->query($sql); - if ($result) - { - $objtp = $db->fetch_object($result); - if ($objtp->label != '') $objp->label = $objtp->label; - } - } - - $var=!$var; - print ''; + } + //print ''; + print ''; + print ''; + print ''; + print "\n"; + $i++; } - else + + print "
'; - print ''; - print ''; - print ''; - print ''; - print ' '; - print ''; - print ' '; - print ''; - print ''; - print ''; - print '
'; + + llxHeader("","",$texte); + + if ($sref || $snom || $sall || $_POST["search"]) + { + print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"], $sortfield, $sortorder,'',$num); + } + else + { + print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); + } + + if (isset($catid)) + { + print "
"; + $c = new Categorie ($db, $catid); + $ways = $c->print_all_ways(' > ','product/reassort.php'); + print " > ".$ways[0]."
\n"; + print "

"; + } + + print ''; + print ''; + print ''; + print ''; + + print ''; + + // Lignes des titres + print ""; + print_liste_field_titre($langs->trans("Ref"),"reassort.php", "p.ref","&envente=$envente".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Label"),"reassort.php", "p.label","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","","",$sortfield,$sortorder); + //print_liste_field_titre($langs->trans("TheoreticalStock"),"reassort.php", "stock_theorique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); + if ($conf->service->enabled && $type == 1) print_liste_field_titre($langs->trans("Duration"),"reassort.php", "p.duration","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="center"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("PhysicalStock"),"reassort.php", "stock_physique","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("MininumStock"),"reassort.php", "p.seuil_stock_alerte","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); + print_liste_field_titre($langs->trans("Status"),"reassort.php", "p.envente","&envente=$envente&".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); + print "\n"; + + // Lignes des champs de filtre + print ''; + print ''; + print ''; + if ($conf->service->enabled && $type == 1) + { + print ''; + } + print ''; + print ''; + print ''; + + $product_static=new Product($db); + + $var=True; + while ($i < min($num,$limit)) + { + $objp = $db->fetch_object($resql); + + // Multilangs + if ($conf->global->MAIN_MULTILANGS) // si l'option est active + { + $sql = "SELECT label FROM ".MAIN_DB_PREFIX."product_det"; + $sql.= " WHERE fk_product=".$objp->rowid." AND lang='". $langs->getDefaultLang() ."'"; + $sql.= " LIMIT 1"; + $result = $db->query($sql); + if ($result) + { + $objtp = $db->fetch_object($result); + if ($objtp->label != '') $objp->label = $objtp->label; + } + } + + $var=!$var; + print ''; - print ''; + print $product_static->getNomUrl(1,'',16); + //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); + print ''; + print ''; - if ($conf->service->enabled && $type == 1) - { - print ''; - } - //print ''; - print ''; - print ''; - print ''; - print "\n"; - $i++; - } - - print "
'; + print ''; + print ''; + print ''; + print ''; + print ' '; + print ''; + print ' '; + print ''; + print ''; + print ''; + print '
'; $product_static->ref=$objp->ref; - $product_static->id=$objp->rowid; + $product_static->id=$objp->rowid; $product_static->type=$objp->fk_product_type; - print $product_static->getNomUrl(1,'',16); - //if ($objp->stock_theorique < $objp->seuil_stock_alerte) print ' '.img_warning($langs->trans("StockTooLow")); - print ''.$objp->label.''.$objp->label.''; - if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); - elseif (eregi('([0-9]+)m',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); - elseif (eregi('([0-9]+)d',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); - else print $objp->duration; - print ''.$objp->stock_theorique.''.$objp->stock_physique.''.$objp->seuil_stock_alerte.''.$product_static->LibStatut($objp->statut,5).'
"; - print ''; - - if ($num > $conf->liste_limit) - { - if ($sref || $snom || $sall || $_POST["search"]) - { - print_barre_liste($texte, $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"], $sortfield, $sortorder,'',$num); + if ($conf->service->enabled && $type == 1) + { + print '
'; + if (eregi('([0-9]+)y',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationYear"); + elseif (eregi('([0-9]+)m',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationMonth"); + elseif (eregi('([0-9]+)d',$objp->duration,$regs)) print $regs[1].' '.$langs->trans("DurationDay"); + else print $objp->duration; + print ''.$objp->stock_theorique.''.$objp->stock_physique.''.$objp->seuil_stock_alerte.''.$product_static->LibStatut($objp->statut,5).'
"; + print ''; + + if ($num > $conf->liste_limit) { - print_barre_liste($texte, $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num); + if ($sref || $snom || $sall || $_POST["search"]) + { + print_barre_liste('', $page, "reassort.php", "&sref=".$sref."&snom=".$snom."&sall=".$sall."&envente=".$_POST["envente"], $sortfield, $sortorder,'',$num, 0, ''); + } + else + { + print_barre_liste('', $page, "reassort.php", "&sref=$sref&snom=$snom&fourn_id=$fourn_id".(isset($type)?"&type=$type":""), $sortfield, $sortorder,'',$num, 0, ''); + } } - } - - $db->free($resql); - + + $db->free($resql); + } else { - dolibarr_print_error($db); + dolibarr_print_error($db); } diff --git a/htdocs/product/stock/fiche.php b/htdocs/product/stock/fiche.php index 6d141e17a9d..1dcbb48d93c 100644 --- a/htdocs/product/stock/fiche.php +++ b/htdocs/product/stock/fiche.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2008 Laurent Destailleur + * Copyright (C) 2004-2009 Laurent Destailleur * Copyright (C) 2005 Simon Tosser * Copyright (C) 2005-2006 Regis Houssin * @@ -130,10 +130,11 @@ llxHeader("","",$langs->trans("WarehouseCard")); if ($_GET["action"] == 'create') { + print_fiche_titre($langs->trans("NewWarehouse")); + print "
\n"; print ''; print ''."\n"; - print_titre($langs->trans("NewWarehouse")); if ($mesg) {