MAES.Fiskal 1.1.3

dotnet add package MAES.Fiskal --version 1.1.3
                    
NuGet\Install-Package MAES.Fiskal -Version 1.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="MAES.Fiskal" Version="1.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="MAES.Fiskal" Version="1.1.3" />
                    
Directory.Packages.props
<PackageReference Include="MAES.Fiskal" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add MAES.Fiskal --version 1.1.3
                    
#r "nuget: MAES.Fiskal, 1.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package MAES.Fiskal@1.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=MAES.Fiskal&version=1.1.3
                    
Install as a Cake Addin
#tool nuget:?package=MAES.Fiskal&version=1.1.3
                    
Install as a Cake Tool

MAES.Fiskal

Contributors Forks Stars Issues License LinkedIn

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.

Reequirements

  1. .NET 8+
  2. Fiscalization WSDL ver. 2.6

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

Define endpoint address (Url)

  1. Demo endpoint
    string url = "https://cistest.apis-it.hr:8449/FiskalizacijaServiceTest";
    
  2. Poduction endpoint
    string url = "https://cis.porezna-uprava.hr:8449/FiskalizacijaService";
    

Load X509Certificate2

  1. From file (You can use relative path eg. "./cert.p12")
    var certificate = new X509Certificate2("filename");
    
  2. 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

  1. 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...)
    };
    
  2. 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

  1. 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...)
    });
    
  2. 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

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.

Development

Example tasks.json

{
    "version": "2.0.0",
    "tasks": [
        {
            "label": "Build",
            "type": "shell",
            "command": "dotnet build",
            "args": [
                "${workspaceFolder}/MAES.Fiskal.csproj",
                "--configuration",
                "Release"
            ],
            "group": {
                "kind": "build",
                "isDefault": true
            },
            "problemMatcher": "$msCompile"
        },
        {
            "label": "Pack",
            "type": "shell",
            "command": "dotnet pack",
            "args": [
                "${workspaceFolder}/MAES.Fiskal.csproj",
                "--configuration",
                "Release"
            ],
            "dependsOn": "Build",
            "problemMatcher": "$msCompile"
        },
        {
            "label": "Push",
            "type": "shell",
            "command": "dotnet nuget push",
            "args": [
                "${workspaceFolder}/bin/Release/*.nupkg",
                "--api-key",
                "${input:nugetApiKey}",
                "--source",
                "https://api.nuget.org/v3/index.json"
            ],
            "dependsOn": "Pack",
            "problemMatcher": []
        }
    ],
    "inputs": [
        {
            "id": "nugetApiKey",
            "type": "promptString",
            "description": "Enter your NuGet API Key",
            "password": true
        }
    ]
}
Product 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
1.1.3 132 9/8/2025
1.1.2 169 8/30/2025
1.1.1 159 8/30/2025
1.1.0 163 8/30/2025
1.0.0 138 8/14/2025