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

Fixed Mini quantity field values are not importing into Snipe-IT #11811

Merged

Conversation

inietov
Copy link
Collaborator

@inietov inietov commented Sep 12, 2022

Description

The CSV importer for Consumables and Accessories doesn't include the min_amt field, so this PR adds it.

Fixes freshdesk #30628 and shortcut [sc-19520]

Type of change

  • Bug fix (non-breaking change which fixes an issue)

How Has This Been Tested?

Test Configuration:

  • PHP version: 8.1
  • MySQL version: 8.0.23
  • Webserver version: nginx/1.19.8
  • OS version: Debian 10

Checklist:

@swartzfeger
Copy link

inietov did you experience item number also not importing via csv? I may need to look at your work to fix this issue I'm having :)

@inietov
Copy link
Collaborator Author

inietov commented Sep 14, 2022

Wasn't aware, just let me test that. Item number is a Consumables' field, right?

@inietov
Copy link
Collaborator Author

inietov commented Sep 14, 2022

Just tested in my local and it's working:
image

Probably you gonna need to open your own issue with more details so we can help you.

@swartzfeger
Copy link

swartzfeger commented Sep 14, 2022

Just tested in my local and it's working:

Probably you gonna need to open your own issue with more details so we can help you.

Hmm, I'm stumped -- I'm getting neither model no or item no in consumables... I also wasn't getting min_qty like you so I thought maybe they were related. I will look into this more deeply (I'm a complete beginner but I find this very fun!)

@inietov
Copy link
Collaborator Author

inietov commented Sep 14, 2022

@swartzfeger Always great to have new people involved! Take a look at your logs, and relevant code is in app/Importer/ConsumableImporter.php, but I just check and both fields are set from the CSV:

image

As I said before, keep us informed about your findings in your own issue, if I can help you I do that gladly :)

@snipe snipe merged commit d598f75 into snipe:develop Sep 14, 2022
@swartzfeger
Copy link

@swartzfeger Always great to have new people involved! Take a look at your logs, and relevant code is in app/Importer/ConsumableImporter.php, but I just check and both fields are set from the CSV:

As I said before, keep us informed about your findings in your own issue, if I can help you I do that gladly :)

I haven't touched php or mysql since 2004 (php3?) so it's been a long time :) But I'm having fun learning again and would love to contribute.

image

My importer has
$this->item['item_no'] = $this->findCsvMatch($row, 'item_number');

Which is why I'm confused. During the setup (when you reference the head field to the import field), I can see the item number under sample value. But after import (no errors reported), the Item No. column is empty :/

FWIW, I added

$this->item['order_number'] = $this->findCsvMatch($row, 'order_number');

and I referenced my item_no csv to the order_number field and it imports just fine. This workaround is ok for now but not ideal, as the order number is technically not the item number.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants