HI Subhadeep,
I have triesd to make a replica of your process and i found system is claculating profit/loss on total invoice value.
You have define document type under ---Indicate Currency Differences for Partial Payments.
System will then calculate the differences as per partial or residual payment.
I hope this would help you.
Regards
Pankaj