From f10cd68f08a6bfbd565a83b40bacc3f55a1265b3 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 21 Nov 2005 10:47:12 +0000 Subject: [PATCH] add MCRD payment type for manually processed ccards --- FS/FS/Conf.pm | 4 ++-- FS/FS/cust_main.pm | 8 ++++---- FS/FS/cust_pay.pm | 5 +++-- FS/FS/cust_pay_void.pm | 4 ++-- FS/FS/cust_refund.pm | 4 ++-- httemplate/edit/cust_main/billing.html | 23 ++++++++++++++++++++--- httemplate/edit/cust_pay.cgi | 1 + httemplate/search/cust_pay.cgi | 4 +++- httemplate/search/report_cust_pay.html | 1 + httemplate/view/cust_bill.cgi | 9 ++++++++- httemplate/view/cust_main/payment_history.html | 8 ++++++++ 11 files changed, 54 insertions(+), 17 deletions(-) diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index dbc44cec8..7fed1a49b 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -1298,7 +1298,7 @@ httemplate/docs/config.html 'section' => 'billing', 'description' => 'Available payment types.', 'type' => 'selectmultiple', - 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP) ], + 'select_enum' => [ qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP) ], }, { @@ -1306,7 +1306,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 DCRD CHEK DCHK LECB BILL CASH WEST COMP HIDE) ], + 'select_enum' => [ '', qw(CARD DCRD CHEK DCHK LECB BILL CASH WEST MCRD COMP HIDE) ], }, { diff --git a/FS/FS/cust_main.pm b/FS/FS/cust_main.pm index f9031d792..e2b3baf34 100644 --- a/FS/FS/cust_main.pm +++ b/FS/FS/cust_main.pm @@ -377,7 +377,7 @@ sub insert { $payby = 'PREP' if $amount; - } elsif ( $self->payby =~ /^(CASH|WEST)$/ ) { + } elsif ( $self->payby =~ /^(CASH|WEST|MCRD)$/ ) { $payby = $1; $self->payby('BILL'); @@ -718,7 +718,7 @@ sub insert_cust_pay_cash { shift->insert_cust_pay('CASH', @_); } -=item insert_cust_pay_prepay AMOUNT [ PAYINFO ] +=item insert_cust_pay_west AMOUNT [ PAYINFO ] Inserts a Western Union payment in the specified amount for this customer. An optional second argument can specify the prepayment identifier for tracking @@ -1150,7 +1150,7 @@ sub check { } } - $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY|CASH|WEST)$/ + $self->payby =~ /^(CARD|DCRD|CHEK|DCHK|LECB|BILL|COMP|PREPAY|CASH|WEST|MCRD)$/ or return "Illegal payby: ". $self->payby; $error = $self->ut_numbern('paystart_month') @@ -1287,7 +1287,7 @@ sub check { if ( $self->paydate eq '' || $self->paydate eq '-' ) { return "Expriation date required" - unless $self->payby =~ /^(BILL|PREPAY|CHEK|DCHK|LECB|CASH|WEST)$/; + unless $self->payby =~ /^(BILL|PREPAY|CHEK|DCHK|LECB|CASH|WEST|MCRD)$/; $self->paydate(''); } else { my( $m, $y ); diff --git a/FS/FS/cust_pay.pm b/FS/FS/cust_pay.pm index 3772473bc..f057d2faf 100644 --- a/FS/FS/cust_pay.pm +++ b/FS/FS/cust_pay.pm @@ -62,7 +62,8 @@ L and L for conversion functions. =item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH), `LECB' (phone bill billing), `BILL' (billing), `PREP` (prepaid card), -`CASH' (cash), `WEST' (Western Union) or `COMP' (free) +`CASH' (cash), `WEST' (Western Union), `MCRD' (Manual credit card), or +`COMP' (free) =item payinfo - card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively @@ -374,7 +375,7 @@ sub check { $self->_date(time) unless $self->_date; - $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST)$/ + $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST|MCRD)$/ or return "Illegal payby"; $self->payby($1); diff --git a/FS/FS/cust_pay_void.pm b/FS/FS/cust_pay_void.pm index 6437163ad..71fe88b6f 100644 --- a/FS/FS/cust_pay_void.pm +++ b/FS/FS/cust_pay_void.pm @@ -48,7 +48,7 @@ L and L for conversion functions. =item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH), `LECB' (phone bill billing), `BILL' (billing), `CASH' (cash), -`WEST' (Western Union) or `COMP' (free) +`WEST' (Western Union), `MCRD' (Manual credit card), or `COMP' (free) =item payinfo - card number, check #, or comp issuer (4-8 lowercase alphanumerics; think username), respectively @@ -129,7 +129,7 @@ sub check { $self->void_date(time) unless $self->void_date; - $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST)$/ + $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|PREP|CASH|WEST|MCRD)$/ or return "Illegal payby"; $self->payby($1); diff --git a/FS/FS/cust_refund.pm b/FS/FS/cust_refund.pm index 48cc7cc7a..8c672b8d7 100644 --- a/FS/FS/cust_refund.pm +++ b/FS/FS/cust_refund.pm @@ -52,7 +52,7 @@ L and L for conversion functions. =item payby - `CARD' (credit cards), `CHEK' (electronic check/ACH), `LECB' (Phone bill billing), `BILL' (billing), `CASH' (cash), -`WEST' (Western Union), or `COMP' (free) +`WEST' (Western Union), `MCRD' (Manual credit card), or `COMP' (free) =item payinfo - card number, P.O.#, or comp issuer (4-8 lowercase alphanumerics; think username) @@ -212,7 +212,7 @@ sub check { unless $self->crednum || qsearchs( 'cust_main', { 'custnum' => $self->custnum } ); - $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|CASH|WEST)$/ + $self->payby =~ /^(CARD|CHEK|LECB|BILL|COMP|CASH|WEST|MCRD)$/ or return "Illegal payby"; $self->payby($1); diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index caac3a956..6168fa97e 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -331,6 +331,22 @@ if ( $payby_default eq 'HIDE' ) { '', + 'MCRD' => + + ''. + + qq!!. + qq!!. + + ''. + ''. + ''. + ''. + ''. + ''. + + '
${r}Amount
 
 
 
 
 
 
', + ); @@ -341,11 +357,12 @@ if ( $payby_default eq 'HIDE' ) { 'BILL' => 'Billing', 'CASH' => 'Cash', # initial payment, then billing', 'WEST' => 'Western Union', # initial payment, then billing', + 'MCRD' => 'Manual credit card', # initial payment, then billing', 'COMP' => 'Complimentary', ); - if ( $cust_main->custnum ) { #don't offer CASH and WEST initial payment types + if ( $cust_main->custnum ) { #don't offer CASH/WEST/MCRD initial payment types # when editing customer - delete $allopt{$_} for qw(CASH WEST); + delete $allopt{$_} for qw(CASH WEST MCRD); } tie my %options, 'Tie::IxHash', @@ -365,7 +382,7 @@ if ( $payby_default eq 'HIDE' ) { #'form_action' => 'nothingyet', #chops bottom of page in IE# 'under_position' => 'absolute', 'html_between' => '', - 'selected_layer' => $payby2option{$payby} || 'CARD', + 'selected_layer' => $payby2option{$payby || $payby_default || $payby[0] }, 'layer_callback' => sub { my $layer = shift; $payby{$layer}; }, ); diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index b2f3f55ff..0370ab726 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -6,6 +6,7 @@ my %payby = ( 'BILL' => 'Check', 'CASH' => 'Cash', 'WEST' => 'Western Union', + 'MCRD' => 'Manual credit card', ); my($link, $linknum, $paid, $payby, $payinfo, $quickpay, $_date); diff --git a/httemplate/search/cust_pay.cgi b/httemplate/search/cust_pay.cgi index bf3df9846..99ffc3d20 100755 --- a/httemplate/search/cust_pay.cgi +++ b/httemplate/search/cust_pay.cgi @@ -17,7 +17,7 @@ if ( $cgi->param('payby') ) { $cgi->param('payby') =~ - /^(CARD|CHEK|BILL|PREP|CASH|WEST)(-(VisaMC|Amex|Discover|Maestro))?$/ + /^(CARD|CHEK|BILL|PREP|CASH|WEST|MCRD)(-(VisaMC|Amex|Discover|Maestro))?$/ or die "illegal payby ". $cgi->param('payby'); push @search, "cust_pay.payby = '$1'"; if ( $3 ) { @@ -170,6 +170,8 @@ 'Cash '. $cust_pay->payinfo; } elsif ( $cust_pay->payby eq 'WEST' ) { 'Western Union'; #. $cust_pay->payinfo; + } elsif ( $cust_pay->payby eq 'MCRD' ) { + 'Manual credit card'; #. $cust_pay->payinfo; } else { $cust_pay->payby. ' '. $cust_pay->payinfo; } diff --git a/httemplate/search/report_cust_pay.html b/httemplate/search/report_cust_pay.html index 18501d5b5..a28ead92d 100644 --- a/httemplate/search/report_cust_pay.html +++ b/httemplate/search/report_cust_pay.html @@ -25,6 +25,7 @@ + diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 8dcbd3a35..572441494 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -29,7 +29,7 @@ my $link = $templatename ? "$templatename-$invnum" : $invnum; )) %> <% if ( $cust_bill->owed > 0 - && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} ) + && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} || $payby{'MCRD'} ) ) { my $s = 0; @@ -58,6 +58,13 @@ my $link = $templatename ? "$templatename-$invnum" : $invnum; <% } %> + <% if ( $payby{'MCRD'} ) { %> + + <%= $s++ ? ' | ' : '' %> + manual credit card + + <% } %> + payment against this invoice
<% } %> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index e58b6248e..f794ccf4a 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -51,6 +51,13 @@ <% } %> +<% if ( $payby{'MCRD'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Post manual credit card payment + +<% } %> +
Post credit
@@ -98,6 +105,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { $payby =~ s/^COMP$/Complimentary by /; $payby =~ s/^CASH$/Cash/; $payby =~ s/^WEST$/Western Union/; + $payby =~ s/^MCRD$/Manual credit card/; $payby =~ s/^BILL$//; my $info = $payby ? " ($payby$payinfo)" : ''; -- 2.11.0