diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index f6fa7dcc4ca..c5744cbd560 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1042,7 +1042,8 @@ 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() + $invoice->getSumDepositsUsed())); 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); }