FIX api.class.php for expense reports (#30818)

* FIX api.class.php

Descriptions of line in expense reports are named comments

* Update api.class.php

---------

Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
ptibogxiv 2024-09-01 15:10:08 +02:00 committed by GitHub
parent 782cd2aefe
commit 5ddf586413
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -253,17 +253,6 @@ class DolibarrApi
unset($object->stats_mrptoconsume);
unset($object->stats_mrptoproduce);
unset($object->origin_object);
unset($object->origin);
unset($object->element);
unset($object->element_for_permission);
unset($object->fk_element);
unset($object->table_element);
unset($object->table_element_line);
unset($object->class_element_line);
unset($object->picto);
unset($object->linked_objects);
unset($object->fieldsforcombobox);
unset($object->regeximgext);
@ -290,10 +279,21 @@ class DolibarrApi
unset($object->prefix_comm);
if (!isset($object->table_element) || $object->table_element != 'ticket') {
if (!isset($object->table_element) || ! in_array($object->table_element, array('expensereport_det', 'ticket'))) {
unset($object->comments);
}
unset($object->origin_object);
unset($object->origin);
unset($object->element);
unset($object->element_for_permission);
unset($object->fk_element);
unset($object->table_element);
unset($object->table_element_line);
unset($object->class_element_line);
unset($object->picto);
unset($object->linked_objects);
// Remove the $oldcopy property because it is not supported by the JSON
// encoder. The following error is generated when trying to serialize
// it: "Error encoding/decoding JSON: Type is not supported"