NAV24 Logo
  • Home
PL | EN
Show / Hide Table of Contents

💬 Comment Export to KSeF

The Comment Export module allows automatic export of comment lines from sales invoices, credit memos, service invoices, and service credit memos to the AdditionalDescription section in the KSeF invoice. This way, additional textual information placed on a document goes directly into the KSeF invoice XML structure.

Key Features

  • Automatic export of "Comment" type lines as additional descriptions (AdditionalDescription) in KSeF.
  • Configurable comment assignment direction – comments below or above the item line, or automatic direction detection based on the document structure (Auto mode).
  • Support for posted sales invoices, sales credit memos, service invoices, and service credit memos.
  • Configuration on the dedicated KSeF Helper Setup page.

Supported Documents

Document Supported
Posted Sales Invoice ✅
Posted Sales Credit Memo ✅
Posted Service Invoice ✅
Posted Service Credit Memo ✅

How It Works

  1. The system captures the KSeF invoice additional description creation event (event from Polish Localization).
  2. It reads the comment export settings from the KSeF settings.
  3. For each item line (non-comment) on the invoice, the system searches for associated comment lines according to the selected direction:
    • Below – comments placed directly after the item line are assigned to that line.
    • Above – comments placed directly before the item line are assigned to that line. Comments after the last item line are assigned to the last item line.
    • Auto – the system analyzes the structure of each document individually and automatically detects the direction: if the first comment line appears before any item line, the "Above" mode is applied (invoices created by "Get Shipment Lines" insert comments above items); otherwise the "Below" mode is applied.
  4. Based on the Comment Format setting, the system builds the comment content:
    • Description – only the "Description" field of the comment line is exported.
    • Description + Description 2 – the "Description" field combined with the "Description 2" field (separated by a space) is exported.
  5. Found comments are exported as AdditionalDescription records with the label "Comment" and the content of the comment line.

Configuration

  1. Search for the KSeF Helper Setup page (or open it from KSeF Settings by clicking the Open KSeF Helper Settings Card link).
  2. Go to the Comment Export | N24KH section.
  3. Configure the options:
    • Export Comment Lines – enable to activate comment export to KSeF.
    • Comment Direction – choose whether comments below or above the item line should be assigned to that line, or select Auto so the system detects the direction based on the document structure. Auto mode is intended for documents where comments throughout the document appear in one consistent pattern.
    • Comment Label – optional custom label used in the AdditionalDescription section. If empty, the default value "Comment" is used.
    • Comment Format – specifies which fields form the comment content: just the "Description" field or "Description + Description 2" (concatenation of both fields separated by a space).

Comment Assignment Direction

Direction Description
Below (comments after line) Comments placed directly after an item line are assigned to that line.
Above (comments before line) Comments placed directly before an item line are assigned to that line. Comments after the last item line are assigned to the last item line.
Auto (detect based on shipment lines) The system analyzes each document individually. If a comment appears before the first item (typical pattern for invoices created by "Get Shipment Lines"), the system uses Above mode. Otherwise it uses Below mode. Intended for documents where comments throughout the document appear in one consistent pattern.

Tips

  • Empty comment lines (without text) are skipped during export.
  • In "Above" mode, comments at the end of the document (after the last item line) are assigned to the last item line.
  • In "Auto" mode – if comments and items are alternately mixed between lines (e.g., some comments come from "Get Shipment Lines" and some are manually added between items), the result may be unpredictable. In that case, set a fixed direction of "Below" or "Above".
  • The description label in KSeF is "Comment" by default. It can be changed in the Comment Label field in settings.
  • Comment export works independently of the KSeF field mapping module – both mechanisms can be active simultaneously.
In this article
Questions? 👉 Contact us: produkty@nav24.pl ↑ Back to top