Book Contents

Book Index

Administrator

Book Contents

Book Index

Switch table state

Process number:

Script ID number:

File: POM_TABCYKL.PAS

Script description: Switches the table filter status as follows: Book->Fast filter->Filter on->Filter off. It also works with the mouse.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Drop SQL

Process number:

Script ID number:

File: DROPSQL.PAS

Script description: Executes the "DROP TABLE" command in SQL on the table whose name is given in the "Naz" script parameter. "SCR_" is added before "Naz".

Address in the tree:

Script parameters:

Naz - _FDPH_EU

Table name.

Book Contents

Book Index

Export of the current data module

Process number:

Script ID number:

File: AKTDM_EX.PAS

Script description: Opens Excel and, after the field names are entered in the first row of the workbook, exports data from the current DM (only the specified fields).

Address in the tree:

Script parameters:

Pole - Me

List of "prog name" columns (including links with ;) separated by the Delimiter. If the field is empty, EXCEL opens, where the user enters the field names into the columns of the 1st row.

Delimiter - |

Fields separator (something other than ;, which separates a link).

FiltrPole

Exports the items where the expression "FiltrPole FiltrFce FiltrHodn" = "Yes".

FiltrHodn

The value the field is compared with.

FiltrFce - =

Filter function.

Visible - No

Yes - displays Excel; No - does not display it.

Book Contents

Book Index

Export data to Excel

Process number:

Script ID number:

File: EXPORTTOEXCEL.PAS

Script description: Simulates the Export to Excel icon that is available in the books of a data module. The grid on which the cursor is placed is exported.

Address in the tree:

Script parameters:

ReportTitle

Title in Excel.

Book Contents

Book Index

Bulk change

Process number:

Script ID number:

File: PRCOMP_BulkChange.PAS

Script description: The script allows a bulk change of the selected data field. The field must be selected on the script form. The required field value is then selected in the Value(s) field. The script can be used for any data module.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Keycodes

Process number:

Script ID number:

File: KEY_CODE.PAS

Script description: A dialog that responds to a key press and displays the key code.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Conversion

Process number:

Script ID number:

File: KONVERZE.PAS

Script description: Import of the balance of invoices in and invoices out and of stock levels from Excel.

Address in the tree:

Script parameters:

ZobrazovatUpozorneni - No

No - only error messages appear in the message list; Yes - warnings also appear in the list.

In the Excel file from which the import is performed, the values for import must start on the second row.

Conversion of invoice balance: On the first row, we mark the key by which customers / suppliers will be identified (Comp. Reg. No., Abbr 1 or Abbreviation 2). In the left part of the input form, we assign Excel columns to the K2 field names. In the lower right part, we enter the Book into which the invoices will be imported and the values of other fields that are mandatory on the invoice. The conversion is performed by pressing the Conversion of invoices out balance button, or the Conversion of invoices in balance button respectively.

Linked Graphics K2_SKRIPT

Picture: Form for conversion of invoices out balance

Stock levels conversion: On the first row, we mark the key by which the article cards will be identified (Abbr 1 or Abbreviation 2). We assign Excel columns to the K2 field names. The quantity must be given in the base unit of measure; the stock price is given per unit. We enter the Book in which the receipt card will be created, the warehouse, the company and the values of other fields that are mandatory on the receipt card. The conversion is performed by pressing the Stock levels conversion button.

Linked Graphics K2_SKRIPT

Picture: Stock levels conversion form

Book Contents

Book Index

Conversion of notes to comments

Process number:

Script ID number: SCIS145

File: CONVERTNOTESTOCOMM.PAS

Script description: Over the current record (container of records), the script converts notes or supplements of the given type to comments of the given type. The script can be run over a book that has notes and comments. The types of notes/supplements and comments are determined by the script parameters.

The script is primarily intended for note types with the "form" Description of 80 characters and for supplements. In the case of supplements, it also converts any language translations. For other note types, it displays a warning.

Address in the tree:

Script parameters:

TypeOfComm -

Creates a comment of the specified type from the note/supplement.

TypeOfNote -

Type of note/supplement to be converted.

Book Contents

Book Index

Advance deduction correction

Process number:

Script ID number:

File: AdvancesDeductionCorrection.PAS

Script description: The script performs the final deduction of an advance (the advance is deducted on itself).

Address in the tree:

Script parameters:

DateOfDeduction - 00.00.0000

Date of deduction. If not specified, the deduction is made as of the current date.

Book Contents

Book Index

Import of code lists for state administration

Process number:

Script ID number: FSPR034

File: ImportStateAdminCode.PAS

Script description: The script imports records from the Code1.csv file (Main/economic activity) into the Code 1 code list, records from the Code2.csv file (Categories of increases/decreases for PAP) into the Code 2 code list and records from the Code4.csv file (codes for the PPaV statement) into the Code 4 code list.

