Book Contents

Book Index

Data boxes

A data box is an electronic repository intended for delivery and for performing acts towards public administration authorities. These documents take the form of a data message. Data boxes are established and administered by the Ministry of the Interior.

pic_3909

Picture: Received message in the data box

Using a data box, it is possible to send and receive official documents in electronic form (data messages) from public administration authorities. Another way of using a data box is sending a Postal data message, which enables communication also between other data box users.

Official documents in electronic form bearing the sender's electronic signature are delivered to the data box. All sent documents must also be marked with an advanced electronic signature.

A document (data message) that is delivered to a data box is deemed delivered at the moment an authorized person logs in to the data box. If the user does not log in to the data box within 10 days of the day the document was delivered, the document is deemed delivered on the last day of this period. As soon as a new data message is stored in the data box, a delivery notification is sent to a mobile phone (for a fee) or to an e-mail box (free of charge). A read message will be kept in the data box for 90 days. After this period, the message will be deleted unless the user has activated the paid Data vault service, which is used for storing - archiving data messages after the stated period.

Data boxes are accessible via a web browser at www.mojedatovaschranka.cz. All available information about data boxes, including the possibility of using a test environment, is available at www.datoveschranky.info.

Any file can be sent from K2 via a data box.

Conditions for Using Data Boxes in IS K2

If we want to use the functionality of sending and loading messages from data boxes in K2, we must meet several conditions and settings:

pic_4882

Picture: Settings on the user's contact person

pic_4883

Picture: Setting the login credentials for the data box

pic_6103

Picture: Created book of letter mail

pic_6102

Picture: ISDS parameters

pic_5633

Certificates Related to Data Boxes
Sending Data Messages from K2

Data messages can be sent from K2 in various ways:

pic_7777

Picture: Send through data box

A text message can also be added to the sent message using the Text message button. When sending, this message will be attached as the file Textová zpráva.PDF.

pic_7778

Picture: Text message

Multiple files can be attached to a message. Files can be selected from storage using the Attach documents button. Below this button there is also information about the size of the attached file and whether it is a high-volume message.

pic_7779

Picture: Attaching multiple files to a message

pic_10348

Picture: Reply to received message

pic_4886

Picture: Icon for exporting a report to *.pdf and sending it via data box

Picture: Bulk sending via data box

Outbox

For situations where the data box is operated by a user or users who have login set up for this data box, but the files to be sent are created by another user who does not have login to the data box, the functionality of the Outbox book can be used.

A user can create a record in the Outbox book, and another user who has access to the data box then actually sends this mail.

pic_107353

Picture: Save to Outbox

Pressing the Save to Post to send button does not send the data message; instead, a new record is created in the Outbox book.

pic_107354

Picture: Message about record creation

The record can then be sent from the Outbox book. Before sending, the first confirmation must be performed on the record. The record can then be sent using the Send message function. The window for sending the message is displayed and the message is sent by pressing the envelope. Sending the message automatically performs the second confirmation of the record, so records that are confirmed twice have already been sent.

pic_107356

Picture: Send message

Records in the Outbox book can also be sent in bulk using the Send via data box bulk action:

pic_107357

Picture: Bulk sending of messages

Loading and Saving Data Messages Using a Script

The link between the data box and K2 is provided by the DataBoxMessages.pas script, which can be run manually or as a scheduled task. The login credentials are looked up according to the User running the script and the Contact person linked to them. Messages from all data boxes available to the given user according to the login are then gradually downloaded to K2. The document type must be DS_DOC.

Received messages are downloaded from data boxes into the corresponding Received letter mail book. Delivery receipts are also downloaded for all messages, with individual records/statuses in the delivery receipt being downloaded as message events. When a message is received, the message itself and three events (data about the sending, delivery and pick-up of the data message) are therefore usually downloaded.

The script downloads messages according to the user's own companies display settings. If one user (contact person) has several data boxes set up for different own companies, messages are downloaded into the books of letter mail that have an own company whose data the user displays. The script therefore takes into account the user's selection of displayed companies.

Depending on the parameter settings, all/some new messages and events are downloaded, while the message ID is used to check that the same message is not loaded again (only any new events in the delivery receipt). After going through all messages of the data box and processing them, the script disconnects from the data box. In the event of an error connecting to the data box, failure to find the Books of letter and parcel services or any other errors, this is (depending on the script parameter settings) written to an error file, the error file is displayed, or it is written to the task scheduler history; it is always written to the K2 recalculation error log.

