Cannot delete or cancel because Purchase Order is linked with GL Entry

Hi,
I am trying to cancel a Purchase order which was linked with Payment Entry which I have already canceled . However when try to cancel the purchase order it is giving the error that it is linked to GL Entry.
I have checked in the GL entry and it has is_cancelled checked
How can I resolve the issue?

-Amit

Hi Amit,

Try cancelling the PO after deleting the Cancelled Payment entry.

Hope this helps.

Thanks

Jay

1 Like

Hi JayRam,
Thanks for the reply. I tried deleting the Payment Entry. However it is giving the same error
Cannot delete or cancel because Payment Entry is linked with GL Entry.
How can we resolve this?

Thanks
-Amit

1 Like

What GL Entry is linked with your Payment Entry. Find that and see if you can cancel and delete that Entry before you try cancelling the PO.

Thanks

Jay

There is no option to delete the GL Entry. Infact I will feel very uncomfortable if we have to handle GL Entries directly ourselves.

-Amit

Usually when you cancel a PO, the Payment entry should get unlinked from the PO. And you should be able to either keep the payment entry or cancel it depending on the business situation.

Which version of ERPNext are you on?

Thanks

Jay

This is how it was working before. I recently updated to version 13 and since then it has been a problem. My system is currently on

ERPNext: v13.7.1 (version-13)

Frappe Framework: v13.7.0 (version-13)

-Amit

Maybe Immutable Ledger (or something similar) has changed the game! Maybe it’s a bug.

You just have to wait for somebody more knowledgeable with the latest releases to help you with this.

Thanks

Jay

Thanks JayRam for your support and help. I really appreciate it.
I will file a bug report so that someone can look into the issue.

-Amit

1 Like

Enable this in Accounts Settings → Transaction Settings:
Delete Accounting and Stock Ledger Entries on deletion of Transaction

1 Like

Hi @Amit_Saxena

Did you create the Github Issue ? Just encountered this same situation so it appears it isn’t fixed yet ?

@Sambhav_Patni actually you shouldn’t have to enable this. GL Entries with ‘Is Cancelled’ ticked shouldn’t prevent you from Cancelling linked docs

Kind regards,

1 Like

I’ve created a Github Issue for same:

https://github.com/frappe/erpnext/issues/32138

Hope it can be fixed soon

Thanks Dear

hi Amit
is your problem solved?? am facing the same issue with a stock entry (material issue) and the FIFO reposting valuation is stuck because of this issue !! any help if possible?
thanks a lot