goldstar19821982
Registered User.
- Local time
- Today, 12:48
- Joined
- Feb 17, 2008
- Messages
- 78
Im trying to edit stock levels. What is the best way for the difference to be calculated?
What i currently have is when an item is added, this saves within a transaction table. so the item details are stored and the quantity selected is stored. So when the quantity is wanting to be edited, and the quantiy is changed the difference should be worked out from when it was originally added to what the new quantity selected is. And the difference should add back into the items table to the stock.
So for example.
Item: drill is selected with a quantity of 10 and the amount in stock is 20. This will add into the listbox and new transactionline will be added to the table with the item and the quantity of 10.
When edited to say quantity 5. This should work out the difference, in this case 5 and add the other 5 back into the item table stock. I want it increment or decrement the difference in values.
Any help or sample solutions:mad would be much appreciated. Im losing my hair on this one....
What i currently have is when an item is added, this saves within a transaction table. so the item details are stored and the quantity selected is stored. So when the quantity is wanting to be edited, and the quantiy is changed the difference should be worked out from when it was originally added to what the new quantity selected is. And the difference should add back into the items table to the stock.
So for example.
Item: drill is selected with a quantity of 10 and the amount in stock is 20. This will add into the listbox and new transactionline will be added to the table with the item and the quantity of 10.
When edited to say quantity 5. This should work out the difference, in this case 5 and add the other 5 back into the item table stock. I want it increment or decrement the difference in values.
Any help or sample solutions:mad would be much appreciated. Im losing my hair on this one....