Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

Software Integration With Tring - Fiscal

Download as pdf or txt
Download as pdf or txt
You are on page 1of 44

TRING D.O.O.

Informatički Inženjering GRAČANICA

Software integration with


Tring fiscal devices

1|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

CONTENT

1. PREREQUISITES FOR INSTALLATION .............................................................. Error! Bookmark not defined.

2. INSTALLATION .............................................................................................. Error! Bookmark not defined.

3. FIRST RUN AND TESTING ............................................................................... Error! Bookmark not defined.

4. SETTING UP TRING.FISCAL SERVER ................................................................ Error! Bookmark not defined.

5. CONNECTING WITH TRING FISCAL DEVICE AND TESTING COMMUNICATION ........................................... 9

6. WAYS TO INTEGRATE PARTNERS SOLUTIONS................................................ Error! Bookmark not defined.


6.1. USING OBJECTS AND FUNCTIONS IN TRING.FISCAL.DRIVER ............................................................... 10
6.1.1. MICROSOFT .NET FRAMEWORK BASED PROJECTS ..................................................................... 13
6.1.2. „COM“ BASED PROJECTS (Visual Basic, Delphi, Visual Fox Pro, ...) ............................................. 13
6.1.3. DIRECT XML SENDING METHOD VIA „HTTP-POST“ METODE ..................................................... 13
6.1.4. COPYING XML FILES TO COMMAND DIRECTORY ........................................................................ 14
6.1.4.1. HOW TO FORMAT NAME OF XML FILE ....................................................................................... 15

7. SENDING COMMANDS I EXAMPLES ....................................................................................................... 15


7.1. Logging to device - Inicijalizacija .......................................................................................................... 15
7.2. Working with item (commodity) database – UpisiArtikal, UpisiArtikle, CitajArtikal, CitajArtikle ...... 16
7.2.1. „UpisiArtikal“ - Write item .......................................................................................................... 17
7.2.2. „UpisiArtikle“ - Write items ........................................................................................................ 18
7.2.3. „CitajArtikal“ - Read item ........................................................................................................... 19
7.2.4. „CitajArtikle“ - Read items .......................................................................................................... 20
7.3. Sales – „StampatiFiskalniRacun“ - Print fiscal bill ............................................................................... 22
7.3.1. Printing fiscal receipt without a customer .................................................................................. 23
7.3.2. Printing fiscal receipt with customer .......................................................................................... 26
7.4. Reclaimed receipt - „StampatiReklamiraniRacun“ – Reclaim a receipt .............................................. 29
7.4.1. Printing reclaimed receipt without a customer .......................................................................... 30
7.4.2. Printing reclaimed receipt with a customer ............................................................................... 32
7.5. CashIn and CashOut – „UnosNovca“ – Cash in, PovratNovca - Out .................................................... 33
7.5.1. Cash in ......................................................................................................................................... 33
7.5.2. Cash out ...................................................................................................................................... 34
7.6. Reports – (X report , Z report, Periodical report) ................................................................................ 34
7.6.1. „StampatiPresjekStanja“ – X report ............................................................................................ 34
7.6.2. „StampatiDnevniIzvjestaj“ – Z report ......................................................................................... 35
7.6.3. „StampatiPeriodicniIzvjestaj“ – Periodical report ...................................................................... 35
7.7. Non-fiscal text – „StampatiNefiskalniTekst“ ........................................................................................ 36
7.8. Printing duplicates of fiscal documents – „StampatiDuplikatPresjekaStanja" .................................... 37
7.9. Other functions – „OsnovneInformacije“ - Basic informations, „UpisiNaDisplej“ – Write to display,
„CitajDatumIVrijeme“ – Read fiscal date and time ........................................................................................... 38
7.9.1. OsnovneInformacije – Basic informations .................................................................................. 38
7.9.2. UpisiNaDisplej – Write To display ............................................................................................... 41
7.9.3. CitajDatumIVrijeme – Read date and time ................................................................................. 42

8. DESCRIPTION OF POSSIBLE ERRORS AND THEIR HANDLING .......................... Error! Bookmark not defined.

2|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

1. PREREQUISITES FOR INSTALLATION


OS: Windows 98 and higher

Windows installer 3.1 or higher

.NET framework 2.0

Hardware: Minimum PIII 1GHz, 256MB RAM, 20GB HDD

2. INSTALLATION

IMPORTANT !!! :

Please uninstall older versions like: CTP1, CPT2 or v1.

1. Run „setup.exe“

2. Click on „Next“

3|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

3. Choose path to install Tring.Fiscal („x:\tring“ is recommended)

4. Click on „Next“

4|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

5. Wait until finished and click „Close“.

3. FIRST RUN AND TESTING


Tring.Fiscal consists of the following:

a) Tring.Fiscal.Server.exe
b) Tring.Fiscal.Driver.dll
c) Tring.Fiscal.POS.exe

Tring.Fiscal.Server is as base application which is used for


receiving commands from other applications and it forwards it to
Tring fiscal printer.
Tring.Fiscal is implemented as a windows application which starts
with Windows automatically.
Tring.Fiscal.Server is „Hybrid“ http server which accepts XML
commands, transforms them into corresponding format and sends it to
execution to Tring.Fiscal printer.
To check Tring.Fiscal.Server, type in some of web browsers you have
installed (IE, Firefox) local network address of the PC where
Tring.Fiscal is installed with its port.
Example: Default is: http://localhost:8085/
Browser will return an XML file for successful access to the server
or it will not be any in case of an error.

5|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

Picture 1. Successfully installed and started Tring.Fiscal.Server

4. SETTING UP TRING.FISCAL SERVER

At application startup there will be a window, as on picture below,


which have three tabs: „server“, „fiskalni uređaj“ (fiscal device) i
Tring.

6|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

In „Server“ tab Tring.Fiscal will show current server settings.

Server settings can be changed directly on table „Server“ (picture


above). On left side of the table (left column) gives a list of all
possible settings, while right side (right column) is for view and
changing the settings.

IMPORTNAT !!! Changes can be made only when all values of settings were changed
then button „Spremi izmjene“ has to be pressed to keep the changes
„NECESSARILY“! Some settings require Tring.Fiscal.Server to be reset to apply
settings. To reset Tring.Fiscal.Server it necessary to press „Zaustavi server“
then „Pokreni server“

Deteiled list and description of all settings is in the following table:

SETTING DESCRIPTION POSSIBLE VALUES


KoristiTringFiscalZa Will Tring.Fiscal take care of database on True
MenadzmentBazeArtikala
fiscal device. False
(UseTringFiscalFor
CommodityDatabase
Management) This setting is relates to folowing commands:
Stampatifiskalniracun (PrintFiscalReceipt) i
stampatireklamiraniracun
(PrintReclaimedReceipt).

If value is = True, then driver will, in case


when commodity does not exist in database on
fiscal device or there has been changes on
Name, unit or tax rate in forbidden period,
automatically add new commodity in database on
device.

If there was a change of Name, Unit, or Tax


rate in allowed period or price change in
forbidden period, then driver will change
these values on fiscal device.

If value is = False,
Then driver will return „Greška“ (error). User
will have to synchronize database between
fiscal device and own database by himself.

ValidacijaArtikalaPrijeProdaje Will Tring.Fiscal.Server validate recipt item True


(ValidateCommodities
before sending it to execution. False
BeforeSale)
This setting relates to commands:
Stampatifiskalniracun (PrintFiscalReceipt) i
stampatireklamiraniracun
(PrintReclaimedReceipt).

If value is = True, then driver will check


receipt items from command:
a) Are values of price, quantities, and
discounts are valid format and in
allowed limits.
b) Is Name, unit, and Tax rate and price
are the same as on the fiscal device
database.

