I don't really understand your requested output description:
- Are you only considering records looking back to the last sale as 'recent'? Or why have you left out 1-Jan and 1-Feb receipts?
-"for eg. in the output for item RBC 12300, GRN Qty is 30, but only 20 is considered as the sum total is equal to 60."
I am totally lost, can't get how you calculate 30, then consider only 20????