diff --git a/htdocs/compta/bank/transfer.php b/htdocs/compta/bank/transfer.php index afc1c6711e0..aa4c39e55ee 100644 --- a/htdocs/compta/bank/transfer.php +++ b/htdocs/compta/bank/transfer.php @@ -5,7 +5,7 @@ * Copyright (C) 2012 Juanjo Menent * Copyright (C) 2015 Jean-François Ferry * Copyright (C) 2015 Marcos García - * Copyright (C) 2018 Frédéric France + * Copyright (C) 2018 Frédéric France * * 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 @@ -51,8 +51,8 @@ if ($action == 'add') $dateo = dol_mktime(12, 0, 0, GETPOST('remonth', 'int'), GETPOST('reday', 'int'), GETPOST('reyear', 'int')); $label = GETPOST('label', 'alpha'); - $amount = GETPOST('amount', 'alpha'); - $amountto = GETPOST('amountto', 'alpha'); + $amount = price2num(GETPOST('amount', 'alpha'), 'MT'); + $amountto = price2num(GETPOST('amountto', 'alpha'), 'MT'); if (!$label) { @@ -115,9 +115,9 @@ if ($action == 'add') $typeto = 'LIQ'; } - if (!$error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, -1 * price2num($amount), '', '', $user); + if (!$error) $bank_line_id_from = $accountfrom->addline($dateo, $typefrom, $label, price2num(-1 * $amount), '', '', $user); if (!($bank_line_id_from > 0)) $error++; - if (!$error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, price2num($amountto), '', '', $user); + if (!$error) $bank_line_id_to = $accountto->addline($dateo, $typeto, $label, $amountto, '', '', $user); if (!($bank_line_id_to > 0)) $error++; if (!$error) $result = $accountfrom->add_url_line($bank_line_id_from, $bank_line_id_to, DOL_URL_ROOT.'/compta/bank/line.php?rowid=', '(banktransfert)', 'banktransfert'); @@ -246,7 +246,6 @@ print ''.$langs->trans("TransferFrom").''.$langs->trans("TransferTo print ''.$langs->trans("AmountToOthercurrency").''; print ''; -$var = false; print ''; $form->select_comptes($account_from, 'account_from', 0, '', 1, '', empty($conf->multicurrency->enabled) ? 0 : 1); print "";