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

Impossible to set initial stockLevel from CSV Import? #1264

Open
jpubb opened this issue Apr 7, 2023 · 1 comment
Open

Impossible to set initial stockLevel from CSV Import? #1264

jpubb opened this issue Apr 7, 2023 · 1 comment
Labels
Bug needs-triage incoming, please sort

Comments

@jpubb
Copy link

jpubb commented Apr 7, 2023

# Bug description

When attemping to import stockLevel, the value of "Stock" in the front end table views is not altered (remains 0).

To test, we use a fairly minimal import field mapping preset:

PartKeepr.PartBundle.Entity.Part > name
PartKeepr.PartBundle.Entity.Part > description
PartKeepr.PartBundle.Entity.Part > comment
PartKeepr.PartBundle.Entity.Part > internalPartNumber
PartKeepr.PartBundle.Entity.Part > category
PartKeepr.PartBundle.Entity.Part > storageLocation

partPartKeeprStockBundleEntityStockEntries > [x] create new item
partPartKeeprStockBundleEntityStockEntries > stockLevel

Looks like this...
image

When importing, everything except stockLevel was imported.

System Information

  • PartKeepr Version: 1.4.0
  • Operating System: Ubuntu 20.04.1 LTS
  • Web Server: Apache
  • PHP Version: PHP 7.2.34-36+ubuntu20.04.1+deb.sury.org+1 (cli)
  • Database and version: /usr/sbin/mysqld Ver 8.0.32-0ubuntu0.20.04.2 for Linux on x86_64 ((Ubuntu))
  • Reproducible on the demo system: Yes
@jpubb jpubb added Bug needs-triage incoming, please sort labels Apr 7, 2023
@jpubb
Copy link
Author

jpubb commented Apr 7, 2023

WORKAROUND (hack)....

Instead of using stockLevel because it's broken/bugged

instead map your quantity to the field status (assuming you don't use/need status. Or map to something else)

Then your import will work, and status will represent qty on hand.

Next go into phpmyadmin and run query:

UPDATE `Part` SET `stockLevel` = `status` WHERE `status` >0

So anything where status is >0 will be mapped to "stockLevel" as you want.

You can then blank all your status back to 0 (be careful - if you use status for something you probably don't want to do this)

UPDATE `Part` SET `status` = 0 WHERE `status` IS NOT NULL

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug needs-triage incoming, please sort
Projects
None yet
Development

No branches or pull requests

1 participant