Skip to content

Repository files navigation

Daily Ledger System

A simple ASP.NET Core MVC application for managing daily customer ledger entries, products, monthly bills, payments, PDF invoices, Excel reports, and monthly bill email sending.

Features

  • Admin login using ASP.NET Core Identity
  • Customer management
  • Product/item management
  • Daily item entry for customers
  • Monthly bill generation
  • Invoice number generation
  • Payment tracking: unpaid, partial paid, paid
  • PDF invoice download using QuestPDF
  • Monthly bill email sending using SMTP/MailKit
  • Email log tracking
  • Excel report export using ClosedXML
  • Business profile/settings page
  • Background monthly billing job using Hangfire

Tech Stack

  • ASP.NET Core MVC (.NET 8)
  • Entity Framework Core 8
  • SQL Server
  • ASP.NET Core Identity
  • Hangfire + SQL Server storage
  • QuestPDF
  • MailKit / MimeKit
  • ClosedXML
  • Bootstrap / jQuery

Project Structure

DailyLedgerSystem/
├── Controllers/
│   ├── AccountController.cs
│   ├── CustomersController.cs
│   ├── DailyEntriesController.cs
│   ├── DashboardController.cs
│   ├── EmailLogsController.cs
│   ├── MonthlyBillsController.cs
│   ├── PaymentsController.cs
│   ├── ProductsController.cs
│   ├── ReportsController.cs
│   └── SettingsController.cs
├── Data/
│   ├── ApplicationDbContext.cs
│   └── DbInitializer.cs
├── Migrations/
├── Models/
│   ├── ApplicationUser.cs
│   ├── Customer.cs
│   ├── DailyEntry.cs
│   ├── EmailLog.cs
│   ├── MonthlyBill.cs
│   ├── Payment.cs
│   ├── Product.cs
│   └── Setting.cs
├── Services/
│   ├── AutoBillSchedulerService.cs
│   ├── EmailService.cs
│   ├── ExcelExportService.cs
│   ├── MonthlyBillService.cs
│   ├── PdfService.cs
│   └── SettingsService.cs
├── ViewModels/
├── Views/
├── wwwroot/
├── Program.cs
├── appsettings.json
└── DailyLedgerSystem.csproj

Prerequisites

Install these before running the project:

  • Visual Studio 2022 or later
  • .NET 8 SDK
  • SQL Server / SQL Server Express / LocalDB
  • Git

Setup Instructions

1. Clone the repository

git clone https://github.com/sonaniharshit/daily-ledger-system.git
cd daily-ledger-system

2. Update database connection string

Open appsettings.json and update the SQL Server connection string.

For LocalDB:

"ConnectionStrings": {
  "DefaultConnection": "Server=(localdb)\\MSSQLLocalDB;Database=DailyLedgerDb;Trusted_Connection=True;TrustServerCertificate=True;"
}

For SQL username/password:

"ConnectionStrings": {
  "DefaultConnection": "Server=YOUR_SERVER;Database=DailyLedgerDb;User Id=YOUR_USER;Password=YOUR_PASSWORD;TrustServerCertificate=True;"
}

3. Configure SMTP email settings

Use Gmail App Password or your own SMTP provider.

"SmtpSettings": {
  "Host": "smtp.gmail.com",
  "Port": 587,
  "Username": "your-email@gmail.com",
  "Password": "your-app-password",
  "FromEmail": "your-email@gmail.com",
  "FromName": "Your Store Name"
}

4. Apply database migrations

Run this from the project folder:

dotnet ef database update

If EF CLI is not installed:

dotnet tool install --global dotnet-ef

5. Run the project

dotnet run

Open the shown localhost URL in your browser.

Default Admin Login

The application seeds one admin user on startup.

Email: admin@ledger.com
Password: Admin@123

Change this default password immediately after first login.


## Main Application Flow

1. Login as admin.
2. Add business details from Settings.
3. Add customers.
4. Add products/items.
5. Create daily entries for customers.
6. Generate monthly bill for a customer.
7. Download PDF invoice or send invoice by email.
8. Update payment status.
9. View reports and export Excel.

## Useful Commands

Restore packages:

```bash
dotnet restore

Build project:

dotnet build

Run project:

dotnet run

Create migration:

dotnet ef migrations add MigrationName

Update database:

dotnet ef database update

License

This project can be published under the MIT License.

About

A complete customer ledger and billing management system built with ASP.NET Core, Entity Framework Core, Hangfire, PDF generation.

Topics

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages