From 3b38e5a870aac3711b9343fdd5453e1d650fb641 Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Fri, 24 Jun 2016 03:00:34 +0200 Subject: [PATCH] FIX Withdraw request should not be possible if amount is negative. --- htdocs/compta/facture/prelevement.php | 37 ++++++++++++++++----------- 1 file changed, 22 insertions(+), 15 deletions(-) diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 00254b7440f6d..0fa260bbe34e0 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -1,7 +1,7 @@ * Copyright (C) 2004 Eric Seigne - * Copyright (C) 2004-2015 Laurent Destailleur + * Copyright (C) 2004-2016 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2010-2014 Juanjo Menent * @@ -483,20 +483,27 @@ // Add a withdraw request if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) { - if ($user->rights->prelevement->bons->creer) - { - print '
'; - print ''; - print ''; - print ''; - print ''; - print ''; - print '
'; - } - else - { - print ''.$langs->trans("MakeWithdrawRequest").''; - } + if ($resteapayer > 0) + { + if ($user->rights->prelevement->bons->creer) + { + print '
'; + print ''; + print ''; + print ''; + print ''; + print ''; + print '
'; + } + else + { + print ''.$langs->trans("MakeWithdrawRequest").''; + } + } + else + { + print ''.$langs->trans("MakeWithdrawRequest").''; + } } else {