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 '
';
print $lipre->statuts[$lipre->statut].'