MAES.Fiskal
1.1.2
See the version list below for details.
dotnet add package MAES.Fiskal --version 1.1.2
NuGet\Install-Package MAES.Fiskal -Version 1.1.2
<PackageReference Include="MAES.Fiskal" Version="1.1.2" />
<PackageVersion Include="MAES.Fiskal" Version="1.1.2" />
<PackageReference Include="MAES.Fiskal" />
paket add MAES.Fiskal --version 1.1.2
#r "nuget: MAES.Fiskal, 1.1.2"
#:package MAES.Fiskal@1.1.2
#addin nuget:?package=MAES.Fiskal&version=1.1.2
#tool nuget:?package=MAES.Fiskal&version=1.1.2
MAES.Fiskal
MAES.Fiskal is a fiscalization tool for invoices developed in C# using .NET 8. It enables automatic generation and submission of fiscal data according to current regulations.
Features
- ZKI Generation
- Invoice fiscalization
- Tip fiscalization
- Free and open source
Installation
Nuget: https://www.nuget.org/packages/MAES.Fiskal
or
git clone https://github.com/MAES-Software/MAES.Fiskal.git
Prerequirements
Load X509Certificate2
- From file (You can use relative path eg. "./cert.p12")
var certificate = new X509Certificate2("filename"); - From some data stream with byte[] bytes
var certificate = new X509Certificate2(bytes);
You must also supply password for given certificate if it has one (by default certificates given from goverment are locked but they can be repackaged)
var certificate = new X509Certificate2("filename", "password");
Usage Example
Define using MAES.Fiskal to get all classes for fiscalization
using MAES.Fiskal;
Sending invoice
- Create invoice
var invoice = new RacunType { BrRac = new BrojRacunaType { BrOznRac = "1", // Invoice number (incremental for each receipt) OznPosPr = "POSL_1", // Workspace code OznNapUr = "1" // Cash reegister number }, DatVrijeme = DateTime.Now.ToString("dd.MM.yyyyTHH:mm:ss"), // DateTime of invoice IznosUkupno = "12.50", // Total amount (must be format 0.00) NakDost = false, Oib = "51560545524", // Identification number of company OibOper = "51560545524", // Odentitfication numer of person operating POS OznSlijed = OznakaSlijednostiType.N, Pdv = [ // Taxes list new () { Stopa = "25.00", // Tax percentage (must be format 0.00) Osnovica = "10.00", // Tax base (must be format 0.00) Iznos = "2.50" // Tax amount (must be format 0.00) } ], Pnp = [], // Fill tax on spending if nececary :S USustPdv = true, // Does company falls under tax obligation laws NacPlac = NacinPlacanjaType.G // Type of payment (G - Cash, K - Cards, etc...) }; - Send invoice
// Call to service var res = await invoice.SendAsync(certificate, url); // Check if there are errors if(res.Greske.Length != 0) Console.WriteLine(res.Greske.Join(',')); // Get jir to store string jir = res.Jir;
Sending invoice tip
Create RacunNapojnicaType from RacunType with NapojnicaTypee as parameter
RacunNapojnicaType invoiceTip = invoice.ToInvoiceTipAsnyc(new () { iznosNapojnice = "1.00", // Tip amount nacinPlacanjaNapojnice = NacinPlacanjaType.G // Tip type of payment (G - Cash, K - Cards, etc...) });Send RacunNapojnicaType
// Call to service var res = await invoiceTip.SendAsync(certificate, url); // Check if there are errors if(res.Greske.Length != 0) Console.WriteLine(res.Greske.Join(','));
Generate ZKI
string zki = invoice.ZKI(certificate);
Both invoice and invoiceTip have .ZKI(certificate) methods
Disabling SSL Certificate Validation (Not Recommended)
If you encounter issues with SSL certificate validation, you can disable certificate checks as follows:
ReferenceTypeExtensions.SslCertificateAuthentication = new()
{
CertificateValidationMode = X509CertificateValidationMode.None,
RevocationMode = X509RevocationMode.NoCheck
};
Warning: Disabling SSL certificate validation is not recommended for production environments, as it reduces security and exposes your application to potential risks. Use this option only for testing or troubleshooting purposes.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net8.0
- System.ServiceModel.Duplex (>= 6.0.0)
- System.ServiceModel.Http (>= 6.0.0)
- System.ServiceModel.Primitives (>= 6.0.0)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.