Technical Specification Ver1
Technical Specification Ver1
CIS specification
1
Certified Invoicing System (CIS) can be any electronic cash register, any terminal with
cash register software, any computer using invoicing software, or any other similar
system used for registration of outbound transactions.
1.2 CIS cannot operate unless connected to a functional Sales Data Controller unit
assigned for the same TIN, which preserves on a irrevocable and secure manner all
relevant data of the outbound transactions, uses this data to calculate an algorithm
that must be printed on the final receipt, in accordance with Article 4 of this
guideline, for the client by the means of CIS printing mechanism
A Certified Invoicing System shall generate receipts, which must show, among others,
the data enumerated in Items a to n of this Article as minimum required information:
a. Taxpayers name;
b. Tax Identification Number;
c. the address at which the sale takes place;
d. tax Identification number of the client(optional);
e. receipt type and transaction type;
f. serial number of the receipt from an uninterrupted ascending number series per
receipt type;
g. registered items and/or services with description, quantity, price, with any
other action that may be done such as cancellations, corrections;
Page 2 of 36
TRANSACTION TYPE
SALES
REFUND
SALES
REFUND
SALES
REFUND
SALES
RECEIPT LABEL
NS
NR
CS
CR
TS
TR
PS
The data flow between the Certified Invoicing System and the Sales Data Controller will
be as follows for each receipt type:
5.2 the CIS sends the following receipt data to the SDC at the time when the receipt is
being produced:
i. date and time;
ii. Tax Identification Number;
iii. client's TIN (optional);
iv. machine registration code (MRC);
v. receipt number;
vi. receipt type and transaction type;
vii. TAX rates;
viii. total amounts with TAX;
ix. TAX amounts.
5.3 the SDC receives receipt data from CIS
Page 3 of 36
CIS shall:
6.2 contain software (PC software or firmware) that controls the functions indicated in
these regulations;
6.3 have reprogrammable TIN under its service mode, for the purpose of ownership
transfer, only if the change of TIN is conditioned by the reset which deletes all
information saved for previously programmed TIN;
6.4 carry consecutive numbers in order to guarantee the completeness and the
inalterability of the journal records. This means that the journal records in the
electronic journal or the journal file (which includes all receipts of the various types,
among other things) can have maximum one ascending numbering per receipt type.
In case of a total reset of the Certified Invoicing System, the aforementioned
numbering shall recommence from 1 (one);
6.5 be provided with a model name and a manufacturing number through a Machine
Registration Code (MRC);
6.6 have display screen showing the inputs and outputs of the sale, capable of taking at
least 13 digits inclusive of 2 decimal places;
6.7 be able to produce receipts and reports with a statement of the registrations during a
day of sales and continuous use (Z daily report) and a statement of the registrations
since the last Z daily report (the X daily report);
6.8 be issued with a version number which is a unique identifier of the software version
and should be adapted for every change made to the software. CIS software version
must be enabled for verification by Authority personnel;
6.9 be able to issue receipts only if connected to SDC unit which is functioning under
normal circumstances;
6.10 be able to independently detect whether the SDC is operational or not, and inform
user of its status in case of error;
6.11 not have any other functions than those stipulated in its documentation. The
documentation shall be written in English and accompany the CIS on delivery;
6.12 have inventory control, where user is able to input and/or remove goods from stock
and produce independent report showing inventory status;
6.13 be able to register deposits and withdrawals;
6.14 be able to register payment with different kinds of means of payment;
6.15 be equipped with paper journal or electronic journal or the log file which contains all
the sales that immediately upon the creation of any printed material are recorded and
shall not operate without it;
6.16 not to be constructed in such a way that it is possible to register a sales amount
without the simultaneously printing a receipt;
Page 4 of 36
Receipt specification
Page 5 of 36
When a CIS provides a function for printing copies of the receipt, printing training or pro
forma tickets, they must be clearly distinguishable from the NORMAL receipt type. The
designation COPY, TRAINING, PRO FORMA has to be placed on the invoice bellow
receipt header and above item description section. Moreover, in such cases the following
text bellow of amount totals of the ticket has to be printed: "THIS IS NOT AN
OFFICIAL RECEIPT. It shall not be possible to alter the receipt identifying text, which
shall be at least twice as big as the text that indicates the amount.
11
All corrections on the receipt of any type must clearly distinguishing negative amounts
from positive amounts by using a minus sign.
12
Normal Sale, defined by receipt label as NS, refers to a receipt that shall be produced
and offered to the client. It is understood to be any receipt produced while the Electronic
Sales Device is in its normal registration mode, used to register sales of goods and/or
services, including corrections and discounts registered by means of the correction and
discount functionalities.
Page 6 of 36
TAXPAYER'S NAME
Shop address
Taxpayer Identification number
Commercial message
CLIENT'S Identification (optional)
Item description, unit price, quantity, total
price and tax designation
Discount percentage, total price with
discount
Void item
Page 7 of 36
Normal Refund, defined by receipt label as NR, refers to a receipt that shall be
produced, while Electronic Sales Device is in refund mode, for a client upon request with
information indicating that a previously printed Normal Sale receipt contains incorrect
information or information on a refund for returned or discounted goods or services.
Such refund receipt contains only negative, refunded amounts. Each receipt of this type
requires a statement by user inputted to a special refund log book containing receipt
details and justification with description and the name of the refund recipient.
13.2 Following is example of receipt type NORMAL and transaction type REFUND (NR)
Trade Name
Address, City
TIN: 000000000
-------------------------------------------------REFUND
REF. NORMAL RECEIPT#:
NNNN
-------------------------------------------------REFUND IS APPROVED ONLY FOR
ORIGINAL SALES RECEIPT
Client ID: 000000000
-------------------------------------------------Gravel /t
9000.00x
5.354
-48186.00B
-25% -36139.50
----------------------------------------------------TOTAL
-36139.50
TOTAL B-18.00%
-36139.50
TOTAL TAX B
-5512.81
TOTAL TAX
-5512.81
------------------------------------------------CASH
-36139.50
ITEMS NUMBER
1
-----------------------------------------------SDC INFORMATION
Date: 25/5/2012
Time: 11:48:27
SDC ID:
SDC001000001
RECEIPT NUMBER:
12/259 NR
Internal Data:
IR84-99TN-FCYY-CE22-4HWE-V5TA-EE
Receipt Signature:
669X-TBMM-GPE4-445D
---------------------------------------------RECEIPT NUMBER:
153
DATE: 25/5/2012
TIME: 11:50:24
MRC:
AAACC123456
-------------------------------------------THANK YOU
WE APPRECIATE YOUR BUSINESS
TAXPAYER'S NAME
Shop address
Taxpayer Identification number
TITLE for REFUND
Receipt number based on which refund is issued
(optional)
Commercial message
CLIENT'S Identification (optional)
Item description, unit price, quantity, total price in
NEGATIVE amount and tax designation
Reduction of price in percentage and total amount
Total amount to be refunded (negative amount)
Total amount with TAX (negative amount)
Total amount of TAX per tax rate (negative)
Total amount of TAX (negative)
Payment method (negative amount)
Number of items
Page 8 of 36
Copy, defined by receipt label as CS or CR, refers to a copy of only previously generated
receipt of any NORMAL receipt type
14.2 Following is example of receipt type COPY and transaction type REFUND (CR):
Trade Name
Address, City
TIN: 000000000
COPY
-------------------------------------------------REFUND
REF. NORMAL RECEIPT#: .... NNNN
-------------------------------------------------REFUND IS APPROVED ONLY FOR
ORIGINAL SALES RECEIPT
Client ID: 000000000
-------------------------------------------------Gravel /t
9000.00x
5.354
-48186.00B
-25% -36139.50
----------------------------------------------------THIS IS NOT AN OFFICIAL RECEIPT
-------------------------------------------------TOTAL
-36139.50
TOTAL B-18.00%
-36139.50
TOTAL TAX B
-5512.81
TOTAL TAX
-5512.81
------------------------------------------------CASH
-36139.50
ITEMS NUMBER
1
-----------------------------------------------COPY
-----------------------------------------------SDC INFORMATION
Date: 25/5/2012
Time: 11:49:47
SDC ID:
SDC001000001
RECEIPT NUMBER:
24/260 CR
Internal Data:
IR84-99TN-FCYY-CE22-4HWE-V5TA-EE
Receipt Signature:
REE4-EGMK-DSA2-PKMM
---------------------------------------------RECEIPT NUMBER:
154
DATE: 25/5/2012
TIME: 11:51:44
MRC:
AAACC123456
-------------------------------------------THANK YOU
WE APPRECIATE YOUR BUSINESS
Warning message
Page 9 of 36
Trade Name
Address, City
TIN: 000000000
TRAINING MODE
-------------------------------------------------Welcome to our shop
Client ID: 000000000
-------------------------------------------------Plain Bread
1000.00x
1.00
1000.00A-EX
Wriggly gum
60.00x
5.00
300.00B
----------------------------------------------------THIS IS NOT AN OFFICIAL RECEIPT
-------------------------------------------------TOTAL
1300.00
TOTAL A-EX
1000.00
TOTAL B-18.00%
300.00
TOTAL TAX B
45.76
TOTAL TAX
45.76
------------------------------------------------CASH
6340.00
ITEMS NUMBER
2
-----------------------------------------------TRAINING MODE
-----------------------------------------------SDC INFORMATION
Date: 25/5/2012
Time: 11:55:12
SDC ID:
SDC001000001
RECEIPT NUMBER:
33/261 TS
---------------------------------------------RECEIPT NUMBER:
155
DATE: 25/5/2012
TIME: 11:57:08
MRC:
AAACC123456
-------------------------------------------THANK YOU
COME BACK AGAIN
YOUR BEST STORE IN TOWN
Warning message
Page 10 of 36
Pro forma or an advance receipt, defined by receipt label only as PS refers to a printout
from an Electronic Sales Device while in pro forma mode, with information similar to
that contained on a NORMAL receipt type.
16.2 Following is example of receipt type PROFORMA and transaction type SALE (PS):
Trade Name
Address, City
TIN: 000000000
PROFORMA
-------------------------------------------------Welcome to our shop
Client ID: 000000000
-------------------------------------------------Cement 42.5/50kg
11000.00x
65.00
715000.00B
Clay local made brick
30.00x
5500.00
16500.00B
----------------------------------------------------THIS IS NOT AN OFFICIAL RECEIPT
-------------------------------------------------TOTAL
880000.00
TOTAL B-18.00%
880000.00
134237.29
TOTAL TAX B
TOTAL TAX
134237.29
-----------------------------------------------PROFORMA
-----------------------------------------------SDC INFORMATION
Date: 25/5/2012
Time: 12:17:41
SDC ID:
SDC001000001
RECEIPT NUMBER:
25/262 PS
---------------------------------------------RECEIPT NUMBER:
156
DATE: 25/5/2012
TIME: 12:19:38
MRC:
AAACC123456
-------------------------------------------THANK YOU
WE LOOK FORWARD TO EARNING
YOUR BUSINESS
17
Warning message
Certified Invoicing System shall have facility to generate detailed X daily report of the
day's sale during which financial transactions were conducted since the previous Z daily
report was generated.
17.2 Daily X reports produced by CIS represent a summary of all registrations since the
end of the previous Z daily report and it shall at least contain information on:
i. trade name and tax identification number;
Page 11 of 36
Electronic Sales Device shall have facility to generate detailed Z daily report at the end
of each day during which financial transactions were conducted and certified receipts
generated. This report will be regarded as a business and accounting record.
18.2 Daily Z report produced by CIS represent a summary of all registrations suitable for
account of a day's sale and shall at least contain information on:
i. trade name and tax identification number;
ii. date and time;
iii. information showing this is an Z daily report;
iv. CIS designation and MRC;
v. total sales amount for all sales receipts labeled as NS, including tax;
vi. total sales amount for all sales receipts labeled as NS, including tax, for the
different main groups if main groups are used;
vii. number of sales receipts labeled as NS;
viii. total refund amount for all refund receipts labeled as NR, including tax;
ix. number of refund receipts labeled as NR;
x. taxable amounts per applicable tax rates divided between sales (NS) and
refunds (NR);
xi. tax amounts per applicable tax rates divided between sales (NS) and refunds
(NR);
xii. opening deposit;
xiii. number of items sold;
xiv. number of receipt copies labeled as CS or CR and amount with tax included;
Page 12 of 36
When no report or only one of the above mentioned reports has been generated, the next
report shall contain all the data for the entire period (from the time of the previous Z
daily report to the time of the new report).
20
PLU report contains full details of each item, the quantities sold and the amounts
collected for each item and category since the previous PLU report was generated.
20.2 PLU report shall at least contain information on:
i. company name and tax identification number;
ii. date and time;
iii. information showing this is an PLU report;
iv. CIS designation;
v. PLU number, item code, item name, unit price, tax rate, quantity on stock.
21
Communication Protocol
21.2 Certified Invoicing System (CIS) connected to the Sales Data Controller (SDC) will:
i. send specific receipt data via the serial port;
ii. receive response data from SDC.
21.3 Protocol type
21.3.1 CIS sends a packed message, containing a command for the SDC.
21.3.2 SDC executes the command and sends a packed message or a non-packed
message (single byte) as a reply. CIS must wait for a reply before sending
another message. The non-packed byte codes are used for handling the
necessary pauses and error conditions.
21.4 Message sequence
21.4.1 During communication, the SDC will always act as a slave machine, listening
for incoming queries from host machine connected to its port and sending back
responses via the same way.
SDC
receipt data
response data
Receipt closing
CIS
<SEQ>
<CMD>
<DATA>
<05>
Preamble
Length: 1 byte; value: 01;
Number of bytes from <01> (excluded) to <05> (included) plus a fixed offset
20h
Length: 1 byte;
Frame serial number
Length: 1 byte; value: 20h - 7Fh;
The SDC sends the same <SEQ> in the reply message. If the SDC receives a
message, including the same <SEQ>, as the last received one, it must do
nothing but repeat the last sent reply message.
Command code
Length: 1 byte; value: 20h - 7Fh
The SDC must send the same <CMD> in the reply message. In case of receiving
a code of a non-existing command, the SDC must send in reply a packed
message with a zero length data field and set the corresponding status bytes.
Data
Bytes value: 20h - 7Fh
The data field format and length depend on the command. If a command includes
no data the data field length is 0. If a syntax error is found in the data field,
the corresponding status bytes must be set and a packed message with a zero
data field must be send as a reply.
Post amble
Length: 1 byte; value: 05h;
Page 14 of 36
Preamble
Length: 1 byte; value: 01;
Number of bytes from <01> (excluded) to <05> (included) plus a fixed offset
<LEN>
20h
Length: 1 byte;
<SEQ>
Frame serial number
Length: 1 byte; value: 20h - 7Fh;
The SDC sends the same <SEQ> in the reply message. If the SDC receives a
message, including the same <SEQ>, as the last received one, it must do
nothing but repeat the last sent reply message.
<CMD>
Command code
Length: 1 byte; value: 20h - 7Fh
The SDC must send the same <CMD> in the reply message. In case of
receiving a code of
a non-existing command, the SDC must send in
reply a packed message with a zero length data field and set the
corresponding status bytes.
<DATA>
Data
Bytes value: 20h - 7Fh
The data field format and length depend on the command. If a command
includes no data the data field length is 0. If a syntax error is found in the
data field, the corresponding status bytes must be set and a packed message
with a zero data field must be send as a reply.
Delimiter (only for messages from the SDC to the CIS)
<04>
Length: 1 byte; value: 04h;
<STATUS> Status of the SDC
Length: 6 bytes
<05>
Post amble
Length: 1 byte; value: 05h;
Check sum (0000h-FFFFh)
<BCC>
Length: 4 bytes; value: 30h - 3Fh
The check sum is formed by the bytes following <01> (without it) to <05>
included, by summing (adding) the values of the bytes.. Each digit is sent as
Page 15 of 36
v.
vi.
vii.
viii.
ix.
x.
xi.
xii.
xiii.
xiv.
xv.
21.9.4
i.
ii.
iii.
Warning codes:
0 no warning;
1 SDC internal memory is near to full (it is at more than 90% of capacity);
2 SDC internal memory is near to full (it is at more than 95% of capacity).
21.10
Detailed command description
21.10.1
This command is used to send CIS receipt data to SDC:
198 (C6h) RECEIPT DATA
<Rtype><TType><MRC>,<TIN>,<Date><Space><Time>,<RNum>,<
Data field:
Page 16 of 36
This command is used to get SDC information for the last receipt
processed by SDC:
200 (C8h) SDC RESPONSE
<RNumber>
Data field:
<Snumber>,<TNumber>,<GNumber>,<RLabel>,<Date><Space><Time
Response:
>,<Receipt Signature>,<Internal Data>
Comment:
Rnumber
Receipt number
SNumber
SDC serial number as a string
TNumber
Receipt number per receipt type
GNumber
Total receipt number
RLabel
Receipt label, based on receipt type (N, C, P, T) and transaction type (S,
R): <receipt type><transaction type>, for example: NS
Date
Date of accepting the receipt by the SDC: DD/MM/YYYY
Time
Time of accepting the receipt by the SDC: HH:MM:SS
Receipt Signature
Receipt Signature, sent as a string
Internal Data
Internal Data, sent as a string
Exemplary
SDC999123456,300234,234556,NS,19/01/2012
Page 17 of 36
This command can be used to read the signatures for the last receipt
processed by SDC:
199 (C7h) SIGNATURE REQUEST
<Type><RNumber>
Data field:
<Signature>
Response:
Comment:
Type
R Receipt Signature
I Internal Data
Rnumber
Receipt number
Signature
SDC signature, sent as a string
Exemplary
responses:
For the Receipt Signature:
JVPGPLYGDJRSMXF2
For the Internal Data:
2ASSDCZBZ5AH3TZVVIKEXRW6IQ
21.10.4
This command can be used to read the counters for the last receipt
processed by SDC:
201 (C9h) COUNTERS REQUEST
<RNumber>
Data field:
<TNumber>,<GNumber>,<Date><Space><Time>
Response:
Comment:
RNumber
Receipt number, sent by the CIS
TNumber
Receipt number per receipt type
GNumber
Total receipt number
Rlabel
Receipt label, based on receipt type (N, C, P, T) and transaction type (S,
R): <receipt type><transaction type>, for example: NS
Date
Date of accepting the receipt by the SDC: DD/MM/YYYY
Time
Time of accepting the receipt by the SDC: HH:MM:SS
Exemplary
300234,234556,NS,19/01/2012 12:39:05
response:
21.10.5
This command is used to read serial number of SDC:
229 (E5h) SDC ID REQUEST
No data
Data field:
<SNumber>
Response:
Comment:
SNumber
SDC serial number as a string
21.10.6
EJ data
Page 18 of 36
Page 19 of 36
SDC Counters
5.2 Counters consists of:
5.2.1 Total Counter;
5.2.2 Counter per Receipt type (Normal, Copy, Training, Proforma);
5.2.3 Total Amounts;
5.2.4 Date and time of the last local audit;
5.2.5 Date and time of the last remote audit.
5.3 Total Counter is incremented for each receipt
5.4 Counter per Receipt type Normal is incremented for each receipt of type Normal
5.5 Counter per Receipt type Copy incremented for each receipt of type Copy
5.6 Counter per Receipt type Training is incremented for each receipt of type Training
5.7 Counter per Receipt type Profo is incremented for each receipt of type Profo
5.8 All counters start with the value 0
5.9 Total counter and Counters per receipt type can only increment by value of 1
5.10 Total Amounts contain:
5.10.1 total Sale Amount registered by SDC for all Normal Sale receipts;
5.10.2 total TAX Sale Amount registered by SDC for all Normal Sales receipts;
5.10.3 total Return Amount registered by SDC for all Normal Refund receipts;
5.10.4 total TAX Return Amount registered by SDC for all Normal Refund receipts.
5.11 All Total Amounts start with the value 0
5.12 Counter cannot be reduced
5.13 Date and time of the last local audit is updated after performing local audit
5.14 Date and time of the last remote audit is updated after performing remote audit
Description
Length and format
SDC total sale tax amount
5 bytes (40 bits) whole number
(excluding decimal part) for all
Normal Sale receipts
RTA
SDC total return tax amount
5 bytes (40 bits) whole number
(excluding decimal part) for all
Normal Refund receipts
ZCNT
SDC number of daily reports
2 bytes (16 bits) whole number
SDCTC SDC Total Receipt Counter
4 bytes (32 bits) whole number
Following applies:
Byte order is big endian
Total length is 128 bits and is fixed
10.3 Internal Input Data is encrypted with AES-256 using Internal Data Encryption Key in
order to get Encrypted Data which is 128 bits long
10.4 Encrypted Data is padded with two zero bits (0x0) in order to get Padded Encrypted
Data which is 130 bits long
10.5 Padded Encrypted Data is encoded with the base - 32 encoding to get Internal Data
which is 26 characters long. All characters are from base - 32 alphabet
10.6 Only Authority shall be able to decrypt Internal Data
11
Description
CIS Date and Time on the
receipt
TIN
CTIN
MRC
RRN
TR1
TV1
TA1
TR2
TV2
TA2
TR3
11 characters
10 characters
5 characters amount
15 characters amount
15 characters amount
5 characters amount
15 characters amount
15 characters amount
5 characters amount
Example
20120605213455
123456789
123456789
Or, if not present:
ABC01012345
12345
18,00
500,00
76,27
0,00
500,00
0,00
0,00
Page 23 of 36
0,00
TA3
Tax Amount 3
15 characters amount
0,00
TR4
Tax Rate 4
5 characters amount
0,00
TV4
Taxable Amount 4
15 characters amount
0,00
TA4
Tax Amount 4
15 characters amount
0,00
RT
Receipt Type
1 character
N or C or T or P
TT
Transaction Type
1 character
S or R
SDCID
Sales Data Controller ID
12 characters
SDC001012345
SDCDT
SDC Date and Time on the
14 characters
20120605213455
receipt
Format:
YYYYMMDDhhmmss
SDCRTC SDC Receipt Type Counter
10 characters
123
SDCTC
SDC Total Receipt Counter
10 characters
1234
Following applies:
All the fields are padded with spaces ( ) from the left in order to reach the specified length
Total length is 241 bytes and is fixed
Decimal comma (,) is used for amounts
If amount is not present, default value is 0,00
11.4 HMAC SHA-1 is applied to Receipt Input data in order to get Data Hash which is
20 bytes long
11.5 At least 10 bytes are taken of Data Hash in order to get Receipt Data Hash
11.6 Receipt Data Hash is encoded with the base - 32 encoding in order to get Receipt
Signature which is 16 characters long. All characters are from base - 32 alphabet
11.7 Only Authority shall be able to verify data integrity and authenticity by using Receipt
signature
12
13
vii.
15
Field description
SDC ID
Task to be executed
Task ID
Starting date and time
6
Interval in minutes
Following applies:
- fields are separated by row separator (one field per row)
- if request period has elapsed parameter 6 is ignored, and command is executed
immediately
15.5.2 Following table represents flags which are combined in sequence of 2
characters in order to execute task:
Char.
Description
Page 26 of 36
17
SDC documentation
17.2 SDC unit shall be validated by Authority as fulfilling the requirements of these
guidelines
17.3 Documentation shall be made available for validation purposes.
17.4 Documentation shall include, but not limited to:
a)
Installation Guide for SDC;
b)
User Manual;
Page 28 of 36
SDC manufacturing
18.2 SDC manufacturer shall comply with a certified version of the product
18.3 SDC real-time clock is set during production
18.4 Unique serial number shall be saved/stored in the SDC while in production
18.5 SDC shall have label firmly set on the outside of the cabinet indicating:
a)
manufacturer and model;
b)
serial number;
c)
software version;
d)
hardware revision;
e)
certificate designation.
19
Communication Protocol
19.2 SDC connected to CIS will:
a)
receive specific receipt data via the serial port;
b)
generate response data;
c)
send response data back to the CIS;
d)
additionally, SDC has parameters that can be configured using the
communication protocol.
19.3 Protocol type:
19.3.1 CIS sends a packed message, containing a command for the SDC.
19.3.2 SDC executes the command and sends a packed message or a non-packed
message (single byte) as a reply. CIS must wait for a reply before sending
another message
19.3.3 The non-packed byte codes are used for handling the necessary pauses and
error conditions.
19.4 Message sequence:
19.4.1 During communication, the SDC will always act as a slave machine, listening
for incoming queries from host machine connected to its port and sending back
responses via the same way.
19.5 Non-packed messages, time-out:
19.5.1 The CIS must ensure a 1000 ms time-out for receiving a reply. If no reply is
received during the time-out, the CIS must send the message with the same
frame serial number and the same command again. After several failures, the
CIS must display a warning for disconnecting or hardware error.
19.5.2 The non-packed messages consist of a single byte:
i. NAK 15H - this code is sent by the SDC when it detects a check sum error.
Page 29 of 36
<SEQ>
<CMD>
<DATA>
<05>
<BCC>
Preamble
Length: 1 byte; value: 01;
Number of bytes from <01> (excluded) to <05> (included) plus a fixed offset
20h
Length: 1 byte;
Frame serial number
Length: 1 byte; value: 20h - 7Fh;
The SDC sends the same <SEQ> in the reply message. If the SDC receives a
message, including the same <SEQ>, as the last received one, it must do
nothing but repeat the last sent reply message.
Command code
Length: 1 byte; value: 20h - 7Fh
The SDC must send the same <CMD> in the reply message. In case of receiving
a code of a non-existing command, the SDC must send in reply a packed
message with a zero length data field and set the corresponding status bytes.
Data
Bytes value: 20h - 7Fh
The data field format and length depend on the command. If a command includes
no data the data field length is 0. If a syntax error is found in the data field,
the corresponding status bytes must be set and a packed message with a zero
data field must be send as a reply.
Post amble
Length: 1 byte; value: 05h;
Check sum (0000h-FFFFh)
Length: 4 bytes; value: 30h - 3Fh
The check sum is formed by the bytes following <01> (without it) to <05>
included, by summing (adding) the values of the bytes. Each digit is sent as
an ASCII code.
Page 30 of 36
Preamble
Length: 1 byte; value: 01;
Number of bytes from <01> (excluded) to <05> (included) plus a fixed offset
<LEN>
20h
Length: 1 byte;
<SEQ>
Frame serial number
Length: 1 byte; value: 20h - 7Fh;
The SDC sends the same <SEQ> in the reply message. If the SDC receives a
message, including the same <SEQ>, as the last received one, it must do
nothing but repeat the last sent reply message.
<CMD>
Command code
Length: 1 byte; value: 20h - 7Fh
The SDC must send the same <CMD> in the reply message. In case of
receiving a code of a non-existing command, the SDC must send in reply a
packed message with a zero length data field and set the corresponding status
bytes.
<DATA>
Data
Bytes value: 20h - 7Fh
The data field format and length depend on the command. If a command
includes no data the data field length is 0. If a syntax error is found in the data
field, the corresponding status bytes must be set and a packed message with a
zero data field must be send as a reply.
Delimiter (only for messages from the SDC to the CIS)
<04>
Length: 1 byte; value: 04h;
<STATUS> Status of the SDC
Length: 6 bytes
<05>
Post amble
Length: 1 byte; value: 05h;
Check sum (0000h-FFFFh)
<BCC>
Length: 4 bytes; value: 30h - 3Fh
The check sum is formed by the bytes following <01> (without it) to <05>
included, by summing (adding) the values of the bytes.. Each digit is sent as an
ASCII code.
<03>
Terminator
Length: 1 byte; value: 03h;
19.9 SDC status bytes:
19.9.1 The SDC current state is coded in a 6 byte field, which is sent in the frame of
each reply message. These bytes contents are the following:
<Byte 0>
<Byte 1><Byte 2> <Byte 3>
<Byte
General usage
4><Byte 5>
P if command is
Error code
Warning code
Manufacturer
successfull
specific
Page 31 of 36
v.
vi.
vii.
viii.
ix.
x.
xi.
xii.
xiii.
xiv.
xv.
19.9.4
i.
ii.
iii.
Warning codes:
0 no warning;
1 SDC internal memory is near to full (it is at more than 90% of capacity);
2 SDC internal memory is near to full (it is at more than 95% of capacity)
19.10
Detailed Command Description:
19.10.1
This command is used to send CIS receipt data to SDC:
198 (C6h) RECEIPT DATA
<Rtype><TType><MRC>,<TIN>,<Date><Space><Time>,<RNum>,<
Data field:
TaxRate1>,<
TaxRate2>,<TaxRate3>,<TaxRate4>,<Amount1>,<Amount2>,<Amount
3>,<Amount4>,<Tax1>,<Tax2>,<Tax3>,<Tax4>[,<ClientsTin>]
<Code><ErrorCode>
Response:
Comment:
RType
Receipt type: N - normal; C - copy; T - training; P - proforma
TType
Transaction type: S sale; R refund
MRC
CIS machine registration code - up to 12 characters
TIN
Tax registration number of the taxpayer
Date
Date of issuing the receipt: DD/MM/YYYY
Time
Time of issuing the receipt: HH:MM:SS
RNum
Receipt number
TaxRate1,,TaxR Percentage Tax rates
Page 32 of 36
This command is used to get SDC information for the last receipt
processed by SDC:
200 (C8h) SDC RESPONSE
<RNumber>
Data field:
<Snumber>,<TNumber>,<GNumber>,<RLabel>,<Date><Space><Time
Response:
>,<Receipt Signature>,<Internal Data>
Comment:
Rnumber
Receipt number
SNumber
SDC serial number as a string
TNumber
Receipt number per receipt type
GNumber
Total receipt number
RLabel
Receipt label, based on receipt type (N, C, P, T) and transaction type (S,
R): <receipt type><transaction type>, for example: NS
Date
Date of accepting the receipt by the SDC: DD/MM/YYYY
Time
Time of accepting the receipt by the SDC: HH:MM:SS
Receipt Signature
Receipt Signature, sent as a string
Internal Data
Internal Data, sent as a string
Exemplary
SDC999123456,300234,234556,NS,19/01/2012
responses:
12:39:05,JVPGPLYGDJRSMXF2,2ASSDCZBZ5AH3TZVVIKEXRW6I
Q
19.10.3
This command can be used to read the signatures for the last receipt
processed by SDC:
199 (C7h) SIGNATURE REQUEST
<Type><RNumber>
Data field:
<Signature>
Response:
Comment:
Type
R Receipt Signature
I Internal Data
Rnumber
Receipt number
Signature
SDC signature, sent as a string
Exemplary
responses:
For the Receipt Signature:
JVPGPLYGDJRSMXF2
For the Internal Data:
2ASSDCZBZ5AH3TZVVIKEXRW6IQ
Page 33 of 36
tin
ssn
vr1
vr2
vr3
vr4
rurl
ntp
Parameters:
Description
Parameter
Format
Time and date
DD/MM/YYYY
(cannot be written HH:mm:ss
after activation)
TIN
string
(cannot be written
after activation)
SDC Id
string
(can be read only)
Tax rate 1
decimal
Tax rate 2
decimal
Tax rate 3
decimal
Tax rate 4
decimal
Report server
string
URL
NTP server
string
address
Read/write
value
value
Example
value
123456789
value
SDC999123456
value
value
value
value
value
0.00
18.00
0.00
0.00
http://12.34.56.78:3000/report
value
1.pool.ntp.org
12/06/2012 13:45:33
Page 35 of 36
Page 36 of 36