Skip to content

Rulvar API reference


Rulvar API reference / @rulvar/core / invoiceFromJournal

Function: invoiceFromJournal()

ts
function invoiceFromJournal(
   entries, 
   priceUsd, 
   options?): InvoiceExport;

Defined in: packages/core/src/engine/invoice.ts:695

The pure invoice fold. Pass the same entries and price table you would pass costReportFromJournal; the totals are that report's gross/net split verbatim. To make the export historically stable against price-table updates, pass the priceUsd rebuilt by journalPricingSnapshot and declare it via options.pricing (RV407); without a snapshot the fold prices at the current table's rates, exactly as before.

Parameters

ParameterType
entriesreadonly JournalEntry[]
priceUsd(servedBy, usage, seq?) => number | undefined
options?{ pricing?: InvoicePricingProvenance; }
options.pricing?InvoicePricingProvenance

Returns

InvoiceExport