diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index fae4739af27..a518fe8d680 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -32,7 +32,6 @@ require("./pre.inc.php"); $langs->load("bills"); - /* * Sécurité accés client */ @@ -50,10 +49,19 @@ if ($_POST["action"] == 'confirm_credite' && $_POST["confirm"] == yes) if ($_POST["action"] == 'infotrans') { $bon = new BonPrelevement($db,""); - $bon->id = $_GET["id"]; - $dt = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); + $bon->fetch($_GET["id"]); - $bon->set_infotrans($user, $dt, $_POST["methode"]); + if ($_FILES['userfile']['name'] && basename($_FILES['userfile']['name'],".ps") == $bon->ref) + { + $dir = DOL_DATA_ROOT.'/prelevement/bon/'; + + if (doliMoveFileUpload($_FILES['userfile']['tmp_name'], $dir . "/" . $_FILES['userfile']['name'])) + { + $dt = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); + + $bon->set_infotrans($user, $dt, $_POST["methode"]); + } + } Header("Location: fiche.php?id=".$_GET["id"]); } @@ -155,7 +163,7 @@ if ($_GET["id"]) if($bon->date_trans == 0) { - print '
'; + print ''; print ''; print ''; print ''; + print ''; print '';
Date Transmission'; @@ -164,6 +172,9 @@ if ($_GET["id"]) print '
Méthode Transmission'; print $html->select_array("methode",$bon->methodes_trans); print '
Fichier'; + print '
'; + print '
'; print ''; print '