You are not logged in.
Pages: 1
Is there a way to print/search a understock cartridge report? I think that could be very useful for ordering.
Thanks a lot.
Offline
You can edit a report by the search engine of cartridges
CentOS 6.5 - CentOS 7.x
PHP 5.6 - PHP 7.x - MySQL 5.6 - MariaDB 10.2 + APC + oOPcache
GLPI from 0.72 to dev version
Certifiée ITIL (ITV2F, ITILF, ITILOSA)
Offline
Bump.
I think, this feature should be working "out-of-the-box". I tried to implement it myself, but ran into problems.
Explanations are below.
SELECT
'glpi' AS currentuser,
`glpi_cartridgeitems`.`alarm_threshold` AS ALARM,
`glpi_cartridgeitems`.`name` AS ITEM_0,
`glpi_cartridgeitems`.`id` AS ITEM_0_2,
`glpi_manufacturers`.`name` AS ITEM_1,
`glpi_cartridgeitems`.`ref` AS ITEM_2,
`glpi_cartridgeitemtypes`.`name` AS ITEM_3,
`glpi_locations`.`completename` AS ITEM_4,
----
COUNT(`glpi_cartridges`.`id`) AS ITEM_5,
----
`glpi_cartridgeitems`.`id` AS id
FROM `glpi_cartridgeitems`
LEFT JOIN `glpi_manufacturers` ON (`glpi_cartridgeitems`.`manufacturers_id` = `glpi_manufacturers`.`id` )
LEFT JOIN `glpi_cartridgeitemtypes` ON (`glpi_cartridgeitems`.`cartridgeitemtypes_id` = `glpi_cartridgeitemtypes`.`id` )
LEFT JOIN `glpi_locations` ON (`glpi_cartridgeitems`.`locations_id` = `glpi_locations`.`id` )
----
LEFT JOIN `glpi_cartridges` ON (`glpi_cartridgeitems`.`id` = `glpi_cartridges`.`cartridgeitems_id` )
----
WHERE
`glpi_cartridgeitems`.`is_deleted` = '0'
AND ( `glpi_cartridgeitems`.`entities_id` IN ('0'))
----
GROUP BY `glpi_cartridgeitems`.`id`
----
ORDER BY ITEM_0 ASC;
To get this work (at least filter by number of cartridges), we need 3 things:
COUNT(`column`) support without hacking commonsearch class and defining custom field type for this. It's ugly and unmaintainable.
auto adding GROUP BY on appropriate column
and fix strange behavoiur of `filed`/`linkfield` variables in query constructor.
If we need advanced filters, we need support for extended queries against glpi_cartridges table like this:
SELECT COUNT (id) FROM glpi_cartridges WHERE date_in IS NOT NULL AND date_use IS NULL;
and so on. That black magic now locates in getCount() function of cartridge class.
Summarizing all the above, query constructor needs serious refactoring. This better be done by main developers, as it affects all application.
Offline
Pages: 1