diff --git a/htdocs/accountancy/customer/index.php b/htdocs/accountancy/customer/index.php
index e6b4e95df07..ede72c9d9e6 100644
--- a/htdocs/accountancy/customer/index.php
+++ b/htdocs/accountancy/customer/index.php
@@ -158,6 +158,9 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_societe_perentity . ".accountancy_code_sell = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
+ if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
+ }
dol_syslog('htdocs/accountancy/customer/index.php');
$result = $db->query($sql);
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index 818455ce979..f047ddf70de 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -166,6 +166,9 @@ if ($action == 'validatehistory') {
$sql .= " LEFT JOIN ".MAIN_DB_PREFIX."accounting_account as aa4 ON " . $alias_product_perentity . ".accountancy_code_buy = aa4.account_number AND aa4.active = 1 AND aa4.fk_pcg_version = '".$db->escape($chartaccountcode)."' AND aa4.entity = ".$conf->entity;
$sql .= " WHERE f.fk_statut > 0 AND l.fk_code_ventilation <= 0";
$sql .= " AND l.product_type <= 2";
+ if (!empty($conf->global->ACCOUNTING_DATE_START_BINDING)) {
+ $sql .= " AND f.datef >= '".$db->idate($conf->global->ACCOUNTING_DATE_START_BINDING)."'";
+ }
dol_syslog('htdocs/accountancy/supplier/index.php');
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index d7097587a73..048fbb0cad3 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1252,6 +1252,9 @@ class Form
if (is_null($ajaxoptions)) {
$ajaxoptions = array();
}
+
+ require_once DOL_DOCUMENT_ROOT . '/core/lib/ajax.lib.php';
+
// No immediate load of all database
$placeholder = '';
if ($selected && empty($selected_input_value)) {
diff --git a/htdocs/product/card.php b/htdocs/product/card.php
index 1e1a365ead1..b1e892ae2da 100644
--- a/htdocs/product/card.php
+++ b/htdocs/product/card.php
@@ -1636,42 +1636,48 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$tooltip .= '
'.$langs->trans("GenericMaskCodes4a", $langs->transnoentities("Batch"), $langs->transnoentities("Batch"));
$tooltip .= '
'.$langs->trans("GenericMaskCodes5");
print '