X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_refund.html;h=d5f5eb2321cdf3b2c52f8964be09ab25ae283a3b;hp=31976150694c3b894eeede8bb83edbb965068532;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hpb=7a618d4493ab7a87f6eabfd1ce3630a6b3436c2f diff --git a/httemplate/view/cust_refund.html b/httemplate/view/cust_refund.html index 319761506..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')), @@ -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; +} +