Documents administration (DMS)
Documents administration covers all work with documents in IS K2. Documents can be stored on:
Documents administration offers many different functions. To make some of them available, a DMS licence must be purchased.
Functions available without a DMS licence:
- document storage on the file system or Google Drive
- division of documents by own companies
- Signi document signing function
- tracking of document history
- document folders - a maximum of 3 folders
Functions available with a DMS licence:
- Documents folders - unlimited number of folders
- Document storage on the Database server
- Shredding policy
- Document revisions
- Archiving and shredding
- Timestamps
- Documents export for accounting audit
- Processing for OCR
- Saving and loading optimized previews
DMS (Document Management System)
DMS (Document Management System) is a document management system used to organize, store, search and manage digital documents within an organization or company. The main goal of a DMS is the efficient management of documents so as to minimize the problems associated with their loss, duplication or obsolescence and to improve overall productivity and collaboration.
DMS includes a wide range of functions that are essential for the efficient operation of a company and the management of its documents. Companies generate a lot of data, and reliable document management allows them to make their overall performance in working with documents more efficient. The primary reason for this functionality is a separate database that always records any change or manipulation of a document.
The starting points of document management are:
- editing capabilities,
- setting of access permissions,
- backup,
- data protection associated with the security and sharing of various business documents,
- full-text search both across documents and within specific content.
K2 DMS allows unneeded documents to be archived or directly shredded, and documents can be published for third-party applications using K2 API.
Note: Most of the functions in this chapter relate to the database document storage, available when a DMS licence is purchased. A DMS licence is not required for the Signi document signing functions and document history tracking.
Settings
DMS settings
DMS settings (Document Management System) are used to configure the document server in the K2 system. They include the settings of the DMS database, management of the multicompany mode, OCR processing of documents and transfer of dimensions between documents and external documents.
DMS settings are available in the tree menu Documents administration (DMS) / Settings / DMS settings.
Before you start using the document server, you need to have FileStream set up on the MSSQL service. More about the settings in the chapter DMS settings_Technical documentation.
On the General tab, we set the DMS database, the multicompany mode and the paths for OCR document processing.

Picture: DMS settings - General tab
Description of fields:
Databse settings |
|
Set DMS
|
The Set DMS button is used to create the document server databases. The function is available only if FileStream is correctly set up on the MSSQL service. Pressing the button creates the necessary DMS databases.
|
Multicompany This section is used to set the way documents are assigned to individual companies in a multicompany environment. The multicompany mode in DMS can work in two modes: 1. Assigning a document to a company is mandatory
2. Assigning a document to a company is optional
|
|
Manual company assignment |
The Manual company assignment button allows you to manually assign a company to documents for which the company was not determined automatically.
|
Automatic company assignment |
The Automatic company assignment button automatically assigns an own company to all documents without a company according to the attached document. |
Company obligatory
|
The Company obligatory option determines whether assigning a document to a company is mandatory. The mandatory mode can only be set if there are no documents without a specified company.
|
OCR settings |
|
OCR export - directory path |
Specifies the path to the directory to which the DocumentOCRProcessing.pas script exports all .pdf documents intended for OCR processing (Optical Character Recognition). |
OCR import - directory path |
Specifies the path to the directory from which the DocumentOCRProcessing.pas script imports already processed, editable .pdf documents back to the original documents in DMS. |
The Dimensions tab contains the dimension transfer map between a document and an external document.

Picture: DMS settings - Dimensions tab
How it works:
- The map contains a list of data modules.
- To each module we can assign one or more external document types for which the dimensions (codes) of documents will be transferred.
- If the map is set and an external document (of the given type) is attached to a document (of the given module) or vice versa:
- The document is marked as Original
- The dimensions from the document are transferred to the external document
Note: For some warehouse or other documents where the dimensions are not stored under the standard program name, the dimensions are not transferred. The external document is only marked as Original.
- If no external document type is set in the map for the given module, the document is marked as General and the dimensions are not transferred to the external document. However, after the document is manually switched to "Original", the dimensions are transferred even if the given external document type is not set in the map for the given module. This also applies to subsequent editing.
A more detailed description of the transfer of dimensions between a document and an external document is given in the chapter Working in the Documents/Documents module.
Document configuration
The second step is the correct document configuration, with which the user will work across documents in K2. The default setting is made by the administrator, who selects the external document types the company works with according to the needs of the company and its users. Document configuration is located in the tree menu Documents administration (DMS) / Settings / Document configuration.
To work with the DMS database document storage, a new record with the Document server type must be created.

