summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorivan <ivan>2005-10-21 15:21:37 +0000
committerivan <ivan>2005-10-21 15:21:37 +0000
commitcccd0b7cd38a88c131e19981be38434f87abe194 (patch)
treeddd0960706fcefdf495fe23178f0479b954093ee /httemplate/view
parenta4fcab2fecfce70e38c7f150e5a870a0f60d1136 (diff)
add CASH and WEST payment types (payments only, not cust_main.payby)
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_bill.cgi40
-rw-r--r--httemplate/view/cust_main/payment_history.html56
2 files changed, 89 insertions, 7 deletions
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 ) { %>
- <A HREF="<%= $p %>edit/cust_pay.cgi?<%= $invnum %>">Enter payments (check/cash) against this invoice</A> |
+<% if ( $cust_bill->owed > 0
+ && ( $payby{'BILL'} || $payby{'CASH'} || $payby{'WEST'} )
+ )
+ {
+ my $s = 0;
+%>
+
+ Post
+
+ <% if ( $payby{'BILL'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;invnum=<%= $invnum %>">check</A>
+
+ <% } %>
+
+ <% if ( $payby{'CASH'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;invnum=<%= $invnum %>">cash</A>
+
+ <% } %>
+
+ <% if ( $payby{'WEST'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;invnum=<%= $invnum %>">Western Union</A>
+
+ <% } %>
+
+ payment against this invoice<BR>
+
<% } %>
<A HREF="<%= $p %>misc/print-invoice.cgi?<%= $link %>">Re-print this invoice</A>
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;
+
%>
<BR><BR><A NAME="history"><FONT SIZE="+2">Payment History</FONT></A><BR>
-<A HREF="<%= $p %>edit/cust_pay.cgi?custnum=<%= $custnum %>">Post cash/check payment</A>
-| <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A>
-| <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A>
+
+<% if ( $payby{'BILL'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=BILL;custnum=<%= $custnum %>">Post check payment</A>
+
+<% } %>
+
+<% if ( $payby{'CASH'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=CASH;custnum=<%= $custnum %>">Post cash payment</A>
+
+<% } %>
+
+<% if ( $payby{'WEST'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>edit/cust_pay.cgi?payby=WEST;custnum=<%= $custnum %>">Post Western Union payment</A>
+
+<% } %>
+
+<% if ( $payby{'CARD'} || $payby{'DCRD'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>misc/payment.cgi?payby=CARD;custnum=<%= $custnum %>">Process credit card payment</A>
+
+<% } %>
+
+<% if ( $payby{'CHEK'} || $payby{'DCHK'} ) { %>
+
+ <%= $s++ ? ' | ' : '' %>
+ <A HREF="<%= $p %>misc/payment.cgi?payby=CHEK;custnum=<%= $custnum %>">Process electronic check (ACH) payment</A>
+
+<% } %>
+
<BR><A HREF="<%= $p %>edit/cust_credit.cgi?<%= $custnum %>">Post credit</A>
<BR>
@@ -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 ) = ( '', '', '', '', '' );