Update card.php

This commit is contained in:
Laurent Destailleur 2018-03-15 00:36:56 +01:00 committed by GitHub
parent 5140c1c5d2
commit c69f5843da
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -181,12 +181,15 @@ if (empty($reshook))
// Merge categories
$static_cat = new Categorie($db);
$custcats_ori = $static_cat->containing($soc_origin->id, 'customer', 'id');
$custcats = $static_cat->containing($object->id, 'customer', 'id');
$custcats = array_merge($custcats,$custcats_ori);
$object->setCategories($custcats, 'customer');
$suppcats_ori = $static_cat->containing($soc_origin->id, 'supplier', 'id');
$suppcats = $static_cat->containing($object->id, 'supplier', 'id');
$suppcats = array_merge($suppcats,$suppcats_ori);
$object->setCategories($suppcats, 'supplier');
// If thirdparty has a new code that is same than origin, we clean origin code to avoid duplicate key from database unique keys.