Skip to content
Snippets Groups Projects
Commit 5ac175b7 authored by Juanjo Menent's avatar Juanjo Menent Committed by GitHub
Browse files

Merge pull request #5602 from aspangaro/4.0-p38

FIX : Accountancy - BANK_DISABLE_DIRECT_INPUT Add an option
parents 8c63d680 43ffb061
No related branches found
No related tags found
No related merge requests found
......@@ -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 '</tr>';
$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td width="80%">' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="center" colspan="2"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';
print "</table>\n";
dol_fiche_end();
......
......@@ -366,8 +366,6 @@ if ($id > 0 || ! empty($ref))
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{
if (empty($conf->accounting->enabled))
{
if ($user->rights->banque->modifier) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&amp;id='.$object->id.'&amp;page='.$page.($vline?'&amp;vline='.$vline:'').'">'.$langs->trans("AddBankRecord").'</a>';
} else {
......@@ -375,9 +373,6 @@ if ($id > 0 || ! empty($ref))
}
} else {
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
} else {
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}
......
......@@ -207,6 +207,11 @@ class modAccounting extends DolibarrModules
"chaine",
"csv"
);
$this->const[24] = array(
"BANK_DISABLE_DIRECT_INPUT",
"yesno",
"1"
);
// Tabs
$this->tabs = array();
......
......@@ -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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment