Fix: [ bug #3206 ] PropaleLigne, OrderLine and FactureLigne given to triggers through update function does not contain all the information

Close #3206
This commit is contained in:
Marcos García de La Fuente
2015-07-18 19:37:58 +02:00
parent d7e9bccad6
commit 4649cf7210
4 changed files with 22 additions and 18 deletions

View File

@@ -2349,13 +2349,14 @@ class Commande extends CommonOrder
$price = ($pu - $remise);
}
// Update line
$this->line=new OrderLine($this->db);
//Fetch current line from the database and then clone the object and set it in $oldline property
$line = new OrderLine($this->db);
$line->fetch($rowid);
// Stock previous line records
$staticline=new OrderLine($this->db);
$staticline->fetch($rowid);
$this->line->oldline = $staticline;
$staticline = clone $line;
$line->oldline = $staticline;
$this->line = $line;
// Reorder if fk_parent_line change
if (! empty($fk_parent_line) && ! empty($staticline->fk_parent_line) && $fk_parent_line != $staticline->fk_parent_line)