Fix: différenciation des produits et services

This commit is contained in:
Regis Houssin 2007-12-05 12:08:53 +00:00
parent 901bdf365c
commit 073830eb6b
3 changed files with 52 additions and 22 deletions

View File

@ -25,7 +25,9 @@ ServicesOnSell=Services on sell
ServicesNotOnSell=Services out of sell ServicesNotOnSell=Services out of sell
InternalRef=Internal reference InternalRef=Internal reference
LastRecorded=Last products/services on sell recorded LastRecorded=Last products/services on sell recorded
LastRecordedProducts=Last %s products/services recorded LastRecordedProductsAndServices=Last %s products/services recorded
LastRecordedProducts=Last %s products recorded
LastRecordedServices=Last %s services recorded
LastProducts=Last products LastProducts=Last products
CardProduct0=Product card CardProduct0=Product card
CardProduct1=Service card CardProduct1=Service card
@ -64,6 +66,8 @@ SupplierRef=Supplier ref.
ShowProduct=Show product ShowProduct=Show product
ShowService=Show service ShowService=Show service
ProductsAndServicesArea=Product and Services area ProductsAndServicesArea=Product and Services area
ProductsArea=Product area
ServicesArea=Services area
AddToMyProposals=Add to my proposals AddToMyProposals=Add to my proposals
AddToOtherProposals=Add to other proposals AddToOtherProposals=Add to other proposals
AddToMyBills=Add to my bills AddToMyBills=Add to my bills

View File

@ -24,7 +24,9 @@ ServicesOnSell=Services en vente
ServicesNotOnSell=Services hors vente ServicesNotOnSell=Services hors vente
InternalRef=Référence interne InternalRef=Référence interne
LastRecorded=Derniers produits/services en vente enregistrés LastRecorded=Derniers produits/services en vente enregistrés
LastRecordedProducts=Les %s derniers produits/services enregistrés LastRecordedProductsAndServices=Les %s derniers produits/services enregistrés
LastRecordedProducts=Les %s derniers produits enregistrés
LastRecordedServices=Les %s derniers services enregistrés
LastProducts=Derniers produits LastProducts=Derniers produits
CardProduct0=Fiche produit CardProduct0=Fiche produit
CardProduct1=Fiche service CardProduct1=Fiche service
@ -62,7 +64,9 @@ Suppliers=Fournisseurs
SupplierRef=Réf. fournisseur SupplierRef=Réf. fournisseur
ShowProduct=Afficher produit ShowProduct=Afficher produit
ShowService=Afficher service ShowService=Afficher service
ProductsAndServicesArea=Espace Produit et Services ProductsAndServicesArea=Espace Produits et Services
ProductsArea=Espace Produits
ServicesArea=Espace Services
AddToMyProposals=Ajouter à mes propositions AddToMyProposals=Ajouter à mes propositions
AddToOtherProposals=Ajouter aux autres propositions AddToOtherProposals=Ajouter aux autres propositions
AddToMyBills=Ajouter à mes factures AddToMyBills=Ajouter à mes factures

View File

