Need to change rate in "purchase invoice"

Hello all,

Here my use case is explained.

"Purchase order" is created  as follow: 
Item - X 
Rate $100
Qty 50
Supplier 'Foo'
Order 23-12-2017
Delivery schedule : 
     -> 20 qty at 25-12-2017
     -> 30 qty at 30-12-2017

Note : Rate of item X updates daily bases, purchase user and supplier talk on telephone and finalize daily rate.

Now when 1st delivery is given at that time rate changes and set to $105, and while 2nd delivery rate changes and set to 99$. so Supplier sends invoice :

20 * $105 = $2,040
30 * $99 = $2,970
Total = $5,010

Here “purchase order” is created 50*$100 = $5000.

ERPNext does not allow to change rate in “purchase invoice”. Can anybody tell me to how to deal with this situation?

You should try turning off the “Maintain same rate throughout purchase cycle” flag in Buying Settings.