2 Purchase Invoices - linked to Project, and Payments, not linked to PO
now the Purchase Order say “To Deliver and Bill”, where factually it has been billed and paid already.
Is there any way to create the missing links between my PINV’s and the PO without cancelling all documents from the Payment Entries via PINV’s up to the Project and re-create everything?
As a last resort I wouldn’t mind to do this in the db directly if there is not other way.
Have you checked the root cause as to why it remains open? Are some of the PO positions not linked to the billed items (check the references in Purchase Order.items) or is there a valuation difference? We have cases (in the sales part), where we manually need to add the references ( frappe.model.set_value) when e.g. creating aggregated invoices… In case the valuation differs, as far as I know you will have to change the status of the order to “Closed”…
well in my case it is most probably a user error. Someone did it in the wrong way. which I am trying to fix. I guess someone Created a PINV from a project which at that time may not have been connected correctly to the PO. Something along those lines.