diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 623e7e121f28b20c13ab5d45c1f6a3a00b495ebf..9e0005bf3ad2bea91fb8502a7eb3f3db70f87212 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -89,11 +89,38 @@ class Contrat extends CommonObject var $product; /** + * TODO: Which is the correct one? * Author of the contract * @var */ var $user_author; + /** + * TODO: Which is the correct one? + * Author of the contract + * @var User + */ + public $user_creation; + + /** + * TODO: Which is the correct one? + * Author of the contract + * @var int + */ + public $fk_user_author; + + /** + * TODO: Which is the correct one? + * Author of the contract + * @var int + */ + public $user_author_id; + + /** + * @var User + */ + public $user_cloture; + /** * Date of creation * @var int @@ -101,7 +128,14 @@ class Contrat extends CommonObject var $date_creation; /** - * Date of last update + * Date of last modification + * Not filled until you call ->info() + * @var int + */ + public $date_modification; + + /** + * Date of validation * @var int */ var $date_validation; @@ -1952,7 +1986,6 @@ class Contrat extends CommonObject while ($xnbp < $nbp) { $line=new ContratLigne($this->db); - $line->desc=$langs->trans("Description")." ".$xnbp; $line->qty=1; $line->subprice=100; $line->price=100; @@ -2421,7 +2454,7 @@ class ContratLigne extends CommonObject $sql.= ",total_localtax1=".price2num($this->total_localtax1,'MT').""; $sql.= ",total_localtax2=".price2num($this->total_localtax2,'MT').""; $sql.= ",total_ttc=".price2num($this->total_ttc,'MT').""; - $sql.= " WHERE rowid = ".$this->rowid; + $sql.= " WHERE rowid = ".$this->id; dol_syslog(get_class($this)."::update_total", LOG_DEBUG); diff --git a/htdocs/install/upgrade2.php b/htdocs/install/upgrade2.php index 09f0d507a3911f6007b950d331e60fc7ee2b7c7b..7bee1a38b6ba4732f782740ee27439965cd32e8a 100644 --- a/htdocs/install/upgrade2.php +++ b/htdocs/install/upgrade2.php @@ -1523,7 +1523,7 @@ function migrate_price_contrat($db,$langs,$conf) // On met a jour les 3 nouveaux champs $contratligne= new ContratLigne($db); //$contratligne->fetch($rowid); Non requis car le update_total ne met a jour que chp redefinis - $contratligne->rowid=$rowid; + $contratligne->id=$rowid; $result=calcul_price_total($qty,$pu,$remise_percent,$txtva,0,0,0,'HT',$info_bits,0,$tmpmysoc); $total_ht = $result[0];