I was answered by @Dharman for my problem (plz click here-> How to update stock quantity according to their batch numbers. And his suggested code is working for me.
Now, I just want to INSERT the updated rows into "temp_sales".
Here is sample picture of required "temp_sales" https://i.stack.imgur.com/ab1an.png.
Thanks