summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2003-04-21 20:53:57 +0000
committerivan <ivan>2003-04-21 20:53:57 +0000
commit030bef17868168b05a67d9f5866b55da1bb9439c (patch)
treeafb0ca6f648985fe710dc07b87ab5008a55c2a0b
parent6eedae5614eee808d0e0c4b9d9b3fe7d1217b776 (diff)
on-demand vs. automatic cards & checks: added DCRD and DCHK payment types
-rw-r--r--FS/FS/Conf.pm4
-rw-r--r--FS/FS/cust_main.pm17
-rw-r--r--FS/FS/part_bill_event.pm4
-rwxr-xr-xFS/bin/freeside-daily2
-rwxr-xr-xFS/bin/freeside-expiration-alerter6
-rwxr-xr-xFS/bin/freeside-setup2
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.cgi9
-rwxr-xr-xfs_signup/FS-SignupClient/cgi/signup.html4
-rw-r--r--httemplate/docs/schema.html4
-rwxr-xr-xhttemplate/edit/cust_main.cgi16
-rwxr-xr-xhttemplate/edit/part_bill_event.cgi2
-rwxr-xr-xhttemplate/edit/process/cust_main.cgi4
-rwxr-xr-xhttemplate/search/cust_main.cgi4
-rwxr-xr-xhttemplate/view/cust_main.cgi12
14 files changed, 55 insertions, 35 deletions
diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm
index cb404ff..5681dde 100644
--- a/FS/FS/Conf.pm
+++ b/FS/FS/Conf.pm
@@ -905,7 +905,7 @@ httemplate/docs/config.html
'section' => '',
'description' => 'Acceptable payment types for the signup server',
'type' => 'selectmultiple',
- 'select_enum' => [ qw(CARD CHEK LECB PREPAY BILL COMP) ],
+ 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB PREPAY BILL COMP) ],
},
{
@@ -1013,7 +1013,7 @@ httemplate/docs/config.html
'section' => 'UI',
'description' => 'Default payment type. HIDE disables display of billing information and sets customers to BILL.',
'type' => 'select',
- 'select_enum' => [ '', qw(CARD CHEK LECB BILL COMP HIDE) ],
+ 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL COMP HIDE) ],
},
{
diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm
index cde370c..cefc764 100644
--- a/FS/FS/cust_main.pm
+++ b/FS/FS/cust_main.pm
@@ -159,7 +159,7 @@ FS::Record. The following fields are currently supported:
=item ship_fax - phone (optional)
-=item payby - `CARD' (credit cards), `CHEK' (electronic check), `LECB' (Phone bill billing), `BILL' (billing), `COMP' (free), or `PREPAY' (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to BILL)
+=item payby - I<CARD> (credit card - automatic), I<DCRD> (credit card - on-demand), I<CHEK> (electronic check - automatic), I<DCHK> (electronic check - on-demand), I<LECB> (Phone bill billing), I<BILL> (billing), I<COMP> (free), or I<PREPAY> (special billing type: applies a credit - see L<FS::prepay_credit> and sets billing type to I<BILL>)
=item payinfo - card number, P.O., comp issuer (4-8 lowercase alphanumerics; think username) or prepayment identifier (see L<FS::prepay_credit>)
@@ -700,11 +700,11 @@ sub check {
}
}
- $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREPAY)$/
+ $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY)$/
or return "Illegal payby: ". $self->payby;
$self->payby($1);
- if ( $self->payby eq 'CARD' ) {
+ if ( $self->payby eq 'CARD' || $self->payby eq 'DCRD' ) {
my $payinfo = $self->payinfo;
$payinfo =~ s/\D//g;
@@ -717,7 +717,7 @@ sub check {
return gettext('unknown_card_type')
if cardtype($self->payinfo) eq "Unknown";
- } elsif ( $self->payby eq 'CHEK' ) {
+ } elsif ( $self->payby eq 'CHEK' || $self->payby eq 'DCHK' ) {
my $payinfo = $self->payinfo;
$payinfo =~ s/[^\d\@]//g;
@@ -770,7 +770,9 @@ sub check {
}
if ( $self->payname eq '' && $self->payby ne 'CHEK' &&
- ( ! $conf->exists('require_cardname') || $self->payby ne 'CARD' ) ) {
+ ( ! $conf->exists('require_cardname')
+ || $self->payby !~ /^(CARD|DCRD)$/ )
+ ) {
$self->payname( $self->first. " ". $self->getfield('last') );
} else {
$self->payname =~ /^([\w \,\.\-\']+)$/
@@ -1244,8 +1246,9 @@ sub bill {
(Attempt to) collect money for this customer's outstanding invoices (see
L<FS::cust_bill>). Usually used after the bill method.
-Depending on the value of `payby', this may print an invoice (`BILL'), charge
-a credit card (`CARD'), or just add any necessary (pseudo-)payment (`COMP').
+Depending on the value of `payby', this may print or email an invoice (I<BILL>,
+I<DCRD>, or I<DCHK>), charge a credit card (I<CARD>), charge via electronic
+check/ACH (I<CHEK>), or just add any necessary (pseudo-)payment (I<COMP>).
Most actions are now triggered by invoice events; see L<FS::part_bill_event>
and the invoice events web interface.
diff --git a/FS/FS/part_bill_event.pm b/FS/FS/part_bill_event.pm
index a75a011..e0e4f3f 100644
--- a/FS/FS/part_bill_event.pm
+++ b/FS/FS/part_bill_event.pm
@@ -37,7 +37,7 @@ FS::Record. The following fields are currently supported:
=item eventpart - primary key
-=item payby - CARD, CHEK, LECB, BILL, or COMP
+=item payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
=item event - event name
@@ -140,7 +140,7 @@ sub check {
}
my $error = $self->ut_numbern('eventpart')
- || $self->ut_enum('payby', [qw( CARD CHEK LECB BILL COMP )] )
+ || $self->ut_enum('payby', [qw( CARD DCRD CHEK DCHK LECB BILL COMP )] )
|| $self->ut_text('event')
|| $self->ut_anything('eventcode')
|| $self->ut_number('seconds')
diff --git a/FS/bin/freeside-daily b/FS/bin/freeside-daily
index 579d071..63e621b 100755
--- a/FS/bin/freeside-daily
+++ b/FS/bin/freeside-daily
@@ -113,7 +113,7 @@ the bill and collect methods of a cust_main object. See L<FS::cust_main>.
-d: Pretend it's 'date'. Date is in any format Date::Parse is happy with,
but be careful.
- -p: Only process customers with the specified payby (CARD, CHEK, BILL, COMP, LECB)
+ -p: Only process customers with the specified payby (I<CARD>, I<DCRD>, I<CHEK>, I<DCHK>, I<BILL>, I<COMP>, I<LECB>)
-v: enable debugging
diff --git a/FS/bin/freeside-expiration-alerter b/FS/bin/freeside-expiration-alerter
index 5399f6d..691fd3a 100755
--- a/FS/bin/freeside-expiration-alerter
+++ b/FS/bin/freeside-expiration-alerter
@@ -97,7 +97,7 @@ foreach my $customer (@customers)
my $expire_time = timelocal(0,0,0,$payday,--$paymonth,$payyear);
#credit cards expire at the end of the month/year of their exp date
- if ($payby eq 'CARD') {
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
($paymonth < 11) ? $paymonth++ : ($paymonth=0, $payyear++);
$expire_time = timelocal(0,0,0,$payday,$paymonth,$payyear);
$expire_time--;
@@ -127,7 +127,7 @@ foreach my $customer (@customers)
$FS::alerter::_template::first = $first;
$FS::alerter::_template::last = $last;
$FS::alerter::_template::company = $company;
- if ($payby eq 'CARD') {
+ if ($payby eq 'CARD' || $payby eq 'DCRD') {
$FS::alerter::_template::payby = "credit card (" .
substr($payinfo, 0, 2) . "xxxxxxxxxx" .
substr($payinfo, -4) . ")";
@@ -202,7 +202,7 @@ user: From the mapsecrets file - see config.html from the base documentation
=head1 VERSION
-$Id: freeside-expiration-alerter,v 1.4 2002-09-16 09:27:14 ivan Exp $
+$Id: freeside-expiration-alerter,v 1.5 2003-04-21 20:53:57 ivan Exp $
=head1 BUGS
diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup
index 010ec4c..8ec0141 100755
--- a/FS/bin/freeside-setup
+++ b/FS/bin/freeside-setup
@@ -291,6 +291,8 @@ foreach my $aref (
[ 'COMP', 'Comp invoice', '$cust_bill->comp();', 30, 'comp' ],
[ 'CARD', 'Batch card', '$cust_bill->batch_card();', 40, 'batch-card' ],
[ 'BILL', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCRD', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
+ [ 'DCHK', 'Send invoice', '$cust_bill->send();', 50, 'send' ],
) {
my $part_bill_event = new FS::part_bill_event({
diff --git a/fs_signup/FS-SignupClient/cgi/signup.cgi b/fs_signup/FS-SignupClient/cgi/signup.cgi
index 6672e60..e384aaf 100755
--- a/fs_signup/FS-SignupClient/cgi/signup.cgi
+++ b/fs_signup/FS-SignupClient/cgi/signup.cgi
@@ -1,6 +1,6 @@
#!/usr/bin/perl -Tw
#
-# $Id: signup.cgi,v 1.35 2002-12-24 23:03:27 ivan Exp $
+# $Id: signup.cgi,v 1.36 2003-04-21 20:53:57 ivan Exp $
use strict;
use vars qw( @payby $cgi $locales $packages $pops $init_data $error
@@ -160,9 +160,10 @@ if ( defined $cgi->param('magic') ) {
}
$payby = $cgi->param('payby');
- if ( $payby eq 'CHEK' ) {
+ if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
#$payinfo = join('@', map { $cgi->param( $payby. "_payinfo$_" ) } (1,2) );
- $payinfo = $cgi->param('CHEK_payinfo1').'@'.$cgi->param('CHEK_payinfo2');
+ $payinfo = $cgi->param($payby. '_payinfo1'). '@'.
+ $cgi->param($payby. '_payinfo2');
} else {
$payinfo = $cgi->param( $payby. '_payinfo' );
}
@@ -212,7 +213,7 @@ if ( defined $cgi->param('magic') ) {
} else {
$password2 = $cgi->param('_password2');
- if ( $payby eq 'CARD' && $cgi->param('CARD_type') ) {
+ if ( $payby =~ /^(CARD|DCRD)$/ && $cgi->param('CARD_type') ) {
$payinfo =~ s/\D//g;
$payinfo =~ /^(\d{13,16})$/
diff --git a/fs_signup/FS-SignupClient/cgi/signup.html b/fs_signup/FS-SignupClient/cgi/signup.html
index 724ffd7..8077409 100755
--- a/fs_signup/FS-SignupClient/cgi/signup.html
+++ b/fs_signup/FS-SignupClient/cgi/signup.html
@@ -92,7 +92,9 @@ Contact Information
my %payby = (
'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
+ 'DCRD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("DCRD"). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="">!,
'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="">!,
+ 'DCHK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="">!,
'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", "12-2037"). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="Accounts Payable">!,
'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR><font color="#ff0000">*</font>Exp !. expselect("COMP"),
@@ -102,7 +104,9 @@ Contact Information
my( $account, $aba ) = split('@', $payinfo);
my %paybychecked = (
'CARD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("CARD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
+ 'DCRD' => qq!Credit card<BR><font color="#ff0000">*</font>$cardselect<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR><font color="#ff0000">*</font>Exp !. expselect("DCRD", $paydate). qq!<BR><font color="#ff0000">*</font>Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="$payname">!,
'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="$account" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="$payname">!,
+ 'DCHK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="$account" MAXLENGTH=10><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="$payname">!,
'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="$payinfo" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("BILL", $paydate). qq!<BR><font color="#ff0000">*</font>Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
'COMP' => qq!Complimentary<BR><font color="#ff0000">*</font>Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR><font color="#ff0000">*</font>Exp !. expselect("COMP", $paydate),
diff --git a/httemplate/docs/schema.html b/httemplate/docs/schema.html
index 593ea82..a59755e 100644
--- a/httemplate/docs/schema.html
+++ b/httemplate/docs/schema.html
@@ -39,7 +39,7 @@
<li><a name="part_bill_event" href="man/FS/part_bill_event.html">part_bill_event</a> - Invoice event definitions
<ul>
<li>eventpart - primary key
- <li>payby - CARD, CHEK, LECB, BILL, or COMP
+ <li>payby - CARD, DCRD, CHEK, DCHK, LECB, BILL, or COMP
<li>event - event name
<li>eventcode - event action
<li>seconds - how long after the invoice date (<a href="#cust_bill">cust_bill</a>._date) events of this type are triggered
@@ -116,7 +116,7 @@
<li><i>ship_daytime</i>
<li><i>ship_night</i>
<li><i>ship_fax</i>
- <li>payby - CARD, CHEK, LECB, BILL, or COMP
+ <li>payby - CARD, DCHK, CHEK, DCHK, LECB, BILL, or COMP
<li>payinfo - card number, P.O.#, or comp issuer
<li>paydate - expiration date
<li>payname - billing name (name on card)
diff --git a/httemplate/edit/cust_main.cgi b/httemplate/edit/cust_main.cgi
index 7065268..d8edbcd 100755
--- a/httemplate/edit/cust_main.cgi
+++ b/httemplate/edit/cust_main.cgi
@@ -357,7 +357,7 @@ if ( $payby_default eq 'HIDE' ) {
print qq!<INPUT TYPE="hidden" NAME="invoicing_list" VALUE="!.
join(', ', $cust_main->invoicing_list). '">';
- foreach my $payby (qw( CARD CHEK LECB BILL COMP )) {
+ foreach my $payby (qw( CARD DCRD CHEK DCHK LECB BILL COMP )) {
foreach my $field (qw( payinfo payname )) {
print qq!<INPUT TYPE="hidden" NAME="${payby}_$field" VALUE="!.
$cust_main->getfield($field). '">';
@@ -405,8 +405,10 @@ if ( $payby_default eq 'HIDE' ) {
);
my %payby = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
- 'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE=""><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="">!,
+ 'CARD' => qq!Credit card (automatic)<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="">!,
+ 'DCRD' => qq!Credit card (on-demand)<BR>${r}<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="" MAXLENGTH=19><BR>${r}Exp !. expselect("DCRD"). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="">!,
+ 'CHEK' => qq!Electronic check (automatic)<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE=""><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="">!,
+ 'DCHK' => qq!Electronic check (on-demand)<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE=""><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="">!,
'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE=""><BR><INPUT TYPE="hidden" NAME="BILL_month" VALUE="12"><INPUT TYPE="hidden" NAME="BILL_year" VALUE="2037">Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="">!,
'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE=""><BR>${r}Exp !. expselect("COMP"),
@@ -415,15 +417,17 @@ if ( $payby_default eq 'HIDE' ) {
my( $account, $aba ) = split('@', $payinfo);
my %paybychecked = (
- 'CARD' => qq!Credit card<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
- 'CHEK' => qq!Electronic check<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="$account"><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="$payname">!,
+ 'CARD' => qq!Credit card (automatic)<BR>${r}<INPUT TYPE="text" NAME="CARD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("CARD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="CARD_payname" VALUE="$payname">!,
+ 'DCRD' => qq!Credit card (on-demand)<BR>${r}<INPUT TYPE="text" NAME="DCRD_payinfo" VALUE="$payinfo" MAXLENGTH=19><BR>${r}Exp !. expselect("DCRD", $cust_main->paydate). qq!<BR>${r}Name on card<BR><INPUT TYPE="text" NAME="DCRD_payname" VALUE="$payname">!,
+ 'CHEK' => qq!Electronic check (automatic)<BR>${r}Account number <INPUT TYPE="text" NAME="CHEK_payinfo1" VALUE="$account"><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="CHEK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="CHEK_month" VALUE="12"><INPUT TYPE="hidden" NAME="CHEK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="CHEK_payname" VALUE="$payname">!,
+ 'DCHK' => qq!Electronic check (on-demand)<BR>${r}Account number <INPUT TYPE="text" NAME="DCHK_payinfo1" VALUE="$account"><BR>${r}ABA/Routing code <INPUT TYPE="text" NAME="DCHK_payinfo2" VALUE="$aba" SIZE=10 MAXLENGTH=9><INPUT TYPE="hidden" NAME="DCHK_month" VALUE="12"><INPUT TYPE="hidden" NAME="DCHK_year" VALUE="2037"><BR>${r}Bank name <INPUT TYPE="text" NAME="DCHK_payname" VALUE="$payname">!,
'LECB' => qq!Phone bill billing<BR>${r}Phone number <INPUT TYPE="text" BANE="LECB_payinfo" VALUE="$payinfo" MAXLENGTH=15 SIZE=16><INPUT TYPE="hidden" NAME="LECB_month" VALUE="12"><INPUT TYPE="hidden" NAME="LECB_year" VALUE="2037"><INPUT TYPE="hidden" NAME="LECB_payname" VALUE="">!,
'BILL' => qq!Billing<BR>P.O. <INPUT TYPE="text" NAME="BILL_payinfo" VALUE="$payinfo"><BR><INPUT TYPE="hidden" NAME="BILL_month" VALUE="12"><INPUT TYPE="hidden" NAME="BILL_year" VALUE="2037">Attention<BR><INPUT TYPE="text" NAME="BILL_payname" VALUE="$payname">!,
'COMP' => qq!Complimentary<BR>${r}Approved by<INPUT TYPE="text" NAME="COMP_payinfo" VALUE="$payinfo"><BR>${r}Exp !. expselect("COMP", $cust_main->paydate),
);
$cust_main->payby($payby_default) unless $cust_main->payby;
- for (qw(CARD CHEK LECB BILL COMP)) {
+ for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) {
print qq!<TD VALIGN=TOP><INPUT TYPE="radio" NAME="payby" VALUE="$_"!;
if ($cust_main->payby eq "$_") {
print qq! CHECKED> $paybychecked{$_}</TD>!;
diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi
index 2104b45..6426eed 100755
--- a/httemplate/edit/part_bill_event.cgi
+++ b/httemplate/edit/part_bill_event.cgi
@@ -41,7 +41,7 @@ print ntable("#cccccc",2), <<END;
<TR><TD ALIGN="right">Payby</TD><TD><SELECT NAME="payby">
END
-for (qw(CARD CHEK LECB BILL COMP)) {
+for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) {
print qq!<OPTION VALUE="$_"!;
if ($part_bill_event->payby eq $_) {
print " SELECTED>$_</OPTION>";
diff --git a/httemplate/edit/process/cust_main.cgi b/httemplate/edit/process/cust_main.cgi
index 5e6000c..3700d9b 100755
--- a/httemplate/edit/process/cust_main.cgi
+++ b/httemplate/edit/process/cust_main.cgi
@@ -10,9 +10,9 @@ $cgi->param('refnum', (split(/:/, ($cgi->param('refnum'))[0] ))[0] );
my $payby = $cgi->param('payby');
if ( $payby ) {
- if ( $payby eq 'CHEK' ) {
+ if ( $payby eq 'CHEK' || $payby eq 'DCHK' ) {
$cgi->param('payinfo',
- $cgi->param('CHEK_payinfo1'). '@'. $cgi->param('CHEK_payinfo2') );
+ $cgi->param($payby. '_payinfo1'). '@'. $cgi->param($payby. '_payinfo2') );
} else {
$cgi->param('payinfo', $cgi->param( $payby. '_payinfo' ) );
}
diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi
index ac238b6..fe4ec5d 100755
--- a/httemplate/search/cust_main.cgi
+++ b/httemplate/search/cust_main.cgi
@@ -469,7 +469,9 @@ sub cardsearch {
$card =~ /^(\d{13,16})$/ or eidiot "Illegal card number\n";
my($payinfo)=$1;
- [ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'}) ];
+ [ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'CARD'})
+ qsearch('cust_main',{'payinfo'=>$payinfo, 'payby'=>'DCRD'})
+ ];
}
sub referralsearch {
diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi
index 01ad573..2dc53e6 100755
--- a/httemplate/view/cust_main.cgi
+++ b/httemplate/view/cust_main.cgi
@@ -223,10 +223,12 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
'<TR><TD ALIGN="right">Billing type</TD><TD BGCOLOR="#ffffff">',
;
- if ( $cust_main->payby eq 'CARD' ) {
+ if ( $cust_main->payby eq 'CARD' && $cust_main->payby eq 'DCRD' ) {
my $payinfo = $cust_main->payinfo;
$payinfo = 'x'x(length($payinfo)-4). substr($payinfo,(length($payinfo)-4));
- print 'Credit card</TD></TR>',
+ print 'Credit card ',
+ ( $cust_main->payby eq 'CARD' ? '(automatic)' : '(on-demand)' ),
+ '</TD></TR>',
'<TR><TD ALIGN="right">Card number</TD><TD BGCOLOR="#ffffff">',
$payinfo, '</TD></TR>',
'<TR><TD ALIGN="right">Expiration</TD><TD BGCOLOR="#ffffff">',
@@ -234,9 +236,11 @@ if ( $conf->config('payby-default') ne 'HIDE' ) {
'<TR><TD ALIGN="right">Name on card</TD><TD BGCOLOR="#ffffff">',
$cust_main->payname, '</TD></TR>'
;
- } elsif ( $cust_main->payby eq 'CHEK' ) {
+ } elsif ( $cust_main->payby eq 'CHEK' && $cust_main->payby eq 'DCHK') {
my( $account, $aba ) = split('@', $cust_main->payinfo );
- print 'Electronic check</TD></TR>',
+ print 'Electronic check',
+ ( $cust_main->payby eq 'CHEK' ? '(automatic)' : '(on-demand)' ),
+ '</TD></TR>',
'<TR><TD ALIGN="right">Account number</TD><TD BGCOLOR="#ffffff">',
$account, '</TD></TR>',
'<TR><TD ALIGN="right">ABA/Routing code</TD><TD BGCOLOR="#ffffff">',