Fixing 'To Bill' Status on Purchase Receipts After Price Adjustments

Hello Everyone!

I hope you all are doing well and enjoying Holi!

I’m currently stuck on a problem and would love to solve it together.

Scenario:
I created a Purchase Order for 10 shirts at $200 each.
Later, I made a Purchase Receipt for 5 shirts at the same rate of $200 each.
At the time of invoicing, I created a Purchase Invoice for these 5 shirts at $200 each.

Twist:
I actually purchased those 5 shirts at $100 each instead of $200.

To adjust this, I issued a Debit Note for -5 shirts at $100 each (i.e., correcting the cost).

Issue:
Now, my Purchase Receipt is still in the “To Bill” status, but I want it to be marked as “Completed.”
Currently, the system does not automatically update the status to Completed after issuing the Debit Note.

Question:
How can I ensure that the Purchase Receipt is marked as “Completed” in this case?

Looking forward to your insights!

Do we have any option to cancel the Purchase Receipt, updating prices in Sales Order via “Update Items” button and then creating the PR and PI this time correctly?

We cannot cancel because there are multiple purchase receipts against that purchase order.

If it’s a one time operation you can update the ‘title’ field in the receipt in the system console.

frappe.db.set_value("Purchase Receipt", "RECEIPT NAME", "title", "Completed")