[freeside-commits] freeside/httemplate/view cust_pay.html,1.7,1.8

Erik Levinson levinse at wavetail.420.am
Wed Nov 3 17:54:38 PDT 2010


Update of /home/cvs/cvsroot/freeside/httemplate/view
In directory wavetail.420.am:/tmp/cvs-serv11192/freeside/httemplate/view

Modified Files:
	cust_pay.html 
Log Message:
added an e-mail link on payment receipts, RT7946


Index: cust_pay.html
===================================================================
RCS file: /home/cvs/cvsroot/freeside/httemplate/view/cust_pay.html,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -w -d -r1.7 -r1.8
--- cust_pay.html	30 Jul 2009 06:42:32 -0000	1.7
+++ cust_pay.html	4 Nov 2010 00:54:36 -0000	1.8
@@ -2,7 +2,10 @@
 
   <% include('/elements/header-popup.html', "$thing Receipt" ) %>
 
-  <CENTER><A HREF="javascript:self.parent.location = '<% $pr_link %>'">Print</A></CENTER><BR>
+  <div align="center">
+    <A HREF="javascript:self.parent.location = '<% $pr_link %>'">Print</A> | 
+    <A HREF="javascript:self.location = '<% $email_link %>'">Re-email</A>
+  </div><BR>
 
 % } elsif ( $link eq 'print' ) { 
 
@@ -15,7 +18,12 @@
      )
   %>
   <BR><BR>
-
+% } elsif ( $link eq 'email' ) {
+%  if ( $email_error ) {
+      <% include('/elements/header-popup.html', "Error re-emailing receipt: $email_error" ) %>
+%  } else {
+      <% include('/elements/header-popup.html', "Re-emailed receipt" ) %>
+%  }
 % } else { 
 
   <% include('/elements/header.html', "$thing Receipt", menubar(
@@ -26,7 +34,7 @@
 
 % }
 
-% unless ($link eq 'popup' ) {
+% unless ($link =~ /^(popup|email)$/ ) {
   <% include('/elements/small_custview.html',
                $custnum,
                scalar($conf->config('countrydefault')),
@@ -110,9 +118,14 @@
     window.print();
   </SCRIPT>
 
-% }
+% } elsif ( $link eq 'email' ) {
 
-% if ( $link =~ /^(popup|print)$/ ) { 
+    <SCRIPT TYPE="text/javascript">
+      window.top.location.reload();
+    </SCRIPT>
+
+% }
+% if ( $link =~ /^(popup|print|email)$/ ) { 
     </BODY>
   </HTML>
 % } else {
@@ -149,6 +162,7 @@
 die "$thing #$paynum not found!" unless $cust_pay;
 
 my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum;void=$void";
+my $email_link = "${p}view/cust_pay.html?link=email;paynum=$paynum;void=$void";
 
 my $custnum = $cust_pay->custnum;
 my $display_custnum = $cust_pay->cust_main->display_custnum;
@@ -159,4 +173,14 @@
 
 tie my %payby, 'Tie::IxHash', FS::payby->payby2longname;
 
+my $email_error;
+
+if ( $link eq 'email' ) {
+    my $email_error = $cust_pay->send_receipt(
+	'manual' => 1,
+    );
+
+    warn "can't send payment receipt/statement: $email_error" if $email_error;
+}
+
 </%init>



More information about the freeside-commits mailing list