banking_reports 1.0.0+7
banking_reports: ^1.0.0+7 copied to clipboard
A Flutter application for generating and printing banking reports with PDF support.
OneCB Reports #
A comprehensive Flutter package for generating professional PDF reports, specifically designed for banking operations. This package provides easy-to-use functions to create formatted PDF documents for Statement of Account (SOA) reports and Cash Transfer Breakdown reports.
Features #
- 📄 PDF Report Generation: Create professional banking reports in PDF format
- 🏦 Banking-focused: Specifically designed for banking operations and reports
- 💰 Cash Breakdown Reports: Generate detailed cash transfer breakdown reports with denomination counting
- 📊 SOA Reports: Create comprehensive Statement of Account reports with transaction history
- 🎨 Customizable Layout: Configurable headers, addresses, and formatting options
- 📱 Flutter Integration: Seamlessly integrates with Flutter applications
- 💾 Web Download: Automatic PDF download functionality for web platforms
- 📊 Transaction Support: Handle debit, credit, and running balance calculations
- 🔢 Pagination: Automatic page numbering and multi-page support
- 💵 Denomination Tracking: Track bills and coins with automatic total calculations
Getting Started #
Prerequisites #
- Flutter SDK ^3.2.0
- Dart SDK ^3.2.0
Installation #
Add this package to your pubspec.yaml file:
dependencies:
onecb_reports: ^1.0.0
Then run:
flutter pub get
Import #
import 'package:onecb_reports/onecb_reports.dart';
Usage #
Basic SOA Report Generation #
import 'package:flutter/material.dart';
import 'package:onecb_reports/onecb_reports.dart';
// Create sample transaction data
List<SoaModel> transactions = [
SoaModel(
transactionDate: DateTime(2024, 1, 15),
transactionCode: 'DEP',
debit: 0.0,
credit: 1000.0,
runningBalance: 1000.0,
branch: 'Main Branch',
tellerId: 'T001',
checkNo: null,
particulars: 'Initial Deposit',
),
SoaModel(
transactionDate: DateTime(2024, 1, 20),
transactionCode: 'WTH',
debit: 250.0,
credit: 0.0,
runningBalance: 750.0,
branch: 'Main Branch',
tellerId: 'T002',
checkNo: '123456',
particulars: 'ATM Withdrawal',
),
];
// Generate the SOA report
void generateReport(BuildContext context) async {
await generateSoaReport(
items: transactions,
branchName: 'OneCB Bank - Main Branch',
branchAddress: '123 Banking Street, Financial District',
withAddress: true,
withCheckNumber: true,
address: '456 Customer Avenue, City, State 12345',
accountNumber: '1234567890',
accountName: 'John Doe',
dateFrom: DateTime(2024, 1, 1),
dateTo: DateTime(2024, 1, 31),
statementDate: DateTime(2024, 2, 1),
context: context,
);
}
Cash Breakdown Report Generation #
import 'package:flutter/material.dart';
import 'package:onecb_reports/onecb_reports.dart';
// Create denomination data
DenominationModel denominations = DenominationModel(
bill1000: 10, // 10 pieces of ₱1000 bills
bill500: 5, // 5 pieces of ₱500 bills
bill200: 8, // 8 pieces of ₱200 bills
bill100: 15, // 15 pieces of ₱100 bills
bill50: 20, // 20 pieces of ₱50 bills
bill20: 25, // 25 pieces of ₱20 bills
coin20: 10, // 10 pieces of ₱20 coins
coin10: 15, // 15 pieces of ₱10 coins
coin5: 20, // 20 pieces of ₱5 coins
coin1: 50, // 50 pieces of ₱1 coins
coin025: 40, // 40 pieces of ₱0.25 coins
coin010: 30, // 30 pieces of ₱0.10 coins
coin005: 20, // 20 pieces of ₱0.05 coins
coin001: 100, // 100 pieces of ₱0.01 coins
);
// Generate the Cash Breakdown report
void generateCashBreakdownReport() async {
await generateCashierBreakdownReport(
denominations: denominations,
branchName: 'OneCB Bank - Main Branch',
remarks: 'End of day cash count',
branchCode: 'MB001',
preparedBy: 'Jane Smith',
acknowledgedBy: 'John Manager',
acknowledgedDesignation: 'Branch Manager',
date: DateTime.now(),
createdAt: DateTime.now(),
openCageAt: DateTime.now().subtract(Duration(hours: 8)),
);
}
SOA Model Properties #
The SoaModel class includes the following properties:
class SoaModel {
final DateTime? transactionDate; // Date of the transaction
final String? transactionCode; // Transaction type code (DEP, WTH, etc.)
final double? debit; // Debit amount
final double? credit; // Credit amount
final double? runningBalance; // Account balance after transaction
final String? branch; // Branch where transaction occurred
final String? tellerId; // Teller ID who processed transaction
final String? checkNo; // Check number (if applicable)
final String? particulars; // Transaction description
}
Denomination Model Properties #
The DenominationModel class includes properties for all Philippine currency denominations:
class DenominationModel {
final int bill1000; // ₱1000 bills
final int bill500; // ₱500 bills
final int bill200; // ₱200 bills
final int bill100; // ₱100 bills
final int bill50; // ₱50 bills
final int bill20; // ₱20 bills
final int coin20; // ₱20 coins
final int coin10; // ₱10 coins
final int coin5; // ₱5 coins
final int coin1; // ₱1 coins
final int coin025; // ₱0.25 coins
final int coin010; // ₱0.10 coins
final int coin005; // ₱0.05 coins
final int coin001; // ₱0.01 coins
// Automatic calculations
double get totalBills; // Total value of all bills
double get totalCoins; // Total value of all coins
double get grandTotal; // Total value of bills + coins
}
Configuration Options #
SOA Report Configuration:
The generateSoaReport function accepts various configuration parameters:
items: List ofSoaModeltransactionsbranchName: Name of the bank branchbranchAddress: Address of the bank branchwithAddress: Whether to include customer address (default: false)withCheckNumber: Whether to show check numbers (default: false)address: Customer address (optional)accountNumber: Customer account numberaccountName: Customer namedateFrom: Statement period start datedateTo: Statement period end datestatementDate: Date when statement was generatedcontext: Flutter BuildContext for web download
Cash Breakdown Report Configuration:
The generateCashierBreakdownReport function accepts these parameters:
denominations:DenominationModelwith cash count databranchName: Name of the bank branchremarks: Additional remarks or notesbranchCode: Branch identification codepreparedBy: Name of person who prepared the reportacknowledgedBy: Name of person who acknowledged the reportacknowledgedDesignation: Job title of acknowledging person (optional)date: Date of the cash breakdowncreatedAt: Timestamp when report was createdopenCageAt: Time when cash cage was opened (optional)
Platform Support #
- ✅ Web: Full support with automatic PDF download
- ✅ Android: Supported
- ✅ iOS: Supported
- ✅ Desktop: Supported (Windows, macOS, Linux)
Dependencies #
This package relies on the following dependencies:
flutter: Flutter SDKprinting: ^5.12.0 - PDF generation and printingpdf: ^3.10.8 - PDF document creationintl: ^0.19.0 - Date formatting and internationalization
Example #
Check out the /example folder for a complete working example of how to use this package in your Flutter application.
Contributing #
Contributions are welcome! Please feel free to submit a Pull Request.
License #
This project is licensed under the MIT License - see the LICENSE file for details.
Support #
If you encounter any issues or have questions, please file an issue on the GitHub repository.
Changelog #
See CHANGELOG.md for a detailed list of changes and updates.