diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index 81813c2bebe..186b20a051d 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -2,3 +2,4 @@
open_collective: dolibarr
custom: https://wiki.dolibarr.org/index.php/Subscribe
+# github: [eldy]
\ No newline at end of file
diff --git a/README.md b/README.md
index 5d4de0af909..f4ccc78e9dc 100644
--- a/README.md
+++ b/README.md
@@ -1,7 +1,6 @@
# DOLIBARR ERP & CRM

-[](https://houndci.com)
|7|8|9|10|develop|
|----------|----------|----------|----------|----------|
diff --git a/htdocs/admin/system/perf.php b/htdocs/admin/system/perf.php
index fbf6fa3bb14..e17756391f1 100644
--- a/htdocs/admin/system/perf.php
+++ b/htdocs/admin/system/perf.php
@@ -522,9 +522,9 @@ if ($resql)
$nb=$obj->nb;
if ($nb > $limitforoptim)
{
- if (empty($conf->global->THIRDPARTY_DONOTSEARCH_ANYWHERE))
+ if (empty($conf->global->COMPANY_DONOTSEARCH_ANYWHERE))
{
- print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'THIRDPARTY_DONOTSEARCH_ANYWHERE');
+ print img_picto('', 'warning.png').' '.$langs->trans("YouHaveXObjectUseSearchOptim", $nb, $langs->transnoentitiesnoconv("ThirdParties"), 'COMPANY_DONOTSEARCH_ANYWHERE');
}
else
{
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index dea2d0c0ed8..5b6a47fa998 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -1758,15 +1758,16 @@ if ($action == 'create' && $usercancreate)
$reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action);
print $hookmanager->resPrint;
if (empty($reshook)) {
- if (! empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER))
- // copy from thirdparty
- $tpExtrafields = new Extrafields($db);
- $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
- if ($soc->fetch_optionals() > 0) {
- $object->array_options = array_merge($object->array_options, $soc->array_options);
- }
+ if (! empty($conf->global->THIRDPARTY_PROPAGATE_EXTRAFIELDS_TO_ORDER)) {
+ // copy from thirdparty
+ $tpExtrafields = new Extrafields($db);
+ $tpExtrafieldLabels = $tpExtrafields->fetch_name_optionals_label($soc->table_element);
+ if ($soc->fetch_optionals() > 0) {
+ $object->array_options = array_merge($object->array_options, $soc->array_options);
+ }
};
- print $object->showOptionals($extrafields, 'edit');
+
+ print $object->showOptionals($extrafields, 'edit');
}
// Template to use by default
diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php
index ce36be991d2..e8fceebb03c 100644
--- a/htdocs/compta/paiement.php
+++ b/htdocs/compta/paiement.php
@@ -597,7 +597,11 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print '
'.$alreadypayedlabel.' | ';
print ''.$remaindertopay.' | ';
print ''.$langs->trans('PaymentAmount').' | ';
- print ' | ';
+
+ $parameters=array();
+ $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $facture, $action); // Note that $action and $object may have been modified by hook
+
+ print ' | ';
print "\n";
$total=0;
@@ -745,7 +749,7 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie
print "";
$parameters=array();
- $reshook=$hookmanager->executeHooks('printFieldListTitle', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
+ $reshook=$hookmanager->executeHooks('printFieldListValue', $parameters, $objp, $action); // Note that $action and $object may have been modified by hook
// Warning
print '';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 3a69d8e6d42..5ee969a73a0 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1887,10 +1887,10 @@ class Form
* @param int $forcecombo Force to use combo box
* @param string $morecss Add more css on select
* @param int $hidepriceinlabel 1=Hide prices in label
- * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
- * 'warehouseopen' = select products from open warehouses,
- * 'warehouseclosed' = select products from closed warehouses,
- * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
+ * @param string $warehouseStatus Warehouse status filter to count the quantity in stock. Following comma separated filter options can be used
+ * 'warehouseopen' = count products from open warehouses,
+ * 'warehouseclosed' = count products from closed warehouses,
+ * 'warehouseinternal' = count products from warehouses for internal correct/transfer only
* @param array $selected_combinations Selected combinations. Format: array([attrid] => attrval, [...])
* @return void
*/
@@ -2042,10 +2042,10 @@ class Form
* @param int $forcecombo Force to use combo box
* @param string $morecss Add more css on select
* @param int $hidepriceinlabel 1=Hide prices in label
- * @param string $warehouseStatus warehouse status filter, following comma separated filter options can be used
- * 'warehouseopen' = select products from open warehouses,
- * 'warehouseclosed' = select products from closed warehouses,
- * 'warehouseinternal' = select products from warehouses for internal correct/transfer only
+ * @param string $warehouseStatus Warehouse status filter to group/count stock. Following comma separated filter options can be used.
+ * 'warehouseopen' = count products from open warehouses,
+ * 'warehouseclosed' = count products from closed warehouses,
+ * 'warehouseinternal' = count products from warehouses for internal correct/transfer only
* @return array Array of keys for json
*/
public function select_produits_list($selected = '', $htmlname = 'productid', $filtertype = '', $limit = 20, $price_level = 0, $filterkey = '', $status = 1, $finished = 2, $outputmode = 0, $socid = 0, $showempty = '1', $forcecombo = 0, $morecss = '', $hidepriceinlabel = 0, $warehouseStatus = '')
@@ -2075,7 +2075,14 @@ class Form
}
$selectFields = " p.rowid, p.label, p.ref, p.description, p.barcode, p.fk_product_type, p.price, p.price_ttc, p.price_base_type, p.tva_tx, p.duration, p.fk_price_expression";
- (count($warehouseStatusArray)) ? $selectFieldsGrouped = ", sum(ps.reel) as stock" : $selectFieldsGrouped = ", p.stock";
+ if (count($warehouseStatusArray))
+ {
+ $selectFieldsGrouped = ", sum(".$db->ifsql("e.statut IS NULL", "0", "ps.reel").") as stock"; // e.statut is null if there is no record in stock
+ }
+ else
+ {
+ $selectFieldsGrouped = ", p.stock";
+ }
$sql = "SELECT ";
$sql.= $selectFields . $selectFieldsGrouped;
@@ -2126,7 +2133,8 @@ class Form
if (count($warehouseStatusArray))
{
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."product_stock as ps on ps.fk_product = p.rowid";
- $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid";
+ $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."entrepot as e on ps.fk_entrepot = e.rowid AND e.entity IN (".getEntity('stock').")";
+ $sql.= ' AND e.statut IN ('.$this->db->escape(implode(',', $warehouseStatusArray)).')'; // Return line if product is inside the selected stock. If not, an empty line will be returned so we will count 0.
}
// include search in supplier ref
@@ -2154,10 +2162,6 @@ class Form
}
$sql.= ' WHERE p.entity IN ('.getEntity('product').')';
- if (count($warehouseStatusArray))
- {
- $sql.= ' AND (p.fk_product_type = 1 OR e.statut IN ('.$this->db->escape(implode(',', $warehouseStatusArray)).'))';
- }
if (!empty($conf->global->PRODUIT_ATTRIBUTES_HIDECHILD)) {
$sql .= " AND pac.rowid IS NULL";
diff --git a/htdocs/core/tpl/contacts.tpl.php b/htdocs/core/tpl/contacts.tpl.php
index 14534b3472e..1f7d403b575 100644
--- a/htdocs/core/tpl/contacts.tpl.php
+++ b/htdocs/core/tpl/contacts.tpl.php
@@ -149,7 +149,7 @@ if ($permission) {
?>
|