Integration with Polish National System of e-Invoices (KSeF) (Standard)

The National System of e-Invoices (KSeF) came into force in Poland in January 2022. Its purpose is to collect e-invoices issued by entrepreneurs. The KSeF system makes it possible to issue structured invoices as one of the accepted forms of documenting transactions, in addition to paper invoices and electronic invoices currently used in business transactions.

In Comarch ERP Standard system, it is possible to record whether a given customer agrees to receive invoices via the KSeF system. The handling of the integration between Comarch ERP Standard system and the KSeF system has been discussed in a separate help article. A parameter Use KSeF on the customer form in Comarch POS application enables the editing of such a consent.

Note
To enable proper communication with KSeF, the following IP addresses must be unblocked:

  • 237.204.182 – access to the demo environment
  • 237.204.187 – access to the production environment

In addition, port 443 must also be unblocked.

To integrate the POS workstation with KSeF, the Use KSeF parameter must be selected in Comarch ERP Standard on the company form (Trade section). The parameter is only displayed if the company’s VAT rate group is set as PL.

In Comarch ERP Standard, it is also necessary to configure the settings on the KSeF tab of the company form in order to support the integration with KSeF in Comarch POS. For a description of the fields, see the Polish National System of e-Invoices article in Comarch ERP Standard Knowledge Base.

Communication with the KSeF platform

Communication with the KSeF platform is carried out through a dedicated component available in Comarch ERP Standard. The component enables the verification of invoice data before it is sent to the KSeF platform, as well as authentication on the KSeF platform and verification of licenses.

In Comarch POS, verification of invoice data is done automatically when a document is approved and sent to KSeF. After Comarch POS transfers the invoice data to the KSeF component, the component generates an .xml file which it checks for all the mandatory information and verifies that the format of the transferred information complies with the e-invoice schema.

Once the invoice is correctly verified, authentication is performed on the KSeF platform. For this purpose, Comarch POS sends a relevant ID number and a token to the component.

The component also supports the verification of licenses needed for the integration with KSeF. Comarch POS uses the license of the ERP system.

Note
If a document does not comply with the e-invoice schema, Comarch POS will display an appropriate message.

Verification of authentication with the KSeF platform

After successful verification of the document data, an ID and a token are sent to the component for proper authentication on the KSeF platform. If one of the data objects is incorrect, Comarch POS will display a corresponding message indicating that the document cannot be confirmed because authorization in KSeF has failed.

Verification of licenses with the KSeF platform

When opening a communication session in KSeF, the license is also verified. If there are problems with the license, Comarch POS will display a corresponding message indicating that the document cannot be confirmed due to the lack of the KSeF license.

Handling of OAR documents

Official Acknowledgement of Receipt (OAR) documents are downloaded by the ERP system and transferred to Comarch POS along with a KSeF number and document status. OAR documents are transferred to Comarch POS as attachments, but such data as a KSeF number and relevant dates are directly retrieved by KSeF immediately after invoice registration.

Handling in documents

In Comarch POS, invoices are automatically registered in KSeF as soon as they are confirmed, provided that the appropriate conditions are met. The communication is handled for sales invoices, sales invoice quantity corrections, advance sales invoices, advance sales invoice quantity corrections, and manual corrections. The customer must be a business entity and a domestic customer. Invoices issued in Comarch POS are only sent to KSeF if:

  • The global parameter Use KSeF is activated
  • The parameter Directly upload documents to KSeF is activated for the POS workstation
  • The invoice’s date of issue is the same as or later than the date set in the Use KSeF from field in the ERP system
  • The customer selected for the invoice has the Use KSeF parameter activated
  • The POS workstation has an active online connection to the KSeF platform
  • The POS user has been granted appropriate permissions to send invoices to KSeF

Customer form

The customer form contains the Use KSeF parameter, which is displayed if:

  • The support of KSeF has been enabled for the company in the ERP system
  • The parameter Directly upload documents to KSeF has been selected in the ERP system
  • The customer type is Domestic (PL)
Note
The parameter applies only to domestic (Polish) business entities; it does not apply to retail customers.
Use KSeF parameter on customer form

Comarch ERP Standard system registers in the KSeF system new invoices, advance sales invoices, sales invoice value corrections, and sales invoice quantity corrections originating from Comarch POS if:

  • The integration with the KSeF system is activated for a given company
  • A business entity has agreed to receive invoices via KSeF

Once it is registered in the KSeF system, an invoice is assigned a number which is then saved in Comarch ERP Standard system and synchronized to Comarch POS.

On the POS workstation, invoice printout is blocked if:

  • A customer has agreed to receive invoices via KSeF
  • The document date is the same as or later than a date entered in the Use KSeF from field in Comarch ERP Standard
  • The document has not yet been assigned a number from the KSeF system

Also, if the conditions above are met, automatic printout is skipped and the following notification is displayed: “The document will be submitted to KSeF system.

If a given invoice already has an assigned number from the KSeF system, it can be printed out with no further limitations.

Document printout

The KSeF connector handles the generation of QR codes based on document data retrieved from Official Acknowledgements of Receipt. The QR code, along with a KSeF number and a verification link, is located in the bottom section of printouts generated in Comarch POS.

The QR code is a unique string of characters represented as a two-dimensional, square-shaped graphical code compliant with the ISO/IEC 18004:2015 standard. The verification link is created on the part of the KSeF component based on the data sent by the ERP system. The verification link is used to verify an invoice issued in KSeF in case the QR code on the printout is illegible for various reasons.

The KSeF-related section on printouts is displayed:

  • For sales invoices, sales invoice quantity corrections, advance sales invoices, advance sales invoice quantity corrections, and manual corrections
  • Only for documents that have been sent and correctly registered on the KSeF platform
Note
In the case of manual corrections or in an environment where KSeF support is not enabled, the section with the code, KSeF number, and verification link will not be printed and visible in the preview.

[Show KSeF Data] button

A button [Show KSeF Data] is available for documents that have been registered in KSeF. The button is available:

  • For sales invoices, sales invoice quantity corrections, advance sales invoices, and advance sales invoice quantity corrections
  • If the Use KSeF parameter is enabled. You can find the parameter in Comarch ERP Standard, in the Trade section of the company form, if the VAT rate group is set as PL.

[Show KSeF Data] button
Selecting the [Show KSeF Data] button opens the KSeF Data window, which displays the following information:

  • QR code of the KSeF document
  • KSeF number (under the QR code)
  • KSeF document status
  • Link to the KSeF document
  • [Close] and [Copy Number] buttons
KSeF Data window

Czy ten artykuł był pomocny?