7|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

If value is = False,
User will have to take care about data
validating.

ZadnjiPLU Number of (PLU) that was last written to Number:


(LastPLU) database in fiscal device. This option is for 1-16000 for
faster checking of new commodities in fiscal TringFavourite
device database. It is not needed to enter any Plus
values in this field except first start of the 1-60000 for
device. TringPartner
We recommend to set this value to „-1“ on
first start. This way Tring.Fiscal will
synchronize database on device with local
repository for faster command executing. This
synchronization will be executed on first
command execution and could take quite long so
you do not have to turn of fiscal device.

AutomatskoLogiranje Will Tring.Fiscal.Server going to login True


(AutomaticLogin) automatically with user-1. False
If value is = True, then Tring.Fiscal.Server
will login every 60 seconds on fiscal device.
This setting is required with Tring.Favourte
Plus device because if at device startup, in
60 seconds device does not recieve command
from PC it exits fiscal printer mode.

If value is = False then Tring.Fiscal.Server


will not login automatically.
ComPort Serial port on PC where fiscal device is List of all
connected. serial (COM)
This setting is related to Tring.Favourite Plus. ports on PC.
Emulator Will Tring.Fiscal.Server send commands to True
fiscal device or it will run in „Emulated False
mode“.
True – will work as emulator. Will not send
commands to fiscal device.
False – will send commands to device (normal
mode)
IBFM Identification number of fiscal module. This AB000010-AB500000
number can be found in Service manual. First AC000010-AC500000
two characters are latters, rest (6) are
numbers (always).
AB – TringFavourite Plus
AC – TringPartner
IPport Port that will listen for connections. 8085
Take care of FIREWALL. It should allow this
port. Default value is: 8085
PauzaPriSlanjuKomandi Time pause in milliseconds while sending From 10 to 500
(PauseBetweenCommands) commands on serial communication –
Tring.Facourite Plus.
Default value is 100. We don't recommend setting
this value lower than 10.
Rising this value rises the time of command
execution (stampatifiskalniracun i
stampatireklamiraniracun, citajartikle).
Rezim Advanced setting for possibility of Maloprodaja
implementation function to work with wholesale Veleprodaja
ad retail prices.
SprematiLogove True – All commands and replies will be saved True
(Save logs) in file called „log.txt“ in folder where False
Tring.Fiscal is installed.
8|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

TrenutniZahtjev Internal counter. Please don't set any values. -1


(CurrentRequest)
VrstaUredjaja Defines device which is directly connected to Favourite
(DeviceType) PC where Tring.Fiscal.Server is installed. Partner
Allowed values are: Mobika
Favourite
Partner
Mobika
ZadnjaKomanda Date and time of last command execution.
(LastCommand) Please don't set any values.
IPAdresa Defines IP address of fiscal device 192.168.10.20
(IPAddress) (Tring.Partner), in case when fiscal device
communicates with PC via TCP/IP protocol.
Take care of FIREWALL. It should not block
this address. Fiscal device and PC should be
on same subnet.
IMPORTANT !!! Default IP address of
TringPartnera is 192.168.10.20
IPGateway Default gateway for TringPartner if there is 192.168.10.1
in the network.
Default value is: 192.168.10.1
IPMask Subnet mask (Tring.Partner) 255.255.255.0
Default is: 255.255.255.0
BrisatiNeuspjesneDatoteke Will Tring.Fical erase XML files that are not True
(EraseFailedFiles) executed. False
Encoding Defult character encoding for executing XML List of all
files. encodings in drop
down list.
XMLPutanja Path which server will scan for XML commands. C:\tring\xml
Replies from server are found in subdirectory
„\odgovori“ in that directory.
XMLTimer Time of scanning directory in seconds. If it From 0 to 10
is set to 0 then the scanning is off.

5. CONNECTING TRING.FISCAL DEVICE AND COMMUNICATION TESTING


After installation, setup, and running Tring.Fiscal.Server application
it is needed to connect Tring.Fiscal Device with PC:

a) TringFavourite Plus – use the original communication cable supplied


with the device. It is recommended to connect Tring.Favourite Plus to
a computer via a USB-serial adapter.
Turn on the devices. Confirm date, if asked. Choose Menu
„Registracija“, and confirm with ZBIR. Type in the password (default
1 for operator number 1). Confirm with ZBIR. On the screen should be
shown "0.00". Press, one after another, next keys: SMN, PRN, NP.
After this keyboard should be blocked. In this way the device is in
the fiscal printer mode. In the old program memory of the devices, it
is needed to send the command "initialization" in 60 seconds after
entering the mode of fiscal printer or cash register will
automatically come out of the fiscal printer mode.
With the new program memory is not necessary to send any command.
There is also the option of automatic entry into the mode of fiscal
printer immediately after turning on the device, but this option must
turned on by the authorized service.

9|Strana
TRING D.O.O. Informatički Inženjering GRAČANICA

If, after giving the command, the device comes out of the fiscal
printer („NEMA KONTAKTA!“ (Eng. NO CONTACT!)), then the problem is
with the misspelled IOSA. IOSA can be changed by authorized personnel
only.
b) TringPartner – uses standard UTP (network) cable for communication
with device. This device has only implemented Ethernet (network)
communication. The default IP address of the device is:
192.168.10.20. IP address can be changed as described in the user
instructions that can be downloaded from the website:
http://www.kase.ba

IMPORTANT !!! Check of the correct settings of Tring.Fiscal.Servera and


Tring.Fiscal device we can check by type in the following address in
Web browser:
http://localhost:8085/test

The device should print the text from the non-fiscal data on the
fiscal mode and the number of IBFM.

In web browser should show the message like on the picture above.

Now fiscal device is ready to work.

6. WAYS TO INTEGRATE PARTNERS SOLUTIONS


There are four ways to send commands for execution to the server:

1) Thru object and functions in Tring.Fiscal.Driver.dll for .NET


framework based technologies.
2) Thru object and functions in „COM“ TringFiscalDriver.tlb for
technologies that supports „COM“ (VB5-6, Delphi, VisualFox Pro)
3) Sending XML commands directly to server via HTTP POST method
(.NET, Java, Delphi,...)
4) Sending XML files to execute in specified directory which is
„scanned“ by Tring.Fiscal.Server.

In first three methods, reply from server is get from functions, while
fourth method, reply is saved to a file in specified directory.

6.1. Using objects and functions in Tring.Fiscal.Driver


Tring.Fiscal.Driver.dll is implemented as standard .NET library of
objects and functions.

10 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

This library is possible to use in this ways:

a) As a .dll for .NET based projects (C#, VB .NET, Java .NET, F#)
b) As a COM object for projects done in Visual Basic 6, Delphi 7+,
Visual Fox Pro 6+ and rest of the tools which supports this
tehnology.

Below are diagrams of some classes from library Tring.Fiscal.Driver.

11 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

12 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

6.1.1. MICROSOFT .NET FRAMEWORK BASED PROJECTS


For using objects and functions in Tring.Fiscal.Driver in .NET
framework environment it is needed to import this library into the
project.
Examples of implementation are given in file cs_primjeri.zip. It
could be found in directory „PRIMJERI“.

6.1.2. „COM“ BASED PROJECTS (Visual Basic, Delphi, Visual Fox Pro, ...)
To use functions and objects from Tring.Fiscal.Driver.dll library it
is necessary to generate file TringFiscalDriver.tlb, which can be
imported into the project.

To register file TringFiscalDriver.tlb it is necessary to do next:

