Manual for the program Maintenance and Service 3 

This document contains a description of some additional information that may be of help especially for administrators, programmers and experienced users.

1. Configuration and data files 

The values ​​saved in the configuration files are set fundamentally in the program Repairs and service. This ensures the accuracy of the saved values. We use a direct access use only in special cases.

servis.ini 
- Standard Windows ini file, it can, if necessary, be edited by a Notepad. This file contains also license information. 

schemams.sql 
- Text file, can be opened in the Notepad. It contains the database schema. This scheme is used when creating your own filters using SQL queries, for details see the file filtry.txt.

filtry *. txt 
- Text file, can be opened in the Notepad. It contains individual filters available in the program in the menu filters. The items in the menu are dynamically generated based on textual descriptions saved the file filtry.txt. * Denotes ISO abbreviation for the language localization, e.g. filtryEN.txt contains filters for the English language localization.

The structure is as follows: The name of the filter;sql query;optional parameter 
The filter name represents what is displayed in the menu of the program, the SQL query is what is sent as a command to the database. The name, query or optional parameter must always be on the same line separated by a semicolon. The optional parameter is a supplementary statement. So far there is only one - statement "default", which indicates whether the program uses the filter as default. If this parameter is not used, the program automatically uses an internal default filter, which creates a classic range of service contracts, i.e. contracts outstanding ranked according to the time remaining to discharge. We always write a next filter on a new line.

ciselnerady, stavy, stavyvle, pracovnici, typyoprav
- Plain text files containing the corresponding values ​​chosen in the program on the Settings tab 
stylservics.css 
- The file that defines the style of a HTML file with states of contracts for the use on web service pages. 

opravy.j * 
- Language file that contains text captions to individual controls of the program. Using this file, you can create a simplified translation of the program into another language or for example rename the columns in the program, see more in the item 7. This file is not a full translation program. 

* This file exists in version 3 just for the sake of backward compatibility. It has been completely replaced by a new system for a full translation.

2. Description of some database fields 

The complete database schema specifies the file schemams.sql. 

Table of Repairs: 
udaj1 – your own number of the contract, if you do not use your own number series, then it should contain the field contractnumber 
udaj2 - product code 
udaj3 - part number 
udaj4 - type of repair 
udaj5 - reserved for control commands 
iddletypu – contract ID of a certain type is used to generate ID of new contracts of this type.

3. Print reports designer 

It is a FastReport standard. Documentation and examples can be found on the manufacturer's website or by using Search. The home webpage of the manufacturer is www.fastreport.com. 

3.1 Creation and installation of custom print reports 

Custom printed reports can be used in two places in the program. In the detail of the contract - the bottom rail in the contract detail below standard buttons. Or in the main window of the program in the menu Tools/Reports.

Recommended procedure for the installation of your own print report for the detail of contract: 
- Select one of the preset print reports (or download from the website of the program), that most closely resembles your intent. 
- Then copy/save the report to the folder sestavy/vlastni 
- Edit it in the designer according to your wishes 
- Open it (if does not exist then create it) in the Notepad vlastni.txt file (vlastni.txt), this file must be located in the folder sestavy/vlastni. 
- Add a line with the description and the name of your new report, separated by a semicolon, the syntax is similar to the file filtry.txt, i.e. "Description of the report;filename.fr3" and save. Attention! Each new declaration must be on a new line as well as in the file filters.txt.

After restarting the program the link to a new report in the contract detail is created (below the standard buttons). 

