Auto approval Sales invoices outstanding balance is not showing in Payment entry

Hi all,

We have to import sales invoices which are available in another system and already approved.

So I have a server script to Auto approve (change the value of the variable) those imported sales invoices.

However, when I try to create a payment entry the outstanding balance is not show for those imported sales invoices and auto approved once.

If I imported and do manual approval via ERPNext UI then the outstanding balance is correct.

According to my Investigation the GL entry is not update for auto approval sales invoices.

Could you please help me to resolve this issue with auto approval please?

Thank you.