Principle of saving a message:

Most of the header data of the data message and some details are saved as a letter mail record. The message itself in the form of a physical file (file type according to the script parameter), including attachments, is saved on the External Documents and Documents (9th Page) tab of this record in the .fo format (unencrypted) or DocK2 (encrypted with the certificate distributed with IS K2), which is an encrypted version of the original .fo file. Delivery receipts are then saved as items (Letter mail letters) on the Items page of the record.

Specifically, the data from the data message are filled into the K2 fields as follows:

Letter mail field name and its use for the data message

Description

Matter.

Received by

The contact person who downloaded the message.

Received on

Date and time of delivery.

Status

Not implemented for a data message.

Kind

Not implemented for a data message.

Recipient data box

The data box into which the message was received.

Sender data box

The data box from which the data message was received.

pic_6913

Picture: Basic data tab

On the Items tab of Letter mail, one item is created for the message itself, followed by several items with delivery receipt events.

pic_6914

Picture: Row 1 with the message, further rows with delivery receipt events

Description of selected fields on the item in the case of a data message (i.e. row 1)

Received on

Event date of reading the message in the data box.

Abbreviation

Message ID.

Brand

Sender's reference number.

Description

Message description (Matter).

Accepted by

The contact person who downloaded the message.

Description of selected fields on the item in the case of delivery receipts:

Received on

Date and time of the delivery receipt event (typically posting, delivery, receipt of the message).

Abbreviation

Generated number containing the date and time of the event (in the YYMMDDHHMMSS format) and the message type designation (from the delivery receipt text - the beginning up to the colon).

Brand

Message type (from the delivery receipt text - the beginning up to the colon).

Description

The beginning of the delivery receipt text truncated to the maximum length of this field.

Accepted by

The contact person who downloaded the message.

pic_6915

Picture: Delivery receipt event detail - message pick-up

Data Box - Reading and Writing Messages

Process number: CRM011

Script ident. no.: FCRM034

File: DataboxMessages.pas

Script description: The script allows messages (including delivery receipts) to be downloaded from a data box and saved to K2 - the Letter mail book.

Address in the tree: [Communication] [Data box]

Script parameters:

K2DocType - DS_DOC

The document type in which the data message will be saved as a full-text file with attachments.

DocAbbrPrefix - DS_

Prefix of the message file name.

MaxMsgCount - -1

Maximum number of downloaded messages. The default value -1 means all messages.

DateFrom - 1.8.2009

"Date from" for downloading messages. Determines the oldest messages to be downloaded.

DeliveredFilesDocType - Document type for saving files as separate documents. It is set if the SaveDeliveredFiles parameter is set to YES. If the parameter is not set, the attachments are set with the same type as the message itself.

CertificateName - K2UniversalED

Name of the certificate for encrypting the message. Empty = the message file is not encrypted.

LoginCertificateThumbPrint -

Cryptographic thumbprint of the login certificate, if a certificate is used to log in to the data box. This thumbprint can be obtained in the details of the given certificate in Windows; however, it must be copied via e.g. Notepad because invisible characters get inserted, which make it invalid.

LoginIdIO - 2000034154

Number of the web record with the login credentials for the data box. The default value sets the standard system record ISDS.

ReceiveSenMessages - No

The parameter determines whether sent messages are also to be downloaded from the data box (Yes) or not (No).

ErrorLogShow - No

The parameter determines whether the error log of message processing is to be displayed on the screen (Yes) or whether it is sufficient to save it to the recalculation error log - type 15 (No).

ErrorLogFileName -

File name including the path for saving the message processing error log, if a file is to be created.

ReceiveDeliveryInfo -
Download also message delivery receipts - processes the downloaded messages and adds events from the delivery receipts

SaveDeliveredFiles - No

Yes - Attach attachments as separate documents. When set to YES, the files contained in the message are attached to this message (record) on the Attachments page in the Letter mail book when the message is downloaded to K2.

K2DelInfoType -
Document type for saving the delivery receipt file to K2

CounterpartyDataBox - Identifier of the counterparty's data box

The data box identifier is entered in the parameter value. Only received messages from this sender are then downloaded to Letter mail.