Address in the tree:

Script parameters:

ImportCode1 - Yes

Yes - records are imported into the Code1 code list; No - the code list is not imported.

ImportCode2 - Yes

Yes - records are imported into the Code2 code list; No - the code list is not imported.

ImportCode4 - Yes

Yes - records are imported into the Code4 code list; No - the code list is not imported.

Book Contents

Book Index

Import of documents from FTP

Explanation of the content of the tables at the beginning of each chapter identifying each script.

Process number: SPR006

Script ID No.: FSSPR029

File: FTPDOCImport.pas

Script description: The script allows downloading files of a defined type from FTP or from a defined directory and checking it regularly.

Address in the tree:

Script parameters:

InputPath

Input directory for loading files; when downloading from FTP, the documents are downloaded to this directory

ArchivePath

Name of the folder for writing data

ErrorPath

Name of the folder for writing erroneous data

LogFilePath

Name of the folder for writing the LogFile

FileExtensions - jpg;jpeg;png

Extensions of imported files

DocType - 34

External document type

FTPServer

FTP - server address

FTPPort - 21

FTP - server port

FTPUserName

FTP - user name

FTPPassword

FTP - password

FTPDirectory

FTP - subdirectory of the FTP server

Book Contents

Book Index

Monitoring of notifications, the task scheduler and the application server

Process number: SPR006

Script ID No.: FSSPR033

File: ASmonitoring.pas

A script that allows monitoring the operation of the application server, notifications and the task scheduler.

Address in the tree:

Script parameters:

DisplayMethodLog

Method of displaying the log - 0 - message (default value), 1 - saving to a file, 2 - sending an email

OutputName

Path + file name

EmailAdress

email address

ReportOnlyErrors

Report errors only

Book Contents

Book Index

Setting of additional rights

Process number:

Script ID number:

File: RightsSetting.PAS

Script description: Using the Setting of additional rights script, we can define so-called additional rights for users or roles, which control the authorization to create (save) and confirm documents in specific document books and to create and confirm stock documents for individual warehouses. Besides authorizations for individual users / roles, the script also handles the permission to create documents for a combination of document book - warehouses.

 

In general, the script can be run over any data module. In this case, all users are loaded automatically. This can be a time-consuming operation, so for setting user authorizations we recommend running the script over the Users module with a prepared filter (selection) of the users the settings currently concern. For setting authorizations via user roles, we run the script over the User roles module.

 

User - Books: Here we define authorizations for users / roles to save documents in individual document books, for the Sale, Purchase, Warehouse, Production, Cash register and Bank modules.

 

User - Warehouses: Here we define authorizations for users / roles to save and confirm stock documents for individual warehouses. Before the abbreviation of each warehouse in the columns, either the letter "V" or "P" appears. In the column with the letter "V", we set the authorization to "issue" a document; in the column with the letter "P", we set the authorization to "confirm" a document. We set authorizations for Release Notes, Receipt cards, Transfer notes and Job Cards. For release notes and receipt cards, the first and second confirmation can be permitted separately; for transfer notes, it can be set separately whether the authorization applies to the issuing or receiving warehouse. For transfer notes, authorization can also be set only for internal transfer notes within one warehouse.

Note: The general setting of the confirmation authorization for release notes and receipt cards takes precedence over the detailed setting for the 1st and 2nd confirmation. For transfer notes too, the general setting takes precedence over the detailed setting for the FROM / TO warehouse.

 

Books - Warehouses: Here we set, regardless of the user, the permission to issue documents in individual document books in combination with a warehouse. The setting applies to documents in the Sale, Purchase, Warehouse and Production areas.

 

 

Authorizations are set by double-clicking in individual cells, or in bulk using the buttons in the ribbon on the Right settings tab. In the All section for absolutely all combinations, in the Module section for the currently displayed table, in the Row section for the row with the current cursor and in the Column section for the column in which a cell is marked. The settings of one row - always within the whole module - can also be transferred to another row by copying. The Copy and Insert commands are in the ribbon on the Copying tab.

 

The evaluation itself takes place when documents are saved and confirmed, using separate scripts that must first be registered. We do this in any registration script by calling the RIK2_STD_Regs procedure from the "RIK2_Register.pas" unit - see the picture below. Instead of calling the whole RIK2_STD_Regs procedure, which registers all the individual scripts for evaluating the authorization settings in individual areas, scripts for selected areas can be registered separately.

Payroll payables must be registered as follows: RiK2_Register.RIK2_STD_RegDM(numfield.cD_PrLiability).

 

