diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php
index 847a429a802..e8fed35e182 100644
--- a/htdocs/product/composition/fiche.php
+++ b/htdocs/product/composition/fiche.php
@@ -201,7 +201,7 @@ if ($id || $ref)
// Number of subproducts
$prodsfather = $product->getFather(); //Parent Products
- $product->get_sousproduits_arbo ();
+ $product->get_sousproduits_arbo();
print '
| '.$langs->trans("AssociatedProductsNumber").' | '.count($product->get_arbo_each_prod()).' | ';
dol_fiche_end();
@@ -287,7 +287,7 @@ if ($id || $ref)
// Number of subproducts
$prodsfather = $product->getFather(); //Parent Products
- $product->get_sousproduits_arbo ();
+ $product->get_sousproduits_arbo();
print '
| '.$langs->trans("AssociatedProductsNumber").' | '.count($product->get_arbo_each_prod()).' | ';
print '
';
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 5e277788520..e64e34cce6f 100755
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -154,12 +154,12 @@ if ($product->id)
print '| '.$langs->trans("Label").' | '.$product->libelle.' |
';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index db38275ef69..bf322351dd4 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -226,7 +226,7 @@ if ($id || $ref)
print '';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 5c786e49412..ce8d7eee74f 100644
--- a/htdocs/product/liste.php
+++ b/htdocs/product/liste.php
@@ -162,7 +162,7 @@ else
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte";
//if (GETPOST("toolowstock")) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder);
- $sql.= $db->plimit($limit + 1 ,$offset);
+ $sql.= $db->plimit($limit + 1, $offset);
dol_syslog("sql=".$sql);
$resql = $db->query($sql);
@@ -202,7 +202,7 @@ else
if (isset($catid))
{
print "";
- $c = new Categorie ($db, $catid);
+ $c = new Categorie($db, $catid);
$ways = $c->print_all_ways(' > ','product/liste.php');
print " > ".$ways[0]."
\n";
print "
";
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 72987478f1b..3751ac59bcc 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -123,12 +123,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 9c80f827d2a..13e059e54bb 100644
--- a/htdocs/product/popuprop.php
+++ b/htdocs/product/popuprop.php
@@ -104,7 +104,7 @@ $sql.= " AND p.entity = ".$conf->entity;
if (isset($_GET['type'])) $sql.= " AND fk_product_type = ".$_GET['type'];
$sql.= " GROUP BY (p.rowid)";
$sql.= $db->order($sortfield,$sortorder);
-$sql.= $db->plimit($limit ,$offset);
+$sql.= $db->plimit($limit, $offset);
$result=$db->query($sql);
if ($result)
diff --git a/htdocs/product/price.php b/htdocs/product/price.php
index 61df125cbef..7c11bcb3f2c 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -264,7 +264,7 @@ else
}
// Status (to sell)
-print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $object->getLibStatut(2,0);
print ' |
';
@@ -327,7 +327,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price
print '| ';
$text=$langs->trans('SellingPrice');
- print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
+ print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
print ' | ';
if ($object->price_base_type == 'TTC')
{
@@ -342,7 +342,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price minimum
print ' |
| ' ;
$text=$langs->trans('MinPrice');
- print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
+ print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
if ($object->price_base_type == 'TTC')
{
print ' | ';
@@ -385,7 +385,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Selling price
print ' |
| ';
$text=$langs->trans('SellingPrice').' '.$i;
- print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
+ print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
print ' | ';
if ($object->multiprices_base_type["$i"] == 'TTC')
{
@@ -401,7 +401,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Min price
print ' |
| ';
$text=$langs->trans('MinPrice').' '.$i;
- print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),$direction=1,$usehelpcursor=1);
+ print $form->textwithpicto($text,$langs->trans("PrecisionUnitIsLimitedToXDecimals",$conf->global->MAIN_MAX_DECIMALS_UNIT),1,1);
if ($object->multiprices_base_type["$i"] == 'TTC')
{
print ' | ';
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index e964f9bca59..c3a2bececd9 100644
--- a/htdocs/product/reassort.php
+++ b/htdocs/product/reassort.php
@@ -148,7 +148,7 @@ $sql.= " p.fk_product_type, p.tms,";
$sql.= " p.duration, p.tosell, p.tobuy, p.seuil_stock_alerte";
if ($toolowstock) $sql.= " HAVING SUM(s.reel) < p.seuil_stock_alerte"; // Not used yet
$sql.= $db->order($sortfield,$sortorder);
-$sql.= $db->plimit($limit + 1 ,$offset);
+$sql.= $db->plimit($limit + 1, $offset);
$resql = $db->query($sql);
if ($resql)
diff --git a/htdocs/product/stats/commande.php b/htdocs/product/stats/commande.php
index 36093d70800..7b2c54fee8b 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print ' |
';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 03cc444cfdc..35ef2e9c310 100644
--- a/htdocs/product/stats/commande_fournisseur.php
+++ b/htdocs/product/stats/commande_fournisseur.php
@@ -92,12 +92,12 @@ if ($_GET["id"] || $_GET["ref"])
print '| '.$langs->trans("Label").' | '.$product->libelle.' |
';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index 306d3a94ab4..92786ff9516 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 6d195b04f5c..dde6d04e2ab 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -99,12 +99,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index eaa7bc8f85f..bdaaf1e20da 100644
--- a/htdocs/product/stats/facture_fournisseur.php
+++ b/htdocs/product/stats/facture_fournisseur.php
@@ -100,12 +100,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php
index 04f5c030410..599739f4463 100644
--- a/htdocs/product/stats/fiche.php
+++ b/htdocs/product/stats/fiche.php
@@ -80,12 +80,12 @@ if (! empty($id) || ! empty($ref))
print '| '.$langs->trans("Label").' | '.$object->libelle.' |
';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $object->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $object->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index b59f9d9707b..170f786fda5 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -94,12 +94,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 19c40b4f935..4554d82000e 100644
--- a/htdocs/product/stock/class/entrepot.class.php
+++ b/htdocs/product/stock/class/entrepot.class.php
@@ -124,7 +124,7 @@ class Entrepot extends CommonObject
* Update properties of a warehouse
*
* @param int $id id of warehouse to modify
- * @param User $user
+ * @param User $user User object
* @return int >0 if OK, <0 if KO
*/
function update($id, $user)
@@ -225,7 +225,7 @@ class Entrepot extends CommonObject
/**
* Load warehouse data
*
- * @param int $id Warehouse id
+ * @param int $id Warehouse id
* @return int >0 if OK, <0 if KO
*/
function fetch($id)
@@ -287,6 +287,7 @@ class Entrepot extends CommonObject
* Load warehouse info data
*
* @param int $id warehouse id
+ * @return void
*/
function info($id)
{
@@ -333,8 +334,9 @@ class Entrepot extends CommonObject
/**
* Return list of all warehouses
- *
- * @return array Array list of warehouses
+ *
+ * @param int $status Status
+ * @return array Array list of warehouses
*/
function list_array($status=1)
{
@@ -407,9 +409,9 @@ class Entrepot extends CommonObject
/**
* Return label of a given status
*
- * @param status Statut
- * @param mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
- * @return string Label of status
+ * @param int $statut Status
+ * @param int $mode 0=long label, 1=short label, 2=Picto + short label, 3=Picto, 4=Picto + long label, 5=Short label + Picto
+ * @return string Label of status
*/
function LibStatut($statut,$mode=0)
{
diff --git a/htdocs/product/stock/class/mouvementstock.class.php b/htdocs/product/stock/class/mouvementstock.class.php
index 135d8efd85a..42fdcf93c0b 100644
--- a/htdocs/product/stock/class/mouvementstock.class.php
+++ b/htdocs/product/stock/class/mouvementstock.class.php
@@ -325,6 +325,7 @@ class MouvementStock
* @param int $qty Quantity
* @param int $price Price
* @param string $label Label of stock movement
+ * @return int <0 if KO, >0 if OK
*/
function reception($user, $fk_product, $entrepot_id, $qty, $price=0, $label='')
{
diff --git a/htdocs/product/stock/index.php b/htdocs/product/stock/index.php
index 102dd03e28b..fc90693fa4f 100644
--- a/htdocs/product/stock/index.php
+++ b/htdocs/product/stock/index.php
@@ -62,8 +62,8 @@ $sql = "SELECT e.label, e.rowid, e.statut";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.statut in (0,1)";
$sql.= " AND e.entity = ".$conf->entity;
-$sql.= " ORDER BY e.statut DESC ";
-$sql.= $db->plimit(15 ,0);
+$sql.= $db->order('e.statut','DESC');
+$sql.= $db->plimit(15, 0);
$result = $db->query($sql);
diff --git a/htdocs/product/stock/liste.php b/htdocs/product/stock/liste.php
index 598b6c91271..de8ec8d2dbf 100644
--- a/htdocs/product/stock/liste.php
+++ b/htdocs/product/stock/liste.php
@@ -44,7 +44,7 @@ if ($page < 0) $page = 0;
$limit = $conf->liste_limit;
$offset = $limit * $page;
-
+
$sql = "SELECT e.rowid, e.label as ref, e.statut, e.lieu, e.address, e.cp, e.ville, e.fk_pays";
$sql.= " FROM ".MAIN_DB_PREFIX."entrepot as e";
$sql.= " WHERE e.entity = ".$conf->entity;
@@ -57,7 +57,7 @@ if ($sall)
$sql.= " AND (e.description like '%".$sall."%' OR e.lieu like '%".$sall."%' OR e.address like '%".$sall."%' OR e.ville like '%".$sall."%')";
}
$sql.= " ORDER BY $sortfield $sortorder";
-$sql.= $db->plimit($limit + 1 ,$offset);
+$sql.= $db->plimit($limit+1, $offset);
$result = $db->query($sql);
if ($result)
diff --git a/htdocs/product/stock/mouvement.php b/htdocs/product/stock/mouvement.php
index 142b3c39233..1de22cd3e2c 100644
--- a/htdocs/product/stock/mouvement.php
+++ b/htdocs/product/stock/mouvement.php
@@ -122,7 +122,7 @@ if (! empty($_GET['idproduct']))
$sql.= " AND p.rowid = '".$_GET['idproduct']."'";
}
$sql.= $db->order($sortfield,$sortorder);
-$sql.= $db->plimit($conf->liste_limit + 1 ,$offset);
+$sql.= $db->plimit($conf->liste_limit+1, $offset);
//print $sql;
$resql = $db->query($sql);
diff --git a/htdocs/product/stock/product.php b/htdocs/product/stock/product.php
index d81c004c7d9..44e887b73cc 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -191,12 +191,12 @@ if ($_GET["id"] || $_GET["ref"])
print '';
// Status (to sell)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Sell").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Sell").') | ';
print $product->getLibStatut(2,0);
print ' |
';
// Status (to buy)
- print '| '.$langs->trans("Status").' ('.$langs->trans("Buy").')'.' | ';
+ print ' |
| '.$langs->trans("Status").' ('.$langs->trans("Buy").') | ';
print $product->getLibStatut(2,1);
print ' |
';