From 749e5eb7f4e94c6ba6551b2b734e745e60b328b6 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 7 Jul 2017 20:24:39 +0200 Subject: [PATCH] Fix link --- htdocs/compta/bank/transfer.php | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index 88d5e94ed83..0d9a9a94aea 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -37,6 +37,7 @@ if (! $user->rights->banque->transfer) accessforbidden(); $action = GETPOST('action','alpha'); +$error = 0; /* @@ -54,22 +55,22 @@ if ($action == 'add_confirm') if (! $label) { - $error=1; + setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Description")), null, 'errors'); } if (! $amount) { - $error=1; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("Amount")), null, 'errors'); } if (! GETPOST('account_from','int')) { - $error=1; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferFrom")), null, 'errors'); } if (! GETPOST('account_to','int')) { - $error=1; + $error++; setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("TransferTo")), null, 'errors'); } if (! $error) @@ -86,7 +87,6 @@ if ($action == 'add_confirm') { $db->begin(); - $error=0; $bank_line_id_from=0; $bank_line_id_to=0; $result=0; @@ -114,7 +114,7 @@ if ($action == 'add_confirm') if (! $error) { - $mesgs = $langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); + $mesgs = $langs->trans("TransferFromToDone","id."\">".$accountfrom->label."","id."\">".$accountto->label."",$amount,$langs->transnoentities("Currency".$conf->currency)); setEventMessages($mesgs, null, 'mesgs'); $db->commit(); } @@ -126,6 +126,7 @@ if ($action == 'add_confirm') } else { + $error++; setEventMessages($langs->trans("ErrorFromToAccountsMustDiffers"), null, 'errors'); } } @@ -147,7 +148,7 @@ $label=''; $amount=''; $amount_to=''; -if($error) +if ($error) { $account_from = GETPOST('account_from','int'); $account_to = GETPOST('account_to','int'); @@ -163,7 +164,7 @@ print "

"; print '
'; print ''; -print ''; +print ''; print ''; print '';