Hello all,
I've previously posted about my database which is being used to manage stock of Aluminium Extrusions. I can now successfully raise a purchase order with an extruder using the system and can also print this order out using a report. The next stage is what happens when the material arrives. I want to manage stocks using a "Stock Transactions" table as I believe this will make it as simple as possible for me to track the actual stock figures without having to consult a multitude of different tables (This is complicated because I have three different warehouses to which my material could be delivered). My problem is this:
When a user generates an order on the system I am happy to use the tblExtrusionOrderLines to generate a "projected" stock figure but when this actually comes into stock I need a trigger to create the relevant records in the stock transactions table. Again this is something I think I will be able to do, my order has a status field so I can run some code when the status becomes "Complete" or "Delivered" etc. Or I could have a button to change the status to complete or delivered and run additional code at this point. My concern is what happens if a user changes an order back from complete to "Open" and makes some changes to the order lines when a stock transaction record already exists for that order? Is there an easy way for me to remove all related records if someone changes back from Complete to Open and then I can reapply when it becomes complete again? Alternatively if there is a fundamentally better way of doing this please let me know!
Many thanks,
Dan
I've previously posted about my database which is being used to manage stock of Aluminium Extrusions. I can now successfully raise a purchase order with an extruder using the system and can also print this order out using a report. The next stage is what happens when the material arrives. I want to manage stocks using a "Stock Transactions" table as I believe this will make it as simple as possible for me to track the actual stock figures without having to consult a multitude of different tables (This is complicated because I have three different warehouses to which my material could be delivered). My problem is this:
When a user generates an order on the system I am happy to use the tblExtrusionOrderLines to generate a "projected" stock figure but when this actually comes into stock I need a trigger to create the relevant records in the stock transactions table. Again this is something I think I will be able to do, my order has a status field so I can run some code when the status becomes "Complete" or "Delivered" etc. Or I could have a button to change the status to complete or delivered and run additional code at this point. My concern is what happens if a user changes an order back from complete to "Open" and makes some changes to the order lines when a stock transaction record already exists for that order? Is there an easy way for me to remove all related records if someone changes back from Complete to Open and then I can reapply when it becomes complete again? Alternatively if there is a fundamentally better way of doing this please let me know!
Many thanks,
Dan