NetLedger 1.2.0

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

// Install NetLedger as a Cake Tool
#tool nuget:?package=NetLedger&version=1.2.0                

<img src="https://github.com/jchristn/NetLedger/raw/main/Assets/icon.jpg" height="128" width="128">

NetLedger

NuGet Version NuGet

NetLedger is a simple, self-contained ledgering library for adding debits and credits, checking balances, and performing commits on pending entries. NetLedger uses Sqlite and is self-contained. If you wish to have a version that uses an external database, please contact us.

New in v1.1.x

  • Breaking changes
  • SummarizedGUIDs is now CommittedByGUID in committed entries rather than the balance entry
  • Entry now have a CommittedUtc
  • Balance object now has an EntryGUID property
  • Balance object now has list of committed GUIDs in the Committed property
  • Bugfix when adding committed entries

Simple Example

Refer to the Test project for a full example.

using NetLedger;

Ledger ledger = new Ledger("netledger.db");
string accountGuid  = ledger.CreateAccount("My account");
Console.WriteLine("My account identifier is: " + accountGuid);

string creditGuid   = ledger.AddCredit (accountGuid, 25.00, "$25 credit!");
string debitGuid    = ledger.AddDebit  (accountGuid, 5.00,  "$5 debit :(");
Balance balance     = ledger.Commit    (accountGuid); 
Console.WriteLine("My current balance is: $" + balance.CommittedBalance);

creditGuid          = ledger.AddCredit (accountGuid, 50.00, "$50 credit!");
Console.WriteLine("My pending balance is: $" + balance.PendingBalance);
balance             = ledger.Commit    (accountGuid, new List<string> { creditGuid });
Console.WriteLine("My current balance is: $" + balance.CommittedBalance);

ledger.DeleteAccountByGuid(accountGuid);
Product Compatible and additional computed target framework versions.
.NET net6.0 is compatible.  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 is compatible.  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 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
1.2.0 134 3/20/2024
1.1.1 917 8/29/2023
1.1.0.2 8,699 11/14/2021
1.1.0.1 327 11/14/2021
1.1.0 2,884 9/18/2021
1.0.0 8,044 12/4/2020

Retarget and refactor, remove Newtonsoft.Json dependency