NLBusinessUtils 1.0.0
dotnet add package NLBusinessUtils --version 1.0.0
NuGet\Install-Package NLBusinessUtils -Version 1.0.0
<PackageReference Include="NLBusinessUtils" Version="1.0.0" />
<PackageVersion Include="NLBusinessUtils" Version="1.0.0" />
<PackageReference Include="NLBusinessUtils" />
paket add NLBusinessUtils --version 1.0.0
#r "nuget: NLBusinessUtils, 1.0.0"
#:package NLBusinessUtils@1.0.0
#addin nuget:?package=NLBusinessUtils&version=1.0.0
#tool nuget:?package=NLBusinessUtils&version=1.0.0
NLBusinessUtils
Validatie- en formatteringshulpmiddelen voor Nederlandse zakelijke gegevens: BSN,
RSIN, KVK-nummer, vestigingsnummer, btw-nummer, loonheffingennummer, IBAN
(inclusief bank-lookup), postcode, telefoonnummer en euro-bedragen. Geen
dependencies, target netstandard2.0 (werkt op .NET Framework 4.6.1+, .NET
Core 2.0+ en alle moderne .NET-versies).
Ook beschikbaar voor Node.js: nl-business-utils op npm.
Installatie
dotnet add package NLBusinessUtils
Gebruik
using NLBusinessUtils;
Bsn.IsValid("123456782"); // true
KvkNumber.IsValid("12345678"); // true
Iban.IsValidDutch("NL91ABNA0417164300"); // true
Iban.Format("nl91abna0417164300"); // "NL91 ABNA 0417 1643 00"
DutchBank.GetName("NL91ABNA0417164300"); // "ABN AMRO Bank N.V."
Postcode.IsValidDutch("1234ab"); // true
Postcode.FormatDutch("1234ab"); // "1234 AB"
PhoneNumber.IsValidDutch("06-12345678"); // true
PhoneNumber.FormatDutch("06-12345678"); // "+31612345678"
LoonheffingenNummer.IsValid("123456782L01"); // true
Vestigingsnummer.IsValid("123456789012"); // true
VatCalculator.AddVat(100m, VatRates.Standard); // 121
VatCalculator.RemoveVat(121m, VatRates.Standard); // 100
Currency.FormatEuro(1234.5m); // "€ 1.234,50"
Currency.ParseEuroAmount("€ 1.234,50"); // 1234.5m
API
Bsn / Rsin
Bsn.IsValid(string value) : bool— valideert een burgerservicenummer met de elfproef. Accepteert 8 of 9 cijfers.Bsn.Normalize(string value) : string— geeft de canonieke 9-cijferige vorm terug, of gooit eenArgumentException.Rsin.IsValid(string value) : bool/Rsin.Normalize(string value) : string— zelfde elfproef, voor rechtspersonen.
KvkNumber
KvkNumber.IsValid(string value) : bool— controleert of de invoer uit precies 8 cijfers bestaat.De KVK publiceert geen checksum-algoritme voor haar nummers. Dit is dus een formaatcontrole, geen bewijs dat het nummer daadwerkelijk geregistreerd is — gebruik hiervoor de KVK API.
VatNumber (btw-nummer)
VatNumber.IsValidFormat(string value) : bool— controleert de structuurNL+ 9 cijfers +B+ 2 cijfers (01-99).VatNumber.HasValidLegacyChecksum(string value) : bool— controleert de elfproef op het 9-cijferige deel.Let op: dit werkt alleen voor btw-nummers van vóór 2020, die zijn afgeleid van het BSN/RSIN. Sinds 1 januari 2020 krijgen natuurlijke personen (eenmanszaken/zzp'ers) een nieuw, privacy-vriendelijk nummer dat per ontwerp niet aan de elfproef voldoet — de Belastingdienst heeft het algoritme daarachter niet gepubliceerd. Een
falseresultaat betekent dus niet automatisch dat het nummer ongeldig is. Gebruik voor zekerheid de VIES-dienst van de EU.VatNumber.Format(string value) : string— canoniekeNLxxxxxxxxxBxx-vorm, of gooit eenArgumentException.
Iban / DutchBank
Iban.IsValidDutch(string value) : bool— structuur + MOD-97 checksum (ISO 13616).Iban.Format(string value) : string— groepeert in blokken van 4, bv.NL91 ABNA 0417 1643 00.DutchBank.GetName(string value) : string?— banknaam op basis van de 4-letterige bankcode in een geldige IBAN. Dekt een handmatig samengestelde en gecontroleerde lijst met grote Nederlandse banken (ABN AMRO, ING, Rabobank, SNS, ASN, Triodos, Knab, bunq, RegioBank, Achmea Bank); geeftnullterug voor een ongeldige IBAN of een bank die niet in de lijst staat, in plaats van te gokken.
Vestigingsnummer
Vestigingsnummer.IsValid(string value) : bool— controleert of de invoer uit precies 12 cijfers bestaat.Ook hiervoor publiceert de KVK geen checksum-algoritme — formaatcontrole only.
LoonheffingenNummer
LoonheffingenNummer.IsValid(string value) : bool— controleert de structuur BSN/RSIN (9 cijfers, elfproef) +L+ 2-cijferig volgnummer (01-99), bv.123456782L01.LoonheffingenNummer.Format(string value) : string— canonieke vorm, of gooit eenArgumentException.
Postcode
Postcode.IsValidDutch(string value) : bool— 4 cijfers (1000-9999) + 2 letters, met of zonder spatie. Sluit de door PostNL nooit uitgegeven combinatiesSS,SA,SDuit.Postcode.FormatDutch(string value) : string— normaliseert naar1234 AB.
PhoneNumber
PhoneNumber.IsValidDutch(string value) : bool— nationaal (0...) of met+31/0031prefix, 10 cijfers. Formaatcontrole, geen controle tegen een netnummer-database.PhoneNumber.IsDutchMobile(string value) : bool—truevoor mobiele nummers (06...).PhoneNumber.FormatDutch(string value) : string— E.164-formaat, bv.+31612345678.
VatRates / VatCalculator
VatRates.Standard/VatRates.Reduced/VatRates.Zero—21m,9m,0m.VatCalculator.CalculateVatAmount(decimal bedragExclBtw, decimal tarief) : decimalVatCalculator.AddVat(decimal bedragExclBtw, decimal tarief) : decimalVatCalculator.RemoveVat(decimal bedragInclBtw, decimal tarief) : decimal
Alle bedragen worden op hele centen afgerond (MidpointRounding.AwayFromZero).
Currency
Currency.FormatEuro(decimal bedrag) : string— formatteert als Nederlandse euro-string, bv.1234.5m→"€ 1.234,50",-19.99m→"-€ 19,99". Bewust handmatig geïmplementeerd (niet via cultuur-afhankelijke formattering) zodat de opmaak stabiel is, onafhankelijk van de globalization-configuratie van de host.Currency.ParseEuroAmount(string waarde) : decimal— parseert een Nederlandse euro-string (met of zonder€-teken) terug naar een decimal. Gooit eenArgumentExceptionbij onherkenbare invoer.
Licentie
MIT — gratis te gebruiken, ook commercieel.
| Product | Versions 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. 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. |
| .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 was computed. |
| .NET Framework | 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. |
-
.NETStandard 2.0
- 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.