}
if ( ! defined( $record->{$_} ) || $record->{$_} eq '' ) {
- if ( driver_name =~ /^Pg$/i ) {
- qq-( $_ IS NULL OR $_ = '' )-;
+ if ( $op eq '=' ) {
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ IS NULL OR $_ = '' )-;
+ } else {
+ qq-( $_ IS NULL OR $_ = "" )-;
+ }
+ } elsif ( $op eq '!=' ) {
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ IS NOT NULL AND $_ != '' )-;
+ } else {
+ qq-( $_ IS NOT NULL AND $_ != "" )-;
+ }
} else {
- qq-( $_ IS NULL OR $_ = "" )-;
+ if ( driver_name =~ /^Pg$/i ) {
+ qq-( $_ $op '' )-;
+ } else {
+ qq-( $_ $op "" )-;
+ }
}
} else {
"$_ $op ?";
my $payinfo = $self->payinfo;
$payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16})$/
- or return gettext('invalid_catd'); # . ": ". $self->payinfo;
+ or return gettext('invalid_card'); # . ": ". $self->payinfo;
$payinfo = $1;
$self->payinfo($payinfo);
validate($payinfo)
- or return gettext('invalid_catd'); # . ": ". $self->payinfo;
+ or return gettext('invalid_card'); # . ": ". $self->payinfo;
return gettext('unknown_card_type')
if cardtype($self->payinfo) eq "Unknown";
$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<BILL> is
+returned, otherwise, the single item B<CARD> 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
FREESIDE_DOCUMENT_ROOT = /var/www/freeside
+INIT_FILE = /etc/init.d/freeside
+
HTTPD_RESTART = /etc/init.d/apache restart
-QUEUED_RESTART = /etc/init.d/freeside restart
+FREESIDE_RESTART = /etc/init.d/freeside restart
#---
cd FS; \
make install UNINST=1
-install: install-perl-modules install-docs
+install-init:
+ [ -e ${INIT_FILE} ] || install -o root -g root -m 711 init.d/freeside-init ${INIT_FILE}
+
+install: install-perl-modules install-docs install-init
deploy: install
${HTTPD_RESTART}
- ${QUEUED_RESTART}
+ ${FREESIDE_RESTART}
create-database:
perl -e 'use DBIx::DataSource qw( create_database ); create_database( "${DATASOURCE}", "${DB_USER}", "${DB_PASSWORD}" ) or die $$DBIx::DataSource::errstr;'
'part_pkg' =>
[
- map { $_->hashref }
+ #map { $_->hashref }
+ map { { 'payby' => [ $_->payby ], %{$_->hashref} } }
grep { $_->svcpart('svc_acct') && $pkgpart_href->{ $_->pkgpart } }
qsearch( 'part_pkg', { 'disabled' => '' } )
],
--- /dev/null
+#! /bin/sh
+#
+# chkconfig: 345 86 16
+# description: Freeside daemons
+
+QUEUED_USER=ivan
+
+FREESIDE_PATH="/home/ivan/freeside_current"
+
+PASSWD_USER=ivan
+PASSWD_MACHINE=localhost
+
+SIGNUP_USER=ivan
+SIGNUP_MACHINE=localhost
+SIGNUP_AGENTNUM=2
+SIGNUP_REFNUM=2
+
+case "$1" in
+ start)
+ # Start daemons.
+ echo -n "Starting freeside-queued: "
+ freeside-queued $QUEUED_USER
+ echo "done."
+
+ echo -n "Starting fs_passwd_server: "
+ su freeside -c "$FREESIDE_PATH/fs_passwd/fs_passwd_server $PASSWD_USER $PASSWD_MACHINE" &
+ echo "done."
+
+ echo -n "Starting fs_signup_server: "
+ su freeside -c "$FREESIDE_PATH/fs_signup/fs_signup_server $SIGNUP_USER $SIGNUP_MACHINE $SIGNUP_AGENTNUM $SIGNUP_REFNUM" &
+ echo "done."
+ ;;
+ stop)
+ # Stop daemons.
+ echo -n "Stopping freeside-queued: "
+ kill `cat /var/run/freeside-queued.pid`
+ echo "done."
+
+ echo -n "Stopping fs_passwd_server: "
+ killall fs_passwd_server
+ echo "done."
+
+ echo -n "Stopping fs_passwd_server: "
+ killall fs_signup_server
+ echo "done."
+ ;;
+
+ restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: freeside {start|stop|restart}"
+ exit 1
+esac
+
+exit 0
+