From 8bea703363c927f99acf7a2cc595b59ebf49ad7a Mon Sep 17 00:00:00 2001
From: Laurent Destailleur <eldy@destailleur.fr>
Date: Fri, 4 Sep 2015 19:42:07 +0200
Subject: [PATCH] Fix deadlock feature. Can't reconciliate cash bank account.
 Sometimes users need. I introduce a hidden option to fix this quickly.

---
 htdocs/compta/bank/class/account.class.php | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php
index 72aa176b7b6..a7e55afb3cb 100644
--- a/htdocs/compta/bank/class/account.class.php
+++ b/htdocs/compta/bank/class/account.class.php
@@ -122,8 +122,10 @@ class Account extends CommonObject
      */
     function canBeConciliated()
     {
+        global $conf;
+
         if (empty($this->rappro)) return -1;
-        if ($this->courant == 2) return -2;
+        if ($this->courant == 2 && empty($conf->global->BANK_CAN_RECONCILIATE_CASHACCOUNT)) return -2;
         if ($this->clos) return -3;
         return 1;
     }
-- 
GitLab