From f19956cf9995fee8897542fafa6c7ec13afde381 Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Fri, 5 Feb 2016 05:30:08 -0800 Subject: [PATCH] zip email CDRs, RT#40112 --- FS/FS/Template_Mixin.pm | 11 ++++++----- httemplate/edit/cust_main/billing.html | 4 ++-- httemplate/view/cust_main/billing.html | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/FS/FS/Template_Mixin.pm b/FS/FS/Template_Mixin.pm index 6d661f11c..1f67792df 100644 --- a/FS/FS/Template_Mixin.pm +++ b/FS/FS/Template_Mixin.pm @@ -2257,7 +2257,7 @@ sub generate_email { my @otherparts = (); if ( ref($self) eq 'FS::cust_bill' && $cust_main->email_csv_cdr ) { - if ( $conf->exists('voip-cust_email_csv_cdr_zip') ) { + if ( $conf->config('voip-cdr_email_attach') eq 'zip' ) { my $data = join('', map "$_\n", $self->call_details(prepend_billed_number=>1) @@ -2273,13 +2273,14 @@ sub generate_email { die "Error zipping CDR attachment: $!" unless $status == AZ_OK; push @otherparts, build MIME::Entity - 'Type' => 'application/zip', - 'Encoding' => 'base64', - 'Data' => $zipdata, + 'Type' => 'application/zip', + 'Encoding' => 'base64', + 'Data' => $zipdata, + 'Disposition' => 'attachment', 'Filename' => 'usage-'. $self->invnum. '.zip', ; - } else { + } else { # } elsif ( $conf->config('voip-cdr_email_attach') eq 'csv' ) { push @otherparts, build MIME::Entity 'Type' => 'text/csv', diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index fcb44a50a..50262e82c 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -234,9 +234,9 @@ function toggle(obj) { % } -% if ( $conf->config('voip-cdr_email_attach') ) { +% if ( my $attach = $conf->config('voip-cdr_email_attach') ) { - email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as CSV to emailed invoices') |h %> + email_csv_cdr eq "Y" ? 'CHECKED' : '' %>> <% mt('Attach CDRs as '. uc($attach). ' to emailed invoices') |h %> % } else { diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index cca140bf8..08b4323a8 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -242,9 +242,9 @@ % } -% if ( $conf->config('voip-cdr_email_attach') ) { +% if ( my $attach = $conf->config('voip-cdr_email_attach') ) { - <% mt('Email CDRs as CSV') |h %> + <% mt('Email CDRs as '.uc($attach)) |h %> <% $cust_main->email_csv_cdr ? $yes : $no %> % } -- 2.11.0