Once the individual evaluation scripts are registered, the authorization settings are checked when documents are saved and confirmed. By default, all combinations of authorizations are not permitted. We permit the required combinations in the form of the Setting of additional rights script.

Address in the tree:

Script parameters:

LoadBooksStocks - Yes

Load the settings for the Books-Warehouses area. By not loading this area, the start of the script can be accelerated when we want to set rights only for the Users-Books or Users-Warehouses combinations (e.g. when a new employee is hired).

LoadUsersBooks - Yes

Load the settings for the Users-Books area.

LoadUsersStocks - Yes

Load the settings for the Users-Warehouses area.

Linked Graphics K2_SKRIPT

Picture: Registration of the script for setting additional rights

Book Contents

Book Index

Parameter settings for the Check of VAT posting

Process number:

Script ID number: FUCT096

File: CHECKVAT_SetUserParams.PAS

Script description: The script is run by the Schedule button in the Check of VAT posting function. It sets the posting check into a scheduled task.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Parameter settings for the Check of asset posting

Process number:

Script ID number: FUCT097

File: CHECKASSET_SetUserParams.PAS

Script description: The script is run by the Schedule button in the Check of asset posting function. It sets the posting check into a scheduled task.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Parameter settings for the Check of posting of receivables, liabilities and payments

Process number:

Script ID number: FUCT098

File: CHECKRELATIONSPAYMENTS_SetUserParams.PAS

Script description: The script is run by the Schedule button in the Check of posting of receivables, liabilities and payments function. It sets the posting check into a scheduled task.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Parameter settings for the Check of posting of stocks

Process number:

Script ID number: FUCT099

File: CHECKSTOCKS_SetUserParams.PAS

Script description: The script is run by the Schedule button in the Check of posting of stocks function. It sets the posting check into a scheduled task.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

New supplement - additional article name

Process number:

Script ID number:

File: DODATEK.PAS

Script description: A dialog for adding the text of a new supplement. It numbers automatically in the format \xxxxxxxxx.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Mark unmatched BPR items as matched

Process number:

Script ID number:

File: BPR_CorrItems.PAS

Script description: A script for marking unmatched items of selected bank orders as matched. These items are then not offered for matching on the bank statement.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

RF Evaluation of rights + New, Change

Process number:

Script ID number:

File: RIK2_RF_ZN.PAS

Script description: The script checks whether the currently logged in user has the rights for a new document or a change for the given document book. If the rights are set (e.g. by the "Setting of additional rights" script), the script runs without problems; if the rights are not set, the script reports an error ("RDSHlas").

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

RF Evaluation of rights + Undo the confirmation

Process number:

Script ID number:

File: RIK2_RF_ODPO.PAS

Script description: The script checks whether the currently logged in user has the rights to undo the confirmation of a document for the given document book. If the rights are set (e.g. by the "Setting of additional rights" script), the script runs without problems; if the rights are not set, the script reports an error ("RDSHlas").

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

RF Evaluation of rights + Confirmation

Process number:

Script ID number:

File: RIK2_RF_PO.PAS

Script description: The script checks whether the currently logged in user has the rights to confirm a document for the given document book. If the rights are set (e.g. by the "Setting of additional rights" script), the script runs without problems; if the rights are not set, the script reports an error ("RDSHlas").

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Closing of SAD bonded warehouse

Process number:

Script ID number: FSPR016

File: TUzavJCD

Script description: Releases goods from the customs warehouse and creates a realization document according to the settings in the SAD parameters.

Address in the tree: [Administrator][Recalculation]

Script parameters:

Interaktiv - No

Yes - does not display the form; No - displays it.

OldErr - No

Yes - the most recently used file is used; No - a new file is always created.

Book Contents

Book Index

Insert a supplement into the document

Process number:

Script ID number:

File: DODDOKL.PAS

Script description: A dialog for adding the text of a new supplement to a document. It numbers automatically in the format \xxxxxxxxx.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Insert external document

Process number:

Script ID number:

File: ADM_DOC.PAS

Script description: Adds a document to the 9th page of the current data module.

Address in the tree:

Script parameters:

AllowChangeFilename - No

Yes - allows manually changing the file name before attaching it to K2.

AlwaysUniqueAbbr - No

Yes - always creates a unique document abbreviation.

Directory

Directory in which the documents are stored.

TypeDoc

Type of the document added by this script.

Book Contents

Book Index

Search for unused fragments

Process number:

Script ID number:

File: FragmentsFindNotUsed.PAS

Script description: The script goes through the individual fragment records and finds all that are not used.
Unused fragments will be marked (with an asterisk). These marked records will be displayed in the currently open fragments DM over which the script was run.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Find document item

Process number:

Script ID number:

File: VYHLPOLDOK.PAS

