InfotelGLPI / printercounters

Plugin Printercounters for GLPI
http://blogglpi.infotel.com
GNU General Public License v2.0
14 stars 9 forks source link

Error "The sub-entities budget amount exceed the parent budget" when it isn't #86

Open eduardomozart opened 3 years ago

eduardomozart commented 3 years ago
  1. Create a new Budget into "Root Entity", with the value of "1076" and period of 01-March-2021 up to 31-March-2021.

glpi_plugins_printercounters_front_budget form root

  1. Create a new Budge into "Root Entity > São Leopoldo" (sub entity), with the value of "786" and period of 01-March-2021 up to 31-March-2021.

glpi_plugins_printercounters_front_budget form sl

  1. Error "The sub-entities budget amount exceed the parent budget" is thrown, but the Amount of subentity isn't higher than Root entity.

Budget from sub entity should be added succesfully.

Budget from sub entity isn't added successfully.

https://glpi.example.com/plugins/printercounters/front/budget.form.php

See above.

A workaround for this issue is adding first the budgets from subentities and just only after adding them add the budget from Root entity.

But I'm not sure if the situation from screenshot below is happening because of that:

glpi_main_table_budge_printer_counter

But I believe that the Printer Counters plugin should group Budgets from dates as a subitem of the corresponding Root entity budget date together, but it isn't happening - Budgets from "March" and "February" is shown inside "February" budget. Instead, "March" budget from subentities should be shown below "March" budget from Root entity.