1. Open directory where file „RegisterTFD.bat“ (in folder where


Tring.Fiscal is installed).
2. Right click on „RegisterTFD“
3. Chose option: „Open“ or „Otvori“ on Windows XP; or „Run as
Administrator“ or „Pokreni kao Administrator“ on Windows Vista
or Windows 7.
4. In case of successful of registration in same directory will be
file TringFiscalTDriver.tbl and you will get next window:

As example of implementing this way of communication is given a


project in VB6 in file: vb_primjer.

6.1.3. DIRECT XML SENDING METHOD VIA „HTTP-POST“ METHOD


This method can use all technologies which have standard HTTP POST
possibility. This method could be implemented thru sending „RAW“ data
via TCP/IP protocol. The requirement is that data have to be sent in
the structure required by the HTTP protocol. The header must specify
the method parameters such as the command address and data type,
while the "body" must contain the appropriate XML content.
Example. Address of Command: http://localhost:8085/inicijalizacija
Type of data: "text / xml"
13 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Below are examples of implementation of this method in Java.

try
{
String requestXML = “<?xml version="1.0" encoding="utf-8"?><Operator
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema"><BrojOperatora>0</BrojOpera
tora><Lozinka>0</Lozinka></Operator>”;
URL url = new URL( “http://localhost:8085/inicijalizacija” );
URLConnection con = url.openConnection();
con.setDoInput(true);
con.setDoOutput(true);
con.setUseCaches (false);
con.setDefaultUseCaches (false);
con.setRequestProperty ( "Content-Type", "text/xml" );
OutputStreamWriter writer = new OutputStreamWriter(
con.getOutputStream() );
writer.write( requestXml );
writer.flush();
writer.close();
// reading the response
InputStreamReader reader = new InputStreamReader(
con.getInputStream() );
StringBuilder buf = new StringBuilder();
char[] cbuf = new char[ 2048 ];
int num;
while ( -1 != (num=reader.read( cbuf )))
{
buf.append( cbuf, 0, num );
}
String result = buf.toString();
System.err.println( "\nResponse from server after POST:\n" + result
);
}
catch( Throwable t )
{ t.printStackTrace( System.out );
}

6.1.4. COPYING XML FILES IN COMMAND DIRECTORY


To be able to execute Tring.Fiscal.Server XML commands it is necessary to
configure the following settings:

1. Setup base path where you want to send XML files. Default path is
„C:\Tring\XML“
2. Setup interval of scanning directory in seconds by
Tring.Fiscal.Server. If interval is = 0 then XML scanning is OFF.

14 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

6.1.4.1. HOW TO FORMAT NAME OF XML FILE

Names of XML files should be formed in this way:


COMMAND_NAME.REQUEST_NUMBER
Example, If file is receipt printing file then format of the file name is:
stampatifiskalniracun.1045
where:
stampatifiskalniracun – Command for printing fical receipt
„.“ = period, separation mark
1045 – receipt number or request number

Example, If „Cash In“ request is needed then format of the file name would
be:
unosnovca.99687
where:
unosnovca – Command for „Cash In“ into the fiscal device
„.“ = period, separation mark
99687– Request number or random number

REPLIES TO XML COMMANDS FROM TRING.FISCAL.SERVER


All replies are given in XML type file, same name as the command, just in
subdirectory „/odgovori“
So for example on command:
Stampatifiskalniracun.1045
Which is placed in „C:\tring\xml“, server will send reply with same name of
the file: Stampatifiskalniracun.1045 in directory „C:\tring\xml\odgovori“.

Examples of commands and their respective XSD shemas are given in


directory: „/xml/primjeri“.

7. GIVING COMMANDS TO TRING FISCAL DEVICES AND EXAMPLES


7.1. Login to device - Initialization
IMPORTANT !!! Initialization is REQUIRED first command while turning on the fiscal device. This command
should be sent while user is logging in software application.

This command is important in Tring.Favourite Plus as described on on page 10.

Example: C#
bool init = printer.Inicijalizacija("localhost", 8085, 0, "0");
where:
localhost – network name or PC IP address on which
Tring.Fiscal.Server is installed.
8085 – port where Tring.Fiscal.Server expects to recieve commands.

0 – operator code, in this case it is administrator.We recommend to


use this opetator because only this operator could change or add commodities.
„0“ – Operator password 1.

15 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Example: VB
Dim init as Boolean
init = printer.Inicijalizacija("localhost", 8085, 0, "0");

Exapmle XML File


Command file name: inicijalizacija.xml or init.xml

Command example:

<?xml version="1.0" encoding="utf-8"?>


<Operator xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojOperatora>0</BrojOperatora>
<Lozinka>0</Lozinka>
</Operator>

Reply example:

<?xml version="1.0" encoding="utf-8"?>


<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv />
<Vrijednost xsi:type="xsd:int">200</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
</KasaOdgovor>

7.2. Working with commodity database – UpisiArtikal , UpisiArtikle, CitajArtikal,


CitajArtikle
Tring.Fiscal devices own operative memory that can store 16.000
commodities with TringFavourite Plus, and 60.000 commodities with
TringPartnera. For every commodity is saved: Name (Including unit of
measure), price and tax group. Operative memory is organized in a way
that it is possible to address every commodity.
PLU- represents memory address-pointer, on which is saved certain
commodity. PLU is with TringFavourite Plus from 1 to 16000, with
TringPartner is 1-60.000. Part of operative memory where commodity
database is saved if realized as „Flash“ memory, for erase preventing
even in case of battery supply power loss. This memory has warranted
writing cycles life, so it is not implemented reset of whole database.
It is only possible to change commodity on certain memory location –
PLU.

Tring.Fiscal.Server has local repository (database) in which are saved


data about database on the fiscal device. Synchronization of local
repository with database on the device is done automatically executing
commands of writing or changing commodities, or setting the „ZadnjiPLU“
= -1, in Tring.Fiscal.Server settings.

Relevant settings of Tring.Fiscal.Server are:


KoristiTringFiscalZaMenadzmentBazeArtikala i ValidacijaArtikalaPrijeProdaje.
Explanation of these settings is given in Section 4.

16 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Class Artikal (commodity) have next properties:


PLU – Memory address where commodity is saved in fiscal device. Number from
1-16000 for TringFavourite Plus and 1-60000 for TringPartner.
If this property is not sent with commodity, then Tring.Fiscal will
find where this commodity is in database on fiscal device.
Sifra – commodity code from software application. It could be Number or
number and characters value up to 50 characters. Commodity code can
be same as PLU.
Naziv – Commodity name. Together with unit of measure, it could be up to 36
characters in Tring.Favourite Plus and 32 characters in
Tring.Partner. Delimiter between commodity name and unit of measure
is „/“ (slash). Tring.Fiscal automatically forms the name and unit of
measure by described algorithm.
JM – Unit of measure of commodity. Maximum 2 characters. Tring.Fiscal
automatically forms name and unit of measure of commodity on
described algorithm.
Stopa – Tax group of commodity.
Allowed values for users who are taxpayers are: E and K, where E –
main group (17%), K-group for commodities released from paying PDV
(0%).
Allowed values for users which are not in „PDV“ system are: A, where
A – group (0%) for users which are not in „PDV“ system.
Cijena – Commodity price. Allowed range is: 0.01 do 9 999 999.99 (7+2).
Tring.Fiscal will automatically validate these values during writing
commodity and sale.

IMPORTANT!!! It is forbidden to change name, unit of measure, and tax group of


commodity on certain PLU in forbidden period. If options
„KoristiTringFiscalZaMenadzmentBazeArtikala i ValidacijaArtikalaPrijeProdaje“,
Tring.Fiscal will, during change of name, unit of measure or tax group of
commodity in forbidden period, automatically add same commodity with new PLU.

7.2.1. UpisiArtikal (WriteCommodity)

C#
Artikal art = new Artikal();
art.PLU = 0; //let Tring.Fiscal find commodity or put it on new location.
Options: ValidacijaArtikalaPrijeProdaje i
KoristiTringFiscalZaMenadzmentBazeArtikala must be st to true.
art.Sifra = „15“ //just numbers
art.Naziv = „Test commodity 15“;
art.JM = „pc“;
art.Cijena = 2.88;
art.Stopa = VrstePoreskihStopa.E_Opca_poreska_stopa_PDV;

//Add to printer
odgovor = printer.UpisiArtikal(art);
if (odgovor.VrstaOdgovora == VrsteOdgovora.OK)
{
Debug.WriteLine(art.Naziv + ":OK");
}

Visual Basic 6

XML Commands
Name of the command file: upisiartikal.xml or ua.xml

17 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Command example:

<?xml version="1.0" encoding="utf-8"?>


<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>592489</BrojZahtjeva>
<VrstaZahtjeva>105</VrstaZahtjeva>
<NoviObjekat>
<Sifra>21</Sifra>
<Naziv>New commodity</Naziv>
<JM>pc</JM>
<Cijena>59</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</NoviObjekat>
</RacunZahtjev>

Reply example:

<?xml version="1.0" encoding="utf-8"?>


<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.2.2. UpisiArtikle (WriteCommodities)

C#
ArtikalList listaArtikala = new ArtikalList();

Artikal art = new Artikal();


art.PLU = 0; //let Tring.Fiscal find commodity or put it on new location.
Options: ValidacijaArtikalaPrijeProdaje i
KoristiTringFiscalZaMenadzmentBazeArtikala must be st to true.
art.Sifra = "15";
art.Naziv = "Test commodity 15";
art.JM = "pc";
art.Cijena = 2.88;
art.Stopa = VrstePoreskihStopa.E_Opca_poreska_stopa_PDV;
listaArtikala.Dodaj(art);

Artikal art2 = new Artikal();


art2.PLU = 0; //let Tring.Fiscal find commodity or put it on new location.
Options: ValidacijaArtikalaPrijeProdaje i
KoristiTringFiscalZaMenadzmentBazeArtikala must be st to true.
art2.Sifra = "20";
art2.Naziv = "Test commodity 20";
art2.JM = "pc";
art2.Cijena = 12.88;
art2.Stopa =
VrstePoreskihStopa.K_Poreska_stopa_PDV_za_artikle_oslobodjene_PDV;
listaArtikala.Dodaj(art2);

//Add to printer
odgovor = printer.UpisiArtikle(listaArtikala);
if (odgovor.VrstaOdgovora == VrsteOdgovora.OK)
{
Debug.WriteLine("OK");

18 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Visual Basic 6

XML Commands
Command file name: upisiartikle.xml or uae.xml

Command example:

<?xml version="1.0" encoding="utf-8"?>


<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>0</BrojZahtjeva>
<VrstaZahtjeva>0</VrstaZahtjeva>
<NoviObjekat>
<Artikli>
<Artikal>
<Sifra>21</Sifra>
<Naziv>New commodity</Naziv>
<JM>pc</JM>
<Cijena>59</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>22</Sifra>
<Naziv>This is commodity 22</Naziv>
<JM>pc</JM>
<Cijena>2399</Cijena>
<Stopa>K</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
</Artikli>
</NoviObjekat>
</RacunZahtjev>

Reply example:

<?xml version="1.0" encoding="utf-8"?>


<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>Greska</VrstaOdgovora>
</KasaOdgovor>

7.2.3. CitajArtikal (ReadCommodity)

C#

Artikal art = printer.CitajArtikal(1);

Visual Basic 6

XML Commands
Command file name: citajartikal.xml or ca.xml

Command example:
<?xml version="1.0" encoding="utf-8"?><double>1</double>
19 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Reply Example:
<?xml version="1.0" encoding="utf-8"?>
<Artikal xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Sifra>1</Sifra>
<Naziv>First commodity</Naziv>
<JM>pc</JM>
<Cijena>2.22</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>1</PLU>
</Artikal>

7.2.4. CitajArtikle(ReadCommodities)

C#

ArtikalList art = printer.CitajArtikle(1,10);

Visual Basic 6

XML Commodities
Command file name: citajartikle.xml or cae.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<ArrayOfDouble xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<double>1</double>
<double>10</double>
</ArrayOfDouble>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<ListaArtikala xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Artikli>
<Artikal>
<Sifra>1</Sifra>
<Naziv>First commodity</Naziv>
<JM>pc</JM>
<Cijena>2.22</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>2</Sifra>
<Naziv>My commodity</Naziv>
<JM>lb</JM>
<Cijena>10.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>3</Sifra>
<Naziv>Some commodity</Naziv>
<JM>pc</JM>
<Cijena>3.33</Cijena>
<Stopa>E</Stopa>
20 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>4</Sifra>
<Naziv>New commodity 4</Naziv>
<JM>pc</JM>
<Cijena>0.99</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>5</Sifra>
<Naziv>Deleted 22</Naziv>
<JM>hh</JM>
<Cijena>22</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>6</Sifra>
<Naziv>Totaly new</Naziv>
<JM>kk</JM>
<Cijena>66.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>7</Sifra>
<Naziv>Commodity 7</Naziv>
<JM>jm</JM>
<Cijena>3.69</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>8</Sifra>
<Naziv>NESQUIK</Naziv>
<JM />
<Cijena>3.24</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>9</Sifra>
<Naziv>Commodity 9</Naziv>
<JM />
<Cijena>258</Cijena>
<Stopa>K</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>
</Artikal>
<Artikal>
<Sifra>10</Sifra>
<Naziv>nihad</Naziv>
<JM>ko</JM>
<Cijena>2.55</Cijena>
<Stopa>K</Stopa>
<Grupa>0</Grupa>
<PLU>0</PLU>

21 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

</Artikal>
</Artikli>
</ListaArtikala>

7.3. Sales – StampatiFiskalniRacun


IMPORTANT !! During fiscal receipt printing command execution there are next
rules:

Operator must be logged in over „inicijalizacija“ command.

a) Commodities must be saved into fiscal device database before command


execution if options „KoristiTringFiscalZaMenadzmentBazeArtikala“ i
„ValidacijaArtikalaPrijeProdaje“ set to „false“.
b) Maximum number of items per receipt in TringFavourite Plus is 95 and in
TringPartner is 500.
c) Commodity quantity that is sold must be in range from 0.01 to 999
999.999
d) Discaount must be in range from 0 to 99.99 (%). If discount is negative
number that will enlarge amount for that percentage of discount.
e) Customers do not have to be saved to database before because of
existance of electronic journal. It is allowed to only define
properties of the class „Kupac“ on receipt and reclaimed receipt.
f) If receipt is made for end customer then class „Kupac“ could be omited
completely from command. Driver will automatically omit customer when
wrong „JIB“ is entered (JIB is customers 13 number identification
number).
g) Allowed payment methods of the receipts are: Gotovina (Cash), Cek
(Check), Kartica (Card) i Virman (Transfer order).
h) It is possible to pay a receipt with more payment methods. Example. If
receipt amount is 100KM then part could be played: Gotovina(Cash)-
20KM, 30KM Cek(Check), 40KM Virman(Transfer order), 10KM Kartica
(Card).
i) If amount of payment method = 0, then complete rest of the amount or
comlete amount of the receipt pays with then payment method.
Example. Receipt amount is 100KM:
_printer.DodajVrstuPlacanja(VrstePlacanja.Gotovina,10)
_printer.DodajVrstuPlacanja(VrstePlacanja.Cek,0)
_printer.DodajVrstuPlacanja(VrstePlacanja.Virman,10)

