X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_bill.cgi;h=344030404ff23cea332eb5d5bc92ab424ccb3b2b;hb=d8950e63d6c3f6fb910c28077e3a3e054ad12388;hp=2ce294e9a87202d4cfcdda45bfb3352df91909bf;hpb=8ef00c68688492b2afa3dde8d3d467f89f238c40;p=freeside.git diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 2ce294e9a..344030404 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -58,6 +58,27 @@ % } +% if ( $conf->exists('cust_bill-enable_promised_date') ) { +% my $onclick = include('/elements/popup_link_onclick.html', +% 'action' => $p.'misc/cust_bill-promised_date.html?'.$invnum, +% 'actionlabel' => emt('Set promised payment date'), +% 'width' => 320, +% 'height' => 240, +% ); +% $onclick = ''; +% if ( $cust_bill->promised_date ) { +% my $date_format = $conf->config('date_format') || '%b %o, %Y'; + <% mt('Payment promised by [_1]', + time2str($date_format, $cust_bill->promised_date) ) %> + ( <% $onclick %><% mt('change') |h %> ) +

+% } +% elsif ( $cust_bill->owed > 0 ) { + <% $onclick %><% mt('Set promised payment date' ) |h %> +

+% } +% } + % if ( $curuser->access_right('Resend invoices') ) { <% mt('Re-print this invoice') |h %> @@ -83,18 +104,41 @@ % 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') ) { +% if ( $conf->exists('invoice_html') && ! $cgi->param('plaintext') ) { <% join('', $cust_bill->print_html(\%opt) ) %> % } else { -
<% join('', $cust_bill->print_text(\%opt) ) %>
+
<% join('', $cust_bill->print_text(\%opt) ) |h %>
% } <& /elements/footer.html &> @@ -105,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; @@ -115,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, @@ -142,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;