Fix replace loan_calcmens() by loanCalcMonthlyPayment()
This commit is contained in:
parent
44445ff9e6
commit
9217ec47dc
@ -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';
|
||||
|
||||
@ -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);
|
||||
|
||||
@ -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
|
||||
|
||||
Loading…
Reference in New Issue
Block a user