Script description: Places the cursor on the 1st item that starts with the required string (it searches either from the current position or from the 1st item).

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Creating a customer filter from purchase/sales documents

Process number:

Script ID number:

File: GENFBNP.PAS

Script description: From the document(s) of the current DM, it adds customers to the filter on the customer book (a cross filter is also possible).

Address in the tree:

Script parameters:

Vyprazdnit - Yes

Book Contents

Book Index

Creating an article filter from purchase/sales documents

Process number:

Script ID number:

File: GENFZNP.PAS

Script description: From the document(s) of the current DM, it adds articles to the filter on the article book (a cross filter is also possible).

Address in the tree:

Script parameters:

Vyprazdnit - Yes

Book Contents

Book Index

Create batches in document items

Process number: SPR003

Script ID number: FSAR001

File: ZBO_SAR2.PAS

Script description: Goes through the document items and creates a batch for them.

Address in the tree:

Script parameters:

No parameters.

 

Book Contents

Book Index

Creating full-text indexes

Process number: SPR001

Script ID number: FSPR030

File: CreateFullTextIndexes.PAS

Script description: The script creates full-text indexes in standard tables according to the manufacturer's definition. The definition of the full-text indexes will be saved to the TableMod.xml file for the current client, and the indexes will be created in the database on the SQL server at the same time.

If K2 is extended using projects in the Object designer and Table extensions = "Object designer" is set, TableMod.xml files are no longer used. In this case, the Object designer creates a global tables.extension.xml file with indexes for all clients. First, however, you need to specify the file to which the script will write the index definition. Typically, the user should select the source xml file of one of the extension projects. After the script is started, the file can be selected from disk, or entered including the full valid path in the "FilenameExtensionFulltext" parameter.

Address in the tree:

Script parameters:

FilenameExtensionFulltext - ' '

Path to the file to which the definition of full-text indexes will be written.

Book Contents

Book Index

Database back-up

Process number:

Script ID number:

File: BACKUP.PAS

Script description: The program is intended for backing up the selected database on the SQL server. A "Trusted connection" to the "SQL server" is used. The logged-in "Windows" user must have "SQL Administrator" rights.

Address in the tree:

Script parameters:

BackupDevice - K2BackupDevice

Device name for the back-up.

BackupFileName - C:\Program Files\Microsoft SQL Server\MSSQL\BACKUP\K2BackupDevice.bak

File name for the back-up.

DatabaseName - K2

Name of the SQL database to back up.

Book Contents

Book Index

Change of file path

Process number:

Script ID number: FSPR031

File: CHANCEFILEPATH.PAS

Script description: Change of file path, transferring the selected document type from the existing storage to a new storage. Before running the script, you need to fill in a form where the existing path is defined in the What field, the new path in the With field, and the document type required for the transfer is selected in the Type field.

Address in the tree:

Script parameters:

DatabaseName -

Database name; if the parameter is left empty, the script works in the current database.

Book Contents

Book Index

Change of the batch flag "Do not insert price into batch"

Process number: SPR003

Script ID number: FSAR002

File: ZBO_SAR4.PAS

Script description: Switches on and off the option of inserting the stock price into batches.

Address in the tree:

Script parameters:

Zapni - No

Yes - the flag is switched on.

Vypni - No

Yes - the flag is switched off.

VFiltr - No

Yes - the script runs over the large filter.

Book Contents

Book Index

Change of the batch flag "Negative stock level allowed"

Process number: SPR003

Script ID number: FSAR003

File: ZBO_SAR3.PAS

Script description: Allows a negative stock level on articles.

Address in the tree:

Script parameters:

Zapni - No

Yes - the flag is switched on.

Vypni - No

Yes - the flag is switched off.

VFiltr - No

Yes - the script runs over the large filter.

Book Contents

Book Index

Display image in TXImage

Process number:

Script ID number:

File: SHOWPICTURE.PAS

Script description: Displays a picture from the 9th page. It searches for an inserted document of the "PICTK2" type. At the first occurrence, it tries to display the document.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Password expiration notifier

Process number:

Script ID number:

File: PasswordExpirationNotifier.pas

Script description: The script checks the approaching expiration of K2 users' passwords and sends users a warning email. For a daily check of password expiration, it is advisable to include the script in the Task scheduler.

Address in the tree:

Script parameters:

DaysBeforeExpiration - 0

How many days before the password expiration the user is to be sent the first warning. The last warning is sent to the user on the day of expiration.

TakeMailFromContactPerson - No

Where the user's email address is taken from. Yes: from the linked contact person. No: from the user card.

MailTypeFromContactPerson - ' '

Type of email address from which the email of the contact person is to be taken. The parameter is relevant only if the "TakeMailFromContactPerson " parameter = Yes.