From 9ade32364885b45dc5fa002de0c8caaa98a4e0ff Mon Sep 17 00:00:00 2001 From: Yash Kothari <24638097+yashkothari1946@users.noreply.github.com> Date: Wed, 2 Oct 2019 13:23:55 +0530 Subject: [PATCH 1/2] #11966 bug fix Stripe : take into account down payments or deposits --- htdocs/public/payment/newpayment.php | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) 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); } From 78751fe0adde65aebd76fd8f80c52ea53022a9ed Mon Sep 17 00:00:00 2001 From: Laurent Destailleur Date: Thu, 3 Oct 2019 15:54:52 +0200 Subject: [PATCH 2/2] Update newpayment.php --- 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 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); }