Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Expanded Bulk Audit functionality #4644

Closed
2 tasks
lostmydog opened this issue Dec 18, 2017 · 47 comments
Closed
2 tasks

Feature Request: Expanded Bulk Audit functionality #4644

lostmydog opened this issue Dec 18, 2017 · 47 comments
Labels
❤️ feature request stale 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick!

Comments

@lostmydog
Copy link

lostmydog commented Dec 18, 2017

Expected Behavior (or desired behavior if a feature request)

Currently, Bulk Audit is still in its infancy, I'd love for some expanded functionality to make the tool very useful for everyone.

The workflow for a bulk audit should be:
First, select a location
Second, scan all assets in location
Once all assets are scanned, click audit button
Next window shows you a breakdown of items scanned. Showing for example: 5 assets audited, 3 assets correct, 2 assets scanned that were previously located elsewhere (Snipe-IT automatically updates the location of these 2 assets to the new room), 1 asset missing from scan (Snipe-IT prompts to assign the status to missing and location to unknown).

With this functionality, a user would be able to go room by room scanning their assets. As they are scanning, they are able to update the location of assets that were not correct, and mark the assets that are missing as such. If those missing items show up in another room, they will then be reassigned to an active status and the location updated for that room. I also believe that you should be able to reassign the user during the asset. I did not show it well in my image below, however I think a second field asking who each asset should be checked out to (or a drop down for the 'checked out to' column) in case the assets are in the correct location however the user has changed.
bulkaudit


Actual Behavior

(what actually happens goes here)


Please confirm you have done the following before posting your bug report:


Provide answers to these questions:

  • Is this a fresh install or an upgrade?
  • Version of Snipe-IT you're running
  • Version of PHP you're running
  • Version of MySQL/MariaDB you're running
  • What OS and web server you're running Snipe-IT on
  • What method you used to install Snipe-IT (install.sh, manual installation, docker, etc)
  • WITH DEBUG TURNED ON, if you're getting an error in your browser, include that error
  • What specific Snipe-IT page you're on, and what specific element you're interacting with to trigger the error
  • If a stacktrace is provided in the error, include that too.
  • Any errors that appear in your browser's error console.
  • Confirm whether the error is reproducible on the demo: https://snipeitapp.com/demo.
  • Include any additional information you can find in app/storage/logs and your webserver's logs.
  • Include what you've done so far in the installation, and if you got any error messages along the way.
  • Indicate whether or not you've manually edited any data directly in the database

Please do not post an issue without answering the related questions above. If you have opened a different issue and already answered these questions, answer them again, once for every ticket. It will be next to impossible for us to help you.

https://snipe-it.readme.io/docs/getting-help


Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

@snipe snipe added the 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick! label Jan 20, 2018
@bmanalili
Copy link

bmanalili commented Jan 31, 2018

Can't wait for this to be finished, very important update.

@lostmydog
Copy link
Author

glad somebody else was looking for this. I thought there would be tons of comments on this one! This is going to be huge if/when it gets implemented. The ability to simply go room by room and audit is going to save us so much time.

@snipe
Copy link
Owner

snipe commented Feb 1, 2018

While I’m okay with the proposed changes, I’m not sure how this is really different than the existing functionality. Scan asset, hit return, it gets added to the total audit session. Change the location if you need to. Keep scanning.

@lostmydog
Copy link
Author

@snipe it looks like the existing functionality simply audits the assets existence, it does not update its location/owner. The functionality I'm looking for will allow users to say audit and update an entire room through the audit function. For example, i just audited a printer next to me that is currently 'ready to deploy' and its location is room 200. I selected location '201' in the audit, however, going to that asset it still shows its location as room 200. In fact, the only place where I can see that the asset was located in room 201 is by going to the audit log and looking up the asset number. The functionality I'm looking for also adds the ability to update the owner, which is a huge addition in my line of work because there is significant turnover.

@snipe
Copy link
Owner

snipe commented Feb 1, 2018

It will update the location if you select that in the audit screen, however it's not meant to update owners. Only checkout should update who actually has the device. Perhaps the ability to mark an audited asset as existing, but needing an owner update could be the best of both worlds, but we have no plans to add checkin/checkout to auditing, as that's not what they're for.

