mirror of
https://github.com/invoiceninja/invoiceninja.git
synced 2025-08-11 15:34:21 -04:00
Fix sorting children
This commit is contained in:
parent
bfbe31b185
commit
b774a07e30
@ -64,11 +64,11 @@ trait PdfMakerUtilities
|
|||||||
|
|
||||||
$processed[] = $child;
|
$processed[] = $child;
|
||||||
}
|
}
|
||||||
|
|
||||||
usort($processed, function ($a, $b) {
|
usort($processed, function ($a, $b) {
|
||||||
return $a['order'] <=> $b['order'];
|
return $a['order'] <=> $b['order'];
|
||||||
});
|
});
|
||||||
|
|
||||||
return $processed;
|
return $processed;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,6 @@ trait PdfMakerUtilities
|
|||||||
public function createElementContent($element, $children)
|
public function createElementContent($element, $children)
|
||||||
{
|
{
|
||||||
foreach ($children as $child) {
|
foreach ($children as $child) {
|
||||||
// info($child);
|
|
||||||
|
|
||||||
$_child = $this->document->createElement($child['element'], $child['content']);
|
$_child = $this->document->createElement($child['element'], $child['content']);
|
||||||
$element->appendChild($_child);
|
$element->appendChild($_child);
|
||||||
@ -98,7 +97,9 @@ trait PdfMakerUtilities
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (isset($child['elements'])) {
|
if (isset($child['elements'])) {
|
||||||
$this->createElementContent($_child, $child['elements']);
|
$sorted = $this->processChildrenOrder($child['elements']);
|
||||||
|
|
||||||
|
$this->createElementContent($_child, $sorted);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user