X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=FS%2FFS%2Fpart_pkg.pm;h=e8cc6771365267b3af1084746c93c4472c07d2e4;hp=00ce1d944ceabbce8c47d3a5ad85cbaa38904a72;hb=98a73bb080f55f4f5d850102bcec6da2807e3d4f;hpb=6866bdda26d1feb152af991388113e2e9309fafb diff --git a/FS/FS/part_pkg.pm b/FS/FS/part_pkg.pm index 00ce1d944..e8cc67713 100644 --- a/FS/FS/part_pkg.pm +++ b/FS/FS/part_pkg.pm @@ -262,11 +262,33 @@ sub svcpart { $pkg_svc[0]->svcpart; } +=item payby + +Returns a list of the acceptable payment types for this package. Eventually +this should come out of a database table and be editable, but currently has the +following logic instead; + +If the package has B<0> setup and B<0> recur, the single item B is +returned, otherwise, the single item B is returned. + +=cut + +sub payby { + my $self = shift; + #if ( $self->setup == 0 && $self->recur == 0 ) { + if ( $self->setup =~ /^\s*0+(\.0*)?\s*$/ + && $self->recur =~ /^\s*0+(\.0*)?\s*$/ ) { + ( 'BILL' ); + } else { + ( 'CARD' ); + } +} + =back =head1 VERSION -$Id: part_pkg.pm,v 1.9 2002-03-24 17:42:58 ivan Exp $ +$Id: part_pkg.pm,v 1.10 2002-04-19 01:16:39 ivan Exp $ =head1 BUGS