Encryption of data messages saved to disk via K2

Without encryption, a file with the .fo extension is created and saved to disk when a data message is downloaded. This file can be read using the 602XML filler application or plug-in by anyone who has access to the file and to the application. If we want access to data messages saved in this way to be restricted, we use the K2Universal.cer certificate (read only)/K2Univesal.pfx (read and encryption): The certificate must be included in the personal certificates and must be set (it is by default) in the CertificateName parameter - it is then used for encrypting the saved files. The attachments themselves are then opened with the K2/ed_app.exe application, i.e. this application "decrypts" the file, which is then displayed using the 602XML filler application or plug-in.

Note: If we do not want to use encryption, we must set the CertificateName parameter to an empty value.

Testing the connection between K2 and the data box

For testing purposes, you can have a free data message Statement from public registers (e.g. from the Trade Register) generated at https://portal.gov.cz/formulare/vypis-z-zivnostenskeho-rejstriku. Click the Fill in the form button for the required register, fill in the Reg. No. of the subject whose record we are requesting and press Next. We will be prompted to log in to the data box through which we want to send the request (and whose connection to K2 we now want to test). The request is then passed to an "automaton" which processes it. Simply by sending the request, a new sent message - Request for a statement from the register is created in the data box. Usually within a few minutes (up to an hour), a received message - the requested Statement from the register arrives in the data box. We can then download only the received message / both messages to K2 by running the script. Delivery receipts are downloaded as well.

Electronic submission

The Electronic submission module mediates electronic communication - electronic submissions. It currently supports submissions to the Czech Social Security Administration (CSSA).

It can therefore be used to send data concerning:

The eSickNotes module is also connected to the Electronic submission module; it creates records in the Electronic submission book, but in the case of eSickNotes the user controls the communication with CSSA directly in the eSickNotes book, unlike other submissions, which are communicated directly in the Electronic submission book.

pic_5190

Picture: Tree menu - Electronic submission

Books for Electronic Submissions

To use the Electronic submission module, it is necessary to create a book or books for Electronic submissions.

Books for Electronic submission can be opened from the tree menu Basic data - Books for Electronic Submissions or Administrator - System - Administration of books - Electronic submission tab.

pic_10059

Picture: Administration of books - book for Electronic submission

pic_10060_2024

Picture: Administration of books - Default setting

Description of fields:

Reference number

Reference number of the organization for communication with CSSA.

VREP service primary URL address

The URL address of the VREP service is pre-filled automatically.

Signature Certificate (Qualified)

A qualified signature certificate issued by an accredited certification authority. It can be set directly on the book, as shown in the picture above (Picture: Default setting). This setting is suitable if the company has one payroll accountant who has one certificate registered with CSSA.

After pressing the button, a Windows window with personal certificates is displayed, where the correct certificate can be selected (via Other options). It is then inserted into this field.

pic_5071

 

 

Encryption certificate (Commercial)

A commercial encryption non-signature certificate with which the data of the CSSA reply will be encrypted. If the Signature certificate (Qualified) is also an encryption certificate, the encryption certificate does not need to be filled in and the qualified certificate is used for data encryption.

CSSA certificate

After pressing the button, a certificate selection window is displayed, where the correct certificate can be selected (via Other options). It is then inserted into this field.

The certificate can be obtained here: https://www.cssz.cz/web/cz/ke-stazeni

 

 

Protocol communication with the VREP service

Communication with the VREP service will be logged and error logs will be saved to the book of error logs, from which they can be displayed later. Error logs can be displayed from the tree menu Communication - Electronic submission - VREP communication error logs.

Take over the signature and encryption certificate from the contact person

The user's signature and encryption certificates can also be set on the contact person (Contact persons book). This option is used when communication with CSSA is handled by several persons and each of them has their own certificate for communication.

In this case, the signature and encryption certificates are not filled in in the book settings and are left empty; at the same time, the Take signature and encryption certificate from contact person check box is selected and the Web type is filled in.

pic_10061_2024

Picture: Take personal certificate from contact person

The certificate then needs to be filled in on the contact person of the user who handles communication with CSSA. If there are several such persons, the certificates need to be set for all persons who handle the communication.

pic_7756_2024

Picture: Setting certificates on a contact person

Web type

If the Take signature and encryption certificate from contact person check box is selected, the Web type must also be filled in. The VREP type is used for this type of communication.

