Fix clone of intervention was not cloning lines.

This commit is contained in:
Laurent Destailleur 2016-07-01 19:15:30 +02:00
parent 02e35f8c76
commit c8c51dd96d

View File

@ -958,8 +958,8 @@ class Fichinter extends CommonObject
if ($objsoc->fetch($socid)>0) if ($objsoc->fetch($socid)>0)
{ {
$this->socid = $objsoc->id; $this->socid = $objsoc->id;
$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0); //$this->cond_reglement_id = (! empty($objsoc->cond_reglement_id) ? $objsoc->cond_reglement_id : 0);
$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0); //$this->mode_reglement_id = (! empty($objsoc->mode_reglement_id) ? $objsoc->mode_reglement_id : 0);
$this->fk_project = ''; $this->fk_project = '';
$this->fk_delivery_address = ''; $this->fk_delivery_address = '';
} }
@ -987,8 +987,7 @@ class Fichinter extends CommonObject
// Add lines because it is not included into create function // Add lines because it is not included into create function
foreach ($this->lines as $line) foreach ($this->lines as $line)
{ {
// TODO $this->addline($user, $this->id, $line->desc, $line->datei, $line->duration);
} }
// Hook of thirdparty module // Hook of thirdparty module
@ -1132,9 +1131,11 @@ class Fichinter extends CommonObject
$line = new FichinterLigne($this->db); $line = new FichinterLigne($this->db);
$line->id = $objp->rowid; $line->id = $objp->rowid;
$line->desc = $objp->description; $line->desc = $objp->description;
$line->duration = $objp->duree;
//For invoicing we calculing hours //For invoicing we calculing hours
$line->qty = round($objp->duree/3600,2); $line->qty = round($objp->duree/3600,2);
$line->date = $this->db->jdate($objp->date); $line->date = $this->db->jdate($objp->date);
$line->datei = $this->db->jdate($objp->date);
$line->rang = $objp->rang; $line->rang = $objp->rang;
$line->product_type = 1; $line->product_type = 1;