pluginsGLPI / order

Order plugin for GLPI
GNU General Public License v3.0
39 stars 44 forks source link

fix(transfer): use own transfer action #320

Closed stonebuzz closed 2 years ago

stonebuzz commented 2 years ago

use own transfer action because :

[2022-05-25 07:54:58] glpisqllog.ERROR: DBmysql::query() in /home/stanislas/Teclib/dev/GLPI/10.0-bugfixes/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: SELECT `glpi_plugin_order_receptions`.`id`, `glpi_plugin_order_receptions`.`name`, `entities`.`completename` AS `locname`, `entities`.`id` AS `entID` FROM `glpi_plugin_order_receptions` LEFT JOIN `glpi_entities` AS `entities` ON (`entities`.`id` = `glpi_plugin_order_receptions`.`entities_id`) WHERE `glpi_plugin_order_receptions`.`id` IN ('1', '2') ORDER BY `locname`, `glpi_plugin_order_receptions`.`name`
  Error: Table '100bugfixes.glpi_plugin_order_receptions' doesn't exist
  Backtrace :
  src/DBmysqlIterator.php:110                        
  src/DBmysql.php:1048                               DBmysqlIterator->execute()
  src/Transfer.php:4145                              DBmysql->request()
  front/transfer.action.php:67                       Transfer->showTransferList()
  {"user":"2@stanislas-XPS-13-9343"} 
[2022-05-25 07:58:16] glpisqllog.ERROR: DBmysql::query() in /home/stanislas/Teclib/dev/GLPI/10.0-bugfixes/src/DBmysql.php line 370
[2022-05-25 08:23:50] glpisqllog.ERROR: DBmysql::query() in /home/stanislas/Teclib/dev/GLPI/10.0-bugfixes/src/DBmysql.php line 370
  *** MySQL query error:
  SQL: SELECT `glpi_plugin_order_orders_items`.`id`, `glpi_plugin_order_orders_items`.`name`, `entities`.`completename` AS `locname`, `entities`.`id` AS `entID` FROM `glpi_plugin_order_orders_items` LEFT JOIN `glpi_entities` AS `entities` ON (`entities`.`id` = `glpi_plugin_order_orders_items`.`entities_id`) WHERE `glpi_plugin_order_orders_items`.`id` IN ('1', '2') ORDER BY `locname`, `glpi_plugin_order_orders_items`.`name`
  Error: Unknown column 'glpi_plugin_order_orders_items.name' in 'field list'
  Backtrace :
  src/DBmysqlIterator.php:110                        
  src/DBmysql.php:1048                               DBmysqlIterator->execute()
  src/Transfer.php:4145                              DBmysql->request()
  front/transfer.action.php:67                       Transfer->showTransferList()

So create own transfer method

Add Entity column from reception image

and Associated items list image

Internal ref : 24077 and 24076

cedric-anne commented 2 years ago

Are you sure it is a good idea to have an order that can have items in multiple distinct entities ? Order already have an entity, and forwards it to order items. https://github.com/pluginsGLPI/order/blob/fb846ba0aa149039edbcef814e8a9caa4668df87/inc/order.class.php#L47-L48

stonebuzz commented 2 years ago

Are you sure it is a good idea to have an order that can have items in multiple distinct entities ? Order already have an entity, and forwards it to order items.

https://github.com/pluginsGLPI/order/blob/fb846ba0aa149039edbcef814e8a9caa4668df87/inc/order.class.php#L47-L48

I think the original idea was to say that an order is made by one entity, and the items are delivered in other

But not having been involved in the development I can't say for sure