dolibarr 25.0.0-alpha
loan.lib.php File Reference

Library for loan module. More...

Go to the source code of this file.

Functions

 loan_prepare_head ($object)
 Prepare array with list of tabs.
 
 loanCalcMonthlyPayment ($mens, $capital, $rate, $numactualloadterm, $nbterm, $amort=null, $source='mens', $grace_period=0, $int=null)
 Calculate remaining loan mensuality and interests.
 

Detailed Description

Library for loan module.

Definition in file loan.lib.php.

Function Documentation

◆ loan_prepare_head()

loan_prepare_head ( $object)

Prepare array with list of tabs.

Parameters
Loan$objectObject related to tabs
Returns
array<array{0:string,1:string,2:string}> Array of tabs to show

Definition at line 34 of file loan.lib.php.

References $conf, $object, complete_head_from_modules(), Link\count(), dol_dir_list(), dol_sanitizeFileName(), and getDolGlobalString().

◆ loanCalcMonthlyPayment()

loanCalcMonthlyPayment ( $mens,
$capital,
$rate,
$numactualloadterm,
$nbterm,
$amort = null,
$source = 'mens',
$grace_period = 0,
$int = null )

Calculate remaining loan mensuality and interests.

Parameters
float$mensValue of this mensuality (interests include, set 0 if we don't paid interests for this mensuality)
float$capitalRemaining capital for this mensuality
float$rateLoan rate
int$numactualloadtermActual loan term
int$nbtermTotal number of term for this loan
null | float | string$amortCapital amortization for this term (optional)
string$sourceSource of modification ('mens', 'amort' or 'interet')
int$grace_periodNumber of terms with grace period (amortization = 0)
null | float | string$intInterest amount for this term (optional)
Returns
array<array{cap_rest:float,cap_rest_str:string,interet:float,interet_str:string,amort:string,amort_num:float,mens:string,mens_num:float}> Array with remaining capital, interest, amortization and mensuality for each remaining terms

Definition at line 107 of file loan.lib.php.

References $conf, $object, price(), and price2num().