Multiple Advance Payment with TDS - Purchase Invoice

Dear Experts,

I am applying multiple advance bank payments against a single purchase invoice at the time of posting the purchase invoice using:

Application → Applies-to Doc. Type → Applies-to Doc. No.

I am facing the mentioned issue:

The TDS amount is getting adjusted correctly, and the ledger entries are also showing properly in the TDS Ledger Entries. However, the Vendor Ledger Entries are not getting updated correctly.

For example:

-Total Invoice Amount: Rs. 5,00,000

-GST Amount: Rs. 90,000

-TDS Amount: Rs. 50,000

Two payments are applied as below:

-Payment of Rs. 2,00,000 with TDS amount of Rs. 20,000

-Payment of Rs. 2,00,000 with TDS amount of Rs. 20,000

Based on this, the system adjusts the TDS amount correctly (Rs. 10,000 against the remaining Rs. 1,00,000 balance).

However, in the Vendor Ledger Entries, the remaining amount is shown as Rs. 3,90,000. It appears that the system has adjusted only the last one payment entry of Rs. 2,00,000, while the other payment entry is not reflected correctly.

Kindly guide me on how to properly adjust the remaining amount in the Vendor Ledger Entries before the Purchase Invoice posting

Looking forward to your guidance.