diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php index 72a568a341d..1aaadb2b4db 100644 --- a/htdocs/product/liste.php +++ b/htdocs/product/liste.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2007 Regis Houssin * * This program is free software; you can redistribute it and/or modify @@ -18,7 +18,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -96,7 +95,8 @@ else -$sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.fk_product_type, '.$db->pdate('p.tms').' as datem,'; +$sql = 'SELECT p.rowid, p.ref, p.label, p.price, p.price_ttc, p.price_base_type,'; +$sql.= ' p.fk_product_type, '.$db->pdate('p.tms').' as datem,'; $sql.= ' p.duration, p.envente as statut, p.seuil_stock_alerte'; $sql.= ' FROM '.MAIN_DB_PREFIX.'product as p'; if ($catid || ($conf->categorie->enabled && !$user->rights->categorie->voir)) @@ -220,7 +220,7 @@ if ($resql) print_liste_field_titre($langs->trans("DateModification"),"liste.php", "p.tms","&envente=$envente".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="center"',$sortfield,$sortorder); if ($conf->service->enabled && $type != 0) print_liste_field_titre($langs->trans("Duration"),"liste.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("SellingPrice"),"liste.php", "p.price","&envente=$envente".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); - if ($conf->stock->enabled && $type != 1) print ''.$langs->trans("TotalStock").''; + if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) print ''.$langs->trans("Stock").''; print_liste_field_titre($langs->trans("Status"),"liste.php", "p.envente","&envente=$envente".(isset($type)?"&type=$type":"")."&fourn_id=$fourn_id&snom=$snom&sref=$sref","",'align="right"',$sortfield,$sortorder); print "\n"; @@ -232,6 +232,9 @@ if ($resql) print ''; print ''; print ''; + print ''; + print ' '; + print ''; if ($conf->service->enabled && $type != 0) { print ''; @@ -241,10 +244,7 @@ if ($resql) print ''; print ' '; print ''; - print ''; - print ' '; - print ''; - if ($conf->stock->enabled && $type != 1) + if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) { print ''; print ' '; @@ -279,7 +279,10 @@ if ($resql) } $var=!$var; - print ''; + print ''; + + // Ref + print ''; print "rowid\">"; if ($objp->fk_product_type==1) print img_object($langs->trans("ShowService"),"service"); @@ -287,8 +290,14 @@ if ($resql) print img_object($langs->trans("ShowProduct"),"product"); print ' '; print ''.$objp->ref."\n"; + + // Label print ''.$objp->label.''; - print ''.dolibarr_print_date($objp->datem)."\n"; + + // Date + print ''.dolibarr_print_date($objp->datem,'day')."\n"; + + // Duration if ($conf->service->enabled && $type != 0) { print ''; @@ -298,35 +307,39 @@ if ($resql) else print $objp->duration; print ''; } - print ''.price($objp->price).''; - // Affichage du stock - if ($objp->fk_product_type!=1 && $conf->stock->enabled && $user->rights->stock->lire) - { - $product_static->id = $objp->rowid; - $product_static->load_stock(); - if ($product_static->no_stock) - { - print ''.$langs->trans("NoStock"); - } - else - { - if ($product_static->stock_reel <= $objp->seuil_stock_alerte) - { - print ''.img_warning().' '.$product_static->stock_reel; - } - else - { - print ''.$product_static->stock_reel; - } - } - } - else if (!$type) - { - print ' '; - } + // Price + print ''; + if ($objp->price_base_type == 'TTC') print price($objp->price_ttc).' '.$langs->trans("TTC"); + else print price($objp->price).' '.$langs->trans("HT"); + print ''; + + // Affichage du stock + if ($conf->stock->enabled && $user->rights->stock->lire && $type != 1) + { + if ($objp->fk_product_type != 1) + { + $product_static->id = $objp->rowid; + $product_static->load_stock(); + if ($product_static->stock_reel < $objp->seuil_stock_alerte) + { + print ''.$product_static->stock_reel.' '.img_warning($langs->trans("StockTooLow")).''; + } + else + { + print ''.$product_static->stock_reel.''; + } + } + else + { + print ' '; + } + } + + // Statut print ''.$product_static->LibStatut($objp->statut,5).''; + print "\n"; $i++; } diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php index 5780d3b1e5c..459f473c2c6 100644 --- a/htdocs/product/stock/index.php +++ b/htdocs/product/stock/index.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 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 @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -30,7 +29,8 @@ require_once("./pre.inc.php"); require_once("./entrepot.class.php"); -$user->getrights("stocks"); +$user->getrights(); + $langs->load("stocks"); if (!$user->rights->stock->lire) diff --git a/htdocs/product/stock/liste.php b/htdocs/product/stock/liste.php index dd28876b48c..7e8f9b3a63a 100644 --- a/htdocs/product/stock/liste.php +++ b/htdocs/product/stock/liste.php @@ -30,7 +30,8 @@ require("./pre.inc.php"); require_once("./entrepot.class.php"); -$user->getrights('stocks'); +$user->getrights(); + $langs->load("stocks"); if (!$user->rights->stock->lire) diff --git a/htdocs/product/stock/valo.php b/htdocs/product/stock/valo.php index 5883c0efa48..ec1558f5b6f 100644 --- a/htdocs/product/stock/valo.php +++ b/htdocs/product/stock/valo.php @@ -1,6 +1,6 @@ - * Copyright (C) 2004-2006 Laurent Destailleur + * Copyright (C) 2004-2007 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 @@ -17,7 +17,6 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * * $Id$ - * $Source$ */ /** @@ -30,7 +29,8 @@ require("./pre.inc.php"); require_once("./entrepot.class.php"); -$user->getrights('stocks'); +$user->getrights(); + $langs->load("stocks"); if (!$user->rights->stock->lire)