...
| Code Block |
|---|
[
{
"Id": <value>, // Composite: $"{InstNr}-{ForbnNr}-{UdebNr}-{Id}" = AKOND.INSTNR-FORBNR-UDEBNR-REGNINGNR
"ServiceId": <value>, // HARDCODED NULL. Previous: Data: AUDEBFORS.FORSYNINGSART (+AFREGNTYPE) via ForsyningsartMapper. El-only join => in practice "consumption_trade" or null (see limitations).
"InvoiceDate": <value>, // Data: AKOND.BILAGSDATO (DateTimeOffset, UTC offset 0) | null
"DueDate": <value>, // Data: AKOND.FORFDATO (DateTimeOffset, UTC offset 0) | null
"Period": <value>, // Derived from StartDate/EndDate month-span: "1month"/"2month"/"3month"/"6month"/"12month" (defaults to "1month" when dates missing or other span)
"StartDate": <value>, // Data: AKOND.DATOFRA (DateTimeOffset, UTC offset 0) | null
"EndDate": <value>, // Data: AKOND.DATOTIL (DateTimeOffset, UTC offset 0) | null
"RemainingAmount": <value>,// Data: running account saldo (SUM of AKOND.KR up to this line) - NOT a per-invoice remaining figure.
"TotalAmount": <value>, // Data: AKOND.KR (decimal) | null
"InvoiceStatus": <value>, // Derived (see status logic below): one of cancelled / credited / paid / overdue / unpaid non-empty BDOC.PAYLOAD exists, else "missing"
// Flat supplementary list; mostly DUPLICATES the structured fields above, as strings/dates.
"Info": [
{ "Key": "invoiceNumber", "Value": <Id> }, // Data: AKOND.REGNINGNR (string)
{ "Key": "invoiceDate", "Value": <InvoiceDate> },// Data: AKOND.BILAGSDATO (DateTimeOffset|null)
{ "Key": "dueDate", "Value": <DueDate> }, // Data: AKOND.FORFDATO (DateTimeOffset|null)
{ "Key": "totalAmount", "Value": <TotalAmount> },// Data: AKOND.KR .ToString() | null
{ "Key": "period", "Value": <Period> }, // Derived period string
{ "Key": "remainingAmount", "Value": <Saldo> }, // Data: running saldo .ToString() | null
{ "Key": "status", "Value": <InvoiceStatus> },// Derived status string
{ "Key": "description", "Value": <Tekst> }, // Data: AKOND.TEKST
{ "Title": "Tekst", "Value": <Tekst> } // Data: AKOND.TEKST (DUPLICATE of description,
// sent via Title (untranslated) not Key)
// NOTE: "ocr" key is NOT emitted (source field not yet identified - TODO)
]
}
] |
...