[ bug #444 ] Regression on auto-closing for proposals and orders

This commit is contained in:
Laurent Destailleur 2012-07-19 16:57:10 +02:00
parent d68a2cb0d8
commit 03f85bef83

View File

@ -2069,11 +2069,16 @@ class Commande extends CommonObject
$sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;'; $sql .= ' WHERE rowid = '.$this->id.' AND fk_statut > 0 ;';
if ($this->db->query($sql) ) if ($this->db->query($sql) )
{ {
if (($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER == 1) && $this->propale_id) if (! empty($conf->propal->enabled) && ! empty($conf->global->PROPALE_CLASSIFIED_INVOICED_WITH_ORDER))
{ {
$propal = new Propal($this->db); $this->fetchObjectLinked('','propal',$this->id,$this->element);
$propal->fetch($this->propale_id); if (! empty($this->linkedObjects))
$propal->classer_facturee(); {
foreach($this->linkedObjects['propal'] as $element)
{
$ret=$element->classer_facturee();
}
}
} }
return 1; return 1;
} }