FIX : Credit note links set from source invoice links
This commit is contained in:
parent
decb93efa6
commit
64dde1595b
@ -983,15 +983,13 @@ if (empty($reshook))
|
|||||||
// Add link between credit note and origin
|
// Add link between credit note and origin
|
||||||
if(! empty($object->fk_facture_source)) {
|
if(! empty($object->fk_facture_source)) {
|
||||||
$facture_source->fetch($object->fk_facture_source);
|
$facture_source->fetch($object->fk_facture_source);
|
||||||
}
|
$facture_source->fetchObjectLinked();
|
||||||
$facture_source->fetchObjectLinked();
|
|
||||||
|
|
||||||
if(! empty($facture_source->linkedObjectsIds)) {
|
if(! empty($facture_source->linkedObjectsIds)) {
|
||||||
$linkedObjectIds = $facture_source->linkedObjectsIds;
|
foreach($facture_source->linkedObjectsIds as $sourcetype => $TIds) {
|
||||||
$sourcetype = key($linkedObjectIds);
|
$object->add_object_linked($sourcetype, current($TIds));
|
||||||
$fk_origin = current($facture_source->linkedObjectsIds[$sourcetype]);
|
}
|
||||||
|
}
|
||||||
$object->add_object_linked($sourcetype, $fk_origin);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user