diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index fe2b221b2d6..f6fa7dcc4ca 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1042,8 +1042,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() + $invoice->getSumCreditNotesUsed())); - if (GETPOST("amount", 'int')) $amount=GETPOST("amount", 'int'); + $amount=price2num($invoice->total_ttc - ($invoice->getSommePaiement() + $invoice->getSumCreditNotesUsed() + $invoice->getSumDepositsUsed())); if (GETPOST("amount", 'int')) $amount=GETPOST("amount", 'int'); $amount=price2num($amount); }