To add the report to the menu Tools/ Reports there is a similar process, only the location of the report is in the folder sestavy/prehledy/*/, where * stands for the abbreviation of ISO code of the language localization. For example, the English version will have these reports in the folder sestavy/prehledy/en/. Here you can edit the file prehledy.txt, the syntax is the same as in the first case.

4. User Accounts 

Fixed administrator account is "admin", password "servis". 

Description of the tab Users administration: 
Function - enable user management: a login dialog occurs when the program starts, enabling the worker to login by the particular name and password with particular permission.

5. Setting SMS function and e-mails to technicians - automatic information sending to the technician about the contract assignment.

Function - to use users as workers - when turned on it will replace the handwritten list of personnel in the tab Setup/General by users from the users list.

Function - e-mails to technicians – switches on the automatic sending of messages to the e-mail of the technician when choosing the technician in the detail of the contract, the users table must be filled in by the e-mail address.

Function - SMS to technicians - the same but in the form of SMS, the users table must be filled in by the mobile phone number.

For the functioning of messaging to technicians (users) in the form of SMS or e –mail there may not be enabled the user administration (registration to the program), only the users names should match with the names of the workers on the tab Settings/Basic, which is ensured easiest by switching on the  option "Use users as workers" (information about the worker`s e-mail or phone to send messages is only in the users table on the tab Users Management, that is why it must coincide with the list of workers/technicians on the tab General).

6. Recording of contracts state to web 

Setting values ​​for the FTP connection correspond to the setting of normal FTP client. A more detailed explanation is deserved only by the parameter "Folder". This is the folder (directory) on the FTP server, in which the final HTML file will be written in and where it will be read by a web client of the user via a web server. This folder is necessary to be specified by the full path from the FTP site logins, for example if we have a web presentation in the web directory, which is directly in the root directory of the web server, the path may look like this: ./web or /web or web (depending on the platform and server settings). If you want to put the file to a subdirectory on the web, use e.g. ./web/service, of course the directory service must exist. In some cases the FTP server can log in default somewhere else than in the web space, then use the standard “travel” convention in the  file parameter, e.g. ../../ibays/www/web1

This function allows you to define the data fields that will appear on the site. This function is intended for professionals and requires at least a basic knowledge of SQL. The default setting corresponds to the original functionality, which displays only the contract parameters, number, status and expected date of manufacture on the web. The use is obvious for the ones experienced with SQL, by modifying the SQL query we can achieve another (wider) selection for output/export function, as well as we can influence so the way of contracts allocation in the final HTML file. The names of individual data fields applicable in the SQL query are specified by the file schemams.sql, see section 1. The column headings are indicated by the column "table columns header", individual titles must be separated by a semicolon. Important notice: Think properly which fields to indicate to the web - especially when it comes to sensitive data, such as names or phone numbers! - See the Act on Personal Data Protection. In this case, it is possible to specify conditions on the service sheet that the customer signs when receiving the contract. It also arises to create a secure access using the authentication on your web and data processing by your own web applications or scripts. For this purpose there is a possibility to export data in CSV format.

We can influence the final appearance of the generated HTML page using the file with styles. This file must be named stylservis.css and placed on a web server in the folder with the website with statuses. 

7. Program language and localization 

Program includes two systems enabling translation into another language. These settings are available in the tab Settings/Language. The second system, situated lower in the tab, is outdated and does not allow a complete the translation. It is there only for historical reasons (backward compatibility) and should not be used for new installations. For the full translation, therefore, always use the first option on the tab Settings/Language. Language files are located in the folder lng. The integrated editor allows you to create your own language files. In case you use the language files to rename fields in the detail of the contract or other labels in the program, always work with your own copy of the language file, because the originals of individual languages ​​can be rewritten/updated within the update. In case of a damage or loss of the original language file it is possible to download the original from the website of the program Repairs and service.

8. Secure communication with a Web/ FTP or SMTP server 

It requires the libraries OpenSSL to be installed. For details on OpenSSL see the manufacturer`s page http://www.openssl.org/. In case of problems it can help to copy libraries libeay32.dll and ssleay32.dll directly to the folder of the program.

9. Import of labor and material 

Prices of labor and material can be filled also via an external file (e.g. an exported list of information system). This function is available in the menu after right-clicking on the list of work items and material. The imported file must be in CSV format – values separated by semicolon. 
Example of file structure: 
70706276;Source 300W;530 
10011;Source replacement;150 
60100040;Diagnosis;200 

For correct operation of the automatic completion of work items and materials during the work with a contract it is necessary that the item names are unique, i.e. there are not more items with exactly the same name in the list. 
On request there is available a free program for registered users to import the labor and material from the system Money S3.

10. Import of new contract from the file. 

The new contract can be also established from an external file. This allows you for example to create a new contract based on the data entered by the customer on the service web site via the web form. The assumption is that the web form, resp. corresponding script is programmed to the desired data input (sending) in a particular format (XML) according to the following pattern:

<?xml version="1.0" encoding="utf-8"?>
<data>
<zakazka>
<druhzbozi>MainBoard K7S41</druhzbozi>
<prislusenstvi>box+manual</prislusenstvi>
<stav>leaking capacitors</stav>
<seriovecislo>SI156421</seriovecislo>
<vadadlezakaznika>not functioning</vadadlezakaznika>
<zakaznikjmeno>John Doe</zakaznikjmeno>
<zakaznikkontakt>777123456</zakaznikkontakt>
<pozadovanereseni>repair quickly</pozadovanereseni>
<cislodokladu></cislodokladu>

The following information may not be related to the formation of a new contract, but are permitted for import:

<nazevdodavatele>Some supplier inc.</nazevdodavatele>
<dodacilist>delivery note number 123</dodacilist>
<kodzbozi>goods code 123</kodzbozi>
<partno>c11102</partno>
<externiodkaz>www.someaddress..</externiodkaz>
</zakazka>
</data>

The file must have the suffix xml.

11. Mailing and SMS to customers 

This function is used for automatic sending of messages to customers when changing the state of their contract. You can adjust this function on the tab Settings/Mailing/SMS. Setting of the mailing function is similar to setting of the current mail client. Sending is done via the user-specified SMTP server. If you have the OpenSSL libraries installed in the system, then it is possible to use a secure communication with the mail server via SSL. The key setting is the very definition of sent messages in relation to states of a contract. The states listed here must match with the states defined on the tab Settings/General. If you change the status on the tab Settings/General, you must also change them manually on the tab Mailing. Likewise, if you add or remove some state, it must be written also here to a new line resp. remove it. The links between the state and sending messages are common for both mailing and SMS.

In the texts sent using the mailing or SMS can be used variables, that will be replaced by a specific value in the moment of sending. 

Variable 
<cizlozakazky> will be replaced with the contract number 
<cenacelkem> will be replaced by the total price of the contract
<popispraci>  will be replaced with the description of repair
<datumprijeti> will be replaced with the date of accept
<druhzbozi> will be replaced with the kind of goods

Example of message: 
Your contract <cislozakazky> is ready for collection and costs <cenacelkem> $. 

Note: The values ​​of variables are not displayed to the user in the query before sending the message, but they are replaced just in the actual sending. 

It is suitable to write texts of messages without diacritics or other special characters. This is especially valid in the case of SMS.

SMS sending is done through a GSM modem and the communication itself with the GSM modem is provided by a separate program smsos.exe in the program folder. This program (further on just SMS module) communicates with the GSM modem through the COM port. The best is a physical connection to the PC via the RS232 connector, but the communication is also possible via the virtual com port in the Windows system (GSM modem can be connected via USB or Bluetooth). Detailed description of the functions of the SMS module can be found in the document smsos.rtf in the program folder.

12. Own Numeric Series 

This function enables you to alter the number format of the contract. There are several options, that can be combined mutually, but it is necessary to warn the user against unnecessarily complicated settings, that may lead to a slowdown of the program and database. Issues of own numerical series are quite complicated. The numbering system should be set only at the beginning - ideally on an empty database before entering the first contract. Any additional changes should be considered carefully, this chapter should be read carefully or consult with the users support of the program.

Important terms: 
simple (real) number of the contract: value generated by the database, which cannot be changed by the user. If own number series are off (default program setting), it is the only number of the contract. It is located in the database under the title "contractnumber" and is the primary key of the repairs table. Because the value is generated by the database itself and it is the primary key, the uniqueness is always guaranteed, no duplicity can ever occur. 

own (user) contract number: value generated by the program based on the values ​​preset by the user. See below. The final shape is given by settings. The user can also change/correct this value in addition, taking the possible risks described at the end of the chapter. Own contract number is physically saved in the database stores under the name "figure1". If own number series are off, there is a copy of the field “contractnumber” in the “figure1”, i.e. the actual number of contract. 

own number series: sequence consisting of own (user) numbers of contracts. 
simple number series: sequence of simple numbers of contracts

When you create your own number series, following rules apply: 
a) If you have no serious reason to use your own contract numbers, do not use it. Keep a simple number series. Here, more than elsewhere, the strength and speed is in simplicity. 

b) If it is a significant benefit for you for example to divide contracts by year, use the button "own number series beginning" for the year with some separator, such as the 2014/ or 2014_ etc. Do not use the diacritics, quotation marks, semicolon or apostrophe for numbers of contracts.

c) The program allows you to set a part of your own number depending on the type of contract. It should be noted that the type of contract can theoretically be any number, and it is needed to count and keep the unique series for each of them, which is particularly complicated in the simultaneous work of several users, which can be theoretically also many, with which the numerical demands increase too. Therefore, it is especially true for this function - do not use it unless you have a serious reason for it.
Model cases: 
1. You use a simple number series. (The function of your own number series is off.) 
2. You use your own start + simple contract number 
3. You use your own start + your counter instead of a simple contract numbers. You must realize that inappropriate setting of the counter can cause duplicity in its own contract number.  
4. You use your own start + simple contract number + your own part according to the type of contract (or vice versa see switch), but you accept that you can experience various complications, especially performance (slow response of the program, redundant database growth, in the extreme case even the congestion in the case of many types of contracts and many users).

Custom Counter:
It allows you to replace the actual number of contracts in the number part by your own value. This function can be used e.g. for annual numbering from 1, see the model case 3.
Example: You have set your own beginning of the number series to 2013/ + value of the counter. The program thus generates the numbers of contracts as 2013/1, 2013/2, 2013/3 etc. In January 2014 you want to set the number format to 2014, and number again from 1. You write 2014 to the column your own start you choose/write 0 to the value of your own counter, and then click on the button Set. This “resets” the value of your own counter to 0.  In fact, it means that the program sets the value of the counter in the database at the last contract to 0, and because the counter counts from the previous contract +1, the following new contract will have a value 1, resp. 2014/1. Setting of the counter to 0 for the previous contract will not affect own nor the actual number or the contract, this value is used only for calculating of the value of the counter.

Change of own contract number: 
The program allows its user to change own number of the contract. This function is debatable as well as functions for deleting contracts from the database or manual editing the database in another program. It should be noted that the program itself ensures best the consistency of number series and records in the database in the best way. Any manual intervention can lead to inconsistency. Care should be taken to avoid manually setting the values ​​that are already in the database. Users can set themselves duplication or delete the value that has been issued on a printed document to the customer. The function can be displayed by right-click on a particular contract.