Skip to content

Commit

Permalink
First step : remove BANK_DISABLE_DIRECT_INPUT
Browse files Browse the repository at this point in the history
  • Loading branch information
aspangaro committed Mar 18, 2017
1 parent 42898cd commit 16b12b3
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 97 deletions.
27 changes: 0 additions & 27 deletions htdocs/accountancy/admin/index.php
Expand Up @@ -141,19 +141,6 @@
}
}

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
*/
Expand Down Expand Up @@ -243,20 +230,6 @@
}
print '</tr>';

$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td>' . $langs->trans("BANK_DISABLE_DIRECT_INPUT") . '</td>';
if (! empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=0">';
print img_picto($langs->trans("Activated"), 'switch_on');
print '</a></td>';
} else {
print '<td align="right"><a href="' . $_SERVER['PHP_SELF'] . '?action=setdisabledirectinput&value=1">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print '</a></td>';
}
print '</tr>';

$var = ! $var;
print "<tr " . $bc[$var] . ">";
print '<td>' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . '</td>';
Expand Down
71 changes: 10 additions & 61 deletions htdocs/compta/bank/bankentries.php
Expand Up @@ -4,8 +4,9 @@
* Copyright (C) 2005-2010 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2012 Vinícius Nogueira <viniciusvgn@gmail.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-cooncept.pro>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2015 Jean-François Ferry <jfefe@aternatik.fr>
* Copyright (C) 2016 Juanjo Menent <jmenent@2byte.es>
* Copyright (C) 2017 Alexandre Spangaro <aspangaro@zendsi.com>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -405,28 +406,19 @@

dol_fiche_end();



/*
* Buttons actions
*/
if ($action != 'addline' && $action != 'reconcile')
if ($action != 'reconcile')
{
print '<div class="tabsAction">';

if ($action != 'addline')
{
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{
if ($user->rights->banque->modifier) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param.'">'.$langs->trans("AddBankRecord").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
} else {
print '<a class="butActionRefused" title="'.$langs->trans("FeatureDisabled").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}
}

if ($user->rights->banque->modifier) {
print '<a class="butAction" href="'.$_SERVER["PHP_SELF"].'?action=addline&page='.$page.$param.'">'.$langs->trans("AddBankRecord").'</a>';
} else {
print '<a class="butActionRefused" title="'.$langs->trans("NotEnoughPermissions").'" href="#">'.$langs->trans("AddBankRecord").'</a>';
}

if ($object->canBeConciliated() > 0) {
// If not cash account and can be reconciliate
if ($user->rights->banque->consolidate) {
Expand Down Expand Up @@ -636,49 +628,6 @@
// print '</td></tr></table>';
}

// Form to add a transaction with no invoice
if ($user->rights->banque->modifier && $action == 'addline')
{
print load_fiche_titre($langs->trans("AddBankRecordLong"),'','');

print '<table class="noborder" width="100%">';
print '<tr class="liste_titre">';
print '<td>'.$langs->trans("Date").'</td>';
print '<td>&nbsp;</td>';
print '<td>'.$langs->trans("Type").'</td>';
print '<td>'.$langs->trans("Numero").'</td>';
print '<td colspan="2">'.$langs->trans("Description").'</td>';
print '<td align=right>'.$langs->trans("Debit").'</td>';
print '<td align=right>'.$langs->trans("Credit").'</td>';
print '<td colspan="2" align="center">&nbsp;</td>';
print '</tr>';

print '<tr '.$bcnd[false].'>';
print '<td class="nowrap" colspan="2">';
$form->select_date(empty($dateop)?-1:$dateop,'op',0,0,0,'transaction');
print '</td>';
print '<td class="nowrap">';
$form->select_types_paiements((GETPOST('operation')?GETPOST('operation'):($object->courant == Account::TYPE_CASH ? 'LIQ' : '')),'operation','1,2',2,1);
print '</td><td>';
print '<input name="num_chq" class="flat" type="text" size="4" value="'.GETPOST("num_chq").'"></td>';
print '<td colspan="2">';
print '<input name="label" class="flat" type="text" size="24" value="'.GETPOST("label").'">';
if ($options) {
print '<br>'.$langs->trans("Rubrique").': ';
print Form::selectarray('cat1', $options, GETPOST('cat1'), 1);
}
print '</td>';
print '<td align="right"><input name="adddebit" class="flat" type="text" size="4" value="'.GETPOST("adddebit").'"></td>';
print '<td align="right"><input name="addcredit" class="flat" type="text" size="4" value="'.GETPOST("addcredit").'"></td>';
print '<td colspan="2" align="center">';
print '<input type="submit" name="save" class="button" value="'.$langs->trans("Add").'"><br>';
print '<input type="submit" name="cancel" class="button" value="'.$langs->trans("Cancel").'">';
print '</td></tr>';
print '</table>';
print '<br>';
}


/// ajax to adjust value date with plus and less picto
print '
<script type="text/javascript">
Expand Down
10 changes: 1 addition & 9 deletions htdocs/core/modules/modAccounting.class.php
@@ -1,6 +1,6 @@
<?php
/* Copyright (C) 2013-2014 Olivier Geffroy <jeff@jeffinfo.com>
* Copyright (C) 2013-2016 Alexandre Spangaro <aspangaro.dolibarr@gmail.com>
* Copyright (C) 2013-2017 Alexandre Spangaro <aspangaro@zendsi.com>
* Copyright (C) 2014 Ari Elbaz (elarifr) <github@accedinfo.com>
* Copyright (C) 2014 Florian Henry <florian.henry@open-concept.pro>
* Copyright (C) 2016 Laurent Destailleur <eldy@users.sourceforge.net>
Expand Down Expand Up @@ -201,14 +201,6 @@ function __construct($db)
"chaine",
"csv"
);
/* Not required to disable this. This make not possible to do complete reconciliation.
Also, this is not a problem, lines added manually will be reported as "not binded into accounting export module
and will be binded manually to be created into general ledger
$this->const[24] = array(
"BANK_DISABLE_DIRECT_INPUT",
"yesno",
"1"
);*/

// Tabs
$this->tabs = array();
Expand Down
2 changes: 2 additions & 0 deletions htdocs/install/mysql/migration/5.0.0-6.0.0.sql
Expand Up @@ -123,3 +123,5 @@ INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USERGR
INSERT INTO llx_const (name, entity, value, type, visible, note) VALUES ('USER_ADDON_PDF_ODT_PATH', 1, 'DOL_DATA_ROOT/doctemplates/users', 'chaine', 0, '');

ALTER TABLE llx_chargesociales ADD COLUMN fk_projet integer DEFAULT NULL;

DELETE FROM llx_const WHERE name = __ENCRYPT('BANK_DISABLE_DIRECT_INPUT')__;

0 comments on commit 16b12b3

Please sign in to comment.