X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=4822ab718391f6a0f2f96014bf71d4c2986eb0b4;hb=eb3bd392a89b8b666dc512951e78913c05b98810;hp=a8b4ac15cfaabc4ee7edb8eeb8d96b2ad7ba3bb1;hpb=ce1b61e7d65317a74f680afb4cb8d8306e14fa5f;p=freeside.git diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index a8b4ac15c..4822ab718 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -104,12 +104,35 @@ % my $br = 0; % if ( $cust_bill->num_cust_event ) { $br++; ( <% mt('View invoice events') |h %> ) -% } +% } % if ( $cust_bill->num_cust_bill_event ) { $br++; ( <% mt('View deprecated, old-style invoice events') |h %> ) % } +% my @modes = grep {! $_->disabled} +% $cust_bill->cust_main->agent->invoice_modes; +% if ( @modes ) { +( <% mt('View as:') %> +
+ +<& /elements/select-table.html, + table => 'invoice_mode', + field => 'mode', + curr_value => scalar($cgi->param('mode')), + records => \@modes, + name_col => 'modename', + onchange => 'change_invoice_mode', + empty_label => '(default)', +&> ) + +% $br++; +% } + <% $br ? '

' : '' %> % if ( $conf->exists('invoice_html') ) { @@ -126,7 +149,9 @@ my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('View invoices'); -my( $invnum, $template, $notice_name ); +my $conf = FS::Conf->new; + +my( $invnum, $mode, $template, $notice_name ); my($query) = $cgi->keywords; if ( $query =~ /^((.+)-)?(\d+)$/ ) { $template = $2; @@ -136,10 +161,9 @@ if ( $query =~ /^((.+)-)?(\d+)$/ ) { $invnum = $cgi->param('invnum'); $template = $cgi->param('template'); $notice_name = $cgi->param('notice_name'); + $mode = $cgi->param('mode'); } -my $conf = new FS::Conf; - my %opt = ( 'unsquelch_cdr' => $conf->exists('voip-cdr_email'), 'template' => $template, @@ -163,12 +187,13 @@ my $cust_bill = qsearchs({ }); die "Invoice #$invnum not found!" unless $cust_bill; +$cust_bill->set('mode' => $mode); + my $custnum = $cust_bill->custnum; my $display_custnum = $cust_bill->cust_main->display_custnum; -#my $printed = $cust_bill->printed; - my $link = "invnum=$invnum"; +$link .= ';mode=' . $mode if $mode; $link .= ';template='. uri_escape($template) if $template; $link .= ';notice_name='. $notice_name if $notice_name;