I have the following CTE that will give me the DocTotal for the entire invoice.
SELECT SUM(Sale + VAT) AS DocTotal
GROUP BY InvoiceNumber
SET DocTotal = CTE_DocTotal.DocTotal
Updates you make to the CTE will be cascaded to the source table.
I have had to guess at your schema slightly, but something like this should work.
;WITH T AS ( SELECT InvoiceNumber, DocTotal, SUM(Sale + VAT) OVER(PARTITION BY InvoiceNumber) AS NewDocTotal FROM PEDI_InvoiceDetail ) UPDATE T SET DocTotal = NewDocTotal