If one contact person needs to have several certificates set, another WEB type needs to be created; it is advisable to create it as a copy of the VREP type (it must also have the Ignore WEB, Eshop field check box selected).

This can happen if payroll is processed within one client for several companies and the person (or persons) responsible for communication with CSSA has a different certificate registered with CSSA for each company.

Then a different web type will be filled in on each book for Electronic submission (for each company) and the contact person will have the corresponding certificate set for each web type:

pic_7758

Picture: Setting several certificates on one contact person

Automatically pick up response when filing

If selected, the submitted request is collected automatically after choosing Send submission in the Electronic submission book.

Number of attempts to pick up answer

This field specifies the number of collection attempts, which are performed at intervals defined by CSSA.

Electronic Submission Book

Individual submissions to CSSA are recorded in the Electronic submission book. Records can be created here directly from scripts related to communication with CSSA, or exported files can be inserted into this book, thereby creating a new record in the book. Each record shows its status, whether it has already been submitted to CSSA, and whether the submission was successful or contains an error.

pic_7082

Picture: Electronic submission book

Creating a record directly from a script/report

Records can be created in the Electronic submission book via scripts/reports related to communication with CSSA. To create a record, the ElectronicSubmissionBook - Book of Electronic submissions parameter must be set wherever we want to create records in the Electronic submission book.

The parameter can be set on the scripts:

The parameter can be set on the report:

Setting the parameter ensures that a new record is created in the Electronic submission book when exporting to an *.XML file.

Example:

To create a record in the Electronic submission book from the Personal record for pension insurance script (MZD_ELDP.PAS), we set the ElectronicSubmissionBook parameter, in which we enter the abbreviation of the book for Electronic submission in which we want to create the records:

pic_5184

Picture: Setting the script parameter

When generating the *.XML file from this script using CTRL+F3, the window for saving the *.XML file to disk is not displayed; instead, after the message about the number of exported files, a message about the creation of a record in the Electronic submission book is also displayed:

pic_5185

Picture: Program message

pic_5186

Picture: Program message

A new record is created in the EP book for electronic submissions; it is ready for submission to CSSA and contains the exported *.XML file:

pic_5187

Picture: EP book for electronic submissions with a newly created record

By loading an XML file

The second way to create a record in the Electronic submission book is by loading an exported *.XML file using the Load XML file function:

pic_5188

Picture: Load XML file function

After starting the function, a window for selecting the *.XML file from the storage opens, and after the file is selected, a record is created in the Electronic submission book; it contains this *.XML file and is ready for submission to CSSA.

Electronic Submission - Basic Data

Basic data contain information related to individual submissions.

pic_7760

Electronic Submission - Basic Data

Description of fields:

Document

Document No. - of the record in the Electronic submission book. The number is assigned by the program and cannot be edited.

Blank form

Identification of the CSSA form to which the submission relates.

Status

Code list of submission statuses. When a new record is created, the status is set to Ready for submission. During communication with CSSA, the program always changes the status according to the course of the communication.

Submitted by

Information about who sent this record to CSSA.

Submitted

If the submission to CSSA has already taken place, the date and time of this submission are inserted into the field.

Submission number

The Submission number field is empty until the submission to CSSA takes place. After the submission is sent, the number is filled in the field. It is a number assigned by CSSA.

Collected

After the submission is collected, the date and time of collection are written into the field. The status does not matter in this case, i.e. the date and time are saved even if the submission contains an error, because the collection of the submission itself has been performed.

DZDPN

If it is a DZDPN submission, the date range for which the query was submitted is also displayed.

pic_7765

Description

The Description field is filled in by the program in the case of the Overview of premiums - where the month of submission is inserted into the description. For the OZUSPOJ submission, the employee's name is saved in the description. For other submissions, the Description field is empty. The user can enter anything in the field.

The Messages section stores individual messages related to communication with CSSA. Messages are saved here by the program when the record is created and also during individual actions performed within communication with CSSA.

Electronic Submission - Persons

The Persons tab displays the employees and their employments that were sent within the submission. In the case of eSickNotes, the data are displayed here after the reply is collected, i.e. after the data have been loaded from CSSA.

pic_7083

Picture: Electronic submission - persons

Electronic Submission - Functions