@lostmydog
Copy link
Author

@snipe How is the location updated? I'm on v4.1.11, when I select a location and put in a tag number in bulk audit and select 'audit', the location is not updated in the assets profile

@bmanalili
Copy link

bmanalili commented Feb 1, 2018 via email

@stale
Copy link

stale bot commented May 5, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions!

@PiQuer
Copy link

PiQuer commented Jun 11, 2018

I am on version v4.4.1 - build 3636 (master), and I have the same issue: location is not updated during audit, selecting a location in the audit screen does not have any effect. @snipe could you please elaborate how this is supposed to work?
The other feature suggestions are also very useful, maybe this issue could be re-opened?

@snipe snipe reopened this Jun 11, 2018
@stale stale bot removed the stale label Jun 11, 2018
@mjb2000
Copy link

mjb2000 commented Jun 21, 2018

The OP mentioned scanning items in bulk, this would be great since it would allow an RFID reader to throw in a whole load of numbers to be audited (while barcode scanners will scan one-by-one an RFID reader will often pick up a bunch of tags at once, so it would be great to collect these either directly in to the web page, or copy them in from an RFID tag gathering app).

Will the bulk input of asset number be supported? Either CSV or CR/LF?

@snipe
Copy link
Owner

snipe commented Jun 21, 2018

I'm sure it will be. I just picked up a NFC/RFID reader and some cards/stickers, so it really depends how my experiments go.

@jacobsen9026
Copy link

@snipe I love your system, it's so much easier to use than our old system Wasp Mobile Asset.

Only one thing that bothers me is this issue. It does not update the locations of assets with an existing location when they are not already checked out.

I can reproduce this in the demo quite easily.

You mentioned

It will update the location if you select that in the audit screen, however it's not meant to update owners.

But it does not. Please let me know if you would like any more info but simply going to the demo and going to for example:

Asset 426236223

which has a location of Ashleighbury and is not already checked out

I choose to audit the asset

Select the location East Antionette

Hit audit and the location does not change.

Furthermore, the history on the asset shows an audit entry but no reference to the location so there is literally nowhere I can connect the dots.

Please advise.

@memtech3
Copy link

memtech3 commented Aug 4, 2018

OH MY GOD THANK YOU SOOO MUCH

@memtech3
Copy link

memtech3 commented Aug 4, 2018

Now snipe-it is starting to look a whole lot more like some of the paid asset management solutions

@gizzmojr
Copy link
Contributor

gizzmojr commented Sep 6, 2018

In response to @jacobsen9026 comment about non-checked out assets getting location updates. I've recently need to do a 100% audit and I now need to print audit reports. My life would be so much easier if bulk scanning, with audit updates, were all aligned.

I'd like to walk into a COMM room, cubicle, etc and just zap everything and hit update, regardless of what the current state of the asset is.

I've dusted off an old project that just needed a bit more work, which I'm very happily going to start using right away. Perhaps it might be of some use to you too.
https://github.com/gizzmojr/snipeit4-scanner

@snipe
Copy link
Owner

snipe commented Sep 6, 2018

@gizzmojr i’m not clear in what you need changed here tho.

@gizzmojr
Copy link
Contributor

gizzmojr commented Sep 6, 2018

My current problems are my users 😝 who move stuff around and forget to update me, no biggie. But when I go to update the item, I have to check it in first then back out to the user/location.
The audit mechanism, records where it was, but doesn't update the asset current location at the same time. So what I wrote does both at the same time via barcode input. Nothing I did, improves upon any capability that's already possible doing manual edits in the web interface.

I understand asset tracking usage is very subjective to managment style. To some, one may want audit location to not equal expected location (at time of checkout), but I do. If I saw asset A at location X on this day, the current location is now location X, same for user.

@memtech3
Copy link

memtech3 commented Sep 8, 2018

do a pull request with your project

@memtech3
Copy link

Can the audit feature be by location? Have an audit tab in each location and a menu item that allows you to see all audits for all rooms and create audits for all rooms or delete etc

@vstephanou
Copy link

vstephanou commented Oct 2, 2018

Hello! I too confirm that auditing an asset and choosing another location than the current, does not update the location.

Maybe this happens because the asset is checked out to a user and not to a location? So location is inherited from the user that is checked out to?

