open-nav
    Preparing search index...

    Function buildStorno

    • Build a storno (full cancellation) of an invoice.

      NAV models a storno as a modifying report: an invoiceReference to the original, every line's amounts reversed, and each line carrying a lineModificationReference. Two NAV rules the shape must satisfy, both learned from the live service: lineOperation is always CREATE on a modifying line, and the reversing lines take chain positions after the original (lineNumberReference continues past it) while the document's own line numbers stay 1..N. Amounts and the summary are negated.

      Handles the common single-invoice, first-modification case; chained modifications (modificationIndex > 1) are the caller's to sequence.

      Parameters

      Returns InvoiceData