FIFO in work order

Hi everyone.

When creating a workorder and subsequently creating a stock entry for manufacture from that work order,the raw material list that gets created automatically in the stock entry seems to select the newest batch that has enough quantity to complete the work order. however i would like it to choose the oldest batch, and if there isn’t enough it should split the rest with the next batch. Is there any way to do this in erpnext?