Picture: Document configuration - Document server type
Description of fields:
Abbreviation |
Abbreviation of the external document type. |
Storage |
In the list, you can select how the original file will be handled when the document is filed and how the file becomes part of IS K2. |
Type description |
Option to assign additional information to the defined type. Maximum length 250 characters. |
Classification |
For better clarity, individual external document types can be placed in a tree (folders). Folders can be defined as:
|
Priority |
Determines the display order of folders within the Classification. Display rules: Priority records (value > 0)
Same priority
Records without priority (value 0)
|
Input folder |
Presetting of the folder (directory) in which the file selection dialog will open after pressing the button in the edit field or after pressing the Selection button on the 1st page of documents. If this item is not filled in, pressing the Selection button uses the last used folder (directory). |
Dialogue extension |
Default file extension of the file dialog. |
Dialogue mask |
File type in the standard Windows file selection dialog (after pressing the Selection button on the 1st page of the document form). The individual character sequences in the text in the order [name],[extension],[name],[ extension], ... must be separated by the "vertical bar" character. Example text: Text files|*.txt|Word|*.doc|All files|*.* This sample text fills the table with three file types, namely text files (files with the "txt" extension), MS Word texts (files with the "doc" extension) and all files. If we want several file types to be listed in one line of the standard file selection dialog, we separate them with the '#' character. Example text: Text files|*.txt|Documents|*.doc#*.rtf This sample text fills the table with text files (files with the "txt" extension) and with documents (files with the "doc" and "rtf" extensions). If we select documents, files with the "doc" and "rtf" extensions will be displayed in the table at once. |
Folders |
Determines into which document folders the document is automatically placed.
|
Tags |
They make it possible to clearly label a document, for example by keywords or essential words. |
Revision file path |
Choice of the path where revisions will be saved. A path accessible to everyone who may work with the revision in progress should be set here.
|
Shredding policy |
Allows you to select a predefined shredding plan according to the shredding rules setting. |
Timestamp automatically |
If the field is checked, every document of this type is automatically stamped with a timestamp when it is created. |
Timestamp authority |
Determines which certification authority will be used for timestamping the given external document type. |
Maximum file size |
Allows you to set the maximum file size for import. |
Versioned |
If the field is checked, all revisions associated with the document are saved. |
Delete the source file after import |
If field is checked, source file will be deleted automatically after import. |
Combine pictures into single pdf automatically |
If the field is checked and several images are attached to External Documents at once, all these images are merged into one PDF. Merging applies only to images with the .png, .jpg and .jpeg extensions. |
OCR processing |
If the field is checked, all *.pdf documents of this type will be processed for OCR. |
In the list of documents, on the Service tab, there is the Import files button, which imports existing documents into the document server database.

Picture: Documents module - Function
When using the import files function, the required instructions must be followed:
- Select the types of documents to import.
- "Transfer only documents used as attachments" - You can transfer only those documents that exist in K2 as an attachment of records in documents, code lists and processes (other documents freely placed in the documents code list will not be transferred to DMS).
- "Prefer PDF" - If you have used any available OCR software to process text scans, use the prefer PDF option. If the OCR software converted the scan to a PDF of the same name, the same creation date and last access date, its PDF version is imported into DMS instead of the image with the defined extension.

Picture: Import files into database
When using the delete files function, the required instructions must be followed:
-Fill in the archive folder to which the files will be moved for backup purposes.
-Review the list of files to be deleted.

Picture: Delete imported files
The complete procedure for transferring documents from the file system to the DMS database document storage:
Perform the following steps gradually for individual document types or for several document types, depending on which processes they relate to.
1. Determine the size of the files being moved (script "FindUnusedDoc", parameter WorkMode=0).
2. Determine the actual availability of the files being moved (script "FindUnusedDoc", parameter WorkMode=1).
3. Decide what to do with unavailable documents.
Ad1.) If you do not need to track them down, continue with step 4.
Ad2.) If you want to try to track them down, determine their current location manually and/or use the "Hledání dokumentů příloh" (Search for attachment documents) script from Infoservice/For partners/Other; alternatively, perform a bulk correction of the location using the "ImportcorrectedPaths" script, which requires as input a CSV file with the identification and new location of the document:
1329;"K:\Dokumenty\K2\k2_chyba.jpg"
93112;"K:\K2\Dokumenty\Faktura prijata\V 1_2020\102019.pdf"
4. Run the Import files function.
Documents that fail to be imported now have a type with the TMP prefix, which is invalidated. Documents that were not available are invalidated. If you used the option to import only used attachments, the remaining unused, freely placed documents are not invalidated. The import can be run repeatedly; it is enough to select the newly created TMP type for the import.
Once you have imported all documents into the DMS database document storage, delete the original files using the "Delete files" function.
For the import to be successful, you will need free storage space for the K2_MANDANT_DMS database corresponding to the sum of the sizes determined in step 1. For a successful deletion with simultaneous use of archiving, you will need the same space in the storage of the archive folder.
Another important thing for DMS are the rights for revisions or for viewing itself. Rights for viewing/changing a record are set on the user role (Administrator / User roles). On the Group of records tab, the administrator defines rights groups for reading and also for changing for individual user roles.
If we assign a rights group to an External document type, the user will see the document only if one of these rights groups is assigned to their role. The same applies to changing. If a user role has a rights group for changing assigned, the user can work with revisions.
Timestamp authority
The Timestamp authority module is used to set up the authorities that the K2 system uses to create and verify timestamps. Each authority used has its own record in the module containing the data needed to communicate with the timestamp service. The module is available in the tree menu Documents administration (DMS) / Settings / Timestamp authority.
The following rights are required to manage timestamp authorities and timestamp history:
- No. 2575 - View mode of timestamp authorities
- No. 2576 - New timestamp authority
- No. 2577 - Change of timestamp authority
- No. 2578 - View timestamp history
- No. 2579 - Change timestamp history settings
An authority that is no longer to be used can be invalidated. New timestamps cannot be created using an invalidated authority or an authority with an unsuitable certificate validity.