As mentioned previously, it would be nice to have the ability to enter a user instead/as well the location. In this way, the asset goes to the place/user where is actually located at the time of the audit.

@stale
Copy link

stale bot commented Dec 2, 2018

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

@stale stale bot added the stale label Dec 2, 2018
@stale
Copy link

stale bot commented Dec 2, 2018

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

@stale stale bot removed the stale label Dec 2, 2018
@Turk186
Copy link

Turk186 commented Dec 3, 2018

I would like to request the ability for self-audit. This would send out an email to the current asset checked out person people with check out assets to confirm asset location and person. The screen should be customizable for what's displayed on the screen, like a list of assets, software, and options. Options could include things like, have asset listed, do not have an asset anymore with an option to type current asset they have or to select people they manage who have that asset.

We have 40+ locations and a physical audit is done every 3 years, would like the ability to do a "soft" audit yearly.

@dnavre
Copy link

dnavre commented Dec 11, 2018

This functionality will help us a lot!
Also, it can work slightly different. Our company is a bit bigger than 100 people and nearly all of them are sitting in an open space. So the room-by-room approach won't really work.
However, the audit can be done on a person by person basis. So an admin can go over the list of employees and re-affirm that a certain asset is still with the employee set in the database.

@stale
Copy link

stale bot commented Feb 9, 2019

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

@stale stale bot added the stale label Feb 9, 2019
@memtech3
Copy link

YES!

@stale
Copy link

stale bot commented Feb 10, 2019

Okay, it looks like this issue or feature request might still be important. We'll re-open it for now. Thank you for letting us know!

@stale stale bot removed the stale label Feb 10, 2019
@Turk186
Copy link

Turk186 commented Feb 10, 2019 via email

@Stacykg91
Copy link

Is this still not a thing? We've signed up to this recently and need to audit 11 schools.

@tritonexperiment
Copy link

tritonexperiment commented Apr 10, 2019

Second requiring this feature.

We want to be able to rapidly update location by scanning assets in a store room/office to update their location. As others have mentioned staff move things around a lot, it would be great to just be able to go through, select a location and bulk update everything found to the location specified.

As mentioned previously, even when looking at the asset, it doesn't show it's location at audit, you have to go to the reports section and look up the asset number there.

Maybe just add a checkbox to update location on the audit page?

@memtech3
Copy link

memtech3 commented Apr 10, 2019 via email

@jacobsen9026
Copy link

jacobsen9026 commented Apr 10, 2019 via email

@memtech3
Copy link

memtech3 commented Jun 2, 2019

Some things to note

highlight the location changed assets yellow or orange
add an undo button to the scanned assets list so that you can remove an item for any reason
add a way to save the audit under a name or date so that you can pause and pickup where you left off
add a way to view finished audits by their name/date or both
audit log by room and audit
mark missing items found and display a banner to show that when scanned in an audit

process idea

process for creating an audit: Go to bulk audit tab, hit button that says create audit, define scope of audit ( room, department, building, several rooms) name audit, go to current bulk audit screen with additions shown at the top of this request and in the to note section where you can scan things in. You can then hit a finalize button after completing your audit which takes you to a page that shows you all problems (wrong location, missing/lost/stolen) and can then select what to do about each problem (ex: mark an item that is missing lost or stolen, or move item marked as wrong location to location that it was scanned at)

@asmith0176
Copy link

Expanding on this feature would be huge. I do IT for our school district and audit around 4000 devices through the summer months. Many times we have new users coming and going so we need to quickly reassign these devices to these new users. I know in an earlier post it was said that Check-in/Checkout isn't planned to be implemented into the audit process but it would be an excellent feature. It would also be great to have the option to include custom fields into this. Maybe as you Audit device include a quick edit button, or even bulk edit on the list in case there are any other fields that need to modified for these devices quickly.

Would it also be possible to lookup based on Serial Number rather than Asset tag? We use serial number to keep track of devices and not asset tags so non of our devices have Asset tags on them. Could we set those fields to search both Asset Tag and Serial Number or is there a way to allow that to be optional?

@stale
Copy link

stale bot commented Aug 24, 2019

Is this still relevant? We haven't heard from anyone in a bit. If so, please comment with any updates or additional detail.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Don't take it personally, we just need to keep a handle on things. Thank you for your contributions!

