Book Contents

Book Index

Purchase / Supply

Book Contents

Book Index

EDI - Import settings

Process number: ZAS019

Script ID number: FZAS025

File: DocImpEdiSettings.pas

Script description: Script for configuring the import of EDI invoices in.

Address in the tree:

Script parameters:

ConfigFileName

If the user does not want to save the import settings to the database, they can save them to a "*.XML" file. The path, including the name of the file, is entered in this parameter.

The basic aspects of the EDI invoice import are set and configured using the EDI Import settings script. After the script is run, a set of configuration forms is displayed. Here we define the Document type, i.e. what kind of document we import into IS K2, the directory structure of the "*.XML" files the function works with, and some header data. The individual document types that can be imported by the function are already filled in after the script is run.

A detailed description of the controls is given in the User guide in the EDI - import settings chapter.

Book Contents

Book Index

EDI - Selection of invoices for import

Process number: ZAS019

Script ID number: FZAS026

File: DocImpEdiInvSel.pas

Script description: Script for selecting documents for import.

Address in the tree:

Script parameters:

MakeImport - No

Yes - after the documents are selected, the import of documents into IS K2 starts automatically.

Once the import and directory structure have been set, we can select specific invoices for import. These documents are selected in the form of the Selection of invoices for import script. This function can be run by only one user within one client. After the script is run, all documents from the default directory for Source files are loaded into the form. These are EDI invoices in (INVOIC messages) that we want to import into IS K2.

pic_3445

Picture: Form for selecting invoices for processing

The invoices we want to import must be marked with asterisks. Marking is done using the standard keyboard shortcuts Ctrl+Space or Shift+Enter, or using the icons in the top bar of the form.

When the selection of records is complete, we press Enter to confirm. The function then asks whether to import the files. After the query is confirmed, the "*.XML" file (INVOIC message) is moved from the directory for Source files to the directory for the Archive of source files. This step also creates a new "*.XML" file in the directory for Working files. Together with these steps, a record is created in the Import documents book.

The selection of invoices for import into IS K2 can also be performed automatically after setting the Automatically load files flag, which can be found in the import settings.

Book Contents

Book Index

K2I - Import settings

Process number: ZAS019

Script ID number: FZAS028

File: DocImpK2iSettings.pas

Script description: Script for configuring the import of invoices in in the K2I format.

Address in the tree:

Script parameters:

ConfigFileName

If the user does not want to save the import settings to the database, they can save them to a "*.XML" file. The path, including the name of the file, is entered in this parameter.

The basic aspects of the K2I invoice import are set and configured using the K2I import settings script. After the script is run, a set of configuration forms is displayed. Here we define, for example, the directory structure of the "*.XML" files the function works with, some invoice header data, the source viewer, or the behaviour of the function when the parent document or invoice item does not exist.

The set of tabs and forms for the K2I invoice import settings is completely identical to the configuration for EDI invoices. A detailed description of the controls is given in the User guide in the EDI - import settings chapter.

Book Contents

Book Index

K2I - Selection of invoices for import

Process number: ZAS019

Script ID number: FZAS029

File: DocImpK2iInvSel.pas

Script description: Script for selecting documents for import.

Address in the tree:

Script parameters:

MakeImport - No

Yes - after the documents are selected, the import of documents into IS K2 starts automatically.

After setting up the K2I invoice import, in the next step we can select specific documents for import into IS K2. The K2I - selection of invoices for import function is used for this. After this function is run, a form is displayed into which all documents from the default directory for Source files are loaded. These are K2I invoices in that we want to import into IS K2.

pic_3683

Picture: Form for selecting invoices for processing

The invoices we want to import must be marked with asterisks. This marking can be adjusted using the standard asterisk icons or the Shift+Enter key combination. Only records marked in this way are always assigned for import.

Using the Enter key, we select the marked records for import. The function then asks whether to import the files. After the query is confirmed, the "*.XML" file (message in the K2I format) is moved from the directory for Source files to the directory for the Archive of source files. This step also creates a new "*.XML" file in the directory for Working files.

The selection of invoices for import into IS K2 can also be performed automatically after setting the Automatically load files flag, which can be found in the import settings.

Book Contents

Book Index

Import documents

Process number: ZAS019

Script ID number: FZAS027

File: DocImp.pas

Script description: Script for the final import of invoices in into IS K2.

Address in the tree:

Script parameters:

No parameters

 

