|
@@ -50,7 +50,7 @@ class Loan extends CommonObject
|
|
|
var $fk_bank;
|
|
|
var $fk_user_creat;
|
|
|
var $fk_user_modif;
|
|
|
- var $fk_projet;
|
|
|
+ var $fk_project;
|
|
|
|
|
|
|
|
|
/**
|
|
@@ -73,7 +73,7 @@ class Loan extends CommonObject
|
|
|
function fetch($id)
|
|
|
{
|
|
|
$sql = "SELECT l.rowid, l.label, l.capital, l.datestart, l.dateend, l.nbterm, l.rate, l.note_private, l.note_public,";
|
|
|
- $sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest,l.fk_projet";
|
|
|
+ $sql.= " l.paid, l.accountancy_account_capital, l.accountancy_account_insurance, l.accountancy_account_interest,l.fk_project";
|
|
|
$sql.= " FROM ".MAIN_DB_PREFIX."loan as l";
|
|
|
$sql.= " WHERE l.rowid = ".$id;
|
|
|
|
|
@@ -100,7 +100,7 @@ class Loan extends CommonObject
|
|
|
$this->account_capital = $obj->accountancy_account_capital;
|
|
|
$this->account_insurance = $obj->accountancy_account_insurance;
|
|
|
$this->account_interest = $obj->accountancy_account_interest;
|
|
|
- $this->fk_projet = $obj->fk_projet;
|
|
|
+ $this->fk_project = $obj->fk_project;
|
|
|
|
|
|
$this->db->free($resql);
|
|
|
return 1;
|
|
@@ -143,7 +143,7 @@ class Loan extends CommonObject
|
|
|
if (isset($this->fk_bank)) $this->fk_bank=trim($this->fk_bank);
|
|
|
if (isset($this->fk_user_creat)) $this->fk_user_creat=trim($this->fk_user_creat);
|
|
|
if (isset($this->fk_user_modif)) $this->fk_user_modif=trim($this->fk_user_modif);
|
|
|
- if (isset($this->fk_projet)) $this->fk_projet=trim($this->fk_projet);
|
|
|
+ if (isset($this->fk_project)) $this->fk_project=trim($this->fk_project);
|
|
|
|
|
|
// Check parameters
|
|
|
if (! $newcapital > 0 || empty($this->datestart) || empty($this->dateend))
|
|
@@ -161,7 +161,7 @@ class Loan extends CommonObject
|
|
|
|
|
|
$sql = "INSERT INTO ".MAIN_DB_PREFIX."loan (label, fk_bank, capital, datestart, dateend, nbterm, rate, note_private, note_public";
|
|
|
$sql.= " ,accountancy_account_capital, accountancy_account_insurance, accountancy_account_interest, entity";
|
|
|
- $sql.= " ,datec,fk_projet,fk_user_author)";
|
|
|
+ $sql.= " ,datec,fk_project,fk_user_author)";
|
|
|
$sql.= " VALUES ('".$this->db->escape($this->label)."',";
|
|
|
$sql.= " '".$this->db->escape($this->fk_bank)."',";
|
|
|
$sql.= " '".price2num($newcapital)."',";
|
|
@@ -176,7 +176,7 @@ class Loan extends CommonObject
|
|
|
$sql.= " '".$this->db->escape($this->account_interest)."',";
|
|
|
$sql.= " ".$conf->entity.",";
|
|
|
$sql.= " '".$this->db->idate($now)."',";
|
|
|
- $sql.= " ".(empty($this->fk_projet)?'NULL':$this->fk_projet).",";
|
|
|
+ $sql.= " ".(empty($this->fk_project)?'NULL':$this->fk_project).",";
|
|
|
$sql.= " ".$user->id;
|
|
|
$sql.= ")";
|
|
|
|
|
@@ -284,7 +284,7 @@ class Loan extends CommonObject
|
|
|
$sql.= " SET label='".$this->db->escape($this->label)."',";
|
|
|
$sql.= " datestart='".$this->db->idate($this->datestart)."',";
|
|
|
$sql.= " dateend='".$this->db->idate($this->dateend)."',";
|
|
|
- $sql.= " fk_projet=".(empty($this->fk_projet)?'NULL':$this->fk_projet).",";
|
|
|
+ $sql.= " fk_project=".(empty($this->fk_project)?'NULL':$this->fk_project).",";
|
|
|
$sql.= " fk_user_modif = ".$user->id;
|
|
|
$sql.= " WHERE rowid=".$this->id;
|
|
|
|