FIX bug invoice classified in propale next update commonobject class in 3.8

This commit is contained in:
arnaud 2015-10-15 16:53:28 +02:00
parent e79fe7401f
commit 6bd13b8071

View File

@ -2124,26 +2124,26 @@ class Propal extends CommonObject
$this->fetchObjectLinked($id,$this->element); $this->fetchObjectLinked($id,$this->element);
foreach($this->linkedObjectsIds as $objecttype => $objectid) foreach($this->linkedObjectsIds as $objecttype => $objectid)
{ {
$numi=count($objectid); // Nouveau système du comon object renvoi des rowid et non un id linéaire de 1 à n
for ($i=0;$i<$numi;$i++) // On parcourt donc une liste d'objets en tant qu'objet unique
foreach($objectid as $key => $object)
{ {
// Cas des factures liees directement // Cas des factures liees directement
if ($objecttype == 'facture') if ($objecttype == 'facture')
{ {
$linkedInvoices[] = $objectid[$i]; $linkedInvoices[] = $object;
} }
// Cas des factures liees par un autre objet (ex: commande) // Cas des factures liees par un autre objet (ex: commande)
else else
{ {
$this->fetchObjectLinked($objectid[$i],$objecttype); $this->fetchObjectLinked($object,$objecttype);
foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid)
{ {
$numj=count($subobjectid); foreach($subobjectid as $subkey => $subobject)
for ($j=0;$j<$numj;$j++)
{ {
if ($subobjecttype == 'facture') if ($subobjecttype == 'facture')
{ {
$linkedInvoices[] = $subobjectid[$j]; $linkedInvoices[] = $subobject;
} }
} }
} }