banking_reports 1.0.0+29 copy "banking_reports: ^1.0.0+29" to clipboard
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 of SoaModel transactions
  • branchName: Name of the bank branch
  • branchAddress: Address of the bank branch
  • withAddress: Whether to include customer address (default: false)
  • withCheckNumber: Whether to show check numbers (default: false)
  • address: Customer address (optional)
  • accountNumber: Customer account number
  • accountName: Customer name
  • dateFrom: Statement period start date
  • dateTo: Statement period end date
  • statementDate: Date when statement was generated
  • context: Flutter BuildContext for web download

Cash Breakdown Report Configuration: The generateCashierBreakdownReport function accepts these parameters:

  • denominations: DenominationModel with cash count data
  • branchName: Name of the bank branch
  • remarks: Additional remarks or notes
  • branchCode: Branch identification code
  • preparedBy: Name of person who prepared the report
  • acknowledgedBy: Name of person who acknowledged the report
  • acknowledgedDesignation: Job title of acknowledging person (optional)
  • date: Date of the cash breakdown
  • createdAt: Timestamp when report was created
  • openCageAt: Time when cash cage was opened (optional)

Validation Slip Configuration: The generateValidationSlip function accepts an OfficialReceiptPrintData object with the following fields:

  • accountName: Customer name
  • accountNumber: Customer account number
  • transactionCode: Transaction code (e.g., WDWL, DPST)
  • tellerId: Teller ID
  • dateTime: Date and time of transaction
  • branch: Branch name
  • referenceNumber: Reference number
  • transactionDescription: Description of transaction
  • amount: Transaction amount
  • change: Change amount
  • orNumber: Official receipt number (optional)

Reversed Transactions Configuration: The reversed transaction functions accept these parameters:

  • items: List of ReversedTnxEntryModel transactions
  • branchName: Name of the bank branch
  • branchAddress: Address of the bank branch
  • bankName: Name of the bank
  • reportDate: Date when the report was generated
  • context: 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 SDK
  • printing: ^5.12.0 - PDF generation and printing
  • pdf: ^3.10.8 - PDF document creation
  • excel: ^4.0.6 - Excel file generation and formatting
  • intl: ^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.

3
likes
0
points
1
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter application for generating and printing banking reports with PDF support.

License

unknown (license)

Dependencies

cupertino_icons, excel, flutter, flutter_svg, intl, number2words, pdf, printing

More

Packages that depend on banking_reports