@stale stale bot added the stale label Aug 24, 2019
@stale
Copy link

stale bot commented Aug 31, 2019

This issue has been automatically closed because it has not had recent activity. If you believe this is still an issue, please confirm that this issue is still happening in the most recent version of Snipe-IT and reply to this thread to re-open it.

@stale stale bot closed this as completed Aug 31, 2019
@timwsuqld
Copy link
Contributor

This is still an issue. During an audit, locations are NOT updated to match the selected location

@jacobsen9026
Copy link

Can we get this issue reopened? It is still relevant.

@jacobsen9026
Copy link

What function is supposed to be handling this? Thinking of adding the functionality myself.

In AssetController.php under app/html/controllers I found two functions, the first appears to be the actual auditing function, the other takes a file as a parameter, I don't think that one is the one I want.

public function audit($id)
    {
        $settings = Setting::getSettings();
        $this->authorize('audit', Asset::class);
        $dt = Carbon::now()->addMonths($settings->audit_interval)->toDateString();
        $asset = Asset::findOrFail($id);
        return view('hardware/audit')->with('asset', $asset)->with('next_audit_date', $dt)->with('locations_list');
    }

Only issue is this function takes only an asset ID and no location. Gotta find what calls this and duplicate the function with a location parameter added.

There's another possible function I could use in the API folder of Controllers also called AssetController.php

public function audit(Request $request) {
        $this->authorize('audit', Asset::class);
        $rules = array(
            'asset_tag' => 'required',
            'location_id' => 'exists:locations,id|nullable|numeric',
            'next_audit_date' => 'date|nullable'
        );
        $validator = Validator::make($request->all(), $rules);
        if ($validator->fails()) {
            return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()->all()));
        }
        $asset = Asset::where('asset_tag','=', $request->input('asset_tag'))->first();
        if ($asset) {
            // We don't want to log this as a normal update, so let's bypass that
            $asset->unsetEventDispatcher();
            $asset->next_audit_date = $request->input('next_audit_date');
            $asset->last_audit_date = date('Y-m-d h:i:s');
            if ($asset->save()) {
                $log = $asset->logAudit(request('note'),request('location_id'));
                return response()->json(Helper::formatStandardApiResponse('success', [
                    'asset_tag'=> e($asset->asset_tag),
                    'note'=> e($request->input('note')),
                    'next_audit_date' => Helper::getFormattedDateObject($log->calcNextAuditDate())
                ], trans('admin/hardware/message.audit.success')));
            }
        }
        return response()->json(Helper::formatStandardApiResponse('error', ['asset_tag'=> e($request->input('asset_tag'))], 'Asset with tag '.$request->input('asset_tag').' not found'));
    }

This one at least has a location_id, does some checks against it, then does nothing with it. This might be the one.

@jacobsen9026
Copy link

I have found a fix for the audit and update location. It is in the auditStore function in AssetsController.php in App/HTML/Controllers.

Just gonna work on preventing it from affecting checked out assets, and then I'll post the changes needed.

@jacobsen9026
Copy link

jacobsen9026 commented Nov 5, 2019

I've posted my commits from my fork https://github.com/jacobsen9026/snipe-it

This is the updated auditStore function found in /App/HTML/Controllers/AssetsController.php

It checks if the asset is checked out, and if not, updates the location based on the input from the audit form.

public function auditStore(AssetFileRequest $request, $id)
 {
     $this->authorize('audit', Asset::class);

     $rules = array(
         'location_id' => 'exists:locations,id|nullable|numeric',
         'next_audit_date' => 'date|nullable'
     );

     $validator = \Validator::make($request->all(), $rules);

     if ($validator->fails()) {
         return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()->all()));
     }

     $asset = Asset::findOrFail($id);

     // We don't want to log this as a normal update, so let's bypass that
     $asset->unsetEventDispatcher();

 //$asset->next_audit_date = date('Y-m-d h:i:s');
     $asset->next_audit_date = $request->input('next_audit_date');
     $asset->last_audit_date = date('Y-m-d h:i:s');

     if (is_null($target = $asset->assignedTo)){
     $asset->location_id = $request->input('location_id');
     }
     if ($asset->save()) {


         $filename = '';

         if ($request->hasFile('image')) {
             $file = $request->file('image');
             try {
                 $destinationPath = config('app.private_uploads').'/audits';
                 $extension = $file->getClientOriginalExtension();
                 $filename = 'audit-'.$asset->id.'-'.str_slug(basename($file->getClientOriginalName(), '.'.$extension)).'.'.$extension;
                 $file->move($destinationPath, $filename);
             } catch (\Exception $e) {
                 \Log::info($e);
             }
         }
         $location = Location::find(request('location_id'))['name'];
         $asset->logAudit($request->input('note').$location, $request->input('location_id'), $filename);
         return redirect()->to("hardware")->with('success', trans('admin/hardware/message.audit.success'));
     }
 }

