Close #9674 by keeping old code present (this help for transition tests)

This commit is contained in:
Laurent Destailleur 2018-10-04 18:20:57 +02:00
parent 09fbe479d1
commit ebba33635b
3 changed files with 6 additions and 5 deletions

View File

@ -302,7 +302,7 @@ if (GETPOST('save') && ! $cancel && $user->rights->banque->modifier)
$error++; $error++;
}*/ }*/
if (! $error) if (! $error && ! empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT))
{ {
$objecttmp = new Account($db); $objecttmp = new Account($db);
$objecttmp->fetch($bankaccountid); $objecttmp->fetch($bankaccountid);
@ -630,7 +630,7 @@ if ($resql)
} }
// Form to add a transaction with no invoice // Form to add a transaction with no invoice
if ($user->rights->banque->modifier && $action == 'addline') if ($user->rights->banque->modifier && $action == 'addline' && ! empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT))
{ {
print load_fiche_titre($langs->trans("AddBankRecordLong"),'',''); print load_fiche_titre($langs->trans("AddBankRecordLong"),'','');
@ -729,7 +729,7 @@ if ($resql)
{ {
if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT)) if (empty($conf->global->BANK_DISABLE_DIRECT_INPUT))
{ {
if (! empty($conf->global->BANK_USE_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments if (empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT)) // If direct entries is done using miscellaneous payments
{ {
if ($user->rights->banque->modifier) { if ($user->rights->banque->modifier) {
$newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)).'"><span class="valignmiddle">'.$langs->trans("AddBankRecord").'</span>'; $newcardbutton = '<a class="butActionNew" href="'.DOL_URL_ROOT.'/compta/bank/various_payment/card.php?action=create&accountid='.$search_account.'&backtopage='.urlencode($_SERVER['PHP_SELF'].'?id='.urlencode($search_account)).'"><span class="valignmiddle">'.$langs->trans("AddBankRecord").'</span>';

View File

@ -155,7 +155,8 @@ if (empty($reshook))
if ($ret > 0) if ($ret > 0)
{ {
$db->commit(); $db->commit();
header("Location: index.php"); $urltogo=($backtopage ? $backtopage : DOL_URL_ROOT.'/compta/bank/various_payment/index.php');
header("Location: ".$urltogo);
exit; exit;
} }
else else

View File

@ -959,7 +959,7 @@ function print_left_eldy_menu($db,$menu_array_before,$menu_array_after,&$tabMenu
} }
// Various payment // Various payment
if (! empty($conf->banque->enabled) && $conf->global->MAIN_FEATURES_LEVEL >= 1) if (! empty($conf->banque->enabled) && empty($conf->global->BANK_USE_OLD_VARIOUS_PAYMENT))
{ {
$langs->load("banks"); $langs->load("banks");
$newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&amp;mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various'); $newmenu->add("/compta/bank/various_payment/index.php?leftmenu=tax_various&amp;mainmenu=billing",$langs->trans("MenuVariousPayment"),1,$user->rights->banque->lire, '', $mainmenu, 'tax_various');