Update doc_generic_invoice_odt.modules.php

This commit is contained in:
Laurent Destailleur 2023-05-17 15:33:04 +02:00 committed by GitHub
parent 3c5b385444
commit 8db4d42ff2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -336,9 +336,10 @@ class doc_generic_invoice_odt extends ModelePDFFactures
$object->fetchObjectLinked('', '', '', '');
//print_r($object->linkedObjects['propal']); exit;
$propal_object = $object->linkedObjects['propal'];
if (isset($propal_object) && sizeof($propal_object)>0) {
$propal_object = array_values($object->linkedObjects['propal'])[0];
$array_propal_object = $object->linkedObjects['propal'];
if (isset($array_propal_object) && is_array($array_propal_object) && count($array_propal_object) > 0) {
$tmparrayofvalue = array_values($array_propal_object);
$propal_object = $tmparrayofvalue[0];
} else {
$propal_object = null;
}