From cccd0b7cd38a88c131e19981be38434f87abe194 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 21 Oct 2005 15:21:37 +0000 Subject: add CASH and WEST payment types (payments only, not cust_main.payby) --- httemplate/view/cust_bill.cgi | 40 +++++++++++++++++- httemplate/view/cust_main/payment_history.html | 56 +++++++++++++++++++++++--- 2 files changed, 89 insertions(+), 7 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index d149cf172..8dcbd3a35 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -8,6 +8,12 @@ my $invnum = $3; my $conf = new FS::Conf; +my @payby = $conf->config('payby'); +#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless grep /\w/, @payby; +my %payby = map { $_=>1 } @payby; + my $cust_bill = qsearchs('cust_bill',{'invnum'=>$invnum}); die "Invoice #$invnum not found!" unless $cust_bill; my $custnum = $cust_bill->getfield('custnum'); @@ -22,8 +28,38 @@ my $link = $templatename ? "$templatename-$invnum" : $invnum; "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", )) %> -<% if ( $cust_bill->owed > 0 ) { %> - Enter payments (check/cash) against this invoice | +<% if ( $cust_bill->owed > 0 + && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} ) + ) + { + my $s = 0; +%> + + Post + + <% if ( $payby{'BILL'} ) { %> + + <%= $s++ ? ' | ' : '' %> + check + + <% } %> + + <% if ( $payby{'CASH'} ) { %> + + <%= $s++ ? ' | ' : '' %> + cash + + <% } %> + + <% if ( $payby{'WEST'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Western Union + + <% } %> + + payment against this invoice
+ <% } %> Re-print this invoice diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 6c475c5f2..e58b6248e 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -1,13 +1,56 @@ <% my( $cust_main ) = @_; - my $conf = new FS::Conf; my $custnum = $cust_main->custnum; + + my $conf = new FS::Conf; + + my @payby = $conf->config('payby'); + #@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) + @payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless grep /\w/, @payby; + my %payby = map { $_=>1 } @payby; + + my $s = 0; + %>

Payment History
-Post cash/check payment -| Process credit card payment -| Process electronic check (ACH) payment + +<% if ( $payby{'BILL'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Post check payment + +<% } %> + +<% if ( $payby{'CASH'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Post cash payment + +<% } %> + +<% if ( $payby{'WEST'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Post Western Union payment + +<% } %> + +<% if ( $payby{'CARD'} || $payby{'DCRD'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Process credit card payment + +<% } %> + +<% if ( $payby{'CHEK'} || $payby{'DCHK'} ) { %> + + <%= $s++ ? ' | ' : '' %> + Process electronic check (ACH) payment + +<% } %> +
Post credit
@@ -51,8 +94,11 @@ foreach my $cust_pay ($cust_main->cust_pay) { $payby =~ s/^BILL$/Check #/ if $payinfo; $payby =~ s/^CHEK$/Electronic check /; $payby =~ s/^PREP$/Prepaid card /; + $payby =~ s/^CARD$/Credit card #/; + $payby =~ s/^COMP$/Complimentary by /; + $payby =~ s/^CASH$/Cash/; + $payby =~ s/^WEST$/Western Union/; $payby =~ s/^BILL$//; - $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); -- cgit v1.2.1