This script is the third step in processing invoices in in the EDI or K2I format. It is the actual import of these documents into IS K2, or the correction of some errors found during processing. After this script is run, all documents from the directory for Working files are always loaded. These are the documents selected for import in the previous step (EDI - selection of invoices for import, K2I - selection of invoices for import).

A detailed description of the controls is given in the User guide in the Import documents chapter.

Book Contents

Book Index

Bulk changes of items

Process number:

Script ID number: FZAK010

File: NAKPRO_BulkMod.pas

Script description: Script for handling bulk changes of purchase/sales document items in K2 - it is not run separately, it is called by the program.

Address in the tree:

Script parameters:

No parameters.

 

The script is called by the program when values on page 1 of purchase/sales documents are changed, or by the user by pressing the Change button on page 2 of the documents. A detailed description of the controls and functionality is given in the User guide in the chapters Shared Purchase and Sale Elements / Basic data (page 1) - SPNaP and Shared Purchase and Sale Elements / Items of purchase and sale (page 2).

Script parameterization

If we save the form settings with the Save settings button (when run from page 2 of the document), these settings are saved in the user directory to the file "TerDelParamNak2.csv" (for purchase) or "TerDelParamPro2.csv" (for sale).

If we select the Next time do not display the form option in the form (when the form is invoked on page 1 of the document), this setting is saved in the user directory to the file "TerDelParamNak1.csv" (for purchase) or "TerDelParamPro1.csv" (for sale). By adding other parameters (see the parameter file for the form on page 2 of the documents) to these files and by a special modification of the script, it is possible to achieve the behaviour that after the values on page 1 of the documents are changed, these values are not updated in the items (the corresponding options in the form will not be activated).

Book Contents

Book Index

Bulk changes of Purchase book settings

Process number: SPR006

Script ID number: FSPR032

File:PurchaseBooksBulkChange.pas

Script description:

The script allows you to change the settings of purchase books in bulk. The user selects the book to which the changes are to be applied and then sets the values of the fields they want to change.

Address in the tree:

Script parameters:

Import of invoices from the ISDOC format

Process number: ZAS023

Script ID number: FZAS024

File: FAP_ImportXML.pas

Description: Import of invoices from the "*.ISDOC" format.

Address in the tree:

Script parameters:

Automatic - No

The value Yes allows documents to be imported in an automatic simplified mode. The condition is that the Book parameter is set, which determines into which purchase book the document is to be imported. At the same time, mapping of at least the required fields must be set, either in general or for a specific supplier.

 

The import only creates an invoice in as a standalone document. In the supplier field of the created invoice in, it then fills in the value from the Suppliers book found by the Comp. Reg. No. from the isdoc or isdocx file. If several supplier cards with the same Comp. Reg. No. are found, a list is displayed from which the user selects.

ReportGUID -

Identifier of the assigned report (the value from the GUID column of the report assigned in the Scripts and reports book). Using this report, it is possible to display the data before the file is imported.

AdvanceArticle - 0

Article number for advance deduction.

LocalReverseChargeTypeOfTax - 0

Internal number of tax type for the reverse charge regime.

Book

Book for import.

CustFindBy - 0

Article matching

0 - not only the supplier code on page 4 of the article card is searched, but also abbreviation 1 on the article card

1 - when matching, the article is searched for only in the supplier codes on page 4 of the article card.

NonTaxedType - NN

Abbreviation for the tax type Do not include in the return.

PaymentsByCreditCard

Parameter for specifying the payment method - Card payment (separated by a semicolon).

PaymentsByCheck

Parameter for specifying the payment method - Payment by cheque (separated by a semicolon).

PaymentsInCash

Parameter for specifying the cash payment methods (separated by semicolons).

TransferToAccount

Parameter for specifying the payment methods by transfer (separated by semicolons).

AccountBetweenPartners

Parameter for specifying the payment method - Posting between partners (separated by a semicolon).

ShowOnlyConfictedItems - NO

Yes - displays only erroneous items during matching.

SupplierId

Supplier. If the automatic parameter is set, the value of this parameter is ignored.

SupplementDocType - ALL

Type of documents for importing attachments.

AllowSkipInvoice - No

Yes - allows unmarked invoices to be skipped. No - all invoices must be marked.

EnableSettingsPage - No

Yes - allows editing the page with the import settings.

SettingsFileName - ImportISDOC_Setting.xml

The parameter determines where the file with the default settings is located.

