@@ -64,6 +64,8 @@ public function getEvaluableQuery(bool $entity_restrict = true): array
6464 $ item_glpitype_table = self ::$ type_itemtype ::getTable ();
6565 $ item_type_table = NetworkEquipmentType::getTable ();
6666 $ location_table = Location::getTable ();
67+ $ infocom_table = Infocom::getTable ();
68+
6769 $ request = [
6870 'SELECT ' => self ::$ itemtype ::getTableField ('id ' ),
6971 'FROM ' => self ::$ itemtype ::getTable (),
@@ -86,6 +88,15 @@ public function getEvaluableQuery(bool $entity_restrict = true): array
8688 $ item_glpitype_table => 'id ' ,
8789 ]
8890 ],
91+ $ infocom_table => [
92+ 'FKEY ' => [
93+ $ infocom_table => 'items_id ' ,
94+ $ item_table => 'id ' ,
95+ ['AND ' => ['itemtype ' => self ::$ itemtype ]],
96+ ]
97+ ],
98+ ],
99+ 'LEFT JOIN ' => [
89100 $ item_type_table => [
90101 'FKEY ' => [
91102 $ item_type_table => 'networkequipmenttypes_id ' ,
@@ -109,6 +120,15 @@ public function getEvaluableQuery(bool $entity_restrict = true): array
109120 self ::$ model_itemtype ::getTableField ('power_consumption ' ) => ['> ' , 0 ],
110121 ],
111122 ],
123+ [
124+ 'OR ' => [
125+ ['NOT ' => [Infocom::getTableField ('use_date ' ) => null ]],
126+ ['NOT ' => [Infocom::getTableField ('delivery_date ' ) => null ]],
127+ ['NOT ' => [Infocom::getTableField ('buy_date ' ) => null ]],
128+ ['NOT ' => [Infocom::getTableField ('date_creation ' ) => null ]],
129+ ['NOT ' => [Infocom::getTableField ('date_mod ' ) => null ]],
130+ ]
131+ ]
112132 ]
113133 ];
114134
@@ -154,7 +174,7 @@ public static function showHistorizableDiagnosis(CommonDBTM $item)
154174 ]
155175 ];
156176 // Change inner joins into left joins to identify missing data
157- $ request ['LEFT JOIN ' ] = $ request ['INNER JOIN ' ];
177+ $ request ['LEFT JOIN ' ] = $ request ['INNER JOIN ' ] + $ request [ ' LEFT JOIN ' ] ;
158178 unset($ request ['INNER JOIN ' ]);
159179 // remove where criterias
160180 unset($ request ['WHERE ' ]);
0 commit comments