The Electronic submission book contains the functions that handle the communication with CSSA itself. These are the functions:

These functions are always run for one record, namely the record on which the cursor is positioned. The individual functions are always available according to the status of the particular record. It is therefore not possible to send a submission again where it has already been sent and, conversely, it is not possible to collect a reply where no submission has been sent.

pic_7766

Picture: Electronic submission - functions

Procedure of Electronic Submission to CSSA

The Send submission function is available if the cursor is on a record that has not been submitted yet, i.e. on a record with an empty Submission number field. Such a record is ready for submission and the function can be run on it. After running the function, the following message should appear:

pic_5180

Picture: Program message

At the same time, the value Submission sent will be saved in the Status field of this record. The submission number assigned by CSSA will be filled in the Submission number field.

On a record where the submission has been sent, this function will no longer be available; instead, the Collect reply and Cancel submission functions become available.

After the submission is sent, it is necessary to run the Collect reply function, which provides information on whether this submission was made correctly and thus whether it was accepted by CSSA. If the Collect reply function is run too early, CSSA may not have processed the submission yet. In this case, the following message appears:

pic_5181

Picture: Program message

The value Repeat reply collection is then set in the Status field. It is therefore advisable to run this function at least one minute after the Send submission function. Processing of the submission by CSSA takes some time, which may vary according to the current situation. If the submission has already been processed by CSSA and contains no errors, the following message is displayed after running the Collect reply function:

pic_5182

Picture: Program message

The value The answer is alright will be set in the Status field.

If the submission contained an error, this error will be displayed in the message when the reply is collected and the value Answer contains an error will be set in the Status field. The message may look like this, for example:

pic_5183

Picture: Program message

If the submission is rejected because it contains an error, the data in K2 or the settings must be corrected (i.e. the error must be corrected in the source data, not in the Electronic submission book), the record in the Electronic submission book must be created again and the submission repeated.

Instead of collecting the request, the submission can be cancelled using the Cancel submission function.

Using the Load XML file function, any form supported within this submission can be loaded into the Electronic submission book.

Using the Prepare again for submission function, which is available in the change mode of a record, an already submitted record can be set to a status in which it can be submitted again. The function can be used e.g. if the certificate was originally set incorrectly or if the submitted data sentence was edited manually.

pic_7767

Picture: Prepare again for submission function - original record before running the function

pic_7768

Picture: Record after running the function - data related to the previous submission are deleted

Automatic Reply Collection

Automatic reply collection can be set in the book for electronic submissions:

pic_7078

Picture: Setting automatic reply collection

If automatic reply collection is set, a reply collection indicator showing the collection time starts after Sending the submission. Automatic reply collection can be interrupted at any time with the Interrupt button.

pic_7077

Picture: Automatic reply collection

The number of collection attempts is set in the book for electronic submissions. Collection attempts are performed at intervals defined by CSSA. If the reply is still not ready at CSSA even after the specified number of collection attempts, the collection must be performed manually later via the Collect reply function. If the collection is successful, a message about the successful collection of the reply is displayed.

pic_7079

Picture: Successful collection

Electronic Submission - Bulk Actions

The functions handling communication with CSSA can also be run as bulk actions. Within a bulk action, each request (each record) is submitted separately, so it is possible to submit different kinds of submissions - data sentences (PRPI, Overview of premiums, etc.) at once.

The bulk action can be run on records marked with an asterisk:

pic_5230

Picture: Electronic submission - bulk actions

If the selected action type is run on a record where this action can no longer be performed (it has already been performed earlier), the information will be stated in the error log.

External Documents and Documents (9th Page)

Any documents can be assigned on the Attachments tab.

pic_5189

Picture: Attachments

Book Contents

Book Index

Certificate administration

The Certificate administration function is used to manage certificates that are uploaded to K2 and stored in the secret storage (OpenBao). The function is available in the tree menu Communication - Certificate administration.

A new certificate can be imported with the Insert key or the New item button.

pic_1703819

Picture: Certificate administration

The following formats are supported:

The imported file may contain the public key, private key and certificate chain. If the private key is password-protected, we enter the corresponding password during the import.

The Default el. signature field contains the thumbprint (fingerprint) of the certificate. For electronic signing, we can select only a certificate imported including the private key, which is necessary to create a signature. Therefore, only certificates containing a private key are displayed in the selection.