Fixed #17816 - added quantity to activity reports #18359
+476
−29
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR adds a
quantitycolumn to theaction_logstable and enables viewing the quantity checked out and the amount of seats where added/removed when updating a license.Screenshots
Activity Report
Asset History
License History
Accessory History
Consumable History
Component History
Migrating old data
When adding or removing seats from a license, the notes field is populated with
added x seatsordeleted x seatsso it is possible to use that note field to update the newly createdquantitycolumn.This PR includes a command,
snipeit:migrate-license-seat-quantities-in-action-logs, to do just that. I avoided including the logic in a migration in case I missed a detail that ended up screwing up action logs but if it looks good to everyone I can pull that logic into a new migration.Database details
In these screenshots of the action log, ID 1-17 were on the develop branch. I switched to this branch starting at ID 18. You'll see the quantity field starts being populated.
This is the result after the command is run:

Here are

action_logentries when items are checked out, accepted, and declined:Semi-related to #17703
Fixes #17816