add per-agent invoice templates, add per-package suspend invoice events, fix automati...
[freeside.git] / FS / FS / cust_pay.pm
index 7be1153..ba9924f 100644 (file)
@@ -385,15 +385,36 @@ sub unapplied {
   sprintf("%.2f", $amount );
 }
 
-=back
+=item cust_main
+
+Returns the parent customer object (see L<FS::cust_main>).
+
+=cut
+
+sub cust_main {
+  my $self = shift;
+  qsearchs( 'cust_main', { 'custnum' => $self->custnum } );
+}
 
-=head1 VERSION
+=item payinfo_masked
 
-$Id: cust_pay.pm,v 1.25 2003-08-05 00:20:42 khoff Exp $
+Returns a "masked" payinfo field with all but the last four characters replaced
+by 'x'es.  Useful for displaying credit cards.
+
+=cut
+
+sub payinfo_masked {
+  my $self = shift;
+  my $payinfo = $self->payinfo;
+  'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4));
+}
+
+=back
 
 =head1 BUGS
 
-Delete and replace methods.
+Delete and replace methods.  payinfo_masked false laziness with cust_main.pm
+and cust_refund.pm
 
 =head1 SEE ALSO