JADU.dll for EET/EETXP, specification 3.1 **************************************** EET - for Windows 7+ EETXP - for Windows XP+ **************************************** Example in Visual Foxpro: If Vartype(Leet)='U' Public Leet Leet=Createobject("JADU.EET") &&Windows 7+ version Leet=Createobject("JADU.EETXP") &&Windows XP+ version Leet.CertHeslo='eet' &&set password for the certificate Leet.Rezim=0 &&full (0) or simplified mode (1) Leet.Overeni=.f. &&verification sending mode only (.t.) Leet.idprovoz=273 &&Business premises Id Leet.idpokl='/5546/RO24' &&identification of the cash register EndIf Leet.DIC="CZ00000019" &&Tax identification number Leet.CertSb='c:\vfp\eet\Certifikát\EET_CA1_Playground-CZ00000019.p12' &&path to the certificate ?Leet.Trzba_kr("9edeb22b-4234-4047-869c-3a76f86c20d3",.t.,"0/6460/ZQ42","2016-01-05T00:30:12+01:00","2016-09-19T19:06:37+01:00",34113.00) **************************************** Short version of a communication method Leet.Trzba_kr("9edeb22b-4234-4047-869c-3a76f86c20d3",.t.,"0/6460/ZQ42","2016-01-05T00:30:12+01:00","2016-09-19T19:06:37+01:00",34113.00) parameters: "9edeb22b-4234-4047-869c-3a76f86c20d3" - UUID (if not set, UUID is generated) .f. - first sending of sales information "0/6460/ZQ42" - serial number of receipt "2016-01-05T00:30:12+01:00" - date and time of sale (if not set, it is set as "now") "2016-09-19T19:06:37+01:00 - date and time of sending of sales information (if not set, it is set as "now") 34113.0 - total amount Optional fields (VAT base, VAT rate, etc.) are set via T_... properties, for example T_DPH1 sets the total VAT, basic VAT rate Optional fields are sent (its property Specified is set to True), if the value <> 0. E.g. Leet.T_Pou_DPH1=10 will be sent, Leet.T_Pou_DPH1=0 will not be sent. Trzba_kr sends also the optional fields, if they are <> 0. The sending does not reset the value of the property, e.g. Leet.T_Pou_DPH1=10 will be sent as long as it is not set = 0. **************************************** Long version Leet.Trzba("9edeb22b-4234-4047-869c-3a76f86c20d3",.t.,"0/6460/ZQ42","2016-01-05T00:30:12+01:00","2016-09-19T19:06:37+01:00",34113.00,3036.00,-820.92,-172.39,-3538.20,-530.73,9756.46,975.65,784.00,967.00,189.00,5460.00,324.00,679.00) parameters: "9edeb22b-4234-4047-869c-3a76f86c20d3" - UUID (if not set, UUID is generated) .f. - first sending of sales information "0/6460/ZQ42" - serial number of receipt "2016-01-05T00:30:12+01:00" - date and time of sale (if not set, it is set as "now") "2016-09-19T19:06:37+01:00 - date and time of sending of sales information (if not set, it is set as "now") 34113.00 - total amount 3036.00 - total amount for performance exempted from VAT, other performance -820.92 - total tax base - basic VAT rate -172.39 - total VAT - basic VAT rate -3538.20 - total tax base - first reduced VAT rate -530.73 - total VAT - first reduced VAT rate 9756.46 - total tax base - second reduced VAT rate 975.65 - total VAT - second reduced VAT rate 784.00 - total amount under the VAT scheme for the sale of used goods - basic VAT rate 967.00 - total amount under the VAT scheme for the sale of used goods - first reduced VAT rate 189.00 - total amount under the VAT scheme for the sale of used goods - second reduced VAT rate 5460.00 - total amount under the VAT scheme for travel service 324.00 - total amount of payments intended for subsequent drawing or settlement 679.00 - total amount of payments which are payments subsequently drawn or settled **************************************** Some programming languages (e.g. older version of Delphi) have problem to pass Deciaml parameter to DLL. So there are methods enabling to set decimal value as a string. Leet.Trzba_kr_string je like Leet.Trzba_kr, but the last parametr is set as a string. Leet.SetT_("Property","Value") sets the values of T_... properties as a string, e.g. Leet.SetT_("T_DPH1","15.2") **************************************** Leet.PubKey Public key from the certificate Leet.FIK FIK Leet.BKP Calculated BKP Leet.PKP Calculated PKP Leet.PKPPlain String to be coded Leet.Odpoved complete SOAP answer from EET Leet.Zprava SOAP message without the signature Leet.ZpravaPodepsana SOAP message including the signature Leet.Chyba_Text Error message, in the case of an error Leet.CertificateCacheTimeout (pouze XP verze) Defines time in days, when the validated certicate of an EET side is accepted without a new validation Leet.CertByte The certificate is read as an array of bytes. Not every programming environment is able to send array of bytes to dll correctly. (The seqence is - CertFrName - CertByte - CertSb/CertHeslo) Leet.CertExpiration Date and time of a cerificate expiration as a string Leet.CertFrName FriendlyName of the certificate. The certificate is read from the certificate store. (The seqence is - CertFrName - CertByte - CertSb/CertHeslo) Leet.CertHeslo Password of the certificate Leet.CertSb Path to the certificate Leet.StoreLocation Selection of the cesrtificate store: UserStore, MachineStore, Both (default) Leet.ToOffSet Returns an inpuit date/time string converted to offset format Leet.DateToOffSet If set to true, dll considers the input date/time strings as without offset and they are converted to offset notation Leet.EETin Date of sending Leet.EETinOff Date of sending with an offset Leet.EETout Date of answer Leet.EEToutOff Date of answer with an offset Leet.Exception Complet dump of an error Leet.GetUUID Returns newly generated UUID Leet.SetProxy It i spossible to define the parametrs for non-transparent proxy. Leet.VarovaniLen The length of the array containing the objects with Warnings. 0 = no warning Leet.VarovaniKod(I) Code of the I-th warning. Array is 0 based. -1 = Subscript is out of range Leet.VarovaniText(I) Text of the I-th warning. Array is 0 based Leet.VynulDane All T_... properties are set to 0 Leet.Vysl Error form EET (>0), OK (=0) or -1, -2, -3 (timeout, communication error error in/with certificate) Leet.oChyba Error object Leet.oHlav Header object Leet.oPolo Answer object Leet.TimeOut Communication timeout. Default value is 5000ms, it is not possible to set a value<2000ms Leet.EETVer EET version Leet.Ver DLL version Leet.T_... Optional fields Leet.Crypto PKP/BKP calculation without an EET communication. (full version only). Method returns "0" = success, otherwise a string containing the error message. Parametr is a PKPPlain string, according to which BKP and PKP is calculated. PKPPlain is: dic_popl | id_provoz | id_pokl | porad_cis | dat_trzby | celk_trzba Example: Leet.Crypto("CZ00000019|273|/5546/RO24|0/6460/ZQ42|2016-09-19T19:06:37+01:00|34113.00") Leet.SetURL Set/Get Uri of the service. (full version only) Leet.ResponseTrusted Whether the answer from EET is trustworthy (logical). Leet.QRFile Saves QR code to a file. First parametr defines the size for the picture (e.g. 300x300), the second one defines the full path with the name of the file. Type of the file is defined by the given extension (jpg, png, ...) Leet.QRString Řetězec pro zakódování pomocí QR kódu. Vhodné při použití vlastního generátoru QR. **************************************** mapping of DLL to EET (read page 13 of http://www.etrzby.cz/assets/cs/prilohy/EET_popis_rozhrani_v3.0_EN.pdf) EET DLL _______________________________________________________________________________ uuid_zpravy parameter in Trzba String dat_odesl parameter in Trzba String prvni_zaslani parameter in Trzba .t./.f. overeni Overeni .t./.f., default .f. dic_popl DIC String dic_poverujiciho DICZast String id_provoz IDProvoz Numeric(5) id_pokl IDpokl/parameter Trzba String porad_cis parameter v Trzba String dat_trzby parameter v Trzba String celk_trzba parameter v Trzba Decimal zakl_nepodl_dph T_Zakl_DPH0 "#.00" zakl_dan1 T_Zakl_DPH1 "#.00" dan1 T_DPH1 "#.00" zakl_dan2 T_Zakl_DPH2 "#.00" dan2 T_DPH2 "#.00" zakl_dan3 T_Zakl_DPH3 "#.00" dan3 T_DPH3 "#.00" cest_sluz T_Cest_DPH "#.00" pouzit_zboz1 T_Pou_DPH1 "#.00" pouzit_zboz2 T_Pou_DPH2 "#.00" pouzit_zboz3 T_Pou_DPH3 "#.00" urceno_cerp_zuct T_Urc_Cerp "#.00" cerp_zuct T_Cerp_Zuct "#.00" rezim Rezim 0/1 **************************************** Objects oHlav,oPolo and oChyba have properties defined by the web service itself. After a succesful communication oHlav is always retyrned, oPolo or oChyba according to the result: oHlav ________________________________________________________________ bkp = Leet.BKP dat_odmit = Leet.EETOutOff dat_odmitSpecified boolean, boolean, whether test is specified rejected dat_prij = Leet.EETOutOff dat_prijSpecified boolean, whether the message is accepted uuid_zpravy = Leet.UUID oPolo ________________________________________________________________ fik = Leet.FIK test = Leet.Overeni testSpecidied boolean, whether test is specified oChyba ________________________________________________________________ kod = Leet.Vysl for values > 0 test = Leet.Overeni testSpecidied boolean, whether test is specified text = Leet.Chyba_text