diff --git a/htdocs/accountancy/admin/index.php b/htdocs/accountancy/admin/index.php index b92da48353f..e6bae2f73d8 100644 --- a/htdocs/accountancy/admin/index.php +++ b/htdocs/accountancy/admin/index.php @@ -141,6 +141,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 */ @@ -230,6 +242,20 @@ if (! empty($user->admin)) } 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 ''; + $var = ! $var; print ""; print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ''; diff --git a/htdocs/compta/bank/bankentries.php b/htdocs/compta/bank/bankentries.php index 81bd829b8f5..7ea3a0807a5 100644 --- a/htdocs/compta/bank/bankentries.php +++ b/htdocs/compta/bank/bankentries.php @@ -394,16 +394,15 @@ if ($id > 0 || ! empty($ref)) foreach ($bankcateg->fetchAll() as $bankcategory) { $options[$bankcategory->id] = $bankcategory->label; } - + // Bank card - $head=bank_prepare_head($object); dol_fiche_head($head,'journal',$langs->trans("FinancialAccount"),0,'account'); - + $linkback = ''.$langs->trans("BackToList").''; - + dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref, '', 0, '', '', 1); - + dol_fiche_end(); /* @@ -413,10 +412,17 @@ if ($id > 0 || ! empty($ref)) { print '
'; - if ($user->rights->banque->modifier) { - print ''.$langs->trans("AddBankRecord").''; - } else { - print ''.$langs->trans("AddBankRecord").''; + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + { + if ($user->rights->banque->modifier) { + print ''.$langs->trans("AddBankRecord").''; + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + else + { + print ''.$langs->trans("AddBankRecord").''; } if ($object->canBeConciliated() > 0) { diff --git a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql index a4357cacdeb..5921e3a8099 100644 --- a/htdocs/install/mysql/migration/5.0.0-6.0.0.sql +++ b/htdocs/install/mysql/migration/5.0.0-6.0.0.sql @@ -124,8 +124,6 @@ INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USER_A ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL; -DELETE FROM llx_const WHERE name = __ENCRYPT('BANK_DISABLE_DIRECT_INPUT')__; - create table llx_payment_various ( rowid integer AUTO_INCREMENT PRIMARY KEY,