diff --git a/htdocs/core/lib/loan.lib.php b/htdocs/core/lib/loan.lib.php index b8e4d39c591..a6deb5ad712 100644 --- a/htdocs/core/lib/loan.lib.php +++ b/htdocs/core/lib/loan.lib.php @@ -94,7 +94,7 @@ function loan_prepare_head($object) * @param int $nbterm Total number of term for this loan * @return array Array with remaining capital, interest, and mensuality for each remaining terms */ -function loan_calcmens($mens, $capital, $rate, $echance, $nbterm) +function loanCalcMonthlyPayment($mens, $capital, $rate, $echance, $nbterm) { global $conf; require_once DOL_DOCUMENT_ROOT.'/loan/class/loanschedule.class.php'; diff --git a/htdocs/loan/calcmens.php b/htdocs/loan/calcmens.php index 06e2bf93b47..d5f9704addc 100644 --- a/htdocs/loan/calcmens.php +++ b/htdocs/loan/calcmens.php @@ -41,6 +41,6 @@ top_httphead(); $output = array(); -$output = loan_calcmens($mens, $capital, $rate, $echance, $nbterm); +$output = loanCalcMonthlyPayment($mens, $capital, $rate, $echance, $nbterm); echo json_encode($output); diff --git a/htdocs/loan/payment/payment.php b/htdocs/loan/payment/payment.php index 2443e44b510..d817cbf3928 100644 --- a/htdocs/loan/payment/payment.php +++ b/htdocs/loan/payment/payment.php @@ -190,7 +190,7 @@ if ($action == 'add_payment') // If payment values are modified, recalculate schedule if (($line->amount_capital <> $pay_amount_capital) || ($line->amount_insurance <> $pay_amount_insurance) || ($line->amount_interest <> $pay_amount_interest)) { - $arr_term = loan_calcmens(($pay_amount_capital + $pay_amount_interest), $remaindertopay, ($loan->rate / 100), $echance, $loan->nbterm); + $arr_term = loanCalcMonthlyPayment(($pay_amount_capital + $pay_amount_interest), $remaindertopay, ($loan->rate / 100), $echance, $loan->nbterm); foreach ($arr_term as $k=>$v) { // Update fk_bank for current line