Tring.Fiscal will ignore payment method „Virman“, because part of the


receipt – 10 KM is paid with „Gotovina“, and the rest – 90 with „Cek“.
j) If payment method is not defined thru the command, then default payment
method is „Gotovina“ (Cash).
k) Paid amount with „Cek“ (Check) and „Kartice“ (Card) could not be
greater than receipt amount.
l) If paid amount is greater than receipt amount, then on the receipt will
be shown „POVRAT“ (refund) for that difference (kusur - change). Refund
is only possible in „Gotovina“ (Cash).

22 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

m) If there is an error during printing items of receipt, whole receipt


would be canceled.

Properties of the class „Kupac“:

IDBroj – Unique identification number of the customer – 13 numbers


PDVBroj – PDV number of the customer (12 numbers) – not mandatory
Naziv – customer name, up to 32 characters
Adresa – customers address, up to 32 characters
PostanskiBroj – Post office number (PO Box) – 5 numbers
Grad – City of place of the customer: on TringFavourite Plus – 12
characters, on TringPartner – 26 characters
On TringFavourite Plus, Tring.Fiscal will in case if address bigger than 16
characters and name is less than 16 characters, will take 32 characters for
address and contrary.

During printing, TringPartner uses fast printing 17 by 17 receipt items. If


receipt has over 100 items, then it will print buffered by 100 items.