MethodOfSampling

Method of collection.

SaveToAttachement

Enter the document type with which the ISDOC file is saved to the imported invoice. If it is not entered, the ISDOC is not saved as an attachment to the document.

Path

Path to the directory with the files to be imported. If it is not entered, it is set by default to the user's user directory.

Before running the script, the user should set some parameters for it to work correctly. These are:

ISDOC - a fixed defined structure of an XML file used for transferring (Export/Import) invoices between systems.

ISDOCX - a compressed file that contains 1 file in the ISDOC format and may also contain other attachments of various types and sizes.

After the script is run, the user must perform 3 basic steps:

Linked Graphics K2_SKRIPT

Picture: Data Import form

After the imported file is selected, the document including all attachments attached to it is loaded into the form. The invoice is displayed in the upper part of the script form, the attachment in the lower part. If the imported invoice has a sheet flag next to it, it means that it has already been imported in the past and in this case it is a correction of the document. Only documents marked with an asterisk are always imported.

Using the Import button in the ribbon, the user moves to the next page of the form. If everything is in order, the user can continue with the import. If not, an error message is displayed after pressing the Import button. In this case, the operator must fill in the necessary information on the Fields matching tab. This tab is used to correct field matching and to fill in default values.

Field matching can be set either as default for a specific imported document, or this specific default setting can be saved directly to the supplier. This can be done using the function on the Fields matching tab. The default field settings are then saved in the company directory. The setting for the relevant supplier is saved in an XML file and attached on the attachments tab of the supplier card under the IMPSETT(XML) document type.

Linking (matching) fields means linking fields in K2 with an element from the ISDOC file from which values are loaded when the document is imported.

Required fields are marked with a red exclamation mark on the Fields matching tab. For these fields, at least a default value must be selected, or these fields must be matched.

Fields matching:

The user selects the Target module (invoice header or items), then in the left part of the form selects the K2 field they want to match and marks it with the cursor bar. In the right part of the form, the user selects from the Select element list the relevant element from which they want to match one of the values. A list of all available elements is displayed below this list. With the cursor bar, the user marks the element to be linked and creates the link using the Link button. The matching itself can be recognized by the information about the element name and path being filled in the Name and Path columns.

Matching can be cancelled using the Detach button. The K2 field is detached from the selected element and there will be no information or values in the Name and Path columns.

The user can enter a default value for individual fields. It will then be imported directly from the code list in K2 without the need for matching with the ISDOC file. For fields whose values are filled in K2 from code lists, the user can enable their update. During the import, the relevant code list is updated with the value from the ISDOC file.

For item matching, we recommend creating a special article card named Error or Error article. We recommend using this article as the default value of the invoice items.

Linked Graphics K2_SKRIPT

Picture: Fields matching

If all required fields are matched and their default values are filled in, the user proceeds to the next import step using the Import button in the ribbon.

The Import of invoices - ISDOC form is divided into two parts. The entire left side concerns the imported invoice. The document header is displayed in the upper part and all items of this document are listed in the lower part.

If the K2 column of an item contains the abbreviation of the user-defined default article (Error or Error article), it means that the article card could not be identified or the name is not entered correctly, etc. The user can remove this discrepancy using the Identify article, or Write name function.

Using the Identify article button, the user gets to the article book, where they can select the article card that belongs to the invoice item. If the user presses Enter, the article name from the invoice and the supplier name will be written to the supplier codes on the article card.

An invoice that is imported for the first time has no flag in the left part of the document header. If the invoice has already been imported, it is a correction, and the invoice has the pic_313i flag. In this case, it is not necessary to select a different document type.

A document type must be assigned to the newly imported document (using the buttons in the middle of the form):

  1. Standalone document - the invoice is imported as a standalone document.
  2. Generate order - generates a parent document for the imported document.
  3. Match - assigns the document to an already existing parent document.

Linked Graphics K2_SKRIPT

Picture: Import form

Matching the invoice with a parent document (Match option).

The entire right part of the data Import form concerns the unconfirmed orders from the selected supplier and the selected book on page 0. The document header is always displayed in the upper part and the items in the lower part. The items displayed are always those of the document on which the cursor bar is positioned in the upper part of the form. By pressing Enter on the order header, the user gets into the system to the specific parent document and can perform all actions in it as in the book.

Before the actual matching, it is necessary to check whether the invoice items and their quantities correspond to the state of the items of the parent document. If not, it will not be possible to match the documents.

