From 3cd118ac68595a912d45e6bcaeb3dfbb0f7591d7 Mon Sep 17 00:00:00 2001 From: Rodolphe Quiedeville Date: Wed, 2 Mar 2005 13:31:36 +0000 Subject: [PATCH] Ajout informations sur le rejet --- htdocs/compta/prelevement/ligne.php | 30 +++++++++++++++++++++++++---- 1 file changed, 26 insertions(+), 4 deletions(-) diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 349a146da6e..6948b62b63d 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -35,22 +35,24 @@ if ($_POST["action"] == 'confirm_rejet') if ( $_POST["confirm"] == 'yes') { + $daterej = mktime(2, 0 , 0, $_POST["remonth"], $_POST["reday"], $_POST["reyear"]); + $lipre = new LignePrelevement($db, $user); if ($lipre->fetch($_GET["id"]) == 0) { - if ($_POST["motif"] > 0) + if ($_POST["motif"] > 0 && $daterej < time()) { $rej = new RejetPrelevement($db, $user); - $rej->create($user, $_GET["id"], $_POST["motif"], $lipre->bon_rowid); + $rej->create($user, $_GET["id"], $_POST["motif"], $daterej, $lipre->bon_rowid); Header("Location: ligne.php?id=".$_GET["id"]); } else { - Header("Location: ligne.php?id=".$_GET["id"]."&action=rejet&socid=".$_GET["socid"]."&previd=".$_GET["previd"]); + Header("Location: ligne.php?id=".$_GET["id"]."&action=rejet"); } } } @@ -88,7 +90,23 @@ if ($_GET["id"]) print 'Statut'; print ' '; print $lipre->statuts[$lipre->statut].''; - + + if ($lipre->statut == 3) + { + $rej = new RejetPrelevement($db, $user); + $resf = $rej->fetch($lipre->id); + if ($resf == 0) + { + print 'Motif du rejet'.$rej->motif.''; + print 'Date du rejet'.strftime("%d %B %Y",$rej->date_rejet).''; + } + else + { + print ''.$resf.''; + } + } + + print '
'; } else @@ -119,6 +137,10 @@ if ($_GET["id"]) print ''; print ''; + print 'Date du rejet'; + print ''; + print $html->select_date(); + print ''; print 'Motif du rejet'; print ''; print '