create_nk_letter
Generate a tenant Nebenkostenabrechnung (utility cost statement) PDF from recoverable line items, handling mid-year tenant changes via occupancy periods.
Instructions
Compile a tenant Nebenkostenabrechnung PDF on the Achi server (no browser pdf.js). Pass recoverable line items only. Do not invent amounts, Anschrift, or IBAN. Do not include Eigentümerkosten leftovers or Quellenangabe — the server strips them. If tenants changed mid-year, pass occupancyId + periodFrom + periodTo so this letter does not overwrite the other stay. Returns a PDF. Also files the unit trail and a settlement (x-achi-nk-settlement-id).
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| year | Yes | ||
| items | Yes | ||
| notes | No | ||
| title | No | ||
| unitId | Yes | ||
| greeting | No | ||
| periodTo | No | YYYY-MM-DD stay end in this settlement year | |
| periodFrom | No | YYYY-MM-DD stay start in this settlement year | |
| occupancyId | No | ||
| prepaidEuros | No | ||
| createSettlement | No |