diff --git a/htdocs/langs/en_US/products.lang b/htdocs/langs/en_US/products.lang
index 0ab21cae322..ae9cd743c8f 100644
--- a/htdocs/langs/en_US/products.lang
+++ b/htdocs/langs/en_US/products.lang
@@ -25,11 +25,13 @@ ProductAccountancySellCode=Accountancy code (sale)
ProductOrService=Product or Service
ProductsAndServices=Products and Services
ProductsOrServices=Products or Services
-ProductsOnSell=Product for sale or for purchase
+ProductsOnSaleOnly=Products for sale only
+ProductsOnPurchaseOnly=Product for purchase only
ProductsNotOnSell=Product not for sale and not for purchase
ProductsOnSellAndOnBuy=Products for sale and for purchase
-ServicesOnSell=Services for sale or for purchase
-ServicesNotOnSell=Services not for sale
+ServicesOnSaleOnly=Services for sale only
+ServicesOnPurchaseOnly=Services for purchase only
+ServicesNotOnSell=Services not for sale and not for purchase
ServicesOnSellAndOnBuy=Services for sale and for purchase
LastModifiedProductsAndServices=Latest %s modified products/services
LastRecordedProducts=Latest %s recorded products
diff --git a/htdocs/product/index.php b/htdocs/product/index.php
index 49a80859bd9..a09a8069b9e 100644
--- a/htdocs/product/index.php
+++ b/htdocs/product/index.php
@@ -84,7 +84,7 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
{
$listofsearchfields['search_product']=array('text'=>'ProductOrService');
}
-
+
if (count($listofsearchfields))
{
print '
';
print '
';
}
@@ -111,7 +111,8 @@ if (! empty($conf->global->MAIN_SEARCH_FORM_ON_HOME_AREAS)) // This is usele
* Number of products and/or services
*/
$prodser = array();
-$prodser[0][0]=$prodser[0][1]=$prodser[1][0]=$prodser[1][1]=0;
+$prodser[0][0]=$prodser[0][1]=$prodser[0][2]=$prodser[0][3]=0;
+$prodser[1][0]=$prodser[1][1]=$prodser[1][2]=$prodser[1][3]=0;
$sql = "SELECT COUNT(p.rowid) as total, p.fk_product_type, p.tosell, p.tobuy";
$sql.= " FROM ".MAIN_DB_PREFIX."product as p";
@@ -120,9 +121,10 @@ $sql.= " GROUP BY p.fk_product_type, p.tosell, p.tobuy";
$result = $db->query($sql);
while ($objp = $db->fetch_object($result))
{
- $status=2;
- if (! $objp->tosell && ! $objp->tobuy) $status=0; // To sell OR to buy
- if ((! $objp->tosell && $objp->tobuy) || ($objp->tosell && ! $objp->tobuy)) $status=1;
+ $status=3;
+ if (! $objp->tosell && ! $objp->tobuy) $status=0; // Not on sale, not on purchase
+ if ($objp->tosell && ! $objp->tobuy) $status=1; // On sale only
+ if (! $objp->tosell && $objp->tobuy) $status=2; // On purchase only
$prodser[$objp->fk_product_type][$status]=$objp->total;
}
@@ -134,10 +136,13 @@ if (! empty($conf->product->enabled))
$statProducts.= ''.$langs->trans("ProductsNotOnSell").' | '.round($prodser[0][0]).' | ';
$statProducts.= "";
$statProducts.= '';
- $statProducts.= '| '.$langs->trans("ProductsOnSell").' | '.round($prodser[0][1]).' | ';
+ $statProducts.= ''.$langs->trans("ProductsOnSaleOnly").' | '.round($prodser[0][1]).' | ';
$statProducts.= "
";
$statProducts.= '';
- $statProducts.= '| '.$langs->trans("ProductsOnSellAndOnBuy").' | '.round($prodser[0][2]).' | ';
+ $statProducts.= ''.$langs->trans("ProductsOnPurchaseOnly").' | '.round($prodser[0][2]).' | ';
+ $statProducts.= "
";
+ $statProducts.= '';
+ $statProducts.= '| '.$langs->trans("ProductsOnSellAndOnBuy").' | '.round($prodser[0][3]).' | ';
$statProducts.= "
";
}
@@ -147,10 +152,13 @@ if (! empty($conf->service->enabled))
$statServices.= ''.$langs->trans("ServicesNotOnSell").' | '.round($prodser[1][0]).' | ';
$statServices.= "";
$statServices.= '';
- $statServices.= '| '.$langs->trans("ServicesOnSell").' | '.round($prodser[1][1]).' | ';
+ $statServices.= ''.$langs->trans("ServicesOnSaleOnly").' | '.round($prodser[1][1]).' | ';
$statServices.= "
";
$statServices.= '';
- $statServices.= '| '.$langs->trans("ServicesOnSellAndOnBuy").' | '.round($prodser[1][2]).' | ';
+ $statServices.= ''.$langs->trans("ServicesOnPurchaseOnly").' | '.round($prodser[1][2]).' | ';
+ $statServices.= "
";
+ $statServices.= '';
+ $statServices.= '| '.$langs->trans("ServicesOnSellAndOnBuy").' | '.round($prodser[1][3]).' | ';
$statServices.= "
";
}
@@ -220,7 +228,7 @@ if (! empty($conf->categorie->enabled) && ! empty($conf->global->CATEGORY_GRAPHS
while ($i < $num)
{
$obj = $db->fetch_object($result);
-
+
print '| '.$obj->label.' | '.$obj->nb.' |
';
$total+=$obj->nb;
$i++;
@@ -292,7 +300,7 @@ if ($result)
}
}
-
+
print '';
print '| ';
$product_static->id=$objp->rowid;
@@ -419,7 +427,7 @@ function activitytrim($product_type)
$i = 0;
$var=true;
-
+
while ($i < $num)
{
$objp = $db->fetch_object($result);
@@ -427,7 +435,7 @@ function activitytrim($product_type)
{
if ($trim1+$trim2+$trim3+$trim4 > 0)
{
-
+
print ' |
| '.$tmpyear.' | ';
print ''.price($trim1).' | ';
print ''.price($trim2).' | ';
@@ -461,7 +469,7 @@ function activitytrim($product_type)
}
if ($trim1+$trim2+$trim3+$trim4 > 0)
{
-
+
print '
| '.$tmpyear.' | ';
print ''.price($trim1).' | ';
print ''.price($trim2).' | ';