function Comment Missing
This commit is contained in:
parent
5d27318e3b
commit
4c0b083f45
@ -190,10 +190,8 @@ class LoanSchedule extends CommonObject
|
|||||||
|
|
||||||
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
dol_syslog(get_class($this)."::fetch", LOG_DEBUG);
|
||||||
$resql=$this->db->query($sql);
|
$resql=$this->db->query($sql);
|
||||||
if ($resql)
|
if ($resql) {
|
||||||
{
|
if ($this->db->num_rows($resql)) {
|
||||||
if ($this->db->num_rows($resql))
|
|
||||||
{
|
|
||||||
$obj = $this->db->fetch_object($resql);
|
$obj = $this->db->fetch_object($resql);
|
||||||
|
|
||||||
$this->id = $obj->rowid;
|
$this->id = $obj->rowid;
|
||||||
@ -374,13 +372,20 @@ class LoanSchedule extends CommonObject
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
function calc_mens($capital,$rate,$nbterm)
|
/**
|
||||||
|
* Calculate mensuality
|
||||||
|
*
|
||||||
|
* @param double $capital Capital
|
||||||
|
* @param double $rate rate
|
||||||
|
* @param int $nbterm nb term
|
||||||
|
* @return double mensuality
|
||||||
|
*/
|
||||||
|
function calc_mens($capital, $rate, $nbterm)
|
||||||
{
|
{
|
||||||
$result='';
|
$result='';
|
||||||
|
|
||||||
if (!empty($capital)&&!empty($rate)&&!empty($nbterm))
|
if (!empty($capital) && !empty($rate) && !empty($nbterm)) {
|
||||||
{
|
$result = ($capital*($rate/12))/(1-pow((1+($rate/12)),($nbterm*-1)));
|
||||||
$result=($capital*($rate/12))/(1-pow((1+($rate/12)),($nbterm*-1)));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return $result;
|
return $result;
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user