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

Add Part: Using takeover all data function causes initial stock levels to be added to prev entry on save #660

Closed
ericmoon opened this issue May 2, 2016 · 6 comments · Fixed by #661
Labels
Milestone

Comments

@ericmoon
Copy link
Collaborator

ericmoon commented May 2, 2016

When the 'Takeover all data' is checked on a Part Add, the initial stock level entry is added the the previous part stock level.

For example, Enter "Part A" with a Initial stock level of 11, then check the takeover all data and save Part A. Change Part A to "Part B" and change nothing else, when you save part B, initial stock level will be saved as 22, Part C would be 33, and so on. Changing the value in the Initial stock level only changes the amount added to the previous stock level.

Problem reproduced on demo.partkeepr.org

browser: chrome
PK version : GIT Dev version
PHP version : 5.6.20-1
SeverOS : debian stretch openvz on 2.6.32-042stab111.12 kernel.
Server version: Apache/2.4.18 (Debian)
mysql version: mysql Ver 14.14 Distrib 5.6.30

@Drachenkaetzchen
Copy link
Member

Please add required information to the issue as per https://github.com/partkeepr/PartKeepr/blob/master/CONTRIBUTING.md

@Drachenkaetzchen
Copy link
Member

I believe the issue is now fixed. Can you verify?

@ericmoon
Copy link
Collaborator Author

ericmoon commented May 6, 2016

That fixed it, thanks.

@sunnyboy988
Copy link

This bug is not completly fixed yet...

Create the fist part like described from ericmoon and set the stock to 100, it sets the stock to 100 -> is ok.
Create the 2nd part and change the stock to 200 and save it, it stets the stock to 200 -> is ok.
Create the 3rd part and change the stock to 0 and save it, it sets the stock to 200 like the last added part -> wrong!

@Drachenkaetzchen
Copy link
Member

I tried as you described, however, it looks okay on my side.

I did:

  • Clicked Add Part, used name test, selected any storage location, set initial stock to 100, clicked Create blank item after save and Takeover all data, clicked Save
  • Set name to test2, set initial stock level to 200, clicked Save
  • Set name to test3, set initial stock level to 0, clicked Save

The stock levels for all 3 test parts are as expected.

@Drachenkaetzchen
Copy link
Member

Can you give more verbose instructions to reproduce, like if you have clicked Takeover all data or not?

Drachenkaetzchen pushed a commit that referenced this issue May 15, 2016
Set the stockLevel property to 0 for each duplicated item, fixes #660
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants