<code>
my $order = [
'STARTING_BALANCE',
'NUMBER_OF_DAYS_IN_PERIOD',
'ENDING_BALANCE',
'TOTAL_DEPOSITS_LESS_INTEREST',
'AVERAGE_COLLECTED_BALANCE',
'TOTAL_WITHDRAWALS_DEBITS',
'ANNUAL_PERCENTAGE_YIELD',
'TOTAL_INTEREST',
];
foreach (@{$this->{'_statement'}{'ACCOUNTS'}[0]{'ACCOUNT'}}) {
foreach my $description ( @{$order} ) {
if (
defined $_->{'MISC_ACCOUNT_DISCLOSURE'}[0]{'DISCLOSURE'}{$description}
and
defined $_->{'MISC_ACCOUNT_DISCLOSURE'}[0]{'DISCLOSURE'}{$description}{VALUE}
and
defined $_->{'MISC_ACCOUNT_DISCLOSURE'}[0]{'DISCLOSURE'}{$description}{NAME}
) {
my $value = $_->{'MISC_ACCOUNT_DISCLOSURE'}[0]{'DISCLOSURE'}{$description}{VALUE};
my $descr = $_->{'MISC_ACCOUNT_DISCLOSURE'}[0]{'DISCLOSURE'}{$description}{NAME};
# stupid but they want it this way
#
$descr .= $value;
push @{$_->{'MISC_DISCLOSURE_ITEMS'}[0]{'ITEM'}}, {
TEXT => $descr,
VALUE => '',
TYPE => $_->{'MISC_DISCLOSURE_ITEMS'}[0]{'TYPE'},
};
}
else {
# if nothing is there just use desription
# and $0.00
#
my $descr = "${description}: \$0.00";
# remove the seperator
#
$descr =~ s/_/ /g;
# upper case the first letter of each word.
# NOTE I really like this one.
$descr =~ s/([\w']+)/\u\L$1/g;
push @{$_->{'MISC_DISCLOSURE_ITEMS'}[0]{'ITEM'}}, {
TEXT => $descr,
VALUE => '',
TYPE => $_->{'MISC_DISCLOSURE_ITEMS'}[0]{'TYPE'},
};
}
}
}
</code>