Payment term on purchase Invoice shows full PO amount instead of invoice amount

When I create a PI (Pur Inv) from PR (Pur Receipt), the payment schedule shows the outstanding for the entire PO instead of the outstanding for PI.
e.g. Created a PO for 10 units for Rs 100 each.
Payment term is 100% in 7 days.
On PO, the payment schedule shows Rs 1000 due in 7 days.
After creating a PR for 1 unit and invoicing it, the PI should show the payment schedule as Rs 100 due in 7 days. However, PI shows Rs 1000 due in 7 days.

It wasn’t that way in version 13. I have noticed this flaw only in version 15.
Am I missing any setting change? Or is this a bug? I highly doubt this will be an intentional feature.

I have checked the following methods in account_controller.py
set_payment_schedule(self)
fetch_payment_terms_from_order(self, po_or_so, po_or_so_doctype)

The logic is simply copying the payment schedule from PO without changing the amount to that outstanding on the invoice.

Best,
Basant