BrainEnterprise.Core.Accounting 3.0.3

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 BrainEnterprise.Core.Accounting --version 3.0.3
NuGet\Install-Package BrainEnterprise.Core.Accounting -Version 3.0.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="BrainEnterprise.Core.Accounting" Version="3.0.3" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add BrainEnterprise.Core.Accounting --version 3.0.3
#r "nuget: BrainEnterprise.Core.Accounting, 3.0.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.
// Install BrainEnterprise.Core.Accounting as a Cake Addin
#addin nuget:?package=BrainEnterprise.Core.Accounting&version=3.0.3

// Install BrainEnterprise.Core.Accounting as a Cake Tool
#tool nuget:?package=BrainEnterprise.Core.Accounting&version=3.0.3

About

This library contains some accounting classes and utilities:

  • Margin: static class for calculating margins and markups
  • VatHelper: static class for the calculation / unbundling of VAT and verification of the VAT number
  • TaxCodeHelper: static class class for the calculation and verification of the Italian Tax Code

How To Use

MarginHelper

Used to calculate various types of margins and profits:

  • MarginPercent;
  • MarkupPercent;
  • OperatingProfit: from revenues and characteristics costs;
  • GrossProfit: from sales price and variable costs;

VatHelper

Check if Vat Registration Number is Valid

BrainEnterprise.Core.Accounting.Vat.VatHelper.CheckVatCode("02201060981");
BrainEnterprise.Core.Accounting.Vat.VatHelper.CheckVatCode("IT 02201060981");
BrainEnterprise.Core.Accounting.Vat.VatHelper.CheckVatCode("IT02201060981");

This function actually supports only Italian Vat Registration Number. For other European countries only a RegEx format check is performed

Vat Calculation and Unbundling

var vat = BrainEnterprise.Core.Accounting.Vat.VatHelper.GetVatAmount(500, 22);
var basePrice = BrainEnterprise.Core.Accounting.Vat.VatHelper.VatUnbundling(1220, 22);

Rounding

Change the value of VatDecimalRound (default value 2) to set different Rounding Rule

BrainEnterprise.Core.Accounting.Vat.VatHelper.VatDecimalRound = 3;
var vat = BrainEnterprise.Core.Accounting.Vat.VatHelper.GetVatAmount(500, 22);

TaxCodeHelper

Used to calculate and Check Italian Fiscal Code

using BrainEnterprise.Core.Accounting.Vat

// Checks only the control character
TaxCodeHelper.Italian.CheckFiscalCode("PLVGLC73M14B157A");

// Checks the Entire Fiscal Code against a specific name and Data
Assert.IsTrue(TaxCodeHelper.Italian.CheckFiscalCode("PLVGLC73M14B157A", "Gianluca", "Plevani", new DateTime(1973, 8, 14), 'M', "B157"));

// Fiscal Code Calculation
var foo1 = TaxCodeHelper.Italian.CalculateFiscalCode("Gianluca", "Plevani", new DateTime(1974, 8, 12), 'M', "B157");
var foo2 = TaxCodeHelper.Italian.CalculateFiscalCode("Luigi", "Fo", new DateTime(1980, 1, 1), 'M', "B157");
var foo3 = TaxCodeHelper.Italian.CalculateFiscalCode("Anna", "Mia", new DateTime(1980, 1, 1), 'F', "B157");
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  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. 
.NET Core netcoreapp2.0 was computed.  netcoreapp2.1 was computed.  netcoreapp2.2 was computed.  netcoreapp3.0 was computed.  netcoreapp3.1 was computed. 
.NET Standard netstandard2.0 is compatible.  netstandard2.1 is compatible. 
.NET Framework net20 is compatible.  net35 was computed.  net40 is compatible.  net403 was computed.  net45 was computed.  net451 was computed.  net452 was computed.  net46 was computed.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
MonoAndroid monoandroid was computed. 
MonoMac monomac was computed. 
MonoTouch monotouch was computed. 
Tizen tizen40 was computed.  tizen60 was computed. 
Xamarin.iOS xamarinios was computed. 
Xamarin.Mac xamarinmac was computed. 
Xamarin.TVOS xamarintvos was computed. 
Xamarin.WatchOS xamarinwatchos was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETFramework 2.0

    • No dependencies.
  • .NETFramework 4.0

    • No dependencies.
  • .NETStandard 2.0

    • No dependencies.
  • .NETStandard 2.1

    • No dependencies.

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
3.0.3 493 2/17/2022
3.0.2 295 10/30/2021
3.0.1 346 10/28/2021
3.0.0 296 10/28/2021

The check are currently implemented for the Italian VAT and Tax Code; contributions related to other countries are welcome