Fiscal Requirements
The EFR serves as a supplementary subsystem to an existing POS application to help fulfill the conditions of Inalterability, Security, Storage and Archiving of data (known as ISCA conditions) enforced by the French “VAT Anti-Fraud” Law.
EFSTA Concept
The following chapters describe the techniques used. It will be amended and improved along with development and fiscal regulations changes.
Certificate
For each EFR, a certificate is locally generated. For minimum signature data length, ECDSA is used. The curve NIST P-256 is acknowledged as safe up to the year 2030. The public key is written into the audit trail and saved to the cloud archive. As soon as the fiscal authority enables the upload of cash register public keys, this also will be performed automatically over the cloud instance.
Certificate Security
The private key of the certificate is stored, encrypted with a system local key (kept in Windows Certificate Store). So, the private key is usable on the source system only.
Electronic Signature
Ticket & Bill Signature
All transactions registered with EFR except those marked NF= (non-fiscal) are signed and chained. Special signature payload formats apply for
- NFS="DUP"
See "Duplicate signature" below - DT="FACT"
See "Invoice signature" - NFS="CLO"
Closure / balance see "Grand totals signature"
Duplicate signature
Duplicates have to be registered and signed (see Printing Duplicates / Reprint).
Invoice signature
Invoice data has to contain customer reference, which is included in the signature payload. See Invoices.
Grand totals signature
Triggered by the frontend application (on periodic closing). Referring periodic reports (per month, year) are created and signed automatically.
Technical event log signature (JET)
Events are logged both by EFR automatically and when triggered by frontend application (see Operation Tracability (JET - Journal des Évènements Techniques)).
Signature Verification
Verification of signatures and the signature chain within the fiscal data storage (e.g. in case of tax audit) can be performed locally on the EFR using the browser interface, or upon export of cloud data for selectable periods. Access to cloud data may be granted by the data owner (i.e. company) to any third party via export ticket, which contains the period decryption keys.
Reports
Reports can be accessed locally on EFR (browser interface) and from cloud via export ticket.
Storage Concept
All relevant data like fiscal transactions, closures, reports (like tax archive GT), audit records (JET) is stored in textual "Journal" files, each containing a bunch of 1000 ascending numbered records (field SeQuence number SQ
) and named after the number range contained (e.g. 0002.jou for SQ 2000-2999).
Each file represents a JSON array (according to RFC 8259 and ECMA-404) with line breaks for better readability, encoding is UTF-8 (RFC 3629 and ISO/IEC 10646-1:2000 Annex D).
This concept implements a permanent, interruptible data stream from POS to efsta Cloud, and subsequently to centralize processes and data interfaces. Cloud archiving is performed immediately, i.e. parallel to storage on local disk.
Local disk space is managed automatically by EFR in the form of a circular (ring) buffer with a capacity (DiskQuota
) of 1000 MB (compressed) per EFR client (RN
), thus running out of disk space is avoided.
Manipulation of journal files with a text editor cannot be prevented by the nature of the files, but data changes are detected and reported. Additionally, it is good practice to inhibit file system access for cash desk operators.
Journal excerpt:
- Generic
- NF525
{"_":"audit","SQ":14,"TS":"2018-06-14T09:18:25","Code":250,"Dsc":"VER:super-POS V3.4.5","DN":11,
"Fis":{"Payload":"audit:001/1/11,250,VER:super-POS_V3.4.5,20180613091825,,,O,-N1dW…","Signature":"rqDgm…"}},
{"_":"rep","SQ":15,"TS":"2018-06-14T09:18:25","TO":"*FISCAL_FR","TY":"CERT","TLT":"001/1","cer":"MFkwE…"},
{"_":"Tra","SQ":16,"TS":"2018-06-14T09:18:25",
"ESR":{"TL":"001","TT":"1","D":"2018-06-14T09:18:25","TN":"1","T":"20.44","DN":1,
"PosA":[{"_":"Pos","PN":"1","IN":"4012345678901","Dsc":"Vinegar 500ml","TaxG":"B","Amt":"1.99","Net":1.81},
{"_":"Mod","PN":"1","Dsc":"Special Offer","Amt":"-0.50","TaxG":"B","Net":-0.46},
{"_":"Pos","PN":"2","IN":"9023456789001","Dsc":"WHOLEWHEAT FUSILLI","TaxG":"B","Amt":"1.50","Net":1.37},
{"_":"Pos","PN":"3","IN":"9023456789001","Dsc":"WHOLEWHEAT FUSILLI","TaxG":"B","Amt":"1.50","Net":1.36},
{"_":"Pos","PN":"4","IN":"4198765432109","Dsc":"KITTEN PET FOOD 25x","TaxG":"A","Amt":"3.49","Net":2.91},
{"_":"Pos","PN":"5","Dsc":"EMMENTAL CHEESE","TaxG":"B","Amt":"3.21","Qty":"0.252","QtyU":"kg","Pri":"12.75","Net":2.92},
{"_":"Lin","LAmt":"----------"},
{"_":"Lin","Dsc":"Subtotal","LAmt":"11.19"},
{"_":"Mod","PN":"2 3","Dsc":"-25% Discount on Pasta","Amt":"-0.75","TaxG":"B","Net":-0.68},
{"_":"Pos","PN":"6","Dsc":"voucher","TaxG":"E","Amt":"10.00","Net":10}],
"TaxA":[{"_":"Tax","TaxG":"A","Prc":"20","Net":"2.91","TAmt":"0.58","Amt":"3.49"},
{"_":"Tax","TaxG":"B","Prc":"10","Net":"6.32","TAmt":"0.63","Amt":"6.95"},
{"_":"Tax","TaxG":"E","Prc":"0","Net":"10.00","TAmt":"0.00","Amt":"10.00"}],
"Fis":{"Payload":"2000:349|1000:695,1044,20180613091825,TIK:001/1/1,Vente,N,","Signature":"xA1KR…",
"Tag":[{"Label":"Date:","Value":"2018-06-14 09:18:25","Name":"Date"},
{"Label":"Numéro:","Value":"TIK:001/1/1","Name":"FN"},
"Tot":{"GT":10.44,"GT10":6.95,"GT20":3.49,"GTabs":10.44,"GTzero":10}},
{"_":"rep","SQ":17,"TS":"2018-06-14T09:18:25","TY":"GTT",
"Fis":{"Payload":"2000:349|1000:695,1044,20180613091825,TIK:001/1/1,N,","Signature":"SNppl…"}},
...
{"_":"audit","SQ":14,"TS":"2018-06-14T09:18:25","Code":250,"Dsc":"VER:super-POS V3.4.5","DN":11,
"Fis":{"Payload":"audit:001/1/11,250,VER:super-POS_V3.4.5,20180613091825,,,O,-N1dW…","Signature":"rqDgm…"}},
{"_":"rep","SQ":15,"TS":"2018-06-14T09:18:25","TO":"*FISCAL_FR","TY":"CERT","TLT":"001/1","cer":"MFkwE…"},
{"_":"Tra","SQ":16,"TS":"2018-06-14T09:18:25",
"ESR":{"TL":"001","TT":"1","D":"2018-06-14T09:18:25","TN":"1","T":"20.44","DN":1,
"PosA":[{"_":"Pos","PN":"1","IN":"4012345678901","Dsc":"Vinegar 500ml","TaxG":"B","Amt":"1.99","Net":1.81},
{"_":"Mod","PN":"1","Dsc":"Special Offer","Amt":"-0.50","TaxG":"B","Net":-0.46},
{"_":"Pos","PN":"2","IN":"9023456789001","Dsc":"WHOLEWHEAT FUSILLI","TaxG":"B","Amt":"1.50","Net":1.37},
{"_":"Pos","PN":"3","IN":"9023456789001","Dsc":"WHOLEWHEAT FUSILLI","TaxG":"B","Amt":"1.50","Net":1.36},
{"_":"Pos","PN":"4","IN":"4198765432109","Dsc":"KITTEN PET FOOD 25x","TaxG":"A","Amt":"3.49","Net":2.91},
{"_":"Pos","PN":"5","Dsc":"EMMENTAL CHEESE","TaxG":"B","Amt":"3.21","Qty":"0.252","QtyU":"kg","Pri":"12.75","Net":2.92},
{"_":"Lin","LAmt":"----------"},
{"_":"Lin","Dsc":"Subtotal","LAmt":"11.19"},
{"_":"Mod","PN":"2 3","Dsc":"-25% Discount on Pasta","Amt":"-0.75","TaxG":"B","Net":-0.68},
{"_":"Pos","PN":"6","Dsc":"voucher","TaxG":"E","Amt":"10.00","Net":10}],
"TaxA":[{"_":"Tax","TaxG":"A","Prc":"20","Net":"2.91","TAmt":"0.58","Amt":"3.49"},
{"_":"Tax","TaxG":"B","Prc":"10","Net":"6.32","TAmt":"0.63","Amt":"6.95"},
{"_":"Tax","TaxG":"E","Prc":"0","Net":"10.00","TAmt":"0.00","Amt":"10.00"}],
"Fis":{"Payload":"2000:349|1000:695,1044,20180613091825,TIK:001/1/1,Vente,N,","Signature":"xA1KR…",
"Tag":[{"Label":"Date:","Value":"2018-06-14 09:18:25","Name":"Date"},
{"Label":"Numéro:","Value":"TIK:001/1/1","Name":"FN"},
{"Label":"Code:","Value":"B0000 1sm6 (NF525)","Name":"Sec"}]}},
"Tot":{"GT":10.44,"GT10":6.95,"GT20":3.49,"GTabs":10.44,"GTzero":10}},
{"_":"rep","SQ":17,"TS":"2018-06-14T09:18:25","TY":"GTT",
"Fis":{"Payload":"2000:349|1000:695,1044,20180613091825,TIK:001/1/1,N,","Signature":"SNppl…"}},
...
For further information on the data structures used see documentation ESR – "efsta Simple Receipt" Format. A short overview of the field names used is included in file readme.txt in each journal export (jou.zip).
Configuration
Certification requirements regulate the availability of header fields within EFR, the logging of value changes and the administration of historical data.
For centralized administration, base data can be set per cash register terminal (EFR) using the efsta cloud portal, with the data being replicated to the EFR instances.
Alternatively you can supply the header fields with POST http://localhost:5618/cfg
.
It is recommended to POST configuration on every program startup before issuing /register. Further details for /cfg
can be found in Configuration.
Manual Configuration
Navigate to http://localhost:5618 in your browser and open "Donneés de base" (base data). Enter the field values required, with the data being replicated to efsta cloud.
Field reference
Element | Attribute | Description | FIDELE label |
---|---|---|---|
Cmp | Company header | ||
Nam | Company name | ENC-TIK-SOC-ETS | |
Ctry | Country | ENC-TIK-SOC-PAY | |
TaxId | Intra-Community VAT identifier | ENC-TIK-SOC-TVA | |
VATonPayment | VAT chargeable on receipt of payment boolean, default: false (on issuance of invoice) | SOC-REF-REGTVA | |
FR_NAF | code NAF / APE Nomenclature d'activités française | ENC-TIK-SOC-NAF | |
FR_SRN | Business Register Identifier | SOC-SIREN | |
FR_RCS | City of Registration + Category | SOC-RCS | |
FR_TYPE | Legal Form | SOC-TYPE | |
FR_CAPITAL | Social Capital | SOC-CAPITAL | |
Loc | Location (store) header | ||
TL | Transaction Location correlating ESR.TL | ||
Adr | Address | ENC-TIK-SOC-ADR | |
Zip | PostCode | ENC-TIK-SOC-CCP | |
City | City | ENC-TIK-SOC-VIL | |
FR_SIR | SIRET code wikipedia.org | ENC-TIK-SOC-SIR | |
Trm | Terminal | ||
TT | Transaction Terminal correlating ESR.TT | ENC-TIK-CAI-NID | |
SW | Software name | ENC-TIK-TAG-VER | |
SWVersion | Software version | ENC-TIK-TAG-VER |
- If fields Loc.TL and Trm.TT are persisted using /cfg, they may be omitted in /register ESR element. For simplicity ESR.TL and ESR.TT are not shown in further example transactions in this document.
VAT Handling
Following rates are used by default if only TaxG
is delivered, but no tax rate in the TaxA
element:
Tax group | TaxG | Tax rate |
---|---|---|
Normal | A | 20% |
Intermédiare | B | 10% |
Réduit | C | 5,5% |
Super réduit | D | 2,1% |
Zero | E | 0% |
Specifics
Document Types
Different fiscal document types can be registered with EFR by specifying the tag <ESR DT="XXX">
. For each document type, a separate Document Number DN will be issued and a signature chain will be created. Recommended values include bill, invoice and ticket, but you may use any document denomination you require and are not limited to these.
Transactions without DT
are marked as "TIK" ("Ticket") in the signature payload. NF and NFS are considered to be non-fiscal = not to be included in the system's grand totals.
Supporting document data – Note (Bill), Receipt (Ticket), Proof of payment
Header and Issuer Data
Sales header information is stored in configuration files cfg/loc.cfg and cfg/trm.cfg
, also preserving historical settings. The fields have to be set with POST /cfg
(Configuration). Header data is added automatically to the transaction upon /register
.
Field | FIDELE label | ESR equivalent |
---|---|---|
Unique document identifier in Database | ENC-NID | ESR.TL/TT/TN |
Unique document number | ENC-TIK-NUM | ESR.DN |
Software version | ENC-TIK-TAG-VER | Cfg.Trm.Version |
Number of prints | ENC-TIK-PRN-NBR | persisted in dat/reprint.dat |
Name of the issuer | ENC-TIK-SOC-ETS | Cfg.Cmp.Nam |
Issuer's address | ENC-TIK-SOC-ADR | Cfg.Loc.Adr |
Postcode of the issuer | ENC-TIK-SOC-CCP | Cfg.Loc.Zip |
City of the issuer | ENC-TIK-SOC-VIL | Cfg.Loc.City |
Country of the issuer | ENC-TIK-SOC-PAY | Cfg.Cmp.Ctry |
Siret (France: institution number, 14 digits) | ENC-TIK-SOC-SIR | Cfg.Loc.FR_SIR |
Code NAF / APE (France: 5 characters, 1 letter + 4 digits) | ENC-TIK-SOC-NAF | Cfg.Cmp.FR_NAF |
Legal Form | SOC-TYPE | Cfg.Cmp.FR_TYPE |
Social Capital | SOC-CAPITAL | Cfg.Cmp.FR_CAPITAL |
Issuer’s RCS | SOC-RCS | Cfg.Cmp.FR_RCS |
Trades Directory Registration number | SOC-METIER | Cfg.Cmp.FR_METIER |
Intra-Community VAT number | ENC-TIK-SOC-TVA | Profile.TaxId |
Salesperson code | ENC-TIK-VEN-NID | ESR.Slp |
Designation of the salesperson | ENC-TIK-VEN-NOM | ESR.SlpN |
Input operator code (cashier) | ENC-TIK-OPS-NID | ESR.Opr |
Designation of the operator (cashier) | ENC-TIK-OPS-NOM | ESR.OprN |
Input operator code (cashier) | ENC-TIK-CAI-NID | Cfg.Trm.TT |
Date and time of recording the document in Database | ENC-TIK-HOR-GDH | ESR.D |
Type of operation (sale, cancellation, partial return, ...) | ENC-OPE-TYP | within Fis.Payload |
Type of document : note (bill), receipt (ticket), proof of payment, ... | ENC-TIK-DOC-TYP | ESR.DT |
Number of sales lines per document | ENC-TIK-LIG-NBR | ESR.PosC |
Document produced by a special function (Training/School mode/…) | ENC-TIK-STA | ESR.Test |
Electronic Signature | ENC-TIK-TAG-SIG | Fis.Signature |
Restitution of Electronic Signature | ENC-TIK-TAG-RET | Fis.Tag[Sec] |
Software name | ENC-TIK-LOG | Cfg.FR_LOG |
Due to the data stream storage architecture, records may not be updated in the journal.
Line Data
Item positions are represented as array ESR.PosA
within the transaction object. Required fields which are not provided in the input data, are computed:
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
1 | Unique document identifier in Database | ENC-NID | ESR.TL/TT/TN |
2 | Unique document number | ENC-TIK-ORI-NUM | ESR.RTL/RTT/RTN, Pos.RPN or Pos.RTL/RTT/RTN/RPN |
3 | Line number | ENC-TIK-LIG-NUM | PosA.PN |
4 | Product/article code | ENC-TIK-LIG-PRO-NID | Pos.IN |
5 | Product/article description | ENC-TIK-LIG-PRO-LIB | Pos.Dsc |
6 | Quantity of product/article per line | ENC-TIK-LIG-PRO-QTE | Pos.Qty |
7 | VAT code | ENC-TIK-LIG-TAX-NID | Pos.TaxG |
8 | VAT rate | ENC-TIK-LIG-TAX-TXX | Pos.Prc |
10 | Tariff amount | ENC-TIK-TAR-PRX | Pos.Amt |
12 | Unit price incl. VAT | ENC-TIK-LIG-PRO-TTC | Pos.Pri |
14 | Discount rate (%) | ENC-TIK-LIG-REM-TXX | Pos.ModPrc |
15 | Discount rate (%) | ENC-TIK-LIG-REM-TOT | Pos.ModAmt |
16 | Total excluding VAT | ENC-TIK-LIG-TOT-MHT | Pos.NMAmt - "net modified Amt" |
17 | Total incl. VAT | ENC-TIK-LIG-TOT-TTC | Pos.MAmt - "modified Amt" |
18 | Quantity (possibly measured) | ENC-TIK-LIG-QTE | Pos.Qty |
19 | Unit of measurement | ENC-TIK-LIG-UDM | Pos.QtyU |
Summary Data
Tax breakdown and totals are added.
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
3 | Total amount excl. tax by VAT rate | ENC-TIK-TOT-MHT | Tax.Net |
4 | VAT code | ENC-TIK-TVA-NID | Tax.TaxG |
5 | VAT rate | ENC-TIK-TVA-TXX | Tax.Prc |
6 | Amount of VAT | ENC-TIK-TVA-MTN | Tax.TAmt |
General Summary
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
3 | Total excluding tax of the document | ENC-TIK-TOT-MHT | ESR.NT |
4 | Total incl. VAT of the piecedocument | ENC-TIK-TOT-TTC | ESR.T |
5* | Total discount amount | ENC-TIK-REM-MTN | ESR.ModT |
Payment Data
Payment records are represented in array ESR.PayA:
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
3 | Code of the method(s) of payment (credit card, cheque, cash, Ticket Restaurant...) | ENC-TIK-REG-TYP | Pay.PayG |
4 | Name of the method of payment (credit card, cash, cash on delivery ...) | ENC-TIK-REG-MOD-LIB | Pay.Dsc |
5 | References of the method(s) of payment of the invoice (No. cheque, type of credit card, etc.) | ENC-TIK-REG-NUM | Pay.UID |
6 | Amount of the payment or customer's account | ENC-TIK-REG-MTN | Pay.Amt |
18 | GDH timestamp of the payment recording | ENC-TIK-REG-HOR-GDH | Pay.TS |
Return of certificate number and signature extract (only for NF525 certification)*
As proof, the printed documents issued to the customer have to contain a security tag, which can be taken from the /register
response: <Tag Label="Code:" Value="B0000 zXjy (NF525)" Name="Sec"/>
The prefix "B0000" is designating product category and number of software certification, the actual number can be set in /config profile:
Alternatively the string "B0000" can be replaced in the frontend software before printing the receipt.
Invoice
An example for invoices can be found in the business case Invoice. Invoices are required to be marked as DT="FACT" ("facture") and customer data has to be specified in tag <Ctm>
. Following fields are required to be included in the signature payload:
Ctm Attribute | Description | FIDELE Label |
---|---|---|
Nam | Company name (B2B) or Customer name (B2C) | TAG-FAC-CLI-NOM |
Zip | Customer postcode | TAG-FAC-CLI-CCP |
TaxId | Intra-community VAT identifier (B2B) / empty (B2C) | TAG-FAC-CLI-TVA |
If all fields are missing on registration, a warning #MISS ESR.Ctm FACT
will be returned.
Element | Name | Mandatory | Description | Example |
---|---|---|---|---|
Ctm | Customer | Yes | Customer data for fiscal invoice | |
Ctm.Nam | Name | Yes | Customer or Company Name | "Victor HÙGO" |
Ctm.Nam2 | Name 2 | No | Name Extension | |
Ctm.Adr | Address | No | Customer or Company Address within City | "123 bis Rue de Trey" |
Ctm.Adr2 | Address 2 | No | Address Extension | |
Ctm.Zip | Postal Code | Yes | according to national rules without country prefix | "25000" |
Ctm.City | City | No | City Name | "Besançon" |
Ctm.Ctry | Country | No | Country ISO 3166 ALPHA-2 | "FR" |
Ctm.TaxId | VAT Number | Yes | Company VAT Number including eventual country prefix | "FR-12345678901" |
Ctm.FR_SIR | SIRET | Yes | for B2B invoices | "732 829 320 0007" |
Ctm.FR_NAF | NAF/APE | No | "47.11D" |
All fields are datatype text. As with other ESR structures, additional <Ctm>
fields may be specified having names longer than 4 characters.
Advance payment
If the invoice contains advance payments, they have to be sent as position with Pos.PTY=”Adv” including the full amount of the purchased item as Pos.RAmt: Example of an invoice transaction with an advance payment of 1.000 € for an item with a price of 5.000 €:
<Tra>
<ESR TL="001" TT="1" DT="FACT">
<Ctm Nam="Víctor HÙGO" Adr="Besançon" Zip="25000" TaxId="FR12345678901"/>
<PosA>
<Pos PN="1" Dsc="Item" Amt="100.00" TaxG="C"/>
<Pos PTY="Adv" PN="2" Dsc="advance payment" Amt="1000.00" TaxG="A" RAmt="5000.00"/>
</PosA>
<PayA>
<Pay Dsc="Cash" Amt="1100.00"/>
</PayA>
</ESR>
</Tra>
Response containing the remaining net amount payable as ESR.FR_AdvRemainNAmt:
<TraC SQ="8">
<ESR DT="FACT" D="2021-06-23T11:05:41" T="2000.00" TN="2" DN="1" NT="1781.2" PosC="2" FR_AdvRemainNAmt="3333.33">
...
Invoice Printing
Per invoice following fields are required:
# | Field | FIDELE label | ESR Field |
---|---|---|---|
21 | remaining net amount payable | FAC-MTN-NE T | ESR.FR_AdvRemainNAmt (since v2.3.1.1) |
22 | Invoice typology for goods, services or both | FAC-TYP-BS M | ESR.FR_BSM I: Items S: Services M: Mixed |
These fields are computed, stored with the transaction and returned in the response for printing.
Per position following fields are required:
# | Field | FIDELE label | ESR field | ESR Field |
---|---|---|---|---|
13 | Unit price tax. excl | ENC-TIK-LIG-PRO-MHT | net tax modified pos price | Pos.NPri |
18 | Total tax. excl | ENC-TIK-LIG-TOT-MHT | net tax modified pos amount | Pos.NMAmt |
These fields are, if delivered in ESR, stored with the transaction. If Pos.NMAmt is missing, the necessary computations are performed by ESR:
- modifier positions are reckoned upon item positions
- for Pos.NMAmt Tax.Net per tax group TaxG is devided to the according positions To assure congruence of position amounts to tax totals in TaxA, a summation according to Kahan Summation Algorithm is used. To allow the frontend application to print invoices with no cent differences, the transaction positions with NMAmt are returned in the response.
Special workflow
If your POS workflow requires the invoice to be printed additionally to a ticket issued before, it has to be registered with (NFS="FACT" declares it as nonfiscal = not to add a second time into Grand Totals, "FACT" generates the required signature).
Training Receipts
An example can be found in the business cases Training. Fiscal regulations require the ID of the trainer/supervisor to be stored with the training transaction, use field name FR_Trainer. Training printouts may not show any amounts and have to be marked by “NON VALABLE POUR ENCAISSEMENT”, "FACTICE", "SIMULATION", or "TEST".
For compatibility reasons <ESR Test="1"
is also valid instead of <ESR NFS="TRAINING"
.
Reprint / Printing Duplicates
Reprints of fiscal documents have to contain a duplicate counter and a signature. Depending on whether your software handles reprints as transaction (journalized and having a Transaction Number TN) there are two ways of signing:
/register
a non-fiscal transaction markedNFS="DUP"
/jou/reprintcnt
get duplicate number and signature
- The validity of the transaction reference (by FN or TL/TT/TN) is not checked
- On a multiclient EFR (profile attribute RN_TT is set) counters for cross referenced transactions (registration and reprint done on different terminals) are handled
- Else, counters cannot be shared between EFR instances
- The frontend application is responsible for providing the data of the original transaction. EFR journal commands (
/find
or/retrieve
; see EFR API Journal) can be used
POST /register
An example can be found in the business cases Reprints.
POST /jou/reprintcnt
Element | Description |
---|---|
Request | /jou/reprintcnt |
Method | POST |
Header | Accept: text/xml (optional for XML response) |
Query | RTL, RTT, RTN Id of transaction RFN Fiscal Number opr Id of the operator requesting the reprint RN in multi-client mode |
Body | Empty |
Example
- http://localhost:5618/jou/reprintcnt?RFN=FACT:001/1/1&opr=1&RN=001_1
- http://localhost:5618/jou/reprintcnt?RTL=001&RTT=1&RTN=1&opr=1&RN=001_1
Response
- Generic
- NF525
<ReprintC SQ="18" RFN="TIK:001/1/1" Cnt="1" DN="5" DT="DUP">
<Cfg FR_LOG="EFR"/>
<Result RC="OK"/>
<Fis>
<Payload>DUP:001/1/5,TIK,1,,20210623111146,TIK:001/1/1,O,__LWtmZ...</Payload>
<Signature>B_ULuvuuexG...</Signature>
<Tag Label="Numéro original:" Value="TIK:001/1/1" Name="RFN"/>
<Tag Label="Code original:" Value="B0000 YYYY" Name="RSec"/>
<Tag Label="Duplicata:" Value="1" Name="ReprintCnt"/>
<Tag Label="Numéro:" Value="DUP:001/1/5" Name="FN"/>
</Fis>
</ReprintC>
<ReprintC SQ="18" RFN="TIK:001/1/1" Cnt="1" DN="5" DT="DUP">
<Cfg FR_LOG="EFR"/>
<Result RC="OK"/>
<Fis>
<Payload>DUP:001/1/5,TIK,1,,20210623111146,TIK:001/1/1,O,__LWtmZ...</Payload>
<Signature>B_ULuvuuexG...</Signature>
<Tag Label="Numéro original:" Value="TIK:001/1/1" Name="RFN"/>
<Tag Label="Code original:" Value="B0000 YYYY" Name="RSec"/>
<Tag Label="Duplicata:" Value="1" Name="ReprintCnt"/>
<Tag Label="Numéro:" Value="DUP:001/1/5" Name="FN"/>
<Tag Label="Code:" Value="B0000 XXXX (NF525)" Name="Sec"/>
</Fis>
</ReprintC>
The incremental count value is delivered in Cnt
.
EFR tries to retrieve the original transaction content (ESR) from local storage or cloud, whereas the data objects are included in the response and can be used for printing. A timeout of 8 secs is used for cloud access to ensure a valid response within request timeout (10 secs).
The current reprint count for a document can be retrieved with http GET
, although only the count integer field is responded.
Traceability of duplicate documents
Journal:
- Generic
- ND525
{"_":"Reprint","SQ":44699,"TS":"2021-05-14T12:17:11","RFN":"TIK:001/1/97","Opr":"23","Rsn":"erreur d'imprimante",
"Cnt":"41","DN":51,"DT":"DUP",
"ESR":{"TL":"001","TT":"1","TN":25,"T":"528.90","D":"2021-05-11T15:00:40","DT":"TIK","DN":97,"PosC":2,"NT":444.45,
...},
"Fis":{
"Tag":[{"Label":"Numéro:","Value":"TIK:001/1/97","Name":"FN"},
"Cfg":{...},
"Fis":{"Payload":"DUP:001/1/51,TIK,41,123,20210514121711,TIK:001/1/97,O,CRoiX…","Signature":"q2d_o…",
"Tag":[{"Label":"Numéro original:","Value":"TIK:001/1/97","Name":"RFN"},
{"Label":"Duplicata:","Value":"41","Name":"ReprintCnt"},
{"Label":"Numéro:","Value":"DUP:001/1/51","Name":"FN"}]}}
}
{"_":"Reprint","SQ":44699,"TS":"2021-05-14T12:17:11","RFN":"TIK:001/1/97","Opr":"23","Rsn":"erreur d'imprimante",
"Cnt":"41","DN":51,"DT":"DUP",
"ESR":{"TL":"001","TT":"1","TN":25,"T":"528.90","D":"2021-05-11T15:00:40","DT":"TIK","DN":97,"PosC":2,"NT":444.45,
...},
"Fis":{
"Tag":[{"Label":"Numéro:","Value":"TIK:001/1/97","Name":"FN"},
{"Label":"Code:","Value":"B000 0j53E (NF525)","Name":"Sec"}]}},
"Cfg":{...},
"Fis":{"Payload":"DUP:001/1/51,TIK,41,123,20210514121711,TIK:001/1/97,O,CRoiX…","Signature":"q2d_o…",
"Tag":[{"Label":"Numéro original:","Value":"TIK:001/1/97","Name":"RFN"},
{"Label":"Duplicata:","Value":"41","Name":"ReprintCnt"},
{"Label":"Numéro:","Value":"DUP:001/1/51","Name":"FN"}]}}
}
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
1 | Identifier of the duplicate | ENC-DUP-NID | Fis.Tag["FN"] |
2 | Original document number | ENC-DUP-ORI-NUM | Fis.Tag["RFN"] |
3 | Type of original document (Invoice, Credit note, Down Payment, Pro Forma) | ENC-DUP-TYP | Part of RFN |
4 | Reprint number | ENC-DUP-PRN-NUM | Reprint.Cnt, Fis.Tag["ReprintCnt"] |
5 | Operator code issuing the duplicate | ENC-GTP-HT | Reprint.Opr |
6 | Date and time of issue of the duplicate | ENC-DUP-HOR-GDH | Reprint.TS |
8 | Signature of the duplicate | ENC-DUP-SIG | Fis.Signature |
10 | Software version | ENC-DUP-VER | Cfg.FR_LOG |
11 | Reason for issuing the duplicate | ENC-SIG-MOTIF | Reprint.Rsn |
Voucher Handling
Basically there are two types of vouchers:
- "Single-purpose voucher" for specific services or goods, containing VAT at time of voucher sale
- "Multi-purpose voucher" for indifferent goods, showing VAT 0%, as the VAT rate is not yet defined
An example can be found in the business cases Voucher.
Since multi-purpose vouchers have 0% VAT, the sales amount is not added to the total field GT, but in the separate field GTvou
.
Variant
In NF525 certification rules, the sale of multi-purpose vouchers is seen as a treasury transaction, marked non-fiscal NFS="Vou"
. The usage of the voucher can then be sent as payment <Pay/>
since the sale is not regarded in the Grand Totals.
Operation Tracability (JET - Journal des Évènements Techniques)
Registration of Audit Events
Automatic (by EFR)
Audit events are logged automatically by EFR when possible, see Audit Code list below.
Optional (by POS Application)
The POS application may register optional <Audit>
records on demand.
Example
<Audit Code="150" Title="Imprimante indisponible" Dsc="error 1234" Opr="99" TL="001" TT="1"/>
Response
<AuditC SQ="9">
<Result RC="OK"/>
<Fis>
<Payload>audit:001/1/4,150,error_1234,20210623112231,99,001/1,O,NhDnN-VmaTaDO...</Payload>
<Signature>o5mH1kcSMG...</Signature>
<Tag Label="Numéro:" Value="audit:001/1/4" Name="FN"/>
</Fis>
</AuditC>
Attribute | Name | Mandatory | Description | Datatype | Example |
---|---|---|---|---|---|
Audit | Audit Trail | Yes | |||
Code | Audit Code | Yes | Referring to Audit Code table below | Integer | 20 |
Title | Title | Yes | Audit Code Title it is suggested to use French wording | Text | "Archivage fiscal de période" |
Dsc | Description | No | Additional description of the individual event for signature payload the content is latinized (diacritics are removed) | Text | "2021-06" |
Opr | Operator Id | No | Operator-ID | Text | "123" |
D | Datetime | No | Date and time of the event | Datetime | "2021-05-30T13:27:54" |
TL | Transaction Location | Yes* | Business Premise / Store ID | Text | "001" |
TT | Transaction Terminal | Yes* | Cash Register Terminal Number | Text | "1" |
TaxId | VAT Number | Yes** | Text | "FR99999999999" |
* Mandatory only if Profile RN_TT (multi client mode) is set. Alternatively can be specified in query parameter:
POST http://localhost:5618/register?RN=001_1
POST http://localhost:5618/register?TL=001&TT=1
** Mandatory only on RN_TT and if clients are of different companies
Manual (by Operator)
Audit Events also can be registered on page http://localhost:5618/control
Audit Codes
Modes:
- A - Automatic (by EFR)
- O - Optional (by POS Application)
- M - Manual (by Operator)
- C - Conditional (not strictly required by ruleset)
- N - Not required (within efsta architecture, meaning usage of efsta Cloud system)
Code | Code Title | Intitulé du code | Mode | Comments |
---|---|---|---|---|
10 | Changing the continuous sequence management mode | Changement du mode de gestion de la séquence continue | O/M/C | To be used in the event of a change in the numbering of supporting documents (change in numbering methods due to temporal or organizational changes). |
20 | Intermediate Fiscal archiving | Archivage fiscal de période | A | Archiving to cloud is done permanently Proper function is audited after each closure <Tra NFS="Z"> and protocolled with this Code (success) or Code=70 (failure) |
30 | Fiscal year or fiscal period end archiving | Archivage fiscal d'année ou d'exercice | A | Archiving to cloud is done permanently Proper function is audited after each closure <Tra NFS="Z"> and protocolled with this Code (success) or Code=70 (failure) |
40 | Stopping the terminal, disconnecting, logging off | Arrêt du terminal, déconnexion, fermeture de session | A | On <Tra NFS="Logoff"> |
50 | Period closing (Day/Month) | Clôture de période (Jour/Mois) | A | After closure <Tra NFS="Z"> of a day that had opened a new month. The period closed and for reference the document number is recorded: "Dsc":"2021-05@TIK:001/1/101" |
60 | Annual or Fiscal period end closing | Clôture annuelle ou d’exercice | A | After closure <Tra NFS="Z"> of a day that had opened a new year. |
70 | Start of degraded mode (offline, ...) | Début de mode degrade (hors connexion, …) | A | Audit Code if EFR cannot connect to the cloud. |
80 | Starting up the terminal, connecting, logging in | Démarrage du terminal, connexion, ouverture de session | A | On EFR start and on <Tra NFS="Logon"> |
90 | Detection of an integrity failure in secure data or in a fiscal tax archive | Détection d’un défaut d’intégrité dans les données sécurisées ou dans une archive fiscale | A | Integrity is broken when a secured data has been modified afterwards. |
95 | Detection of a break in the continuous sequence | Détection d'une rupture de la séquence continue | O/C | Concerns the detection of the break in the continuous sequence except when changing the management mode managed by the event code 10. |
100 | Start of execution of a special function | Début de l'exécution d'une fonction spéciale | O/C | The school and training modes are, for example, special functions. |
105 | End of execution of a special function | Fin de l'exécution d'une fonction spéciale | O/C | The school and training modes are, for example, special functions. |
110 | Data export | Exportation de données | O/M/C | The data export does not concern the accounting export A data export can be, for example, the production of a file associated with the Z report, an export to a stock management module... |
120 | End of degraded mode | Fin de mode dégradé | O/C | The end of the degraded mode corresponds to a reconnection of the terminal causing the stop of the autonomous mode and the restart of the centralized/connected mode. |
123 | Forced data forwarding to the central system | Renvoi forcé de données vers le système central | N | permanent |
125 | Centralization of data after the end of the downgraded mode | Centralisation des données après la fin du mode dégradé | N | permanent |
126 | Adding a point of sale or a user workstation | Rajout d’un point de vente ou d’un poste utilisateur | O/M/C | |
127 | Deletion of a point of sale or user workstation | Suppression d’un point de vente ou d’un poste utilisateur | O/M/C | |
128 | Change of taxable entity using the software | Changement d’assujetti utilisant le système d’encaissement | A | This event occurs if a change in field value Cmp.FR_SRN is detected upon POST /cfg. |
130 | User Authorisation/Rights Management | Habilitation d’utilisateur/Gestion des droits | O/C | Any change in user rights, profiles, types impacting certified features must be traced by this event. |
140 | Importing external data | Importation de données externes | O/C | The import of a file from a third party / external software must be recorded in this event (file from a weight scale, EDI etc...). |
150 | Printer unavailable | Imprimante indisponible | O/M/C | The software may not be able to know the printer's unavailability information, in which case the editor must justify why. |
155 | Duplicate of a note (bill) | Duplicata d’une note | O/C | Issuing a duplicate note (bill) necessarily involves inserting this event. |
160 | Accounting entries recording | Enregistrement des écritures en comptabilité | O/C | Occurs when the software writes directly into the accounting entries records database. |
170 | Treatment of cash register closure and balance | Traitement de fond de caisse | O/C/A | Automatic on NFS=”INI” and NFS=”TRANSFER” |
180 | Generation of an export file for accounting entries | Génération d'un fichier d'exportation des écritures comptables | O/C | Occurs when the software generates an exchange file for import into accounting software. |
190 | Cancellation of a receipt (ticket) | Annulation de ticket | A | Void on <ESR Void="1"> or <ESR RTN="1234"> The amount of negative turnover and for reference the document number is recorded: "Dsc":"EUR-99.90@TIK:001/1/105" |
200 | Data purging | Purge des données | A | Data may be purged automatically after archiving to the cloud. |
205 | Partial purging of JET | Purge Partielle du JET | N | As JET data is recorded along with ticket data, the fiscal purging rules apply (see Code=200). |
210 | Data recovery from other software following system changes | Reprise de données d’autres logiciels suite à changement de systèmes | M/C | For example, before starting up. |
220 | Restoration of a database | Restauration d’une base de données | N/A | Automatic on Offline systems on /backup/restore |
230 | Backup of a database | Sauvegarde d’une base de données | N/A | Automatic on Offline systems on /backup |
240 | Follow-up of maintenance interventions | Suivi des interventions de maintenance | M/C | To ensure maintenance and to deal with errors and bugs an editor may need to intervene on the database. This can cause a break in the chain and the integrity of the security. In this case, he must enter this code MANUALLY with the reason for the maintenance. This code is therefore a "Manual" code. |
250 | Installation of a new major version of the software | Installation d’une nouvelle version majeure du logiciel | A/M | This event occurs on a new EFR version, or if a change in field value Trm.SW is detected upon POST /cfg. |
255 | Installation of a new minor version of the software | Installation d’une nouvelle version mineure du logiciel | C | This event can be created by the software installation program or entered manually. |
260 | Data Initialization | Initialisation des données | A | May occur the first time the software is used. |
270 | Evolution of compliance parameter | Evolution de paramètre de conformité aux règles | O/M/C | Any change of parameters impacting the certification rules must be traced by this event code. (Example: change of location in the software parameters, activation of multi-currency input, etc.). |
280 | Start/end of tax audit | Début/fin d’opération de contrôle fiscal | A | on download jou.zip |
290 | Exchange with a chartered accountant (sending the FEC or the Z summation of the cash register) | Echange avec un expert-comptable (envoi du FEC ou du Z de caisse) | C | |
295 | File transfer at the request of the administration | Transfert de fichier à la demande de l'administration | O/M/C | |
300 | Parameter activation allowed and documented | Activation de paramètre autorisé et documenté | C | Replaced by code 270 and 410 but retained for historical purposes. |
320 | Abandonment of a commercial sale (transaction) not yet recorded | Abandon d’une opération de vente (transaction) commerciale non encore enregistrée | A | on <ESR NFS="ABORT"> |
323 | Cancellation/Modification of an article line | Annulation/Modification d’une ligne d’article | A/O/C | Automatic on every line void (Pos.Void=”1”). Must be sent by POS if modifying an article line (For example, a change in price. However, it is not advisable to trace changes in quantity so as not to generate too many events of this type). |
324 | Abandonment of a validated note (bill) | Abandon d'une note validée | O/C | The note mentioned here is not a fee note but the note(bill) used in restaurants. The event memorizes abandoned notes (bills) that have been previously validated but for which no receipt (ticket) has been issued. |
325 | Cancellation(s) of article(s) after order | Annulation(s) d’article(s) après commande | O/C | |
326 | Return(s) of article(s) after a note (bill) has been issued | Retour(s) d'article(s) après une émission d’une note | O/C | |
327 | Change to "offered" note (bill) | Passage en note « offerte » | O/C | |
328 | Change to “offered” article | Passage d’article en « offert » | O/C | |
329 | Unprinted note (bill) | Non édition d’une note | O/C | on <ESR DO=”noprint” ... Allows you to trace unprinted notes (bills) |
330 | Initialization of period-end closing | Initialisation de la clôture de fin de période | O/C | In the case of closures consisting of several treatments, this event allows to trace the start of the closing treatment. |
400 | Change of fiscal period duration | Changement de la durée de l’exercice | O/C | |
410 | Change of data regarding the identification of the taxable company or agent | Changement de données affectant l’identification de l’assujetti ou du mandataire | A | on <Cfg><Loc …> |
420 | Changing the method of payment after issuing the receipt (ticket) | Changement du mode de règlement, après émission du ticket | O/C | |
430 | Change of table (in restoration) already assigned to a note | Changement de table (en restauration) affectée à une note | O/C | |
440 | Transfer of the tax archive to an external medium | Transfert des archives fiscales sur support externe | O/M/C | |
450 | Traceability of the change of the pair of keys used for the electronic signature | Traçabilité du changement du trousseau de clés utilisé pour signer | A | on fiscal key-pair change in case of initial generation or backup restore. |
900-999 | Editor function | Fonction éditeurs | O/C | The editor can insert its own codes to trace additional events. |
Periodic Closing / Z Report
Periodically closing of the "till" is required, usually once per opening day. An example can be found in the business cases Z-Report.
Transaction totals of the day per VAT rate are delivered in element <Z>
along with:
Element | Description |
---|---|
Per | Closure Period (month) |
ZI | Incremental Z report Index |
LastD | Last closure Date |
LastSQ | Internal SeQuence number of last closure; to fetch the transactions included use GET http://localhost:5618/retrieve?_=Tra&last={LastSQ} |
Month/Year Closure
Month and year closures are requested by the French fiscal regulations. They are automatically recorded (in .jou journal file and dat/bal.dat
) on the first closure opening a new month. With each month's closure, a year's closure covering the last 12 months is performed as well (if data for more than one month is available). This is especially useful if a company's fiscal year differs from the calendric year.
Period reports (monthly and annual) are stored locally and can be fetched by requests:
GET http://localhost:5618/control/total
GET http://localhost:5618/control/bal
Periodic cumulative data (Grand Totals)
Daily Z Report
Grand Totals per day are triggered by a closure transaction ESR.NFS="Z"
.
Journal example:
- Generic
- NF525
{"_":"Tra","SQ":357,"TS":"2018-08-30T16:02:24",
"ESR":{"TL":"001","TT":"1","NFS":"Z","D":"2017-04-01T18:00:00","TN":"218","DN":91,
"Fis":{"Payload":"2000:1500|1000:3500,5000,20170401180000,CLO:001/1/91,O,Vi9nE…","Signature":"AJd9nE…",
"Tag":[{"Label":"Numéro:","Value":"Z:001/1/91","Name":"FN"},
"Z":{"Per":"201704","ZI":1,"T":"50.00","TN":"44.32","LastD":"2017-03-31T13:00:00","LastSQ":355,
"ZTaxA":[{"_":"ZTax","Prc":"20","Net":"1.50","Amt":"15.00"},
{"_":"ZTax","Prc":"10","Net":"31.82","Amt":"35.00"}]},
"Tot":{"GT":177,"GT20":142,"GT10":35,"GTabs":177,"GTvou":50}}
{"_":"Tra","SQ":357,"TS":"2018-08-30T16:02:24",
"ESR":{"TL":"001","TT":"1","NFS":"Z","D":"2017-04-01T18:00:00","TN":"218","DN":91,
"Fis":{"Payload":"2000:1500|1000:3500,5000,20170401180000,CLO:001/1/91,O,Vi9nE…","Signature":"AJd9nE…",
"Tag":[{"Label":"Numéro:","Value":"Z:001/1/91","Name":"FN"},
{"Label":"Code:","Value":"B0000 XyZ1 (NF525)","Name":"Sec"}]}},
"Z":{"Per":"201704","ZI":1,"T":"50.00","TN":"44.32","LastD":"2017-03-31T13:00:00","LastSQ":355,
"ZTaxA":[{"_":"ZTax","Prc":"20","Net":"1.50","Amt":"15.00"},
{"_":"ZTax","Prc":"10","Net":"31.82","Amt":"35.00"}]},
"Tot":{"GT":177,"GT20":142,"GT10":35,"GTabs":177,"GTvou":50}}
# | Field | FIDELE Label | ESR Equivalent |
---|---|---|---|
1 | Period ID | ENC-GTP-ORI-NUM | Z.Per |
2 | Amounts incl. VAT Breakdown by VAT rate | ENC-GTP-MTN-TVA-TTC | ZTax.Amt |
3 | Amounts excluding VAT broken down by VAT rates | ENC-GTP-MTN-TVA-HT | ZTax.Net |
4 | Associated VAT rate | ENC-GTP-MTN-TVA-TAUX | ZTax.Prc |
5 | Grand Total including VAT for the period | ENC-GTP-TTC | Z.T |
6 | Grand Total excluding VAT for the period | ENC-GTP-HT | Z.NT |
7 | Perpetual Cumulative Algebraic Grand Total (GTPCA) | ENC-GTP-PER-TTC | Tot.GT |
8 | Perpetual Absolute Value Grand Total (GTPVA) | ENC-GTP-PER-TTC-ABS | Tot.GTabs |
9 | Date/Time Grand Total Periodic Recording | ENC-GTP-HOR-GDH | Tra.TS |
10 | Electronic Signature of the Grand Total Periodic | ENC-GTP-TAG-SIG | Fis.Signature |
11 | Grand Totals of multi purpose vouchers | Tot.GTvou |
Month/Year Totals
Created automatically with the first Z report in a new month (e.g. with closure on February 1st for January):
{"_":"rep","SQ":4651,"TS":"2018-09-01T17:11:36","TY":"MONTH","D":"2018-09-01T17:03:55",
"Z":{"Per":"201808","T":"5520.62","NT":"4848.25",
"ZTaxA":[{"_":"ZTax","Prc":"20","Net":"1960.75","Amt":"2352.90"},
{"_":"ZTax","Prc":"10","Net":"2697.93","Amt":"2967.72"},
{"_":"ZTax","Prc":"5.5","Net":"189.57","Amt":"200.00"}]},
"Fis":{"Payload":"2000:235290|1000:296772|0550:20000,552062,20180831181222,201808,O,XvxbY…","Signature":"q_syt…"},
"Tot":{"GT":62555.44,"GT0550":8420,"GT10":32546.95,"GT20":21588.49,"GTabs":65428.35}}