If printer is „stuck“ during printing receipt,„PrekiniRacun“ command should


be used.

7.3.1. Štampanje fiskalnog računa bez kupca (Printig fiscal receipt without
customer)

C#
KasaOdgovor odgovor = new KasaOdgovor();
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=..\..\..\..\..\VB6\pos.mdb");
OleDbCommand command = new OleDbCommand("select * from
KOMITENTI where JIB=1234567890123", con); //customer on the receipt

OleDbDataReader dr;
try
{
//open connection
con.Open();

//new receipt
Racun _racun = new Racun();
//in case if this is reclaimed receipt here goes the number
of fiscal receipt that is reclaimed
_racun.BrojRacuna = "1";

//Loading items
command.CommandText = "SELECT RACUNI_STAVKE.BrojStavke,
RACUNI_STAVKE.BrojRacuna, RACUNI_STAVKE.Artikal, RACUNI_STAVKE.Kolicina,
RACUNI_STAVKE.Cijena, RACUNI_STAVKE.Rabat, ARTIKLI.Naziv, ARTIKLI.JM,
ARTIKLI.StopaPDV " +
"FROM RACUNI_STAVKE INNER JOIN ARTIKLI
ON RACUNI_STAVKE.Artikal = ARTIKLI.Sifra " +
" where RACUNI_STAVKE.BrojRacuna=1";
dr = command.ExecuteReader();

while (dr.Read())

23 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

{
RacunStavka _stavka = new RacunStavka();
//commodity
Artikal art = new Artikal();
art.Sifra = dr.GetValue(2).ToString();
art.Naziv = dr.GetString(6);
art.JM = dr.GetString(7);
art.Stopa = (VrstePoreskihStopa)dr.GetInt16(8);
art.Cijena = (double)dr.GetValue(4);
_stavka.artikal = art;
_stavka.Kolicina = (double)dr.GetValue(3);
_stavka.Rabat = (double)dr.GetValue(5);

_racun.DodajStavkuRacuna(_stavka);

}
dr.Close();
//enter payment method
//when amount is 0 then whole amount goes to that payment
method
//according the Law, it has to be enabled to pay one
receipt with more payment methods.
//
_racun.DodajVrstuPlacanja(VrstePlacanja.Virman, 0);

//add to printer
if (fiskalniracun)
{
odgovor = printer.StampatiFiskalniRacun(_racun);
}
else {
odgovor = printer.StampatiReklamiraniRacun(_racun);
}

if (odgovor.VrstaOdgovora == VrsteOdgovora.OK)
{
Debug.WriteLine("OK");
for (int i = 0; i < odgovor.Odgovori.Count; i++)
{
Debug.WriteLine
(String.Format("{0}:{1}",odgovor.Odgovori[i].Naziv,odgovor.Odgovori[i].Vrij
ednost.ToString()));
//if (odgovor.Odgovori[i].Naziv ==
"BrojFiskalnogRacuna")
//{
// //
//}
}
}

con.Close();

}
catch (Exception ex)
{

MessageBox.Show(ex.Message);

24 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Visual Basic 6

XML Commands
Command file name: stampatifiskalniracun.xml or sfr.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>233</BrojZahtjeva>
<VrstaZahtjeva>0</VrstaZahtjeva>
<NoviObjekat>
<StavkeRacuna>
<RacunStavka>
<artikal>
<Sifra>2</Sifra>
<Naziv>My commodity</Naziv>
<JM>pc</JM>
<Cijena>10.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>2</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>
</StavkeRacuna>
<VrstePlacanja>
<VrstaPlacanja>
<Oznaka>Gotovina</Oznaka>
<Iznos>0</Iznos>
</VrstaPlacanja>
</VrstePlacanja>
<Napomena>Thank you for visiting us!!!</Napomena>
<BrojRacuna>0</BrojRacuna>
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv>OK</Naziv>
<Vrijednost xsi:type="xsd:string" />
</Odgovor>
<Odgovor>
<Naziv>BrojFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:long">35</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>DatumFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">9.1.11</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>VrijemeFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">13:20</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>IznosFiskalnogRacuna</Naziv>
25 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Vrijednost xsi:type="xsd:int">0</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>0</BrojZahtjeva>
</KasaOdgovor>

7.3.2. Štampanje fiskalnog računa sa kupcem (Printing fiscal receipt with


customer)

C#
KasaOdgovor odgovor = new KasaOdgovor();
OleDbConnection con = new
OleDbConnection(@"Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=..\..\..\..\..\VB6\pos.mdb");
OleDbCommand command = new OleDbCommand("select * from
KOMITENTI where JIB=1234567890123", con); //Customer on the receipt

OleDbDataReader dr;
try
{
//open connection
con.Open();

//New receipt
Racun _racun = new Racun();
//in case if this is reclaimed receipt here goes the number
of fiscal receipt that is reclaimed
_racun.BrojRacuna = "1";
//add customer if exists
Kupac kup = new Kupac();

dr = command.ExecuteReader();
while (dr.Read())
{

kup.IDbroj = dr.GetDouble(0); //Only numbers


kup.Naziv = dr.GetString(1);
kup.Adresa = dr.GetString(2);
kup.PostanskiBroj = int.Parse(dr.GetString(3));
kup.Grad = dr.GetString(4);
}
dr.Close();
//set the customer ont the receipt
_racun.Kupac = kup;

//Load items of the receipt


command.CommandText = "SELECT RACUNI_STAVKE.BrojStavke,
RACUNI_STAVKE.BrojRacuna, RACUNI_STAVKE.Artikal, RACUNI_STAVKE.Kolicina,
RACUNI_STAVKE.Cijena, RACUNI_STAVKE.Rabat, ARTIKLI.Naziv, ARTIKLI.JM,
ARTIKLI.StopaPDV " +
"FROM RACUNI_STAVKE INNER JOIN ARTIKLI
ON RACUNI_STAVKE.Artikal = ARTIKLI.Sifra " +
" where RACUNI_STAVKE.BrojRacuna=1";
//
dr = command.ExecuteReader();

while (dr.Read())
{
RacunStavka _stavka = new RacunStavka();
//commodity
Artikal art = new Artikal();

26 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

art.Sifra = dr.GetValue(2).ToString();
art.Naziv = dr.GetString(6);
art.JM = dr.GetString(7);
art.Stopa = (VrstePoreskihStopa)dr.GetInt16(8);
art.Cijena = (double)dr.GetValue(4);
_stavka.artikal = art;
_stavka.Kolicina = (double)dr.GetValue(3);
_stavka.Rabat = (double)dr.GetValue(5);

_racun.DodajStavkuRacuna(_stavka);

}
dr.Close();
//enter payment method
//when amount is 0 then whole amount goes to that payment
method
//according the Law, it has to be enabled to pay one
receipt with more payment methods.
//
_racun.DodajVrstuPlacanja(VrstePlacanja.Virman, 0);

//Add to printer
if (fiskalniracun)
{
odgovor = printer.StampatiFiskalniRacun(_racun);
}
else {
odgovor = printer.StampatiReklamiraniRacun(_racun);
}

if (odgovor.VrstaOdgovora == VrsteOdgovora.OK)
{
Debug.WriteLine("OK");
for (int i = 0; i < odgovor.Odgovori.Count; i++)
{
Debug.WriteLine
(String.Format("{0}:{1}",odgovor.Odgovori[i].Naziv,odgovor.Odgovori[i].Vrij
ednost.ToString()));
//if (odgovor.Odgovori[i].Naziv ==
"BrojFiskalnogRacuna")
//{
// //
//}
}
}

con.Close();

}
catch (Exception ex)
{

MessageBox.Show(ex.Message);

Visual Basic 6

XML command
Command file name: stampatifiskalniracun.xml or sfr.xml

27 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>233</BrojZahtjeva>
<VrstaZahtjeva>0</VrstaZahtjeva>
<NoviObjekat>
<Kupac>
<IDbroj>1234567890123</IDbroj>
<Naziv>Tring d.o.o. Informatički Inženj</Naziv>
<Adresa>Mehmeda Vehbi ef. Šemsekadića bb</Adresa>
<PostanskiBroj>75320</PostanskiBroj>
<Grad>Gračanica</Grad>
</Kupac>
<StavkeRacuna>
<RacunStavka>
<artikal>
<Sifra>2</Sifra>
<Naziv>My commodity</Naziv>
<JM>pc</JM>
<Cijena>10.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>2</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>
</StavkeRacuna>
<VrstePlacanja>
<VrstaPlacanja>
<Oznaka>Gotovina</Oznaka>
<Iznos>0</Iznos>
</VrstaPlacanja>
</VrstePlacanja>
<Napomena>Thank you for vising us!!!</Napomena>
<BrojRacuna>233</BrojRacuna>
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv>OK</Naziv>
<Vrijednost xsi:type="xsd:string" />
</Odgovor>
<Odgovor>
<Naziv>BrojFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:long">36</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>DatumFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">9.1.11</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>VrijemeFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">13:29</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>IznosFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:int">0</Vrijednost>
28 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>233</BrojZahtjeva>
</KasaOdgovor>

7.4. Reclamation - StampatiReklamiraniRacun (Recalimed receipt)


IMPORTANT!!! During execution of the command of printing reclaimed receipt same
rules applies as on fiscal receipt (see chapter 7.3), and new rules applies:

a) It is mandatory to set property „BrojRacuna“ to fiscal receipt number


on which reclamation is related in command for printing reclaimed
receipt.
b) It is necessary to have enough amount of Cash make reclaimed receipt.
If for example amount of reclaimed receipt 100KM, then it is necessary
to have at least 100KM in fiscal device.
c) Money return is only possible in „Gotovina“ (Cash) from reclaimed
receipt.
d) If in command is paymant methods (Vrste plaćanja), then it is treated
as customers additional payment!
Example. If amount of reclaimed receipt is 100KM, and in command for
printing reclaimed receipt „StampatiReklamiraniRacun“ exists payment
methods, „Gotovina“ 10KM (Cash), Virman 10KM (Transfer order), then it
implies that customer paid us 20 KM and we have to return him 100KM.
More about this you can find in „Pravilnik o izgledu fiskalnih
dokumenata“.

