From 7d4553179db43aeccecd7a3139f50f5ad42061df Mon Sep 17 00:00:00 2001 From: Juanjo Menent Date: Sat, 1 Dec 2018 15:48:46 +0100 Subject: [PATCH] Fix #9929 --- htdocs/public/payment/newpayment.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 3afd590da53..58d6a4d1d2e 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -2,6 +2,7 @@ /* Copyright (C) 2001-2002 Rodolphe Quiedeville * Copyright (C) 2006-2017 Laurent Destailleur * Copyright (C) 2009-2012 Regis Houssin + * Copyright (C) 2018 Juanjo Menent * * 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 @@ -928,7 +929,7 @@ if ($source == 'invoice') if ($action != 'dopayment') // Do not change amount if we just click on first dopayment { - $amount=price2num($invoice->total_ttc - $invoice->getSommePaiement()); + $amount=price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed())); if (GETPOST("amount",'int')) $amount=GETPOST("amount",'int'); $amount=price2num($amount); }