Book Contents

Book Index

Blanket purchase orders

Process number: ZAS022

Script ID number: FZAS004

File: CT_PURCHASE.PAS

Script description: The script creates, in a special purchase book, a contract that specifies the agreed content of the business with the supplier (articles, prices, delivery terms, etc.) for the selected period, and handles its execution including the creation of documents in the regular purchase book.

Address in the tree:

Script parameters:

BookContract

The book in which contract sales orders will be saved.

BookDocument

The book in which the actual documents will be created.

History - Yes

Remembering the history of ordered items.

By default, the script is assigned to the Joint Contracts purchase button on the K2 desktop. The standard contract buttons on the desktop have the behaviour of their scripts preset by the parameters from the factory so that they can also be run on the program's demo data. Therefore, before using contracts for the first time, it is necessary to set up the desktop and the script parameters according to the conditions of each client.

Book Contents

Book Index

Add purchase orders to blanket order

Process number:

Script ID number: FCRM021

File: OBVTOCONTRACTS.PAS

Script description: The script creates a contract according to the offer abbreviation. It goes through all activities of the OFI offer type. From the activities on page 9 it determines the attached orders and inserts them into the contract.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Data for INTRASTAT

Process number: CEL008

Script ID number: FCEL016

File: FA_INTR.PAS

Script description: The script is used to facilitate the creation of SAD documents (intended for INTRASTAT reporting) from invoices (both in and out). It works on the book of invoices out or in and inserts into the invoices information important for creating the SAD – the data contained on pages 1 and 2 of the SAD (the data are stored on the invoice in the form of two notes on page 1 of the document).

Address in the tree: [Purchase/Supply] [Functions]

[Sale/Sales order processing] [Functions]

Script parameters:

StatUrceni

The code of the country of destination is filled in.

KrajPuvodu

The code of the region of origin is filled in.

VypoctovyVzorec

Calculation formula of incidental costs.

Transaction

The transaction code is filled in.

DodaciPodminky

The delivery terms code is filled in.

DruhDopravy

The mode of transport code is filled in.

ZvlastniPohyb

The code for the special type is filled in.

Book Contents

Book Index

Insert e-waste fee into order

Process number: ZAS021

Script ID number: FZAS007

File: VLOZ_EO_OBV.PAS

Script description: Inserts e-waste fee items into the order. A more detailed description is in the Financing of e-waste collection methodology.

Address in the tree:

Script parameters:

No parameters.

Book Contents

Book Index

Select optimal supplier

Process number: ZAS002

Script ID number: FZAS010

File: ZBO_OPTD.PAS

Script description: Based on the weights assigned to the individual parameters, the script selects the optimal supplier for the given Article card. Parameters with a higher number than the other parameters have a greater weight.

Address in the tree: [Purchase/Supply] [Basic data] [Articles] [Functions]

[Purchase/Supply] [Basic data] [Prices]

Script parameters:

Doklad - No

Yes - the script runs only on the selected Article card.

Tabulka - No

Yes - the script runs on the table.

VFiltr - No

Yes - the script runs after the large filter.

PravoNaRec - Yes

If the parameter is set to "Yes", it ignores records to which the user has no rights.

Parametry

Filled in by the program.

Vahy

Filled in by the program.

Neinteraktiv - No

Yes - the form is not displayed.

HlasZboBez - No

Yes - displays a list of articles that have no records in supplier prices.

IgnoreZeroPrice - No

Yes - suppliers with a zero price are not included in the evaluation of the optimal supplier by price.

The script allows you to evaluate the individual suppliers entered on page 4 of the Article card and to fill in, on page 1 of the Article card in the Optimal supplier field, the one that best meets the values entered in the script. After the script is run, the following form is displayed:

Linked Graphics K2_SKRIPT

Picture: Select optimal supplier form

Here we assign a weight to the individual parameters using numbers, on the basis of which the optimal supplier is then evaluated. A larger number for a given parameter means a greater weight for that parameter. If, for example, price is the most important for us and the number of delivery days comes second, we enter a larger number in the price field than in the field for the number of delivery days. The size of the number is not limited; the larger the number we enter, the higher the priority of the respective parameter for us. By placing strong emphasis on a certain parameter, we can thus clearly define that, despite unfavourable results of other parameters, the supplier that best meets the most preferred parameter wins.