29 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Problem above, you could solve in this way:


Say that customer xx day paid 100 KM. He comes after yy days to reclaim
a receipt. It is necessary to execute command „UnosNovca“, with cash
100KM. Make reclaimed receipt with cash return of 100KM.
additional payments are not implemented in TringFavourite Plus.

7.4.1. Štampanje reklamiranog računa bez kupca (Printing reclaimed receipt


without a customer)

C#
//new receipt
Racun _racun = new Racun();
//in case if this is reclaimed receipt here goes the number
of fiscal receipt that is reclaimed
_racun.BrojRacuna = "1";
///...identical procedure as on fiscal receipt
///...
///....
//print reclaimed receipt

odgovor = printer.StampatiReklamiraniRacun(_racun);

Visual Basic 6

XML Commands
Command file name: StampatiReklamiraniRacun.xml or srr.xml
30 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>19</BrojZahtjeva>
<VrstaZahtjeva>2</VrstaZahtjeva>
<NoviObjekat>
<StavkeRacuna>
<RacunStavka>
<artikal>
<Sifra>2</Sifra>
<Naziv>My commodity</Naziv>
<JM>pc</JM>
<Cijena>10.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>2</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>
</StavkeRacuna>
<VrstePlacanja />
<Napomena>Thank you for visiting us!!!</Napomena>
<BrojRacuna>19</BrojRacuna><!—Number of the fiscal receipt that is being
reclaimed-->
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv>OK</Naziv>
<Vrijednost xsi:type="xsd:string" />
</Odgovor>
<Odgovor>
<Naziv>BrojFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:long">5</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>DatumFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">9.1.11</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>VrijemeFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">13:46</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>IznosFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:int">0</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>19</BrojZahtjeva>
</KasaOdgovor>

31 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

7.4.2. Štampanje reklamiranog računa sa kupcem (Printinf reclaimed receipt with


customer)

C#
//new receipt
Racun _racun = new Racun();
//in case if this is reclaimed receipt here goes the number
of fiscal receipt that is reclaimed
_racun.BrojRacuna = "1";
///...identical procedure as in fiscal receipt
///...
///....
//print reclaimed receipt

odgovor = printer.StampatiReklamiraniRacun(_racun);

Visual Basic 6

XML Commands
Command file name: StampatiReklamiraniRacun.xml or srr.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>20</BrojZahtjeva>
<VrstaZahtjeva>2</VrstaZahtjeva>
<NoviObjekat>
<Kupac>
<IDbroj>1234567890123</IDbroj>
<Naziv>Tring d.o.o. Informatički Inženj</Naziv>
<Adresa>Mehmeda Vehbi ef. Šemsekadića bb</Adresa>
<PostanskiBroj>75320</PostanskiBroj>
<Grad>Gračanica</Grad>
</Kupac>
<StavkeRacuna>
<RacunStavka>
<artikal>
<Sifra>2</Sifra>
<Naziv>My commodity</Naziv>
<JM>pc</JM>
<Cijena>10.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>2</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>
</StavkeRacuna>
<VrstePlacanja />
<Napomena>Thank you for visiting us!!!</Napomena>
<BrojRacuna>20</BrojRacuna><!—Number of the fiscal receipt that is being
reclaimed-->
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
32 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Odgovor>
<Naziv>OK</Naziv>
<Vrijednost xsi:type="xsd:string" />
</Odgovor>
<Odgovor>
<Naziv>BrojFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:long">4</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>DatumFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">9.1.11</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>VrijemeFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:string">13:46</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>IznosFiskalnogRacuna</Naziv>
<Vrijednost xsi:type="xsd:int">0</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>20</BrojZahtjeva>
</KasaOdgovor>

7.5. Cash in, Cash out – UnosNovca, PovratNovca


