Link sales invoice to sales order after the fact

I created a sales order a few months ago and then created a sales invoice directly from the order. Now I recently billed the customer for another part of the sales order, but created the invoice directly for the customer, because I forgot about the sales order. Can I somehow link the new sales invoice (already submitted) to the sales order as well via the normal ERPNext UI? Currently the sales order is showing an inaccurate percentage for “Amount Billed”.

From the UI side, it is not possible to update!

You have to make a patch and run for that, otherwise cancel the invoice and create a invoice from the order.

OK but then I would have to reset the numbering series to get the same invoice number back, right? Or is there an easier option?

If not coming in sequence then you can set it Document Naming Settings.

I believe you just need to set the reference number (Sales Order Number) for that invoice and it’s line items, in order for everything to be updated properly.

You could do this via the developer console or through a script. (If the reference field is not allowed to be edited after submit, then you can add some temporary property setters to allow them to be edited after submit.)

Ofcourse, there is no easy way via the UI to do it… Other than to cancel and create anew.

1 Like