Picture: Timestamp authority
Supported timestamps
Both non-qualified and qualified timestamps can be used in the K2 system:
- Non-qualified timestamps (e.g. freeTSA)
- Qualified timestamps (PostSignum – Czech Post) - to use qualified timestamps, a contract must be concluded with the timestamp service provider.
- PostSignum provides timestamps in accordance with the international standard RFC 3161.
- Communication takes place via the secure HTTPS protocol.
- For qualified timestamps, authorization with a name and password (Basic authentication) is currently supported.
Creating an authority from a template
A new authority is created using the New authority from template function. The following templates are available:
- FreeTSA – non-qualified authority,
- PostSignum – flat rate – qualified authority,
- PostSignum – prepaid service – qualified authority.
After a template is selected, the data needed to set up the authority are automatically pre-filled. These are mainly the description and address of the TSA service, the authentication method and the URL of the CA certificate. For qualified PostSignum authorities, a login name and password must be entered. The password is stored in encoded form. It can later be changed using the Authority password change function in the ribbon.

Picture: Timestamp authority - PostSignum
Certificate history
For each authority, the Certificate history of the authority is recorded. The history contains the individual generations of certificates with which the timestamps were actually issued. For individual certificates, the following are recorded, for example:
- serial number,
- certificate fingerprint,
- subject and issuer,
- validity period.
The signature certificate is obtained directly from the timestamp token. The history thus records the certificates with which the timestamps were actually created.
Only the CA certificate, which is used to verify the timestamp, is downloaded separately. If, when checking an existing timestamp, the system finds a generation of the signature certificate that has not yet been recorded, it obtains it from the timestamp token and automatically records it in the certificate history. In this way, previously created timestamps can also be traced and verified.
Using the timestamp authority
The timestamp authority is not set globally, but at the document type level. In the Document configuration, a different certification authority (from the TSA code list) can be selected for each type.
This makes it possible, for example, to:
- use freeTSA for internal documents
- use PostSignum for legally significant documents.
Documents folders
In the Documents folders module, we create folders into which individual documents can be placed. These folders then form a tree structure visible in the Documents code list, which allows clear organization and administration of documents.
The Documents folders book is located in the tree menu Documents administration (DMS) / Settings / Documents folders. To work with the Documents folders module, the following rights must be set: View document folders (No. 2351), New document folder (No. 2352) and Edit document folders (No. 2353).

Picture: Documents folders

Picture: Tree structure in the Documents code list
Basic data tab
This tab defines the basic data, namely the Name and the Parent folder.

Picture: Documents folders - Basic data
Documents tab
This tab displays all documents that have been placed in the given folder. Using the Insert key, further documents can be added to this tab. This method is particularly suitable for bulk insertion of a larger number of documents.

Picture: Documents folders - Documents
Individual folders can be invalidated with the F8 key. Documents placed in such a folder remain visible, but new documents can no longer be moved into the invalidated folder using Drag and Drop.
Shredding policy
If the user decides to use the automatic shredding or archiving function (described in more detail in the chapter Archiving and shredding in the Documents module), they set up the shredding policy in the tree menu Documents administration (DMS) / Settings / Shredding policy.
When defining a new shredding policy, we fill in the Abbreviation and Description fields, as well as the number of years after which the document is moved to the archive and the number of years after which the document is subsequently shredded.

Picture: Shredding policy
Working in the Documents module
The Documents module contains all documents attached to individual documents and code lists (e.g. Article).
Documents are located in the tree menu Documents administration (DMS) - Documents. A new document can also be inserted here:
- with the Insert key, or
- simply using Drag and Drop and then selecting the document type.
For documents of the DMS type, previews are created (Component for creating), which are stored in the database for faster display and subsequently loaded from it. Documents of the DMS type cannot be copied (F6 key).
Tree structure
Administration, searching and filtering of documents is made easier by the tree structure, which allows documents to be sorted into individual folders and subfolders, thus providing a clear hierarchy and easy navigation between different levels of documents. Individual folders of the tree structure are created in the Documents folders module, see the chapter Documents folders.
In the lower part of the screen, in the Folders section, all folders in which the given document is placed are displayed. This table provides a quick overview and enables efficient document administration. The table is read-only.

