$self->payname($1);
}
- #$self->zip =~ /^\s*(\w[\w\-\s]{3,8}\w)\s*$/
- # or return "Illegal zip: ". $self->zip;
- #$self->zip($1);
+ #we have lots of old zips in there... don't hork up batch results cause of em
+ $self->zip =~ /^\s*(\w[\w\-\s]{3,8}\w)\s*$/
+ or return "Illegal zip: ". $self->zip;
+ $self->zip($1);
$self->country =~ /^(\w\w)$/ or return "Illegal country: ". $self->country;
$self->country($1);
- $error = $self->ut_zip('zip', $self->country);
- return $error if $error;
+ #$error = $self->ut_zip('zip', $self->country);
+ #return $error if $error;
#check invnum, custnum, ?
$hook = sub {
my $hash = shift;
+ my $cpb = shift;
$hash->{'paid'} = sprintf("%.2f", $hash->{'paid'}); #hmmmm
$hash->{'_date'} = time; # got a better one?
+ $hash->{'payinfo'} = $cpb->{'payinfo'}
+ if( substr($hash->{'payinfo'}, -4) eq substr($cpb->{'payinfo'}, -4) );
};
$approved_condition = sub {
my $new_cust_pay_batch = new FS::cust_pay_batch { $cust_pay_batch->hash };
- &{$hook}(\%hash);
+ &{$hook}(\%hash, $cust_pay_batch->hashref);
if ( &{$approved_condition}(\%hash) ) {