@ -1,7 +1,7 @@
<?php <?php
/* Copyright (C) 2001-2006 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2001-2006 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) 2005-2006 Regis Houssin <regis@dolibarr.fr> * Copyright (C) 2005-2007 Regis Houssin <regis@dolibarr.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
@ -41,9 +41,13 @@ $staticproduct=new Product($db);
* *
*/ */
$transAreaType = $langs->trans("ProductsAndServicesArea");
if (isset($_GET["type"]) && $_GET["type"] == 0) $transAreaType = $langs->trans("ProductsArea");
if (isset($_GET["type"]) && $_GET["type"] == 1) $transAreaType = $langs->trans("ServicesArea");
llxHeader("","",$langs->trans("ProductsAndServices")); llxHeader("","",$langs->trans("ProductsAndServices"));
print_fiche_titre($langs->trans("ProductsAndServicesArea")); print_fiche_titre($transAreaType);
print '<table border="0" width="100%" class="notopnoleftnoright">'; print '<table border="0" width="100%" class="notopnoleftnoright">';
@ -85,22 +89,35 @@ print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>'; print '<tr class="liste_titre"><td colspan="2">'.$langs->trans("Statistics").'</td></tr>';
if ($conf->produit->enabled) if ($conf->produit->enabled)
{ {
print "<tr $bc[0]>"; $statProducts = "<tr $bc[0]>";
print '<td><a href="liste.php?type=0&amp;envente=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td align="right">'.round($prodser[0][0]).'</td>'; $statProducts.= '<td><a href="liste.php?type=0&amp;envente=0">'.$langs->trans("ProductsNotOnSell").'</a></td><td align="right">'.round($prodser[0][0]).'</td>';
print "</tr>"; $statProducts.= "</tr>";
print "<tr $bc[1]>"; $statProducts.= "<tr $bc[1]>";
print '<td><a href="liste.php?type=0&amp;envente=1">'.$langs->trans("ProductsOnSell").'</a></td><td align="right">'.round($prodser[0][1]).'</td>'; $statProducts.= '<td><a href="liste.php?type=0&amp;envente=1">'.$langs->trans("ProductsOnSell").'</a></td><td align="right">'.round($prodser[0][1]).'</td>';
print "</tr>"; $statProducts.= "</tr>";
} }
if ($conf->service->enabled) if ($conf->service->enabled)
{ {
print "<tr $bc[0]>"; $statServices = "<tr $bc[0]>";
print '<td><a href="liste.php?type=1&amp;envente=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td align="right">'.round($prodser[1][0]).'</td>'; $statServices.= '<td><a href="liste.php?type=1&amp;envente=0">'.$langs->trans("ServicesNotOnSell").'</a></td><td align="right">'.round($prodser[1][0]).'</td>';
print "</tr>"; $statServices.= "</tr>";
print "<tr $bc[1]>"; $statServices.= "<tr $bc[1]>";
print '<td><a href="liste.php?type=1&amp;envente=1">'.$langs->trans("ServicesOnSell").'</a></td><td align="right">'.round($prodser[1][1]).'</td>'; $statServices.= '<td><a href="liste.php?type=1&amp;envente=1">'.$langs->trans("ServicesOnSell").'</a></td><td align="right">'.round($prodser[1][1]).'</td>';
print "</tr>"; $statServices.= "</tr>";
} }
if (isset($_GET["type"]) && $_GET["type"] == 0)
{
print $statProducts;
}
else if (isset($_GET["type"]) && $_GET["type"] == 1)
{
print $statServices;
}
else
{
print $statProducts.$statServices;
}
print '</table>'; print '</table>';
print '</td><td valign="top" width="70%" class="notopnoleftnoright">'; print '</td><td valign="top" width="70%" class="notopnoleftnoright">';
@ -119,6 +136,7 @@ if ($conf->categorie->enabled && !$user->rights->categorie->voir)
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_subproduct as sp ON p.rowid = sp.fk_product_subproduct";
$sql.= " WHERE sp.fk_product_subproduct IS NULL"; $sql.= " WHERE sp.fk_product_subproduct IS NULL";
if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= " AND IFNULL(c.visible,1)=1 "; if ($conf->categorie->enabled && !$user->rights->categorie->voir) $sql.= " AND IFNULL(c.visible,1)=1 ";
if (isset($_GET["type"])) $sql.= " AND p.fk_product_type = ".$_GET["type"];
$sql.= " ORDER BY p.datec DESC "; $sql.= " ORDER BY p.datec DESC ";
$sql.= $db->plimit($max,0); $sql.= $db->plimit($max,0);
$result = $db->query($sql) ; $result = $db->query($sql) ;
@ -130,12 +148,16 @@ if ($result)
$i = 0; $i = 0;
if ($num > 0) if ($num > 0)
{ {
print '<table class="noborder" width="100%">'; $transRecordedType = $langs->trans("LastRecordedProductsAndServices",$max);
if (isset($_GET["type"]) && $_GET["type"] == 0) $transRecordedType = $langs->trans("LastRecordedProducts",$max);
if (isset($_GET["type"]) && $_GET["type"] == 1) $transRecordedType = $langs->trans("LastRecordedServices",$max);
print '<table class="noborder" width="100%">';
print '<tr class="liste_titre"><td colspan="4">'.$langs->trans("LastRecordedProducts",$max).'</td></tr>'; print '<tr class="liste_titre"><td colspan="4">'.$transRecordedType.'</td></tr>';
$var=True; $var=True;
while ($i < $num) while ($i < $num)
{ {
@ -162,7 +184,7 @@ if ($result)
print "</a> <a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></td>\n"; print "</a> <a href=\"fiche.php?id=$objp->rowid\">$objp->ref</a></td>\n";
print '<td>'.dolibarr_trunc($objp->label,40).'</td>'; print '<td>'.dolibarr_trunc($objp->label,40).'</td>';
print "<td>"; print "<td>";
if ($objp->type==1) print $langs->trans("ShowService"); if ($objp->fk_product_type==1) print $langs->trans("ShowService");
else print $langs->trans("ShowProduct"); else print $langs->trans("ShowProduct");
print "</td>"; print "</td>";
print '<td align="right" nowrap="nowrap">'; print '<td align="right" nowrap="nowrap">';