X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_refund.html;h=d5f5eb2321cdf3b2c52f8964be09ab25ae283a3b;hb=59669128b6409e2556aa26d659c5cc22a1c7b945;hp=996b4c05a4d47be1a9b227ae208060f34e2897e5;hpb=fb4ab1073f0d15d660c6cdc4e07afebf68ef3924;p=freeside.git diff --git a/httemplate/view/cust_refund.html b/httemplate/view/cust_refund.html index 996b4c05a..d5f5eb232 100644 --- a/httemplate/view/cust_refund.html +++ b/httemplate/view/cust_refund.html @@ -2,7 +2,12 @@ <& /elements/header-popup.html, mt('Refund Receipt') &> -
<% mt('Print') |h %>

+
+ <% mt('Print') |h %> +% if ( $cust_main->invoicing_list_emailonly ) { + | <% mt('Email') |h %> +% } +
% } elsif ( $link eq 'print' ) { @@ -16,6 +21,12 @@ %>

+% } elsif ( $link eq 'email' ) { +% if ( $email_error ) { + <& /elements/header-popup.html, mt("Error re-emailing receipt: [_1]", $email_error) &> +% } else { + <& /elements/header-popup.html, mt("Re-emailed receipt") &> +% } % } else { <& /elements/header.html, mt('Refund Receipt'), menubar( @@ -26,7 +37,7 @@ % } -% unless ($link eq 'popup' ) { +% unless ($link =~ /^(popup|email)$/ ) { <& /elements/small_custview.html, $custnum, scalar($conf->config('countrydefault')), @@ -62,7 +73,7 @@ <% $cust_refund->payby_name %><% $cust_refund->paymask ? ' #'.$cust_refund->paymask : '' %> -% if ( $cust_refund->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_refund->paybatch ) { +% if ( $cust_refund->payby =~ /^(CARD|CHEK|LECB)$/ && $cust_refund->processor ) { <% mt('Processor') |h %> @@ -71,7 +82,7 @@ <% mt('Authorization #') |h %> - <% $cust_refund->authorization %> + <% $cust_refund->auth %> % if ( $cust_refund->order_number ) { @@ -91,9 +102,14 @@ window.print(); -% } +% } elsif ( $link eq 'email' ) { -% if ( $link =~ /^(popup|print)$/ ) { + + +% } +% if ( $link =~ /^(popup|print|email)$/ ) { % } else { @@ -125,10 +141,13 @@ my $cust_refund = qsearchs({ }); die "Refund #$refundnum not found!" unless $cust_refund; +my $cust_main = $cust_refund->cust_main; + my $pr_link = "${p}view/cust_refund.html?link=print;refundnum=$refundnum"; +my $email_link = "${p}view/cust_refund.html?link=email;refundnum=$refundnum"; my $custnum = $cust_refund->custnum; -my $display_custnum = $cust_refund->cust_main->display_custnum; +my $display_custnum = $cust_main->display_custnum; my $conf = new FS::Conf; @@ -136,4 +155,11 @@ my $money_char = $conf->config('money_char') || '$'; tie my %payby, 'Tie::IxHash', FS::payby->payby2longname; +my $email_error; + +if ( $link eq 'email' ) { + $email_error = $cust_refund->send_receipt( 'cust_main' => $cust_main ); + warn "can't send refund receipt: $email_error" if $email_error; +} +