Hello dear OzGrid, me again.
Need to find the right certificate to print based on fuel level at some date.
If i had 0 litres in reservoire and then 26Jan i received 30 000 litres, so in next days, if there isn't any other receive(in) i will print that(30000) certificate.
I need formula to somehow monitor fuel level. If fuel level is 31 000 litres at January 27th, something is wrong. If fuel level is 29 or less, then give customer that (30000) certificate. It's too complicated. Reservoires are 100 000 litres capacity, so there might be 130 000 receive in for some date(28 Jan), because, at 28 Jan i could also sell 30 000litres. It's so complicated.
Any help would be greatly appreciated.