Skip to content
Snippets Groups Projects
Commit 9bfb22ad authored by Florian Henry's avatar Florian Henry
Browse files

Merge branch 'develop' of https://github.com/Dolibarr/dolibarr.git into develop

parents 77280431 dbb0fa09
No related branches found
No related tags found
No related merge requests found
<?php <?php
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2009 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2011 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2013 Juanjo Menent <jmenent@2byte.es>
* *
* This program is free software; you can redistribute it and/or modify * This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
...@@ -50,7 +50,7 @@ class RejetPrelevement ...@@ -50,7 +50,7 @@ class RejetPrelevement
$this->motifs = array(); $this->motifs = array();
$this->facturer = array(); $this->facturer = array();
$this->motifs[0] = $langs->trans("StatusMotif0"); $this->motifs[0] = "";//$langs->trans("StatusMotif0");
$this->motifs[1] = $langs->trans("StatusMotif1"); $this->motifs[1] = $langs->trans("StatusMotif1");
$this->motifs[2] = $langs->trans("StatusMotif2"); $this->motifs[2] = $langs->trans("StatusMotif2");
$this->motifs[3] = $langs->trans("StatusMotif3"); $this->motifs[3] = $langs->trans("StatusMotif3");
......
...@@ -55,12 +55,24 @@ if ($action == 'confirm_rejet') ...@@ -55,12 +55,24 @@ if ($action == 'confirm_rejet')
{ {
$daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int')); $daterej = mktime(2, 0, 0, GETPOST('remonth','int'), GETPOST('reday','int'), GETPOST('reyear','int'));
if (empty($daterej))
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->trans("Date")),'errors');
}
if (GETPOST('motif','alpha') == 0)
{
$error++;
setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentities("RefusedReason")),'errors');
}
$lipre = new LignePrelevement($db, $user); $lipre = new LignePrelevement($db, $user);
if ($lipre->fetch($id) == 0) if ($lipre->fetch($id) == 0)
{ {
if (GETPOST('motif','alpha') > 0 && $daterej < time()) if ( ! $error && $daterej < time())
{ {
$rej = new RejetPrelevement($db, $user); $rej = new RejetPrelevement($db, $user);
...@@ -73,8 +85,8 @@ if ($action == 'confirm_rejet') ...@@ -73,8 +85,8 @@ if ($action == 'confirm_rejet')
{ {
dol_syslog("Motif : ".GETPOST('motif','alpha')); dol_syslog("Motif : ".GETPOST('motif','alpha'));
dol_syslog("$daterej $time "); dol_syslog("$daterej $time ");
header("Location: ligne.php?id=".$id."&action=rejet");
exit; $action="rejet";
} }
} }
} }
...@@ -305,9 +317,11 @@ if ($id) ...@@ -305,9 +317,11 @@ if ($id)
{ {
dol_print_error($db); dol_print_error($db);
} }
$db->close();
} }
dol_htmloutput_mesg($mesg);
llxFooter(); llxFooter();
$db->close();
?> ?>
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment