Printing product serial numbers in Shipping doc

For displaying serial numbers for multiple products in a single shipment the following can be used instead of what is in the original post:

(($res = $db->query('select llx_equipement.ref from llx_equipement,llx_equipementevt where llx_equipementevt.fk_expedition = ‘.$object->lines[0]->fk_expedition.’ and llx_equipementevt.fk_equipement = llx_equipement.rowid and llx_equipement.fk_product = ‘.$object->lines[ isset($GLOBALS[‘xjkvn’]) ? ++$GLOBALS[‘xjkvn’] : $GLOBALS[‘xjkvn’] = 0 ]->fk_product)) && ($arr = $res->fetch_all()) ) ? implode(’, ', array_map(function ($entry) { return $entry[0]; }, $arr)) : ‘Reference number not found’

One way of addressing this issue is to add code in expedition/card.php that would add the shipment to the llx_expeditiondet_extrafields table, before the complementary attributes are fetched.

Don’t know if there is a better alternative to such a hack.