From 6bd13b8071b87a8251b0b0c6aaa941b853011740 Mon Sep 17 00:00:00 2001 From: arnaud Date: Thu, 15 Oct 2015 16:53:28 +0200 Subject: [PATCH] FIX bug invoice classified in propale next update commonobject class in 3.8 --- htdocs/comm/propal/class/propal.class.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 69f36c83136..71295e94f70 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -2124,26 +2124,26 @@ class Propal extends CommonObject $this->fetchObjectLinked($id,$this->element); foreach($this->linkedObjectsIds as $objecttype => $objectid) { - $numi=count($objectid); - for ($i=0;$i<$numi;$i++) + // Nouveau système du comon object renvoi des rowid et non un id linéaire de 1 à n + // On parcourt donc une liste d'objets en tant qu'objet unique + foreach($objectid as $key => $object) { // Cas des factures liees directement if ($objecttype == 'facture') { - $linkedInvoices[] = $objectid[$i]; + $linkedInvoices[] = $object; } // Cas des factures liees par un autre objet (ex: commande) else { - $this->fetchObjectLinked($objectid[$i],$objecttype); + $this->fetchObjectLinked($object,$objecttype); foreach($this->linkedObjectsIds as $subobjecttype => $subobjectid) { - $numj=count($subobjectid); - for ($j=0;$j<$numj;$j++) + foreach($subobjectid as $subkey => $subobject) { if ($subobjecttype == 'facture') { - $linkedInvoices[] = $subobjectid[$j]; + $linkedInvoices[] = $subobject; } } }