Picture: Documents - List tab
Tree structure functions
- Drag and Drop - Documents can be moved between nodes using Drag and Drop:
- Individually: By dragging a single document.
- In bulk: By dragging all documents marked with an asterisk.
- Copying documents between folders
- When dragging while holding down the Ctrl key, the document remains in the original folder and is also assigned to the newly selected folder.
- This copying applies only when moving between created folders (it does not apply to the <All> and <No folder> nodes).
Description of nodes in the tree structure
- <All>
- Displays all documents, regardless of their placement in folders.
- When a document is moved from the <All> node, the document is assigned to the newly selected folder, but it remains visible in the <All> node.
- <No folder>
- Contains documents that are not placed in any folder.
- When a document is moved from this node to another folder, the document is removed from the <No folder> node.
- Individual folders
- Documents can be placed in multiple folders at the same time.
- When a document is moved between two folders using Drag and Drop, the document is removed from the original folder and added to the new one.
- When dragging while holding down the Ctrl key, the document is copied (it remains in the original folder and is added to the new one).
Basic data
On the Basic data tab, all data about the document is available (it differs depending on the Document type).
This data describes the content, identifies the document by categorization data, helps in organizing, searching, sorting and administering documents without the need to open the whole document, helps link documents that, for example, belong to the same person or partner, and is a key tool for managing and organizing information in the system.

Picture: Basic data - Document server type
Description of fields:
The Category, Kind, Partner and Origin fields are based on the type of the first attached document:
Category |
Document category (incoming / outgoing / internal) |
Kind |
Kind according to the first attached document. |
Partner |
Partner according to the kind. |
Origin |
E.g. Email, Mail, Data box, Google, Not specified |
The values of the Category, Kind, Origin and Partner fields can be created and filled in using the Fill in metadata function (on the Function tab in the ribbon).
If we do not yet have any Categories created, we can create them using the Create categories Incoming, Outgoing, Internal button. The created categories are automatically entered into the following fields. After setting up the categories, it is necessary to choose which data is to be filled in. The Show map button displays a table in which the link between the Kind, Category and Origin values of the document is defined. After confirming with the OK button, the field values are filled in on all documents of the Document server type.

Picture: Fill in metadata function

Picture: Map of Category, Kind, Origin
The Status, Step and Handled by fields are linked to Workflow processes:
Status |
When the step changes, the WKF process sets the document status to the defined value using an action with the CalcVar parameter. |
Step |
Simultaneously with setting the status, the step identification is transferred to the Step field. |
Handled by |
Simultaneously with setting the status, the solver is transferred to the Handled by field. |
The procedure for linking with WKF is described in the chapter Controlling the document status from workflow.
Type |
External document type |
Company |
Specifies the own company to which the document belongs. Each document belongs to exactly one own company. When inserted, a document of the Document server type is assigned to the current own company. If we attach the document to a document (record), it is assigned to the own company of that document. If the Mandatory mode is set (in the DMS settings), the value in the field cannot be deleted. |
The values of the fields under the Codes button are transferred from the attached document if the transfer is set for the given document type on the Axes tab in the DMS settings.
Documents of the Document server type can be edited by means of revisions. We start a revision in View mode with the Create new document revision button. The document opens for editing. After making the changes, we save the document and end the revision with the Save revision button. After the revision is closed, a dialog is displayed in which we can enter a comment on the changes made.
Note: The Create new document revision action is not available if the document is included in a shredding list or is archived.

Picture: Revision comment
To be able to work with document revisions, the following rights must be assigned:
- No. 2345 – Revise documents
- No. 2376 – Create revisions for timestamped documents
- No. 2388 – Close/cancel another user's revision
Only one document revision can be open at a time.
Working with a revision opened by another user
To work with another user's revision, the user must have the right No. 2388 (Close/cancel another user's revision). In the case of cancellation, any revision of any user can be cancelled. In the case of closing, only revisions that are temporarily stored in a special physical path defined in the document configuration in the "Revision file path" field can be closed.
Working with revisions in the Document history
On the Document history tab, a record of each change made is created. If the Versioning mode is not set for the given document type (the document type does not have the "Versioned" option checked), only a record of the revision made is visible in the history. If the given document type has the Versioned, field checked, it is possible to continue working with the revisions.
"Versioning" mode enabled
All revisions made are saved in the history. When versioning is enabled, the original or any previous version of the document can be displayed at any time using the "View document" function. The function is available via the right mouse button on a record of the "Document changed" or "DMS document created" type. This function differs from the function of the same name available from the ribbon, which opens a preview of the current version of the document.
It is also possible at any time to return the document to its original state or to the state of any previous revision using the "Return to revision" function. The function is also available via the right mouse button on a record of the "Document changed" or "DMS document created" type.

