diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php
index b019872da6e..0173ac931cc 100644
--- a/htdocs/accountancy/admin/index.php
+++ b/htdocs/accountancy/admin/index.php
@@ -168,6 +168,18 @@ if ($action == 'setmanagezero') {
}
}
+if ($action == 'setdisabledirectinput') {
+ $setdisabledirectinput = GETPOST('value', 'int');
+ $res = dolibarr_set_const($db, "BANK_DISABLE_DIRECT_INPUT", $setdisabledirectinput, 'yesno', 0, '', $conf->entity);
+ if (! $res > 0)
+ $error ++;
+ if (! $error) {
+ setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
+ } else {
+ setEventMessages($langs->trans("Error"), null, 'mesgs');
+ }
+}
+
/*
* View
*/
@@ -342,6 +354,20 @@ if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
}
print '';
+$var = ! $var;
+print "
";
+print '| ' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . ' | ';
+if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
+ print '';
+ print img_picto($langs->trans("Activated"), 'switch_on');
+ print ' | ';
+} else {
+ print '';
+ print img_picto($langs->trans("Disabled"), 'switch_off');
+ print ' | ';
+}
+print '
';
+
print "\n";
dol_fiche_end();
diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php
index 3eb4764bb11..10c52e657ab 100644
--- a/htdocs/compta/bank/account.php
+++ b/htdocs/compta/bank/account.php
@@ -366,16 +366,11 @@ if ($id > 0 || ! empty($ref))
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{
- if (empty($conf->accounting->enabled))
- {
- if ($user->rights->banque->modifier) {
- print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'';
- } else {
- print ''.$langs->trans("AddBankRecord").'';
- }
- } else {
- print ''.$langs->trans("AddBankRecord").'';
- }
+ if ($user->rights->banque->modifier) {
+ print 'id.'&page='.$page.($vline?'&vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'';
+ } else {
+ print ''.$langs->trans("AddBankRecord").'';
+ }
} else {
print ''.$langs->trans("AddBankRecord").'';
}
diff --git a/htdocs/core/modules/modAccounting.class.php b/htdocs/core/modules/modAccounting.class.php
index af51e01c576..60d99438f4f 100644
--- a/htdocs/core/modules/modAccounting.class.php
+++ b/htdocs/core/modules/modAccounting.class.php
@@ -207,6 +207,11 @@ class modAccounting extends DolibarrModules
"chaine",
"csv"
);
+ $this->const[24] = array(
+ "BANK_DISABLE_DIRECT_INPUT",
+ "yesno",
+ "1"
+ );
// Tabs
$this->tabs = array();
diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang
index 056466706a1..3c8a431fbb6 100644
--- a/htdocs/langs/en_US/accountancy.lang
+++ b/htdocs/langs/en_US/accountancy.lang
@@ -56,7 +56,8 @@ ACCOUNTING_LENGTH_DESCRIPTION=Length for displaying product & services descripti
ACCOUNTING_LENGTH_DESCRIPTION_ACCOUNT=Length for displaying product & services account description form in listings (Best = 50)
ACCOUNTING_LENGTH_GACCOUNT=Length of the general accounts
ACCOUNTING_LENGTH_AACCOUNT=Length of the third party accounts
-ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function of length of the accounts.
+ACCOUNTING_MANAGE_ZERO=Manage the zero at the end of an accounting account. Needed by some countries. Disable by default. Be careful with the function "length of the accounts".
+BANK_DISABLE_DIRECT_INPUT=Disable free input of bank transactions. Enable by default with this module.
ACCOUNTING_SELL_JOURNAL=Sell journal
ACCOUNTING_PURCHASE_JOURNAL=Purchase journal