Purchase Invoice has incorrect outstanding amount after payment entry

Hi All,

So I am new to erpnext, but for the love of god can’t figure this one out :slight_smile:

So here is my situation:
I have a purchase invoice that is submitted and “overdue”. I then proceed to add a Payment Entry for that Purchase Invoice and fill out the last missing details (date and transaction reference) and hit save, then submit the payment entry.

The issue I have: I have a purchase invoice for a total of 4000, all of which is outstanding. When I then add the payment entry for 4000 and submit all looks good. Now if I go back to my purchase invoice, the outstanding amount is -4000.

Any ideas what could be causing this?



If the Purchase Invoice is for 4000 and you create a Payment Entry for 4000, the status of Purchase Invoice should change to “Paid” on refresh.

Could you please share a screenshot of both the PI and Payment Entry?

1 Like

Hi Michelle,

Thanks for getting back to me. After a few more hours of digging I figured out it was a PEBKAC (problem exists between keyboard and chair).

Consider it resolved - my mistake.

Having this issue as well on ERPNext v 14.9 after an upgrade

It’s exactly related to this

I’ll update my instance and see if this helps

The Repost Payment Ledgers Tool works but you need to add

def is_job_queued(job_name: str) -> bool:
	for queue in get_queues():
		for job_id in queue.get_job_ids():
			if not job_id:
			job = queue.fetch_job(job_id)
			if job.kwargs.get("job_name") == job_name and job.kwargs.get("site") == frappe.local.site:
				return True
	return False

at the bottom of apps/erpnext/erpnext/accounts/utils.py as of frappe version 14.20, otherwise you get an error (as of 23/12/2022)