Picture: Document history - "Versioning" mode
Folders, History
The upper Folders table lists all folders in which the document is currently placed. In Change mode, the document can be removed from a given folder (by deleting the folder from this table) or, conversely, placed in other folders (with the Insert key).
The Document changes history table makes it possible to track all actions that individual users have performed on the document over time. Individual actions contain information on when and which user worked with the document, attached comments on individual revisions and a preview of the state at the time of the action.
Note: A DMS licence is not required for tracking document history.
Attention: For revision actions to be saved, the "versioned" field must be checked in the document configuration. Working with revisions is described in more detail in the chapter Revise documents.

Picture: Document history
Documents
This tab lists all documents to which the document is attached. A new document can be attached via the paper clip icon.

Picture: Documents - Documents tab
A Relationship kind is specified for each document. This value determines the relationship of the document to the given document (record):
- Original document (Original): The original document on the basis of which the record in the ERP system was created (e.g. a scanned received invoice). Axes are transferred from the document (record) to the document only with this relationship kind. There can always be only one original document.
- Supporting document (Basis): A document that is not directly the "original document", but provides key information or background materials for the record in the ERP (e.g. a contract, delivery note or order that serves as the basis for an invoice out).
- Audit document (Audit): A document that is attached specifically for audit purposes or to meet regulatory requirements. These documents are necessary to verify the correctness of data and processes (e.g. a document with floating stamps).
- General attachment (General): Common attachments without a significant impact on the record (e.g. e-mail communication, article photos, or marketing materials related to the order).
- Error attachment (Error): Documents marked as erroneous, corrected by another attachment.
If a document marked as Original is already attached and we attach a new document, the original document is automatically reset to General and the new one becomes the Original.
The AxisForDocument.PAS: script is used for retroactive marking of already attached document attachments:
- It can only be run over a container or a filter of documents.
- The script goes through the attached documents, checks their settings in the map and accordingly:
- sets the Relationship kind
- transfers the axes from the document (record) to the document.
The following example shows how axis values are transferred from a sales order to a document.
1. In the DMS settings on the Axes tab, we set the document type ALL for the Sales Orders module.

Picture: DMS settings - Axes tab
2. The sales order has the axis values (codes) filled in.

Picture: Sales order
3. On the External Documents and Documents (9th Page) tab of the sales order, we attach two documents:
- a document of the ALL type
- a document of another type (e.g. DMS).

Picture: Sales order - External Documents and Documents (9th Page) tab
4. All axis values from the sales order have been transferred to the attached document of the ALL type. The axes have not been transferred to the document of the DMS type.

Picture: Document of the ALL type with transferred axes

Picture: Document of the DMS type
Digital signing of documents with Signi
Signing and approving documents is possible via the Signi service. It is necessary to have an account set up at www.signi.com and to purchase the required number of documents there. Payment is always made per document. Signi digital signatures comply with the eIDAS standard and are valid throughout the European Union.
Note: A DMS licence is not required for signing documents with Signi.
The basic principle of using Signi in K2 is as follows:
For a selected document, you can choose the handover option, which sends the document via the API to the Signi platform, where the selected Contact persons are invited by e-mail to sign it. The signing itself takes place on the Signi portal and the signed document is sent to K2. Subsequently, you can have Signi issue a protocol in which, among other things, the times and places of signatures or approvals are recorded. K2 works with a status (Signi status), which gives an at-a-glance overview of whether the document has been Sent, whether it is waiting for a signature, or whether it is already closed and thus completed.

Picture: Signi tab in Documents
The created document can be handed over for signature to selected contact persons based on a predefined template or without a template. When using the function without a template, the user must fill in the Language and the signing order, and then enter the signers. In the Signer table, one contact person with the proposer flag must be specified. It is not necessary to require a signature from every person; for example, the Approval Signature type can be used, in which case only approval in the Signi environment will be required.
After the document is handed over, the Signi status changes to "Waiting" and two new actions are available:
- Send for signature - the document is sent to the selected e-mail address,
- Sign on site - you will be immediately asked to sign in the Signi environment (web browser)
Via the link or the Sign on site action, you get to the Signi web environment, where you can view the document and then sign it at the chosen place. Before each signing, verification by a PIN code sent in an SMS message to the specified number is required. After verification, the document can be signed and the Date and Name of the municipality where the signing takes place can be entered. Using the Insert signature button, the document is saved and, if all required signatures are complete, the document is sent back to K2, where it appears as closed. If the Signi status is Closed, it is possible to download the protocol of the signing action, which is displayed as another line in the documents.

