FIX update of nb of period of loan
This commit is contained in:
parent
7e488c7ccd
commit
6a6cf956b1
@ -182,8 +182,8 @@ if (empty($reshook))
|
|||||||
$object->datestart = $datestart;
|
$object->datestart = $datestart;
|
||||||
$object->dateend = $dateend;
|
$object->dateend = $dateend;
|
||||||
$object->capital = $capital;
|
$object->capital = $capital;
|
||||||
$object->nbterm = GETPOST("nbterm");
|
$object->nbterm = GETPOST("nbterm",'int');
|
||||||
$object->rate = GETPOST("rate");
|
$object->rate = price2num(GETPOST("rate",'alpha'));
|
||||||
|
|
||||||
$accountancy_account_capital = GETPOST('accountancy_account_capital');
|
$accountancy_account_capital = GETPOST('accountancy_account_capital');
|
||||||
$accountancy_account_insurance = GETPOST('accountancy_account_insurance');
|
$accountancy_account_insurance = GETPOST('accountancy_account_insurance');
|
||||||
|
|||||||
@ -292,11 +292,18 @@ class Loan extends CommonObject
|
|||||||
{
|
{
|
||||||
$this->db->begin();
|
$this->db->begin();
|
||||||
|
|
||||||
|
if (! is_numeric($this->nbterm))
|
||||||
|
{
|
||||||
|
$this->error='BadValueForParameterForNbTerm';
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
$sql = "UPDATE ".MAIN_DB_PREFIX."loan";
|
$sql = "UPDATE ".MAIN_DB_PREFIX."loan";
|
||||||
$sql.= " SET label='".$this->db->escape($this->label)."',";
|
$sql.= " SET label='".$this->db->escape($this->label)."',";
|
||||||
$sql.= " capital='".price2num($this->db->escape($this->capital))."',";
|
$sql.= " capital='".price2num($this->db->escape($this->capital))."',";
|
||||||
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
||||||
$sql.= " dateend='".$this->db->idate($this->dateend)."',";
|
$sql.= " dateend='".$this->db->idate($this->dateend)."',";
|
||||||
|
$sql.= " nbterm=".$this->nbterm.",";
|
||||||
$sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',";
|
$sql.= " accountancy_account_capital = '".$this->db->escape($this->account_capital)."',";
|
||||||
$sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',";
|
$sql.= " accountancy_account_insurance = '".$this->db->escape($this->account_insurance)."',";
|
||||||
$sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',";
|
$sql.= " accountancy_account_interest = '".$this->db->escape($this->account_interest)."',";
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user