Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

An edit problem of chain reactions

Status
Not open for further replies.

newtomysql

Technical User
Apr 11, 2001
96
MY
Dear All,
I have a system which first receives item as the hq outlet from then I will do a mark up. Eg. say my cost price is 9.9 so I mark up 0.10. So it becomes 10 when it reaches my first outlet. Thereafter the same product can be transfered from one outlet to the other. The problem comes here is that when I have made a mistake in the markup settings say I set it as 100. So my price becomes 109.90 which is wrong. So I have kept a log to track all the markup changes which I have done. The problem I can track when I transfer from hq to first outlet. Problem here is that from the first outlet I could transfer to second and from second to third and there after. So I dont know how to track it via a chain reaction? Any suggestions please. Thanks.
 
have a single table or multiple tables, that would get updated on each move, so it'll be very easy to see. i.e

prodKey firsto secondo thrido fortho...etc

if the item only moves thru firsto, only that col will be updted, when/if it moves to secondo that col will be updated and so on.

You can even put consrtaints on there that if secondo is greater than firsto by certain#, it will fail to update and notify you immediately. Same logic can be used for other outlets
 
But database design says don't list thingsd like first, second, third etc in a single row. The usual way is to have a second table keyed on (this example) prodkey and a sequence number so you can have as many movements as you like without worrying how "wide" the row needs to be.
 
Dear Ingress,
In my sample I also got 2 table on tblTransfer and tblTranferDetails which track exactly all the movements from each outlet to outlet. So how can I solve my problem? Thanks.
 
that sounds good if you have the detals of where things moved.
So you need a query that will cascade updates through a set of rows based on time (?).
Might be easier to create a script - do you know PHP ?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top