diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index 8a2ee5bce35..6a9a67d1c55 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -870,7 +870,7 @@ else
$conciliate=$account->canBeConciliated();
if ($conciliate == -2) print $langs->trans("No").' ('.$langs->trans("CashAccount").')';
else if ($conciliate == -3) print $langs->trans("No").' ('.$langs->trans("Closed").')';
- else print 'rappro?'':' checked').'"> '.$langs->trans("DisableConciliation");
+ else print ' 0)?'':' checked="checked"').'"> '.$langs->trans("DisableConciliation");
print '';
// Balance
diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index cf38669d554..9747703c58f 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -970,6 +970,34 @@ class Account extends CommonObject
}
+ /**
+ * Load indicators for dashboard (this->nbtodo and this->nbtodolate)
+ *
+ * @return int Nb of account we can reconciliate
+ */
+ public static function countAccountToReconcile()
+ {
+ global $db, $conf, $langs;
+
+ if ($user->societe_id) return 0; // protection pour eviter appel par utilisateur externe
+
+ $nb=0;
+
+ $sql = "SELECT COUNT(ba.rowid) as nb";
+ $sql.= " FROM ".MAIN_DB_PREFIX."bank_account as ba";
+ $sql.= " WHERE ba.rappro > 0 and ba.clos = 0";
+ if (empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) $sql.= " AND ba.courant != 2";
+ $resql=$db->query($sql);
+ if ($resql)
+ {
+ $obj = $db->fetch_object($resql);
+ $nb = $obj->nb;
+ }
+ else dol_print_error($db);
+
+ return $nb;
+ }
+
/**
* Return clicable name (with picto eventually)
*
diff --git a/htdocs/index.php b/htdocs/index.php
index 0b6bbbbc4a9..c3771c37121 100644
--- a/htdocs/index.php
+++ b/htdocs/index.php
@@ -400,7 +400,11 @@ if (! empty($conf->banque->enabled) && $user->rights->banque->lire && ! $user->s
{
include_once DOL_DOCUMENT_ROOT.'/compta/bank/class/account.class.php';
$board=new Account($db);
- $dashboardlines[] = $board->load_board($user);
+ $nb = $board::countAccountToReconcile();
+ if ($nb > 0)
+ {
+ $dashboardlines[] = $board->load_board($user);
+ }
}
// Number of cheque to send