diff --git a/htdocs/compta/bank/virement.php b/htdocs/compta/bank/virement.php
index 314bb86df6a..123b3e238d1 100644
--- a/htdocs/compta/bank/virement.php
+++ b/htdocs/compta/bank/virement.php
@@ -42,6 +42,8 @@ if (!$user->rights->banque->modifier)
*/
if ($_POST["action"] == 'add')
{
+ $langs->load("errors");
+
$mesg='';
$dateo = dolibarr_mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]);
$label = $_POST["label"];
@@ -57,6 +59,16 @@ if ($_POST["action"] == 'add')
$error=1;
$mesg.="
".$langs->trans("ErrorFieldRequired",$langs->transnoentities("Amount"))."
";
}
+ if (! $_POST['account_from'])
+ {
+ $error=1;
+ $mesg.="".$langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferFrom"))."
";
+ }
+ if (! $_POST['account_to'])
+ {
+ $error=1;
+ $mesg.="".$langs->trans("ErrorFieldRequired",$langs->transnoentities("TransferTo"))."
";
+ }
if (! $error)
{
require_once(DOL_DOCUMENT_ROOT.'/compta/bank/account.class.php');
@@ -79,7 +91,9 @@ if ($_POST["action"] == 'add')
if ($result1 > 0 && $result2 > 0)
{
- $mesg.="";
+ $mesg.="";
$db->commit();
}
else
@@ -127,51 +141,18 @@ print '';
$var=false;
print '| ';
-print " | \n";
+print $html->select_comptes($_POST['account_from'],'account_from',0,'',1);
+print " | ";
-print '\n";
+print "\n";
+print $html->select_comptes($_POST['account_to'],'account_to',0,'',1);
+print " | \n";
print "";
-$html->select_date('','','','','','add');
+$html->select_date($dateo,'','','','','add');
print " | \n";
-print ' | ';
-print ' | ';
+print ' | ';
+print ' | ';
print "";