Note: If the supplier price is entered in a foreign currency, it is converted according to the current rate from the exchange rate list (i.e. the rate marked as current with a dot in the Akt column).

For non-numeric parameters, the user must determine the order or preference of the values. The buttons with 3 dots are used for this purpose; they display a form containing predefined values from the relevant code lists. By moving the records, we determine their priority (best / worst).

Linked Graphics K2_SKRIPT

Picture: Criterion value priorities form

How does the script work?

For each supplier (for each price list on page 4 of the Article), the script evaluates the individual criteria (parameters) one by one. It first calculates the so-called "internal weight", which essentially determines how advantageous the given value is among all values. Then the resulting weight of the given criterion is calculated as the product of "internal weight" * "external weight" (the number entered by the user in the form). Finally, the total weight is calculated for each supplier (or price list) as the sum of the weights of all criteria. The record (price list) with the highest sum wins and its supplier is filled in as the optimal supplier on the Article card.

Calculation of the internal weight

First, the minimum and maximum value (of each criterion) from all price lists are determined. The minimum value is subtracted from all records. The internal weight is then calculated as 1-(current value/maximum value).

Example

The data in the example are constructed so that you can see the difference in finding the optimal supplier depending on the weights set for the individual criteria.

The following price lists are defined on the Article card:

Supplier

Price

Delivery days

Payment method

AB Group

100 CZK

14

In cash

Bravo

200 CZK

2

By transfer

Customs

110 CZK

1

By transfer

For the Payment method, we have set the order of priorities so that payment "By transfer" is the best option and payment "In cash" the worst.

Weight settings: Price = 3, Delivery days = 2, Payment method = 1.

In this case, the company Celnice becomes the optimal supplier, even though it does not have the best price. This is because, although the price criterion has the greatest weight for us, the weight is not high enough to reverse, for the company AB Group, which has the best price, the unfavourable results of the remaining two criteria in which this supplier was the worst.

However, if we set the weights as follows: Price = 100, Delivery days = 2, Payment method = 1, then the company AB Group, which offers the lowest price, becomes the optimal supplier. This is because the emphasis on the price criterion is so high that, in the sum of all criteria, it can suppress the unfavourable results of the remaining two criteria.

It follows from the above that if we evaluate multiple criteria, we need to carefully consider how strong an emphasis we place on the individual criteria so that the result meets our expectations.

Book Contents

Book Index

Creation of SAD - stock receipt from FAP/SA

Process number: CEL003

Script ID number: FCEL044

File: JCD_GENER.PAS

Script description: Generation of SAD - stock receipt from invoices in.

Address in the tree:

Script parameters:

CisFirmy - 77

K2 number of the importer's company.

The script is run in the Purchase module in the Invoices in book. It creates a document in the SAD-Bonded stock book from the invoice in. The purchase items must have notes of the following type:

SP

country of origin

CP

Item No.

There may also be notes of the following type:

DO

incidental costs

HM

weight

EU

name

PR

preference

P1

reference number

JC

customs office description

Book Contents

Book Index

Articles to order

Process number: ZAS007

Script ID number:

File: ZBO2PURCH.PAS

Script description: The script filters articles either to be ordered (an order should be created for them) or to be produced (a job card should be created for them).

Address in the tree: [Purchase / Supply] [Purchase Orders] [Overviews]

[Production] [Production planning] / Articles to produce

Script parameters:

Delete FromFiter - No

No - articles to order; Yes - takes only articles with the "Product" or "Subassembly" property enabled - articles to produce.

ProductsOnly - No

No - creates a new evaluation filter; Yes - deletes articles that do not meet the conditions from the evaluation filter.

Book Contents

Book Index

Creation of other liability from an invoice

Process number: ZAS025

Script ID number: FZAS030

File: FA_CreateOtherRelation.PAS

Script description: The script is run on an invoice in. After it is run, a form is displayed in which the Company, Cost centre, Contract code, Payment method and Description are set according to the invoice. We enter the book in which the liability is to be created, the dates, the amount, the VAT rate or the other liability card, and possibly other data. After the form is confirmed, an other liability document is created.

If the Tax type and Account are not entered, they are filled in according to the settings of the book in which the document is created.

The Tax point date is filled in depending on the Tax point date parameter set in the book.

If we do not set the supplier's bank account in the parameters, it is filled in according to the invoice in.

Address in the tree: [Purchase] [Other liabilities]

Script parameters:

See the parameters of the Creation of other receivable from an invoice script.