Picture: Signing in the Signi environment
In the administration section, the above-mentioned fields can be defined in a template, which you then use with the With templates function/button. This is used, for example, when the proposer is a recurring contact person (e.g. the company's managing director). When inserting a signer, you select from the list of Contact persons, choose the Signature type and the signature Place, i.e. where exactly in the document the signatures are to be required, for example at the end of the document. When using coordinates, it is necessary to enter the page number and the % placement according to the coordinates (X and Y axes). Within the template, it is also possible to set a list of permitted document types that can be sent for signature via Signi. In the Permitted document types field, they must be separated by a semicolon.

Picture: Creating and configuring a template for Signi
In the administration, it is also possible to define a so-called Workspace. This is the basic setting of Signi. Here you enter the API key, which K2 will use to communicate with Signi; you also need to select the Type of email address to which the data will be sent and your own document type that will be received back into K2. It is possible to set different document types for different statuses (Default and signed, Expired, Rejected). The Fill in statuses according to the status of the sent document check box determines whether the signed documents stored on the External Documents and Documents (9th Page) tab are given the same status as the sent document. If you use multicompany, you need to select the own company for which this setting is valid.
Timestamps
Individual documents can be provided with a timestamp, which serves as proof of the existence of the document at a specific time.
A Timestamp is used to precisely identify the moment in time when a certain event or change occurred. It is an important security element that proves that the document has not been changed since it was provided with a timestamp assigned by a timestamp authority. Timestamps are crucial for maintaining the integrity of records, auditing and tracing the history of documents.
A timestamp serves:
- as legal proof that the document has not been changed,
- for audit purposes,
- from a security point of view, as a guarantee that no unauthorized change has been made to the attached document.
Only documents of the Document server type can be timestamped. For other document types, the functions are not accessible.
To work with timestamps on documents, the following rights must be assigned:
- No. 2374 - Add timestamp to documents
- No. 2375 - Remove timestamp
- No. 2376 - Create revisions for timestamped documents
Before starting to work with timestamps, the following settings must be made.
1. Creating a timestamp authority
First, we create the authority that will be used to create and verify timestamps. We create the authority in the Timestamp authority module.
Creating and setting up the authority is described in more detail in the chapter Timestamp authority.
2. Setting the authority on the document type
Timestamps can only be used for documents of the Document server type. We set the created authority in the Document configuration for the relevant document type of the Document server kind in the Timestamp authority field. Different authorities can be set for individual document types.
If every newly created document of the given type is to be provided with a timestamp automatically, we check the "Timestamp automatically" option. In that case, filling in the Timestamp authority field is mandatory.

Picture: Document configuration - Document server type
Functions for working with timestamps can be found both in the Documents module and directly on selected documents – for example in a Sales order or an Invoice.
3 main actions are available:
- Create timestamp
- Check timestamp validity
- Delete timestamp
In the Documents module, the functions are available on the Function tab (for one specific document) and on the Bulk action tab (for all marked documents). On documents (records), the functions are available on the External Documents and Documents (9th Page) tab - Documents tab (for one specific attached document).

Picture: Documents - functions for creating, checking and deleting a timestamp

Picture: Invoice out - functions for creating and checking a timestamp
Create timestamp
The "Create timestamp" function stamps the given document, thereby guaranteeing that the document has not been changed from this moment on.
Check timestamp validity
The "Check timestamp validity" function verifies the validity of the certificate for issuing timestamps and verifies that the given document has not changed. If the stamp is invalid, the timestamp icon
changes to
.
The timestamp validity check can be run as a scheduled task - the CheckTimeStamps.pas script. The script goes through and checks only stamps with a date older than 1 week. We recommend running the task once a week.
Delete timestamp
The "Delete timestamp" function removes the timestamp from the document and writes this change to the document history. A stamp can only be deleted within 7 days of its creation.
Document history
The creation of a timestamp is recorded in the document history. If an authorized change is made to the document (e.g. by means of a revision), the original document together with its timestamp is saved to the history and the changed document is assigned a new stamp in order to preserve the audit trail.
Note: To revise a document provided with a timestamp, the right No. 2376 - Create revisions for timestamped documents is required.

Alerts
Alerts can be used to warn that:
- certificates are about to expire,
- there are documents that have an invalid stamp.
Archiving and shredding in the Documents module
Archiving and shredding are used to manage the life cycle of documents according to the rules defined in shredding policies.
Archiving marks the document as archived. The document is physically moved to the archive database (DMS_ARCHIVE), where it remains stored. An archived document can no longer be revised. If necessary, the document can be made accessible again using the Undo the archiving function.
Shredding represents the permanent removal of a document from the records. It is carried out by means of a shredding list, which contains the documents intended for shredding. After the shredding list is approved and shredding is subsequently performed, the documents are marked as shredded and then deleted from the database.
Note: Archiving and unarchiving documents require the right 2346 – Archive documents or 2347 – Undo the archiving of documents, respectively.

Picture: Documents – Bulk actions
The Archiving, Undo the archiving and Shredding functions are available on the Bulk actions tab. Only documents in the Closed revision status can be archived or shredded. We can work with documents individually or in bulk. In addition to manual marking, automatic functions can also be used to select documents for archiving or shredding:
- Automatic archiving - runs a predefined filter that selects documents intended for archiving. The selection includes documents with an assigned shredding policy whose archiving period has expired and which have not yet been archived.
- Automatic shredding - runs a predefined filter that selects documents intended for shredding. The selection includes documents with an assigned shredding policy whose shredding period has expired and which are not yet included in any shredding list.
After running the automatic function, we check the filter results and adjust the selection of documents as needed.
- We then archive the selected documents using the Archiving button.
- Using the Shredding button, we create a shredding list containing the selected documents. In the form, we fill in the abbreviation and description of the shredding list and save the record.

Picture: Shredding list
The Shredding list serves as the basis for the approval and subsequent shredding of documents.
In the tree menu Documents administration (DMS) - Shredding list, we open an overview of shredding lists. Here we can create new shredding lists or work with existing ones.
Before shredding, we must approve the shredding list. Approval is performed with the Approve function on the Function tab. Only approved shredding lists can be shredded.

Picture: Shredding list
Processing for OCR
OCR (Optical Character Recognition) is used to recognize text in scanned documents or images and convert it into an editable and searchable form. The result is a PDF supplemented with a so-called OCR layer, so that the document can be searched, text can be copied or used for further automation.
How OCR processing works
- Using the scheduled task Other / Process documents for OCR, we export the required PDF files to a folder that serves as input for the OCR process.
- The OCR process takes the files from the input folder, adds the OCR layer and saves them to the output folder.
- The scheduled task Process documents for OCR takes the processed PDF files with the OCR layer from the folder that serves as the OCR output and replaces the original files with them.
The task processes only PDF documents that:
- have the document type "Document server",
- have the "Process for OCR", option checked in the document type configuration,
- have not yet been exported for OCR, i.e. are not marked as "IsExportedForOCR".
To prevent the input folder from being overfilled with too many PDF files, a Limit for the number of exported documents can be set in the scheduled task.

Picture: Scheduled task Process documents for OCR - Setting the limit for the number of exported documents
Settings in K2:
1. Setting in the document type
In the configuration of the "Document server" document type, the "Process for OCR" option is available. If it is checked, documents of this type will be included in the OCR process.
2. Directories for OCR processing
In the DMS settings, the following fields must be filled in:
- Directory path for OCR export (serves as input for the OCR process) - PDF documents intended for OCR processing are exported to this folder.
- Directory path for OCR import (serves as output of the OCR process) - PDF files with the OCR layer are imported from this folder and replace (or are added to) the original PDFs with the scan.
Note: Exported PDFs are saved under the name id+.pdf (e.g. 158.pdf). OCR outputs intended for import must have the same name so that the system pairs them correctly.
3. Scheduled task for processing
Both OCR export and import are performed using the scheduled task Other / Process documents for OCR.
The task performs:
- export of the relevant PDFs to the OCR input folder,
- import of the processed PDFs from the OCR output folder back to K2 - it adds them or replaces the original PDF files with them.
Note: After the export/import is finished, information about the number of successfully processed documents is displayed in the history detail of the scheduled task record.
After processing, documents are marked with flags (also visible in the columns):
- IsExportedForOCR – True if the document has been exported for OCR
- IsImportedFromOCR – True if the document has been imported back after OCR
4. Document changes history
Both OCR export and import are written to the document history.
- If document versioning is enabled or the document is provided with a timestamp, the original version without OCR is also preserved in the history during import.
- If versioning is not enabled and the document is not provided with a timestamp, the document is simply overwritten and the original version will no longer be available.

Picture: Processing for OCR - Document history
My documents
The functionality of the My documents module is the same as that of the Documents module, but it contains a filter that restricts the display to the documents of the given user only. It displays only documents for which the user is listed as the author (the value in the AuthorId field corresponds to the contact person of the logged-in user).
To work in this module, the following rights must be assigned:
- No. 2354 – View the My documents code list
- No. 2355 – Change the My documents code list
- No. 2356 – New record of the My documents code list
Case files
The Case files module is used to keep records of documents that are not directly linked to other documents in the K2 system (invoices, sales orders, contracts, etc.). One case file groups a list of documents that are related to each other. It enables the administration and organization of these documents within individual case files. Typical use cases are, for example, contracts, correspondence with courts, project documentation and other materials that need to be kept and recorded outside the main agenda of the K2 system.
Case files are located in the tree menu Documents administration (DMS) - Case files. To work in this module, the following rights must be assigned:
- No. 2371 - View case files
- No. 2372 - Edit case files
- No. 2373 - New case file

Picture: Case files module
Case files can be sorted into different books (Books of documents) and linked to workflow processes.
Items tab
The Items tab provides simplified and quick access to the most frequently attached types of attachments in a case file, namely Documents (files) and Documents (records). Functionally, it is a simplified variant of the External Documents and Documents (9th Page) tab.
The link between a case file and the attached items (documents) is bidirectional:
- attached documents (files and records) can be displayed from the case file,
- on documents (e.g. an invoice), it is possible to display the case files in which they are included.
In addition to the general "paper clip" function (lookup into all modules), the Items tab also enables direct attachment of selected record types using commands
.
These commands:
- speed up the work of attaching items,
- can be configured and adjusted as needed,
- can refer to any modules of the system.

Picture: Case files - link to the invoice out

Picture: Invoice out - link to the Case file
Documents export for accounting audit
The export is used for bulk creation of PDF files (corresponding to documents) that contain stamp-type annotations showing data from related documents.
The export is implemented by the CreateStampAnnotation.PAS script. It can be used on the Invoice out/in and Other liabilities/receivables documents. For each module, the display of stamps can be configured from the following selection:
- identification stamp
- contract stamp
- payments stamp
- posting stamp
- VAT stamp
- timestamp stamp.

Picture: Exported Invoice out
The script allows you to define an output folder for the exported PDF files. If the Invoice out or Other receivable does not contain a PDF file on the External Documents and Documents (9th Page) tab, the export creates it and attaches it to the attachments with the type specified in the DMS_Type parameter.
Controlling the document status from workflow
Procedure for controlling the document status from workflow:
1. Add an input action of the CalcVar. type to the required step.

Picture: Step - "Input" action

Picture: Action
2. Create a query for the product using the FIRST function, the DOKUMENT product and the StatusId field

Picture: Create query
3. Set the StatusId field to the required value

It is advisable to set up the work with the status reciprocally, i.e., for example, not only the input action of the approval step to the "approved" status, but also the input action of the previous step to the "for approval" status, so that not only the approval of the step but also the rejection works correctly.
Together with setting the status, the current solver and step are automatically taken over into the document.
Other document administration storages
When working with documents in IS K2, other storages can be used in addition to the database storage:
- file system
- Google Drive.
Storage - file system
Described in more detail in the chapter External Documents and Documents (9th Page) - Linkage and links.
Storage - Google Drive
Documents administration enables linkage with the Google Drive service. Files are stored on Google Drive; only links are kept in IS K2. When an attachment is inserted, the file is uploaded to Google Drive. An already existing file on Google Drive can also be used as an attachment.
Setting up the connection to Google Drive
The procedure for setting up the linkage to Google Drive is given in the chapter Setting up the linkage to Google Drive_Technical documentation.
Document configuration
Furthermore, in the Document configuration book (Documents administration (DMS) / Settings / Document configuration), it is necessary to create a new document type with the Google Workspace type.

Picture: Document configuration - Google Workspace type
Description of fields:
Abbreviation |
Abbreviation of the external document type. |
Type |
In the selection, you can choose how the original file will be handled when the document is filed and how the file will become part of IS K2. When using Google Drive, the Google Workspace type must be selected. |
Hide in menu |
Allows you to hide the document type in the offer. |
Type description |
Option to assign further information to the defined type. |
Folder |
Document types will be sorted into folders. |
Input folder |
Presetting of the folder (directory) in which the file selection dialog will open after pressing the button in the edit field or after pressing the Selection button on the 1st page of documents. If this item is not filled in, pressing the Selection button opens the last used folder (directory). |
Target folder |
The identifier of the folder on Google Drive must be entered in this field. |
Maximum file size |
Allows you to set the maximum file size for import. |
Working with documents on Google Drive
Adding a new document
A new document of the Google Workspace type can be inserted on the External Documents and Documents (9th Page) page by pressing the
button and selecting the given type, or by dragging the document into the Documents section and then selecting the document type. After the attachment is inserted, the file is uploaded to Google Drive; only links will be kept in IS K2.

Picture: Opened offer of document types - sorted into folders
Connecting an existing document
An already existing file stored on Google Drive can also be used as an attachment. Using the Ctrl+C keys, we copy an already existing document from Google Drive and using the Ctrl+Shift+V keys we paste it onto the External Documents and Documents (9th Page) page in IS K2.

Picture: Inserting an existing document Ctrl+Shift+V
Document viewed/opened
We open the document in the usual way. The document opens in Google Drive.
Searching on Google Drive
Google Drive offers full-text search, which allows users to effectively search not only the names of files and folders, but also the content of these files. This function is very useful because it allows you to quickly find the information you need without having to browse through individual files manually.
Simply enter the search term in the search field on Google Drive. The results can be displayed by relevance, or you can refine the search using the mentioned filters and operators.