NAME

Business::NAB::AccountInformation::Group

SYNOPSIS

use Business::NAB::AccountInformation::Group;

my $Group = Business::NAB::AccountInformation::Group->new(
	ultimate_receiver_identification => $ult_receiver_id,
	originator_identification => $org_id,
    as_of_date => $as_of_date,
	additional_field => $additional_field,
    control_total_a => $total_a,
    number_of_accounts => $number_of_accounts,
    control_total_b => $total_b,
);

DESCRIPTION

Class for parsing a NAB "Account Information File (NAI/BAI2)" group line (type 02).

ATTRIBUTES

ultimate_receiver_identification (Str, max length 4096)
originator_identification (Str, max length 8)
as_of_date (DateTime)
additional_field
control_total_a (Int)
number_of_accounts (Int)
control_total_b (Int)
number_of_records (Int)
accounts (ArrayRef[Business::NAB::AccountInformation::Account])

METHODS

new_from_raw_record

Returns a new instance of the class with attributes populated from the result of parsing the passed line:

my $Group = Business::NAB::AccountInformation::Group
    ::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 $Group = Business::NAB::AccountInformation::Group
    ::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 accounts:

$Group->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).

SEE ALSO

Business::NAB::Types

Business::NAB::AccountInformation::Account

Business::NAB::AccountInformation::Transaction