But that doesn't handle the bulk audit. For that we need to update the audit function in /App/HTML/Controllers/API/AssetsController.php to be the following. Does the same stuff as the other file.

  public function audit(Request $request) {


       $this->authorize('audit', Asset::class);
       $rules = array(
           'asset_tag' => 'required',
           'location_id' => 'exists:locations,id|nullable|numeric',
           'next_audit_date' => 'date|nullable'
       );

       $validator = Validator::make($request->all(), $rules);
       if ($validator->fails()) {
           return response()->json(Helper::formatStandardApiResponse('error', null, $validator->errors()->all()));
       }

       $asset = Asset::where('asset_tag','=', $request->input('asset_tag'))->first();


       if ($asset) {
           // We don't want to log this as a normal update, so let's bypass that
           $asset->unsetEventDispatcher();

           $asset->next_audit_date = $request->input('next_audit_date');
           $asset->last_audit_date = date('Y-m-d h:i:s');
           if (is_null($target = $asset->assignedTo)){
              $asset->location_id = $request->input('location_id');
           }


           if ($asset->save()) {
               $location = Location::find(request('location_id'))['name'];
               $log = $asset->logAudit(request('note').$location,request('note'));

               return response()->json(Helper::formatStandardApiResponse('success', [
                   'asset_tag'=> e($asset->asset_tag),
                   'note'=> e($request->input('note')),
                   'next_audit_date' => Helper::getFormattedDateObject($log->calcNextAuditDate())
               ], trans('admin/hardware/message.audit.success')));
           }
       }

       return response()->json(Helper::formatStandardApiResponse('error', ['asset_tag'=> e($request->input('asset_tag'))], 'Asset with tag '.$request->input('asset_tag').' not found'));





   }

GitHub
A free open source IT asset/license management system - jacobsen9026/snipe-it

@jacobsen9026
Copy link

I also saw last night that this functionality is already being built into the Development branch. (I accidentally committed to the Master branch at first).

@jacobsen9026
Copy link

jacobsen9026 commented Nov 6, 2019

For those interested in moving items that are checked out to locations add after

if (is_null($target = $asset->assignedTo)){
              $asset->location_id = $request->input('location_id');
           }

the following

if ($asset->assignedType() == Asset::LOCATION){
                $target = Location::find($request->input('location_id'));
                $asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset audit');
            }

In both AssetsController.php files.

Or if you also want to checkout unchecked out assets replace the first block with

if ($asset->assignedType() == Asset::LOCATION || is_null($asset->assignedTo)){
            $target = Location::find($request->input('location_id'));
            $asset->checkOut($target, Auth::user(), date('Y-m-d H:i:s'), '', 'Checked out on asset audit');
        }

@jacobsen9026
Copy link

Pull request
#7580

I added an additional setting in the General Settings section to always checkout audited assets if they are not already checked out to a user.

@rmacaldo
Copy link

Is this still available? I'm on v6.0.14 build 9236 but nothing seems to appear on the feature request.

@jacobsen9026
Copy link

It doesn't appear that my pull request was accepted. They still have a broken audit, even the notes section to this day is still useless as it's data is inaccessible from the website, if there is any.

I've been running my customized version of this app for my job same as the pull request I submitted, for a while. Definitely missing some security updates by now, but I keep it off the internet so not too much of a risk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❤️ feature request stale 👩‍💻 ready for dev These issues are ready for someone to work on them - take your pick!
Projects
None yet
Development

No branches or pull requests