![]() |
romaldus 10/24/2016 |
Hi, I've seen many questions regarding inventory management, but can seem to figure it out without help. Looking at three tables:
|
![]() |
Sergey Kornilov admin 10/26/2016 |
Alan, |
A
|
ashumak author 10/31/2016 |
Alan, you are not really telling what exactly you need to do. Try to make your question or questions more specific so we can suggest some code.
|
A
|
ashumak author 10/31/2016 |
Let me try to explain better:
|
A
|
ashumak author 10/31/2016 |
Ahh your suggested sample was great...i got the basic mathmatics working. When I sell stock it is removed from the stock count. When I add more stock it adds to the stock count. I just adjusted the event that was shown. I used: global $conn; $strSQLUpdate = "UPDATE inventory_stock SET Qnty = Qnty - '".$values["Qnty"]."' WHERE Item ='".$values["Item"]."'"; db_exec($strSQLUpdate,$conn); I just changed the - to a plus for the two different needs. Now the hard part. If I allow editing of the Inventory_Sales, I will need to allow for the adjustment. So I need to check what the Qnty was before the edit, and then adjust depending on whether I added more or took less...any suggestions on how i can do that? My thinking would be to add back any Qnty removed when i open the edit, and then subtract the Qnty after the save.... Suggestions...?
|
![]() |
lefty 10/31/2016 |
Ahh your suggested sample was great...i got the basic mathmatics working. When I sell stock it is removed from the stock count. When I add more stock it adds to the stock count. I just adjusted the event that was shown. I used: global $conn; $strSQLUpdate = "UPDATE inventory_stock SET Qnty = Qnty - '".$values["Qnty"]."' WHERE Item ='".$values["Item"]."'"; db_exec($strSQLUpdate,$conn); I just changed the - to a plus for the two different needs. Now the hard part. If I allow editing of the Inventory_Sales, I will need to allow for the adjustment. So I need to check what the Qnty was before the edit, and then adjust depending on whether I added more or took less...any suggestions on how i can do that? My thinking would be to add back any Qnty removed when i open the edit, and then subtract the Qnty after the save.... Suggestions...?
|