snipe-it icon indicating copy to clipboard operation
snipe-it copied to clipboard

Imported License can't be checked out

Open khanisak opened this issue 8 years ago • 5 comments

Hello, As explained in the link below, today i want to import several license data from csv file and checked out the license manually Snipe-IT Importing Data

This is my sample csv file. sample-licenses.xlsx

The import process have been completed succesfully without problem. But when i want to checked out my license, snipe says "This item has a status label that is undeployable and cannot be checked out at this time". 0 license show in avail column.

After do a little research, i found that the code below in app/Http/Transformers/LicensesTransformer.php return false and disallow me to checkout the license. 'user_can_checkout' => (bool) ($license->free_seats_count > 0),

When i look into license_seats table in database, there is no data related to the imported license. So i decided to insert 1 data into license_seats table with the id of imported license and now 1 license shows in avail column and i can checked out 1 seats to my user.

Why Snipe-IT don't create the data in license_seats table when i imported 80 seats of license? Wether Snipe-IT works like that or i have wrong content in my csv?

This is my server configuration

  • Ubuntu 16.04 LTS
  • PHP 7.0.22
  • MySQL 5.7

I have make sure that my Snipe-IT is up to date. Thank you for great platform !! :1st_place_medal:

khanisak avatar Jan 23 '18 09:01 khanisak

@dmeltzer can you take a peek?

snipe avatar Jan 24 '18 12:01 snipe

Can you share some of the csv file? Do you have a "seats" column?

mnemonicly avatar Jan 24 '18 12:01 mnemonicly

@dmeltzer Here is my csv file sample-licenses.xlsx

Yes, there is a "seats" columns there with value 80. The importer succesfully import 80 seats of license (As shown in the seats column license page) but the Avail column shows 0 license.

khanisak avatar Jan 25 '18 07:01 khanisak

Hello,

This is fallout from disabling the event dispatcher when importing to prevent double logs.

#4912 should fix.

mnemonicly avatar Jan 25 '18 13:01 mnemonicly

@dmeltzer Works like a charm Thank you :+1: :+1:

khanisak avatar Jan 29 '18 04:01 khanisak