Skip to content
Snippets Groups Projects
Commit 3b38e5a8 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

FIX Withdraw request should not be possible if amount is negative.

parent 453c6264
Branches
Tags
No related merge requests found
<?php <?php
/* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org> /* Copyright (C) 2002-2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com> * Copyright (C) 2004 Eric Seigne <eric.seigne@ryxeo.com>
* Copyright (C) 2004-2015 Laurent Destailleur <eldy@users.sourceforge.net> * Copyright (C) 2004-2016 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com> * Copyright (C) 2005-2012 Regis Houssin <regis.houssin@capnetworks.com>
* Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es> * Copyright (C) 2010-2014 Juanjo Menent <jmenent@2byte.es>
* *
...@@ -482,6 +482,8 @@ if ($object->id > 0) ...@@ -482,6 +482,8 @@ if ($object->id > 0)
// Add a withdraw request // Add a withdraw request
if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0) if ($object->statut > Facture::STATUS_DRAFT && $object->paye == 0 && $num == 0)
{
if ($resteapayer > 0)
{ {
if ($user->rights->prelevement->bons->creer) if ($user->rights->prelevement->bons->creer)
{ {
...@@ -499,6 +501,11 @@ if ($object->id > 0) ...@@ -499,6 +501,11 @@ if ($object->id > 0)
} }
} }
else else
{
print '<a class="butActionRefused" href="#" title="'.dol_escape_htmltag($langs->trans("AmountMustBePositive")).'">'.$langs->trans("MakeWithdrawRequest").'</a>';
}
}
else
{ {
if ($num == 0) if ($num == 0)
{ {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment