Mews.Fiscalizations.Italy 13.0.0

The ID prefix of this package has been reserved for one of the owners of this package by NuGet.org. Prefix Reserved
dotnet add package Mews.Fiscalizations.Italy --version 13.0.0
NuGet\Install-Package Mews.Fiscalizations.Italy -Version 13.0.0
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="Mews.Fiscalizations.Italy" Version="13.0.0" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Mews.Fiscalizations.Italy --version 13.0.0
#r "nuget: Mews.Fiscalizations.Italy, 13.0.0"
#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.
// Install Mews.Fiscalizations.Italy as a Cake Addin
#addin nuget:?package=Mews.Fiscalizations.Italy&version=13.0.0

// Install Mews.Fiscalizations.Italy as a Cake Tool
#tool nuget:?package=Mews.Fiscalizations.Italy&version=13.0.0

<p align="center"> <a href="https://mews.com"> <img alt="Mews" src="https://user-images.githubusercontent.com/51375082/120493257-16938780-c3bb-11eb-8cb5-0b56fd08240d.png"> </a> <br><br> <b>Mews.Fiscalizations.Italy</b> is a .NET library that was built to help reporting of e-invoices to the Italian authorities (SDI - Sistema di Interscambio) using <a href="https://www.uniwix.com/">Uniwix API.</a>. <br><br> <a href="https://www.nuget.org/packages/Mews.Fiscalizations.Italy/"> <img src="https://img.shields.io/nuget/v/Mews.Fiscalizations.Italy"> </a> <a href="https://github.com/MewsSystems/fiscalizations/blob/master/LICENSE"> <img src="https://img.shields.io/github/license/MewsSystems/fiscalizations"> </a> <a href="https://github.com/MewsSystems/fiscalizations/actions/workflows/publish-italy.yml"> <img src="https://img.shields.io/github/actions/workflow/status/MewsSystems/fiscalizations/publish-italy.yml?branch=master&label=publish"> </a> </p>

📃 Description

A client library for reporting invoices through SDI (Sistema di interscambio) using Uniwix API. Here are the main parts of the library:

  • Uniwix Client that handles communication with the SDI through Uniwix API.
  • DTOs that can be serialized into XML conforming to the FatturaPA format (the official format in which all invoices need to be reported).
  • DTOs for handling messages sent by the Uniwix/SDI.

⚙️ Installation

The library can be installed through NuGet packages or the command line as mentioned below:

Install-Package Mews.Fiscalizations.Italy

🎯 Features

  • Functional approach via FuncSharp.
  • No Italian abbreviations.
  • Early data validation.
  • Asynchronous I/O.
  • All endpoints are covered with tests.
  • Intuitive immutable DTOs.
  • Cross platform (uses .NET 6).

📦 NuGet

We have published the library as Mews.Fiscalizations.Italy.

🔐 Security protocol

  • TLS 1.0 protocol must be enabled, that can be achieved by adding the following line to your code:
ServicePointManager.SecurityProtocol |= SecurityProtocolType.Tls;

👀 Code Examples

Listed below are some of the common examples. If you want to see more code examples, please check the Tests.

Uniwix Client can be created using the Username and Password which can be created through Uniwix website.

  1. Invoices can be reported to the SDI using SendInvoiceAsync API which requires the ElectronicInvoice (the invoice to be reported) as a parameter.
  2. Invoice can be retrieved using SendInvoiceAsync API which requires the fileId of the invoice that was already submitted as a parameter.
  3. It is possible to confirm that the credentials are valid using VerifyCredentialsAsync API which would return a flag that indicates if the credentials are valid or not.

Create Electronic invoice

var invoice = new ElectronicInvoice
{
    Version = VersioneSchemaType.FPR12,
    Header = invoiceHeader,
    Body = new[] { invoiceBody }
};

Create invoice header

var header = new ElectronicInvoiceHeader
{
    TransmissionData = new TransmissionData
    {
        SequentialNumber = "1",
        DestinationCode = "1234567",
        TransmitterId = senderId,
        TransmissionFormat = TransmissionFormat.FPR12,
    },
    Provider = new Provider
    {
        IdentificationData = new IdentificationData
        {
            VatTaxId = senderId,
            Identity = new Identity
            {
                CompanyName = "Italian company ltd."
            },
            FiscalRegime = FiscalRegime.Ordinary
        },
        OfficeAddress = address
    },
    Buyer = new Buyer
    {
        IdentityData = new SimpleIdentityData
        {
            Identity = new Identity
            {
                FirstName = "John",
                LastName = "Smith"
            },
            TaxCode = "SDASDA96L27H501H"
        },
        OfficeAddress = address
    }
};

Create sender id

var senderId = new SenderId
{
    CountryCode = Countries.Italy.Alpha2Code,
    TaxCode = "1234567"
};

Create address

var address = new Address
{
    Street = "Roma Street",
    City = "Rome",
    CountryCode = Countries.Italy.Alpha2Code,
    ProvinceCode = "RM",
    Zip = "00031"
};

Create invoice body

var invoiceBody = new ElectronicInvoiceBody
{
    GeneralData = new GeneralData
    {
        GeneralDocumentData = new GeneralDocumentData
        {
            DocumentType = DocumentType.Invoice,
            CurrencyCode = "EUR",
            IssueDate = DateTime.UtcNow,
            DocumentNumber = "1",
            TotalAmount = 100m
        }
    },
    ServiceData = new ServiceData
    {
        InvoiceLines = new[] { invoiceLine },
        TaxSummary = new[] { taxSummary }
    },
    PaymentData = new[] { paymentData }
};

Create invoice line

var invoiceLine = new InvoiceLine
{
    LineNumber = "1",
    Description = "Item 1",
    UnitCount = 1m,
    PeriodStartingDate = DateTime.UtcNow,
    PeriodClosingDate = DateTime.UtcNow,
    UnitPrice = 100m,
    TotalPrice = 100m,
    VatRate = 10m
};

Create tax rate summary

var taxSummary = new TaxRateSummary
{
    VatRate = 10m,
    TaxAmount = 9m,
    TaxableAmount = 90m,
    VatDueDate = VatDueDate.Immediate
};

Create payment data

var paymentData = new PaymentData
{
    PaymentDetails = new [] { paymentDetail },
    PaymentTerms = PaymentTerms.LumpSum
};

Create payment detail

var paymentDetail = new PaymentDetail
{
    PaymentMethod = PaymentMethod.Cash,
    PaymentAmount = 100m
};
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. 
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
13.0.0 326 1/29/2024
12.0.1 89 10/4/2023
12.0.0 598 8/27/2023
11.0.2 701 8/2/2023
11.0.1 771 7/26/2023
11.0.0 736 7/24/2023
10.0.0 810 3/24/2023
9.0.5 814 3/13/2023
9.0.4 808 3/10/2023
9.0.3 843 12/16/2022
9.0.2 955 10/21/2022
9.0.1 981 10/17/2022
9.0.0 963 9/6/2022
8.0.2 1,004 7/4/2022
8.0.1 1,013 1/20/2022
8.0.0 987 1/19/2022
7.0.1 913 11/5/2021
7.0.0 894 7/27/2021
6.0.0 895 7/21/2021
5.0.0 918 5/25/2021