Paulqvz Posted September 15, 2020 Share Posted September 15, 2020 Good day I have three tables - receiving - shipping and stock movement. everyday i transfer into stock movent the sum of receining with date - havein a stock movent entry per day - I also at end of day update with shipping for that day, in stock table I calculate ne stock level. my problem is that when three days bac i stil have stock i need to start subtracting from oldest entry first till it reaches 0 the move over to second eldest? i have no idea where to start or how to achieve this Quote Link to comment https://forums.phpfreaks.com/topic/311488-how-do-you-subtract-from-the-oldest-array-first-then-the-second-oldest-etc/ Share on other sites More sharing options...
Barand Posted September 15, 2020 Share Posted September 15, 2020 I'd start by sorting them by date so I know the oldest. Quote Link to comment https://forums.phpfreaks.com/topic/311488-how-do-you-subtract-from-the-oldest-array-first-then-the-second-oldest-etc/#findComment-1581403 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.