Browse Source

Merge branch '18.0' of git@github.com:Dolibarr/dolibarr.git into 19.0

Laurent Destailleur 1 year ago
parent
commit
9f1393f6ea
1 changed files with 5 additions and 5 deletions
  1. 5 5
      htdocs/loan/payment/payment.php

+ 5 - 5
htdocs/loan/payment/payment.php

@@ -114,16 +114,16 @@ if ($action == 'add_payment') {
 	if (!$error) {
 		$paymentid = 0;
 
-		$pay_amount_capital = price2num(GETPOST('amount_capital'));
-		$pay_amount_insurance = price2num(GETPOST('amount_insurance'));
+		$pay_amount_capital = (float) price2num(GETPOST('amount_capital'));
+		$pay_amount_insurance = (float) price2num(GETPOST('amount_insurance'));
 		// User can't set interest him self if schedule is set (else value in schedule can be incoherent)
 		if (!empty($line)) {
 			$pay_amount_interest = $line->amount_interest;
 		} else {
-			$pay_amount_interest = price2num(GETPOST('amount_interest'));
+			$pay_amount_interest = (float) price2num(GETPOST('amount_interest'));
 		}
-		$remaindertopay = price2num(GETPOST('remaindertopay'));
-		$amount = $pay_amount_capital + $pay_amount_insurance + $pay_amount_interest;
+		$remaindertopay = (float) price2num(GETPOST('remaindertopay'));
+		$amount = (float) price2num($pay_amount_capital + $pay_amount_insurance + $pay_amount_interest, 'MT');
 
 		// This term is allready paid
 		if (!empty($line) && !empty($line->fk_bank)) {