diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index a518fe8d680..7831f964a0b 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -62,6 +62,10 @@ if ($_POST["action"] == 'infotrans') $bon->set_infotrans($user, $dt, $_POST["methode"]); } } + else + { + dolibarr_syslog("Fichier invalide",LOG_WARN); + } Header("Location: fiche.php?id=".$_GET["id"]); } @@ -69,12 +73,19 @@ if ($_POST["action"] == 'infotrans') if ($_POST["action"] == 'infocredit') { $bon = new BonPrelevement($db,""); - $bon->id = $_GET["id"]; + $bon->Fetch($_GET["id"]); $dt = mktime(12,0,0,$_POST["remonth"],$_POST["reday"],$_POST["reyear"]); - $bon->set_infocredit($user, $dt); + $error = $bon->set_infocredit($user, $dt); - Header("Location: fiche.php?id=".$_GET["id"]); + if ($error == 0) + { + Header("Location: fiche.php?id=".$_GET["id"]); + } + else + { + Header("Location: fiche.php?id=".$_GET["id"]."&error=$error"); + } } llxHeader('','Bon de prélèvement'); @@ -117,6 +128,13 @@ if ($_GET["id"]) { dolibarr_fiche_head($head, $hselected, 'Prélèvement : '. $bon->ref); + if (isset($_GET["error"])) + { + print '
| '.$langs->trans("Ref").' | '.$bon->ref.' |
| '.$langs->trans("Date").' | '.strftime("%d %b %Y",$bon->datec).' |
| '.$langs->trans("Date").' | '.strftime("%e %B %Y",$bon->datec).' |
| '.$langs->trans("Amount").' | '.price($bon->amount).' |
| '.$langs->trans("File").' | '; @@ -146,7 +164,7 @@ if ($_GET["id"]) $muser->fetch(); print ' |
| Date Transmission / Par | '; - print strftime("%d %b %Y",$bon->date_trans); + print strftime("%e %B %Y",$bon->date_trans); print ' par '.$muser->fullname.' |
| Méthode Transmission | '; print $bon->methodes_trans[$bon->method_trans]; @@ -155,7 +173,7 @@ if ($_GET["id"]) if($bon->date_credit <> 0) { print ' |
| Crédité le | '; - print strftime("%d %b %Y",$bon->date_credit); + print strftime("%e %B %Y",$bon->date_credit); print ' |