},
'approved' => sub {
my $hash = shift;
- $hash->{'status'} eq ' '
+ ($hash->{'status'} eq ' ') || ($hash->{'status'} eq 'W');
},
'declined' => sub {
my $hash = shift;
if $hash->{'status'} eq ' '; #false laziness with 'approved' above
return 1;
}
- #skipping W for now (maybe it should be declined?)
- if ($hash->{'status'} eq 'W') {
- #file counts this as part of total, but we skip
- $totaloffset += sprintf("%.2f", $hash->{'paid'} / 100 );
- return 1;
- }
return
($hash->{'recordtype'} eq '3') || #Account Trailer Record, concludes returned items
($hash->{'subtype'} ne '0'); #error messages, etc, too late to apply to previous entry
die "invalid branch/routing number '$aba'\n";
}
+ ## set custname to business name if business checking or savings account is used otherwise leave as first and last name.
+ my $custname = $cust_pay_batch->cust_main->first . ' ' . $cust_pay_batch->cust_main->last;
+ $custname = $cust_pay_batch->cust_main->company
+ if (($cust_pay_batch->cust_main->paytype eq "Business checking" || $cust_pay_batch->cust_main->paytype eq "Business savings") && $cust_pay_batch->cust_main->company);
+
$i++;
sprintf("%06u", $i).
'D'.
sprintf("%010.0f",$cust_pay_batch->amount*100).
' '.
time2str("%Y%j", time + 86400).
- sprintf("%-30.30s", encode('utf8', $cust_pay_batch->cust_main->first . ' ' .
- $cust_pay_batch->cust_main->last)).
+ sprintf("%-30.30s", encode('utf8', $custname)).
'E'. # English
' '.
sprintf("%-15s", $shortname).