Allowed ways of „cash in“ and „cash out“ are: „Gotovina“ (eng.Cash), „Cek“(
eng.Check), „Kartica“ (eng.Card) i Virman(Eng. Transfer order). Take care
of the names of payment methods because they are case sensitive!

7.5.1. UnosNovca (Cash In)

C#

odgovor = printer.UnosNovca(VrstePlacanja.Gotovina,100);

Visual Basic 6

XML Command
Command file name: unosnovca.xml or un.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>0</BrojZahtjeva>
<VrstaZahtjeva>7</VrstaZahtjeva>
<NoviObjekat>
<Oznaka>Gotovina</Oznaka>
<Iznos>125.35</Iznos>
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

33 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

7.5.2. PovratNovca (Cash Out)

C#

odgovor = printer.PovratNovca (VrstePlacanja.Gotovina,100);

Visual Basic 6

XML Commands
Command file name: povratnovca.xml or pn.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunZahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>0</BrojZahtjeva>
<VrstaZahtjeva>7</VrstaZahtjeva>
<NoviObjekat>
<Oznaka>Virman</Oznaka>
<Iznos>120.33</Iznos>
</NoviObjekat>
</RacunZahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.6. Reports – (StampatiPresjekStanja, StampatiDnevniIzvjestaj,


StampatiPeriodicniIzvjestaj)

7.6.1. StampatiPresjekStanja (X-report)


Report „Presjek stanja“ or X-report, is report about current fiscal device
state: total sales, total reclaimed, sales and reclaimed by tax groups, and
money state in the register.
This report could be printed more than once a day.
This report does not closes the register!

C#

odgovor = printer.StampatiPresjekStanja();

Visual Basic 6

XML Commands
Command file name: StampatiPresjekStanja.xml or sps.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<Zahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>149678</BrojZahtjeva>
<VrstaZahtjeva>3</VrstaZahtjeva>

34 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Parametri />
</Zahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>Greska</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.6.2. StampatiDnevniIzvjestaj (Z-report)


„Dnevni izvještaj“ or Z-report, is report about total state of the
register between two Z-reports: total sales, total reclaimed, sales and
reclaimed by tax groups.
This is mandatory report, which is usual printed on the ond of the day.
It is possible to print this report more than once a day, but device
limitations are 2000 Z-reports per one fiscal module and electronic
journal.
This report „Closes“ the fiscal device (Sets sales and reclaimed and
money to „= 0“).

C#

odgovor = printer.StampatiDnevniIzvjestaj();

Visual Basic 6

XML Command
Command file name: StampatiDnevniIzvjestaj.xml or sdi.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<Zahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>330176</BrojZahtjeva>
<VrstaZahtjeva>4</VrstaZahtjeva>
<Parametri />
</Zahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.6.3. StampatiPeriodicniIzvjestaj (Periodical report)


„Periodični izvještaj“ (Periodical report), is report of the register
between two time intervals: total sales, total reclaimed, sales and
reclaimed by tax groups.

35 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

This is a mandatory report that have to be printed on the end of the


month and period is: first day of that month to last day of that month.

This report does not „closes“ the register!

C#

odgovor = printer.StampatiPeriodicniIzvjestaj(new DateTime(2010, 10,


10), new DateTime(2010, 10, 10));

Visual Basic 6

XML commands
Command file name: StampatiPeriodicniIzvjestaj.xml or spi.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<Zahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>129345</BrojZahtjeva>
<VrstaZahtjeva>5</VrstaZahtjeva>
<Parametri>
<Parametar>
<Naziv>odDatuma</Naziv>
<Vrijednost>1.1.2011 14:59:58</Vrijednost>
</Parametar>
<Parametar>
<Naziv>doDatuma</Naziv>
<Vrijednost>9.1.2011 14:59:58</Vrijednost>
</Parametar>
</Parametri>
</Zahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>Greska</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.7. Non-Fiscal text – StampatiNefiskalniTekst (Non fiscal text)


By the Law, it is possible to print any kind of non-fiscal text thru fiscal
device. It is possible to print any kind of additional reports, commercial
text, under next conditions:

a) It is not allowed to print any kind of logo in non-fiscal text, or


any kind of object that is similar to „fiscal logo“.
b) It is not allowed more than 5 characters „-„ and „=“ in one line.
From security reasons, Tring.Fiscal automatically replaces these
characters with „ „.
c) Before start of printing non-fiscal text it has to be „POČETAK
NEFISKALNOG TEKSTA“, and in the end „KRAJ NEFISKALNOG TEKSTA“.
d) Complete non-fiscal text has to be saved to electronic journal.

36 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

e) On TringFavourite Plus-a, start of the non-fiscal text „$$_“ i „$#_“


are reserved for non fiscal reports.

Tring.Fiscal during format of received command for printing non non-fiscal


text, first splits text by „LineFeed“, (Byte =10), then sends line by line
to printer.

Take care that number of characters in line for Tring.Favourite Plus = 18


and Tring.Partner = 32.

C#

odgovor = printer.StampatiNefiskalniDokument("Test document \n ok");

Visual Basic 6

XML Command
Command file name: StampatiNefiskalniDokument.xml or snd.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<Zahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>837650</BrojZahtjeva>
<VrstaZahtjeva>6</VrstaZahtjeva>
<Parametri>
<Parametar>
<Naziv>Text</Naziv>
<Vrijednost>
Test document
ok
</Vrijednost>
</Parametar>
</Parametri>
</Zahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.8. Printing duplicates of fiscal documents – StampatiDuplikatPresjekaStanja

It is possible to print only last fiscal document on fiscal device.


Duplicate of a fiscal document is used when, from some reason is error in
printig, (out of paper, paper is jammed, etc.).

37 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

C#

odgovor = printer.StampatiDuplikatPresjekaStanja ();

Visual Basic 6

XML Command
Command file name: Duplikat.xml or dup.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<Zahtjev xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<BrojZahtjeva>941874</BrojZahtjeva>
<VrstaZahtjeva>6</VrstaZahtjeva>
<Parametri />
</Zahtjev>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.9. Other functions – OsnovneInformacije, UpisiNaDisplej, CitajDatumIVrijeme


(Basic informations, WriteToDisplay, ReadDateTime)

7.9.1. OsnovneInformacije(Basic informations)

C#

odgovor = printer.OstaleInformacije ();

Visual Basic 6

XML Command
Command file name: OstaleInformacije.xml or oi.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv>FactoryId</Naziv>
<Vrijednost xsi:type="xsd:string" />
</Odgovor>
<Odgovor>
<Naziv>FMSignature</Naziv>
<Vrijednost xsi:type="xsd:string">vt</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>IBFM</Naziv>

38 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Vrijednost xsi:type="xsd:string">123456</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>JIB</Naziv>
<Vrijednost xsi:type="xsd:string">4444444444444</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>PIB</Naziv>
<Vrijednost xsi:type="xsd:string">333333333333</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>InitTime</Naziv>
<Vrijednost xsi:type="xsd:string"> 18:4</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>InitDate</Naziv>
<Vrijednost xsi:type="xsd:string">06.01.2011</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>NumberOfDailyReports</Naziv>
<Vrijednost xsi:type="xsd:unsignedInt">5</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>NumberOfTaxChanges</Naziv>
<Vrijednost xsi:type="xsd:unsignedInt">3</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>NumberOfResets</Naziv>
<Vrijednost xsi:type="xsd:unsignedInt">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>NumberOfServices</Naziv>
<Vrijednost xsi:type="xsd:unsignedInt">2</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Linija1</Naziv>
<Vrijednost xsi:type="xsd:string">NAZIV OBVEZNIKA**м**тŽУ#-9*_Ч*0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Linija2</Naziv>
<Vrijednost xsi:type="xsd:string">NAZIV PROFAJNOG MJESTA* -*tо*КИ</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Linija3</Naziv>
<Vrijednost xsi:type="xsd:string">ADRESA PRODAJNOG MJESTA*т**s**q</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Linija4</Naziv>
<Vrijednost xsi:type="xsd:string">POŠTANSKI BROJ MJESTA I MJESTO*</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Linija5</Naziv>
<Vrijednost xsi:type="xsd:string">**ОLszЕ-5nn*гđџG6*Чпо****Њš!зцΑ</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_GotovinaUnos</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_CekUnos</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_KarticaUnos</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>

