NAME
Business::NAB::AccountInformation::Account
SYNOPSIS
use Business::NAB::AccountInformation::Account;
my $Account = Business::NAB::AccountInformation::Account->new(
commercial_account_number => $commercial_account_number,
currency_code => $currency_code,
transaction_code_values => $transaction_code_values,
control_total_a => $total_a,
control_total_b => $total_b,
);
DESCRIPTION
Class for parsing a NAB "Account Information File (NAI/BAI2)" account identifier line (type 03).
ATTRIBUTES
- commercial_account_number (Str, max length 4096)
- currency_code (Str, max length 3)
- transaction_code_values (HashRef)
- control_total_a (Int)
- control_total_b (Int)
- number_of_records (Int)
- transactions (ArrayRef[Business::NAB::AccountInformation::Transaction])
METHODS
new_from_raw_record
Returns a new instance of the class with attributes populated from the result of parsing the passed line:
my $Account = Business::NAB::AccountInformation::Account
::Payments::DescriptiveRecord->new_from_raw_record( $line );
new_from_record
Returns a new instance of the class with attributes populated from the result of parsing the already parsed line:
my $Account = Business::NAB::AccountInformation::Account
::Payments::DescriptiveRecord->new_from_record( @record );
validate_totals
Checks if the control_total_a and control_total_b values match the expected totals of the contained transaction items and transaction code values
$Account->validate_totals( my $is_bai2 = 0 );
Will throw an exception if any total doesn't match the expected value.
Takes an optional boolean param to stipulate if the file type is BAI2 (defaults to false).