diff --git a/htdocs/product/composition/fiche.php b/htdocs/product/composition/fiche.php
index 847a429a8024446957612bab4c0426b008735bc4..e8fed35e1825633636f8368925ed2799bc6b9aa9 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 '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
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 '<tr><td>'.$langs->trans("AssociatedProductsNumber").'</td><td>'.count($product->get_arbo_each_prod()).'</td>';
print '</tr>';
diff --git a/htdocs/product/document.php b/htdocs/product/document.php
index 5e277788520343760d9c54a8ddd03682938f274e..e64e34cce6f3025f2f680c68c9e18ed55c8073fd 100755
--- a/htdocs/product/document.php
+++ b/htdocs/product/document.php
@@ -154,12 +154,12 @@ if ($product->id)
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/fournisseurs.php b/htdocs/product/fournisseurs.php
index db38275ef69beb845f7dce0166a1223c8e681bc3..bf322351dd47a63b70e8a8e701328c88ed4b8605 100644
--- a/htdocs/product/fournisseurs.php
+++ b/htdocs/product/fournisseurs.php
@@ -226,7 +226,7 @@ if ($id || $ref)
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/liste.php b/htdocs/product/liste.php
index 5c786e494128a77371d4ecf968f416ab6cc72352..ce8d7eee74f804ad72f4e4a8b8a4d451b8c897d6 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 "<div id='ways'>";
- $c = new Categorie ($db, $catid);
+ $c = new Categorie($db, $catid);
$ways = $c->print_all_ways(' > ','product/liste.php');
print " > ".$ways[0]."<br>\n";
print "</div><br>";
diff --git a/htdocs/product/photos.php b/htdocs/product/photos.php
index 72987478f1b1d2fdd557d0bb0afa1c10b77825bd..3751ac59bcc2ff560cce72fab342d5b88fac8bcf 100644
--- a/htdocs/product/photos.php
+++ b/htdocs/product/photos.php
@@ -123,12 +123,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/popuprop.php b/htdocs/product/popuprop.php
index 9c80f827d2a94e5e260a7aaeb2459a4727cf05b6..13e059e54bb782aa1f6951787a78fa65c24e9862 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 61df125cbef1129cfadea12d482f9fbde6018246..7c11bcb3f2c32aae2a7dd38ba74f17000dabd8f6 100644
--- a/htdocs/product/price.php
+++ b/htdocs/product/price.php
@@ -264,7 +264,7 @@ else
}
// Status (to sell)
-print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>';
+print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $object->getLibStatut(2,0);
print '</td></tr>';
@@ -327,7 +327,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price
print '<tr><td width="20%">';
$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 '</td><td>';
if ($object->price_base_type == 'TTC')
{
@@ -342,7 +342,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Price minimum
print '<tr><td>' ;
$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 '<td><input name="price_min" size="10" value="'.price($object->price_min_ttc).'">';
@@ -385,7 +385,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Selling price
print '<tr><td width="20%">';
$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 '</td><td>';
if ($object->multiprices_base_type["$i"] == 'TTC')
{
@@ -401,7 +401,7 @@ if ($action == 'edit_price' && ($user->rights->produit->creer || $user->rights->
// Min price
print '<tr><td>';
$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 '<td><input name="price_min_'.$i.'" size="10" value="'.price($object->multiprices_min_ttc["$i"]).'">';
diff --git a/htdocs/product/reassort.php b/htdocs/product/reassort.php
index e964f9bca59721ade4a400661d706777461da37e..c3a2bececd913c4b940e44a4d544f901584deed5 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 36093d7080088eb282531b288a541b2d1781b97c..7b2c54fee8b63463ffdc0e0daae331548aa4c1cc 100644
--- a/htdocs/product/stats/commande.php
+++ b/htdocs/product/stats/commande.php
@@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/commande_fournisseur.php b/htdocs/product/stats/commande_fournisseur.php
index 03cc444cfdcb8c85615c5b214843425df5070aff..35ef2e9c310307f3602bb3772e86da2eed51012b 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 '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$product->libelle.'</td></tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/contrat.php b/htdocs/product/stats/contrat.php
index 306d3a94ab4285aaed4e20d834ab04ff2efbbc99..92786ff9516b1ee5008eb834f60f58b87598a472 100644
--- a/htdocs/product/stats/contrat.php
+++ b/htdocs/product/stats/contrat.php
@@ -97,12 +97,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/facture.php b/htdocs/product/stats/facture.php
index 6d195b04f5c7220956438a47942dab09a3a25725..dde6d04e2ab063ea221b1400a8e05124a65f6ad7 100644
--- a/htdocs/product/stats/facture.php
+++ b/htdocs/product/stats/facture.php
@@ -99,12 +99,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/facture_fournisseur.php b/htdocs/product/stats/facture_fournisseur.php
index eaa7bc8f85f4f4c5bd721f2164bedcb5c8946ab1..bdaaf1e20da5545e42dd17b003d6fdce2e69e5c9 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 '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/fiche.php b/htdocs/product/stats/fiche.php
index 04f5c030410911333c9947939120fa2ed25f2c7e..599739f4463f4c3462c0922065043feb33ddec4a 100644
--- a/htdocs/product/stats/fiche.php
+++ b/htdocs/product/stats/fiche.php
@@ -80,12 +80,12 @@ if (! empty($id) || ! empty($ref))
print '<tr><td>'.$langs->trans("Label").'</td><td colspan="3">'.$object->libelle.'</td></tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $object->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $object->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stats/propal.php b/htdocs/product/stats/propal.php
index b59f9d9707b2ffc331131ac814056f4e90563db4..170f786fda50b1e0c5cc460373c20f8ea3892650 100644
--- a/htdocs/product/stats/propal.php
+++ b/htdocs/product/stats/propal.php
@@ -94,12 +94,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td colspan="3">';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td colspan="3">';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td colspan="3">';
print $product->getLibStatut(2,1);
print '</td></tr>';
diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php
index 19c40b4f93551eba970177a44dec94c1af2e2b46..4554d82000e66bed16217cb60a699d546f6ecd5a 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 135d8efd85a42110fbf31f31b488f3891e003a6a..42fdcf93c0bf6dc90870adf8a870f7366a3050e0 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 102dd03e28be23ac9deb2f1cb955b2fa040dded7..fc90693fa4ff0ed7fca80789fb5f994af1245877 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 598b6c912712dea7ee8889a8132373f4167de559..de8ec8d2dbf5b14bab3000cf261a03496b3649fa 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 142b3c39233a33208a4d60ad7175ab89dbe0a991..1de22cd3e2c2672a3bd33cdf9ea3a60c98317629 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 d81c004c7d990ebea80e6ddc7530b8ee37d98a7c..44e887b73cc42db9c696672b9d91f595ad2efa8a 100644
--- a/htdocs/product/stock/product.php
+++ b/htdocs/product/stock/product.php
@@ -191,12 +191,12 @@ if ($_GET["id"] || $_GET["ref"])
print '</tr>';
// Status (to sell)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Sell").')</td><td>';
print $product->getLibStatut(2,0);
print '</td></tr>';
// Status (to buy)
- print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')'.'</td><td>';
+ print '<tr><td>'.$langs->trans("Status").' ('.$langs->trans("Buy").')</td><td>';
print $product->getLibStatut(2,1);
print '</td></tr>';