39 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

</Odgovor>
<Odgovor>
<Naziv>_VirmanUnos</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_GotovinaPovrat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_CekPovrat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_KarticaPovrat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_VirmanPovrat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_StanjeGotovine</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_StanjeCeka</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_StanjeKartice</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPlaceno</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoReklamirano</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoKusur</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoKusurGotovine</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPrometPorezA</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPrometPorezE</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPrometPorezK</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPrometPoretJ</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>

40 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Odgovor>
<Naziv>_UkupnoPrometPorezM</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPorezA</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPorezE</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPorezK</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPoretJ</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoPorezM</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_PrometPremaKupcima</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_ReklamiraniPrometPremaKupcima</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoRabat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>_UkupnoReklamiraniRabat</Naziv>
<Vrijednost xsi:type="xsd:double">0</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>OK</VrstaOdgovora>
</KasaOdgovor>

7.9.2. UpisiNaDisplej
This function in only available on TringPartner-u.

C#

odgovor = printer.UpisiNaDisplej(racunstavka);

Visual Basic 6

XML Command
Command file name: UpisiNaDisplej.xml or und.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunStavka xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<artikal>
<Sifra>6</Sifra>

41 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

<Naziv>Sasvim novi</Naziv>
<JM>kk</JM>
<Cijena>66.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>6</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

7.9.3. CitajDatumIVrijeme
This function is only available on TringPartner-u.

C#

odgovor = printer.UpisiNaDisplej(racunstavka);

Visual Basic 6

XML Command
Command file name: citajdatumivrijeme.xml or cdv.xml

Command example:
<?xml version="1.0" encoding="utf-8"?>
<RacunStavka xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<artikal>
<Sifra>6</Sifra>
<Naziv>Sasvim novi</Naziv>
<JM>kk</JM>
<Cijena>66.33</Cijena>
<Stopa>E</Stopa>
<Grupa>0</Grupa>
<PLU>6</PLU>
</artikal>
<Kolicina>1</Kolicina>
<Rabat>0</Rabat>
</RacunStavka>

Reply example:
<?xml version="1.0" encoding="utf-8"?>
<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori />
<VrstaOdgovora>OK</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

42 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

8. DESCRIPTION OF POSIBLE ERRORS AND THEIR HANDLING


Tring.Fiscal always returns reply of type KasaOdgovor.
Below is example of file with error:

<?xml version="1.0" encoding="utf-8"?>


<KasaOdgovor xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<Odgovori>
<Odgovor>
<Naziv>Nedefiniran_Artikal</Naziv>
<Vrijednost xsi:type="xsd:int">510</Vrijednost>
</Odgovor>
<Odgovor>
<Naziv>Kolicina_cijena_0_Displej_u_kvaru_Placanje_0</Naziv>
<Vrijednost xsi:type="xsd:int">512</Vrijednost>
</Odgovor>
</Odgovori>
<VrstaOdgovora>Greska</VrstaOdgovora>
<BrojZahtjeva>553325325</BrojZahtjeva>
</KasaOdgovor>

Below is a list of posible errors. Errors of Tring.Partner are from 400 do


699, while TringFavourite Plus is from 600 to 699:

Nepoznata_greska=499,
Veza_sa_printerom_u_prekidu=400,
Operator_nije_logiran=401,
Neispravno_vrijeme =410,
Vrijeme_manje_od_vremena_fiskalizacije=411,
Napravi_dnevni_izvjestaj=412,
Greska_fiskalne_memorije=413,
Uredjaj_je_vec_fiskaliziran=414,
Porezna_grupa_ne_postoji=415,
Nema_elektronskog_zurnala_Pogresan_parametar=416,
Nema_servisnog_jumpera=417,
Pogresno_vrijeme = 418,
Vrijeme_manje_od_vremena_fiskalizacije_2 = 430,
DST_vec_promijenjeno=431,
Fiskalna_memorija_puna_porezi=440,
Fiskalna_memorija_puna_izvjestaji = 441,
Fiskalna_memorija_puna_reseti = 442,
Porezne_stope_iste = 470,
Operator_nije_logiran_2 = 655,
Greska_Fiskalna_Memorija_Elektronski_Zurnal_Modem=500,
Neispravno_vrijeme_2=501,
Neispravno_Fiskalno_Vrijeme=502,
Nema_papira=503,
Visoka_Temperatura_Printera=504,
Maximalan_Broj_Dnevnih_Izvjestaja=505,
Maximalan_Broj_Reseta=506,
Nepoznata_Greska=507,
Neispravna_Komanda=508,
Nedefinirana_Porezna_Grupa=509,
Nedefiniran_Artikal=510,
Maximalan_broj_artikala_dostignut=511,
Kolicina_cijena_0_Displej_u_kvaru_Placanje_0=512,
Prekoracenje_cijene_kolicine_placanja=513,
Prekoracenje_u_dnevnom_totalu=514,
Prekoracenje_u_prodaji_ili_placanju=515,
Prekoracenje_stavki_racuna_ili_reklamacije=516,
Prekoracenje_u_iznosu_reklamacije=517,

Ne_postoji_artikal_za_reklamaciju_Problem_rabata_Greska_u_nefiskalnom_tekstu=518,

43 | S t r a n a
TRING D.O.O. Informatički Inženjering GRAČANICA

Napravite_dnevni_izvjestaj_Skinite_servisni_jumper_IOSA_nije_uredu=519,
Format_kolicine_nije_uredu_Maximalan_Broj_klijenata_u_RAM=520,
Prekoracenje_iznosa_placanja=521,
Pogresna_vrsta_placanja_Servis_u_toku_Nedozvoljeni_rezim=522,
Placanja_karticom_ili_cekom_vece_od_iznosa_racuna=523,
Ukupna_suma_placanja_veca_od_sume_racuna=524,
Pogresna_komanda_za_trenutni_status=525,
Pogresan_parametar=526,
Problem_sa_terminalom_nema_odgovora=527,
Elektronski_zurnal_nema_konekcije=528,
Elektronski_zurnal_je_pun=529,
Problem_sa_prodajom_ili_dodavanjem_novog_artikla=530,
Elektronski_zurnal_prazan_ili_je_zamjenjen=531,
Račun pun ! = 601,
Prekoračenje u količini ili iznosu ! = 602,
Nema dovoljno novca ili količine ! = 603,
Ne postoji stavka za prodaju ili storno ! = 604,
Artikal nije programiran ! = 605,
Zahtjev nije validan ! = 606,
Cijena nije validna ili ne postoji ! = 607,
Količina nije validna ili ne postoji ! = 608,
Ne postoji veza sa PC ! = 609,
Zahtjev nije validan za trenutni status uređaja ! = 610,
Prekoračenje u prodaji po artiklima ! = 611,
Prekoračenje u dnevnoj prodaji (dnevni izvještaj se mora pokreniti) ! = 614,
Prekoračenje u prodaji po operateru (izvještaj po operaterima se mora pokreniti)
! = 615,
Nema papira ! = 616,
Pregrijavanje štampača ! = 617

44 | S t r a n a

You might also like