FiscalHr for Python
FiscalHr is Python helper class for fiscalization in Croatia.
Installation
pip install --process-dependency-links FiscalHr
or
pip install https://github.com/vingd/libxml2-python/archive/libxml2-python-2.7.8.zip pip install FiscalHr
Certificate conversion
Example for openssl:
umask 0077 openssl pkcs12 -in "FISKAL 1.P12" -out fiskal-1.pem
Example Usage
Send receipt
from fiscalhr.fiscal import Fiscal
fis = Fiscal('fiskal-1.pem', 'fiskal-1.pem', key_passphrase='some secret')
now = fis.localtime_now()
racun = fis.create('Racun')
racun.Oib = '01234567890'
racun.USustPdv = True
racun.DatVrijeme = fis.format_time(now)
racun.OznSlijed = 'P'
racun.BrRac.BrOznRac = 7
racun.BrRac.OznPosPr = 'PP-1'
racun.BrRac.OznNapUr = 'NAP-4'
porez = fis.create('Porez')
porez.Stopa = fis.format_decimal(25)
porez.Osnovica = fis.format_decimal(100)
porez.Iznos = fis.format_decimal(25)
racun.Pdv.Porez.append(porez)
racun.IznosUkupno = fis.format_decimal(125)
racun.NacinPlac = 'K'
racun.OibOper = '01234567890'
racun.NakDost = False
racun.ZastKod = fis.generate_zki(racun)
print racun.ZastKod
response = fis.send('racuni', racun)
print response
Register business premises
Example for registering internet shop, with no pass phrase on SSL key and test mode enabled:
from datetime import datetime
from fiscalhr.fiscal import Fiscal
fis = Fiscal('fiscal-key.pem', 'fiscal-cert.pem', test=True)
pp = fis.create('PoslovniProstor')
pp.Oib = '01234567890'
pp.OznPoslProstora = '1'
pp.RadnoVrijeme = 'non-stop'
pp.DatumPocetkaPrimjene = fis.format_time(datetime(2013, 7, 1), 'Datum')
adresa = fis.create('OstaliTipoviPP')
adresa = "Internet trgovina"
pp.AdresniPodatak.OstaliTipoviPP = adresa
response = fis.send('poslovniProstor', pp, nosend=False)
print response
Copyright and License
FiscalHr for Python is Copyright (c) 2013 Vingd, Inc. and licensed under the MIT License.
Metadata
Release files for FiscalHr 0.2.10
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| FiscalHr-0.2.10.tar.gz | 25.9 kB | Without provenance | Details |
Release files / FiscalHr-0.2.10.tar.gz
| Download URL | FiscalHr-0.2.10.tar.gz |
|---|---|
| Size | 25.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1c3097ee9f4544a2ef81b458d3c88244580c16e1e2cabcb769932848a142a23e
|
|
BLAKE2b-256 checksum How to use checksums |
071ee831b1b6c640b67d9146c743f28429c6a94535b86dfd625e271ce927500a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for FiscalHr 0.2.10
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.