banking_reports 1.0.0+29
banking_reports: ^1.0.0+29 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, Cash Transfer Breakdown reports, Validation Slips, and more.
Features #
- ๐ PDF Report Generation: Create professional banking reports in PDF format
- ๐ Excel Export Support: Generate Excel reports with styled formatting and merged cells
- ๐ฆ 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
- ๐งพ Validation Slips: Generate official receipt validation slips for teller transactions
- ๐ Teller Entries & Blotter Reports: Support for teller entry and blotter report generation
- ๐ Reversed Transactions: Generate PDF and Excel reports for reversed/cancelled transactions
- ๐ฅ Collector Reports: Create collector batch reports with signature blocks
- ๐จ Customizable Layout: Configurable headers, addresses, and formatting options
- ๐ฑ Flutter Integration: Seamlessly integrates with Flutter applications
- ๐พ Dual Export Options: Choose between PDF and Excel formats with theme toggles
- ๐ 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 #
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 #
Validation Slip Generation #
import 'package:onecb_reports/onecb_reports.dart';
// Create validation slip data
OfficialReceiptPrintData receiptForm = OfficialReceiptPrintData(
accountName: "Jane Doe",
accountNumber: "00123456789",
transactionCode: "WDWL",
tellerId: "TELLER002",
dateTime: DateTime.now().toString(),
branch: "Main Branch",
referenceNumber: "REF9876543210",
transactionDescription: "Cash Withdrawal",
amount: "5000.00",
change: "0.00",
orNumber: "OR20240612001",
);
// Generate the validation slip (web)
generateValidationSlip(receiptForm);
Reversed Transactions Report Generation #
import 'package:flutter/material.dart';
import 'package:onecb_reports/onecb_reports.dart';
// Create reversed transaction data
List<ReversedTnxEntryModel> reversedTransactions = [
ReversedTnxEntryModel(
transactionId: "TXN001234567",
accountNumber: "1234567890",
branchDate: DateTime(2024, 1, 15),
transactionType: "TRANSFER",
transactionAmount: 5000.0,
maker: "TELLER001",
approver: "MANAGER001",
),
ReversedTnxEntryModel(
transactionId: "TXN001234568",
accountNumber: "0987654321",
branchDate: DateTime(2024, 1, 16),
transactionType: "WITHDRAWAL",
transactionAmount: 2500.0,
maker: "TELLER002",
approver: "MANAGER001",
),
];
// Generate PDF report
void generateReversedTransactionsPDF(BuildContext context) async {
await generateReverseTnxPDF(
items: reversedTransactions,
branchName: 'OneCB Bank - Main Branch',
branchAddress: '123 Banking Street, Financial District',
bankName: 'OneCB Bank',
reportDate: DateTime.now(),
context: context,
);
}
// Generate Excel report
void generateReversedTransactionsExcel() async {
await generateReversedTnxExcel(
items: reversedTransactions,
branchName: 'OneCB Bank - Main Branch',
branchAddress: '123 Banking Street, Financial District',
bankName: 'OneCB Bank',
reportDate: DateTime.now(),
);
}
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)),
);
}
Model Properties #
SoaModel
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
}
ReversedTnxEntryModel
class ReversedTnxEntryModel {
final String? transactionId; // Unique transaction identifier
final String? accountNumber; // Account number involved
final DateTime? branchDate; // Date of reversal
final String? transactionType; // Type of transaction (TRANSFER, WITHDRAWAL, etc.)
final double? transactionAmount; // Amount that was reversed
final String? maker; // Person who initiated the reversal
final String? approver; // Person who approved the reversal
}
DenominationModel
OfficialReceiptPrintData
The OfficialReceiptPrintData class includes the following properties:
class OfficialReceiptPrintData {
final String accountName;
final String accountNumber;
final String transactionCode;
final String tellerId;
final String dateTime;
final String branch;
final String referenceNumber;
final String transactionDescription;
final String amount;
final String change;
final String? orNumber;
// ...other fields as needed
}
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)
Validation Slip Configuration:
The generateValidationSlip function accepts an OfficialReceiptPrintData object with the following fields:
accountName: Customer nameaccountNumber: Customer account numbertransactionCode: Transaction code (e.g., WDWL, DPST)tellerId: Teller IDdateTime: Date and time of transactionbranch: Branch namereferenceNumber: Reference numbertransactionDescription: Description of transactionamount: Transaction amountchange: Change amountorNumber: Official receipt number (optional)
Reversed Transactions Configuration: The reversed transaction functions accept these parameters:
items: List ofReversedTnxEntryModeltransactionsbranchName: Name of the bank branchbranchAddress: Address of the bank branchbankName: Name of the bankreportDate: Date when the report was generatedcontext: Flutter BuildContext (for PDF function only)
Both generateReverseTnxPDF and generateReversedTnxExcel functions use the same data model and provide:
- Styled headers with bank information
- Consistent table formatting
- Summary totals for transaction count and amounts
- Professional layout suitable for banking operations
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 creationexcel: ^4.0.6 - Excel file generation and formattingintl: ^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. Example files are provided for SOA, Cash Breakdown, and Validation Slip generation.
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.