From 111e44493aad7eff8a754d2fe09352120a578292 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Fri, 3 Jul 2015 06:48:49 +0200 Subject: [PATCH 1/2] Disable button add a line in bank module when accountancy module is activated --- htdocs/compta/bank/account.php | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index f2a7649166a..1b840275eaa 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -392,7 +392,7 @@ if ($id > 0 || ! empty($ref)) if ($action != 'addline') { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) + if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT) && empty($conf->accounting->enabled)) { if ($user->rights->banque->modifier) { @@ -466,15 +466,12 @@ if ($id > 0 || ! empty($ref)) print '
'.$navig.'
'; } - print ''; - // Form to add a transaction with no invoice if ($user->rights->banque->modifier && $action == 'addline') { - print ''; - print ''; - print ''; + print_fiche_titre($langs->trans("AddBankRecordLong"),'',''); + print '
'.$langs->trans("AddBankRecordLong").'
'; print ''; print ''; print ''; @@ -507,11 +504,13 @@ if ($id > 0 || ! empty($ref)) print '
'; print ''; print ''; - print ""; - - print ''."\n"; + print '
'.$langs->trans("Date").' 
 
'; + print ''; + print '
'; } + print ''; + /* * Affiche tableau des transactions bancaires */ From 4627e72f5955d112c2be7240f89318bed4303a15 Mon Sep 17 00:00:00 2001 From: aspangaro Date: Sat, 4 Jul 2015 00:01:40 +0200 Subject: [PATCH 2/2] Debug && PSR2 --- htdocs/compta/bank/account.php | 51 ++++++++++++++-------------------- 1 file changed, 21 insertions(+), 30 deletions(-) diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index 1b840275eaa..680a12c211c 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -374,43 +374,34 @@ if ($id > 0 || ! empty($ref)) * Boutons actions */ - if ($action != 'delete') - { + if ($action != 'delete') { print '
'; - if ($object->type != 2 && $object->rappro) // If not cash account and can be reconciliate - { - if ($user->rights->banque->consolidate) - { + if ($object->type != 2 && $object->rappro) { // If not cash account and can be reconciliate + if ($user->rights->banque->consolidate) { print ''.$langs->trans("Conciliate").''; - } - else - { + } else { print ''.$langs->trans("Conciliate").''; } } - if ($action != 'addline') - { - if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT) && 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").''; - } - } - - print '
'; - } + if ($action != 'addline') { + 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").''; + } + } else { + print ''.$langs->trans("AddBankRecord").''; + } + } + print ''; + } print '
';