From b6971314b234feb121153158fc05eb0f8865ba74 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 16 Mar 2009 05:54:34 +0000 Subject: fix custnum display on domain view --- httemplate/view/svc_domain.cgi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 8c1f4cecd..36577d39c 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -138,9 +138,9 @@ my $cust_svc = qsearchs('cust_svc',{'svcnum'=>$svcnum}); my $pkgnum = $cust_svc->getfield('pkgnum'); my($cust_pkg, $custnum, $display_custnum); if ($pkgnum) { - $cust_pkg =qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); + $cust_pkg = qsearchs('cust_pkg', {'pkgnum'=>$pkgnum} ); $custnum = $cust_pkg->custnum; - $custnum = $cust_pkg->cust_main->display_custnum; + $display_custnum = $cust_pkg->cust_main->display_custnum; } else { $cust_pkg = ''; $custnum = ''; -- cgit v1.2.1 From 320bcf3afbae18935ab954d1a738e9502d53955f Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 29 Mar 2009 09:38:30 +0000 Subject: optimize customer view when there's lots of packages; *really* avoid looking up any config inside the package loop, RT#5083 --- .../view/cust_main/one_time_charge_link.html | 82 ++++++++++++ httemplate/view/cust_main/packages.html | 142 +++++---------------- httemplate/view/cust_main/packages/status.html | 4 +- 3 files changed, 116 insertions(+), 112 deletions(-) create mode 100644 httemplate/view/cust_main/one_time_charge_link.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/one_time_charge_link.html b/httemplate/view/cust_main/one_time_charge_link.html new file mode 100644 index 000000000..6ed70ee4c --- /dev/null +++ b/httemplate/view/cust_main/one_time_charge_link.html @@ -0,0 +1,82 @@ + + + +
+ + + + +
+ +<% include('/elements/popup_link.html', { + 'action' => $p.'edit/quick-charge.html?custnum='. $cust_main->custnum, + 'label' => 'One-time charge', + 'actionlabel' => 'One-time charge', + 'color' => '#333399', + 'width' => 763, + 'height' => 408, + }) +%> + +<%init> + +my($cust_main) = @_; + + diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 2c258881a..72846b8ec 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -1,94 +1,25 @@ Packages
-% if ( $curuser->access_right('One-time charge') ) { - - -
- - - - -
-% } - % my $s = 0; % if ( $curuser->access_right('Order customer package') ) { <% $s++ ? ' | ' : '' %> - <% order_pkg_link($cust_main) %> + <% include( '/elements/popup_link-cust_main.html', + 'action' => $p. 'misc/order_pkg.html', + 'label' => 'Order new package', + 'actionlabel' => 'Order new package', + 'color' => '#333399', + 'cust_main' => $cust_main, + 'closetext' => 'Close', + 'width' => 763, + ) + %> % } % if ( $curuser->access_right('One-time charge') % && $conf->config('payby-default') ne 'HIDE' % ) { -% <% $s++ ? ' | ' : '' %> - <% include('/elements/popup_link.html', - { - 'action' => $p. 'edit/quick-charge.html?custnum='. $cust_main->custnum, - 'label' => 'One-time charge', - 'actionlabel' => 'One-time charge', - 'color' => '#333399', - 'width' => 763, - 'height' => 408, - }) - %> + <% include('one_time_charge_link.html', $cust_main) %> % } % if ( $curuser->access_right('Bulk change customer packages') ) { @@ -146,24 +77,11 @@ Current packages % $bgcolor = $bgcolor1; % } % -% my $countrydefault = scalar($conf->config('countrydefault')) || 'US'; % my %iopt = ( -% 'bgcolor' => $bgcolor, -% 'cust_pkg' => $cust_pkg, -% 'part_pkg' => $cust_pkg->part_pkg, -% -% #for services.html and status.html -% 'cust_pkg-display_times' => $conf->exists('cust_pkg-display_times'), -% -% #for location.html -% 'countrydefault' => $countrydefault, -% 'statedefault' => ( scalar($conf->config('statedefault')) -% || ($countrydefault eq 'US' ? 'CA' : '') ), -% -% #for services.html -% 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'), -% 'legacy_link' => $conf->exists('legacy_link'), -% +% 'bgcolor' => $bgcolor, +% 'cust_pkg' => $cust_pkg, +% 'part_pkg' => $cust_pkg->part_pkg, +% %conf_opt, % ); @@ -193,6 +111,7 @@ Current packages if ( el ) el.scrollIntoView(true); % } + <%init> my( $cust_main ) = @_; @@ -205,6 +124,23 @@ my $packages = get_packages($cust_main, $conf); my $show_location = $conf->exists('cust_pkg-always_show_location') || ( grep $_->locationnum, @$packages ); # ? '1' : '0'; +my $countrydefault = scalar($conf->config('countrydefault')) || 'US'; +my %conf_opt = ( + #for services.html and status.html + 'cust_pkg-display_times' => $conf->exists('cust_pkg-display_times'), + + #for status.html + 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'), + + #for location.html + 'countrydefault' => $countrydefault, + 'statedefault' => ( scalar($conf->config('statedefault')) + || ($countrydefault eq 'US' ? 'CA' : '') ), + #for services.html + 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'), + 'legacy_link' => $conf->exists('legacy_link'), +); + #subroutines sub get_packages { @@ -226,16 +162,4 @@ sub get_packages { [ $cust_main->$method() ]; } -sub order_pkg_link { - include( '/elements/popup_link-cust_main.html', - 'action' => $p. 'misc/order_pkg.html', - 'label' => 'Order new package', - 'actionlabel' => 'Order new package', - 'color' => '#333399', - 'cust_main' => shift, - 'closetext' => 'Close', - 'width' => 763, - ) -} - diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 106137ba9..af407b0df 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -122,7 +122,7 @@ % % } % -% if ( $conf->exists('cust_pkg-show_autosuspend') ) { +% if ( $opt{'cust_pkg-show_autosuspend'} ) { % my $autosuspend = pkg_autosuspend_time( $cust_pkg ); % $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend; % } @@ -170,8 +170,6 @@ my %opt = @_; -my $conf = new FS::Conf; - my $bgcolor = $opt{'bgcolor'}; my $cust_pkg = $opt{'cust_pkg'}; my $part_pkg = $opt{'part_pkg'}; -- cgit v1.2.1 From 3a1f501e679daa106fa4fe826ad70608bb033f54 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 29 Mar 2009 10:34:20 +0000 Subject: avoid looking up package details redundantly in the pkg loop, RT#5083 --- httemplate/view/cust_main/packages/package.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index b07e1af94..c56fa0bdc 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -58,18 +58,18 @@ % my $editi = $curuser->access_right('Edit customer package invoice details'); % my $editc = $curuser->access_right('Edit customer package comments'); +% my @cust_pkg_detail = $cust_pkg->cust_pkg_detail; +% my @invoice_detail = grep { $_->detailtype eq 'I' } @cust_pkg_detail; +% my @comments = grep { $_->detailtype eq 'C' } @cust_pkg_detail; % -% if ( $cust_pkg->cust_pkg_detail('I') -% || $cust_pkg->cust_pkg_detail('C') -% || $editi -% || $editc ) { +% if ( scalar(@invoice_detail) || scalar(@comments) || $editi || $editc ) { % % my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum. % ';detailtype='; -% if ( $cust_pkg->cust_pkg_detail('I') ) { +% if ( @invoice_detail ) { <% include('/elements/table-grid.html') %> @@ -89,7 +89,7 @@ -% foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('I') ) { +% foreach my $cust_pkg_detail ( @invoice_detail ) {  - <% $cust_pkg_detail->detail |h %> @@ -113,7 +113,7 @@ % } -% if ( $cust_pkg->cust_pkg_detail('C') ) { +% if ( @comments ) { <% include('/elements/table-grid.html') %> @@ -133,7 +133,7 @@ -% foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('C') ) { +% foreach my $cust_pkg_detail ( @comments ) {  - <% $cust_pkg_detail->detail |h %> -- cgit v1.2.1 From 77d3d252f8e577de62f0bd5d6d267bc2fd2e5278 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 29 Mar 2009 10:39:57 +0000 Subject: avoid looking up part_pkg redundantly in the pkg loop, RT#5083 --- httemplate/view/cust_main/packages/package.html | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index c56fa0bdc..5edbb4d59 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -38,7 +38,7 @@ % % if ( $curuser->access_right('Customize customer package') ) { % $br=1; - ( <%pkg_customize_link($cust_pkg,$cust_pkg->custnum)%> ) + ( <%pkg_customize_link($cust_pkg,$part_pkg)%> ) % } % <% $br ? '
' : '' %> @@ -198,9 +198,10 @@ sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); } sub pkg_customize_link { my $cust_pkg = shift or return ''; + my $part_pkg = shift; my $custnum = $cust_pkg->custnum; qq!Customize!; } -- cgit v1.2.1 From 75989a32bd20f0ab3d38d2cd2c05795ea9b7590d Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 29 Mar 2009 23:44:12 +0000 Subject: hide over 2 (or configured) cancelled and one-time charge packages, RT#5083 --- httemplate/view/cust_main/packages.html | 33 +++++++++++++++++++++++++++++---- 1 file changed, 29 insertions(+), 4 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 72846b8ec..7643e3efd 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -53,6 +53,13 @@ Current packages cancelled packages ) % } +% if ( $num_old_packages ) { +% $cgi->param('showoldpackages', 1); + ( show old packages ) +% } elsif ( $cgi->param('showoldpackages') ) { +% $cgi->param('showoldpackages', 0); + ( hide old packages ) +% } % if ( @$packages ) { <% include('/elements/table-grid.html') %> @@ -119,7 +126,7 @@ my $conf = new FS::Conf; my $curuser = $FS::CurrentUser::CurrentUser; -my $packages = get_packages($cust_main, $conf); +my( $packages, $num_old_packages ) = get_packages($cust_main, $conf); my $show_location = $conf->exists('cust_pkg-always_show_location') || ( grep $_->locationnum, @$packages ); # ? '1' : '0'; @@ -146,8 +153,7 @@ my %conf_opt = ( sub get_packages { my $cust_main = shift or return undef; my $conf = shift; - - my @packages = (); + my $method; if ( $cgi->param('showcancelledpackages') eq '0' #see if it was set by me || ( $conf->exists('hidecancelledpackages') @@ -159,7 +165,26 @@ sub get_packages { $method = 'all_pkgs'; } - [ $cust_main->$method() ]; + my @packages = $cust_main->$method(); + my $num_old_packages = scalar(@packages); + + unless ( $cgi->param('showoldpackages') ) { + my $years = $conf->config('cust_main-packages-years') || 2; + my $seconds = 31556926; #60*60*24*365.2422 is close enough + my $then = time - $seconds; + + my %hide = ( 'cancelled' => 'cancel', + 'one-time charge' => 'setup', + ); + + @packages = + grep { !exists($hide{$_->status}) or $_->get($hide{$_->status}) > $then } + @packages; + } + + $num_old_packages -= scalar(@packages); + + ( \@packages, $num_old_packages ); } -- cgit v1.2.1 From 3b5ccffae54e59c012eb1ebb348207510ca1d5ce Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 00:32:03 +0000 Subject: part_pkg caching should speedup display of lots of packages, RT#5083 --- httemplate/view/cust_main/packages.html | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 7643e3efd..9b1d5b317 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,6 +76,7 @@ Current packages Services +% my %part_pkg = (); % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { @@ -84,12 +85,18 @@ Current packages % $bgcolor = $bgcolor1; % } % +% $part_pkg{$cust_pkg->pkgpart} ||= $cust_pkg->part_pkg; +% $cust_pkg->{'_pkgpart'} ||= $part_pkg{$cust_pkg->pkgpart}; #XXX cache kludge +% % my %iopt = ( % 'bgcolor' => $bgcolor, % 'cust_pkg' => $cust_pkg, -% 'part_pkg' => $cust_pkg->part_pkg, +% 'part_pkg' => $part_pkg{$cust_pkg->pkgpart}, % %conf_opt, % ); +% +% my $oldDEBUG = $FS::cust_pkg::DEBUG; +% $FS::cust_pkg::DEBUG = 2; @@ -101,6 +108,8 @@ Current packages <% include('packages/services.html', %iopt) %> +% $FS::cust_pkg::DEBUG = $oldDEBUG; + % } -- cgit v1.2.1 From 4a525836ffb9fa8a941c11247637543d931733b8 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 01:05:04 +0000 Subject: forget caching, instead scoop up cust_pkg and part_pkg in one query, RT#5083 --- httemplate/view/cust_main/packages.html | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 9b1d5b317..56bc63fd0 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,7 +76,7 @@ Current packages Services -% my %part_pkg = (); +% local($FS::cust_pkg::DEBUG) = 2; % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { @@ -85,18 +85,15 @@ Current packages % $bgcolor = $bgcolor1; % } % -% $part_pkg{$cust_pkg->pkgpart} ||= $cust_pkg->part_pkg; -% $cust_pkg->{'_pkgpart'} ||= $part_pkg{$cust_pkg->pkgpart}; #XXX cache kludge +% $cust_pkg->{'_pkgpart'} = new FS::part_pkg { $cust_pkg->hash }; #quelle klud % % my %iopt = ( % 'bgcolor' => $bgcolor, % 'cust_pkg' => $cust_pkg, -% 'part_pkg' => $part_pkg{$cust_pkg->pkgpart}, +% 'part_pkg' => $cust_pkg->part_pkg, % %conf_opt, % ); % -% my $oldDEBUG = $FS::cust_pkg::DEBUG; -% $FS::cust_pkg::DEBUG = 2; @@ -108,8 +105,6 @@ Current packages <% include('packages/services.html', %iopt) %> -% $FS::cust_pkg::DEBUG = $oldDEBUG; - % } @@ -174,7 +169,10 @@ sub get_packages { $method = 'all_pkgs'; } - my @packages = $cust_main->$method(); + my @packages = $cust_main->$method( { + 'select' => 'cust_pkg.*, part_pkg.*', + 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )' + } ); my $num_old_packages = scalar(@packages); unless ( $cgi->param('showoldpackages') ) { -- cgit v1.2.1 From a852ab2648b1496a0010276c2e3b516211190671 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 01:09:01 +0000 Subject: forget caching, instead scoop up cust_pkg and part_pkg in one query, RT#5083 --- httemplate/view/cust_main/packages.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 56bc63fd0..07601dd54 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,7 +76,7 @@ Current packages Services -% local($FS::cust_pkg::DEBUG) = 2; +% $FS::cust_pkg::DEBUG = 2; % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { -- cgit v1.2.1 From c9ac50fa78dcf1f9ac3dda747448ee8ef703d69c Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 01:28:40 +0000 Subject: fix setup date display, RT#5083 --- httemplate/view/cust_main/packages.html | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 07601dd54..8ff2269ab 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -85,6 +85,9 @@ Current packages % $bgcolor = $bgcolor1; % } % +% my %hash = $cust_pkg->hash; +% my %part_pkg = map { /^part_pkg_(.+)$/ or die; $1 => $hash{$_}; } +% grep { /^part_pkg_/ } keys %hash; % $cust_pkg->{'_pkgpart'} = new FS::part_pkg { $cust_pkg->hash }; #quelle klud % % my %iopt = ( @@ -169,8 +172,12 @@ sub get_packages { $method = 'all_pkgs'; } + my $part_pkg_fields = join(', ', map { "part_pkg.$_ AS part_pkg_$_" } + fields('part_pkg') + ); + my @packages = $cust_main->$method( { - 'select' => 'cust_pkg.*, part_pkg.*', + 'select' => "cust_pkg.*, $part_pkg_fields", 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )' } ); my $num_old_packages = scalar(@packages); -- cgit v1.2.1 From ff2ad3e74efe8173d362003e1efdce5953388acf Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 01:39:26 +0000 Subject: doh, fix pkg display, RT#5083 --- httemplate/view/cust_main/packages.html | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 8ff2269ab..9b13a8f97 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -86,9 +86,9 @@ Current packages % } % % my %hash = $cust_pkg->hash; -% my %part_pkg = map { /^part_pkg_(.+)$/ or die; $1 => $hash{$_}; } +% my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } % grep { /^part_pkg_/ } keys %hash; -% $cust_pkg->{'_pkgpart'} = new FS::part_pkg { $cust_pkg->hash }; #quelle klud +% $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; % % my %iopt = ( % 'bgcolor' => $bgcolor, @@ -172,12 +172,14 @@ sub get_packages { $method = 'all_pkgs'; } - my $part_pkg_fields = join(', ', map { "part_pkg.$_ AS part_pkg_$_" } - fields('part_pkg') - ); + my $cust_pkg_fields = + join(', ', map { "cust_pkg.$_ AS $_" } fields('cust_pkg') ); + + my $part_pkg_fields = + join(', ', map { "part_pkg.$_ AS part_pkg_$_" } fields('part_pkg') ); my @packages = $cust_main->$method( { - 'select' => "cust_pkg.*, $part_pkg_fields", + 'select' => "$cust_pkg_fields, $part_pkg_fields", 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )' } ); my $num_old_packages = scalar(@packages); -- cgit v1.2.1 From 77df77ea5cc49c10d8768d25d54332dc0833466e Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 03:12:25 +0000 Subject: really prevent separate part_pkg query, RT#5083 --- httemplate/view/cust_main/packages.html | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 9b13a8f97..001e6ec82 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -85,11 +85,6 @@ Current packages % $bgcolor = $bgcolor1; % } % -% my %hash = $cust_pkg->hash; -% my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } -% grep { /^part_pkg_/ } keys %hash; -% $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; -% % my %iopt = ( % 'bgcolor' => $bgcolor, % 'cust_pkg' => $cust_pkg, @@ -184,6 +179,13 @@ sub get_packages { } ); my $num_old_packages = scalar(@packages); + foreach my $cust_pkg ( @packages ) { + my %hash = $cust_pkg->hash; + my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } + grep { /^part_pkg_/ } keys %hash; + $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; + } + unless ( $cgi->param('showoldpackages') ) { my $years = $conf->config('cust_main-packages-years') || 2; my $seconds = 31556926; #60*60*24*365.2422 is close enough -- cgit v1.2.1 From 613f320ae076de8612ff80fc99c516b544ff3897 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 04:15:56 +0000 Subject: try not to search for nothing in cust_svc so much, RT#5083 --- httemplate/view/cust_main/packages.html | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 001e6ec82..d98de8e63 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -173,9 +173,17 @@ sub get_packages { my $part_pkg_fields = join(', ', map { "part_pkg.$_ AS part_pkg_$_" } fields('part_pkg') ); + my $group_by = + join(', ', map "cust_pkg.$_", fields('cust_pkg') ). ', '. + join(', ', map "part_pkg.$_", fields('part_pkg') ); + + my $num_cust_svc = + '( SELECT COUNT(*) FROM cust_svc WHERE cust_pkg.pkgnum = cust_svc.svcnum )'; + my @packages = $cust_main->$method( { - 'select' => "$cust_pkg_fields, $part_pkg_fields", - 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )' + 'select' => " $cust_pkg_fields, $part_pkg_fields, ". + " $num_cust_svc AS num_cust_svc ", + 'addl_from' => ' LEFT JOIN part_pkg USING ( pkgpart ) ', } ); my $num_old_packages = scalar(@packages); -- cgit v1.2.1 From 5ef6e82fad107523eae428d3fea51e2302c99cb6 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 04:31:47 +0000 Subject: try not to search for nothing in cust_svc so much, RT#5083 --- httemplate/view/cust_main/packages.html | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index d98de8e63..20d42a48e 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -192,6 +192,7 @@ sub get_packages { my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } grep { /^part_pkg_/ } keys %hash; $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; + $cust_pkg->{'_num_cust_svc'} = $cust_pkg->get('_num_cust_svc'); } unless ( $cgi->param('showoldpackages') ) { -- cgit v1.2.1 From dbd43e72a0cc7510f344b133c8f0b6ac8dd07c51 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 04:35:39 +0000 Subject: doh! underscore, RT#5083 --- httemplate/view/cust_main/packages.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 20d42a48e..aa1d7e721 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -192,7 +192,7 @@ sub get_packages { my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } grep { /^part_pkg_/ } keys %hash; $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; - $cust_pkg->{'_num_cust_svc'} = $cust_pkg->get('_num_cust_svc'); + $cust_pkg->{'_num_cust_svc'} = $cust_pkg->get('num_cust_svc'); } unless ( $cgi->param('showoldpackages') ) { -- cgit v1.2.1 From 631063078b0e9ac6d53616f42c32eec30a76d24b Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 04:41:33 +0000 Subject: double doh! RT#5083 --- httemplate/view/cust_main/packages.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index aa1d7e721..53ed6bf2b 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -178,7 +178,7 @@ sub get_packages { join(', ', map "part_pkg.$_", fields('part_pkg') ); my $num_cust_svc = - '( SELECT COUNT(*) FROM cust_svc WHERE cust_pkg.pkgnum = cust_svc.svcnum )'; + '( SELECT COUNT(*) FROM cust_svc WHERE cust_pkg.pkgnum = cust_svc.pkgnum )'; my @packages = $cust_main->$method( { 'select' => " $cust_pkg_fields, $part_pkg_fields, ". -- cgit v1.2.1 From cec41a47c4cbb9eda007713e376970addc9ac626 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 30 Mar 2009 06:10:18 +0000 Subject: okay. counts are needed for the package sort, so push the embedded counting into cust_main.pm. sure hope this does it. RT#5083 --- httemplate/view/cust_main/packages.html | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 53ed6bf2b..d55560f34 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -177,13 +177,9 @@ sub get_packages { join(', ', map "cust_pkg.$_", fields('cust_pkg') ). ', '. join(', ', map "part_pkg.$_", fields('part_pkg') ); - my $num_cust_svc = - '( SELECT COUNT(*) FROM cust_svc WHERE cust_pkg.pkgnum = cust_svc.pkgnum )'; - my @packages = $cust_main->$method( { - 'select' => " $cust_pkg_fields, $part_pkg_fields, ". - " $num_cust_svc AS num_cust_svc ", - 'addl_from' => ' LEFT JOIN part_pkg USING ( pkgpart ) ', + 'select' => "$cust_pkg_fields, $part_pkg_fields", + 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )', } ); my $num_old_packages = scalar(@packages); @@ -192,7 +188,6 @@ sub get_packages { my %part_pkg = map { /^part_pkg_(.+)$/ or die; ( $1 => $hash{$_} ); } grep { /^part_pkg_/ } keys %hash; $cust_pkg->{'_pkgpart'} = new FS::part_pkg \%part_pkg; - $cust_pkg->{'_num_cust_svc'} = $cust_pkg->get('num_cust_svc'); } unless ( $cgi->param('showoldpackages') ) { -- cgit v1.2.1 From a5bf104f1fb29ea6e3fa6993dd60069e3d2cfca7 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 14 Apr 2009 20:27:50 +0000 Subject: don't hide old packages that have services, RT#5179 --- httemplate/view/cust_main/packages.html | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index d55560f34..0da82500a 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -177,8 +177,11 @@ sub get_packages { join(', ', map "cust_pkg.$_", fields('cust_pkg') ). ', '. join(', ', map "part_pkg.$_", fields('part_pkg') ); + my $num_svcs = '( SELECT COUNT(*) FROM cust_svc '. + ' WHERE cust_svc.pkgnum = cust_pkg.pkgnum ) AS num_svcs'; + my @packages = $cust_main->$method( { - 'select' => "$cust_pkg_fields, $part_pkg_fields", + 'select' => "$cust_pkg_fields, $part_pkg_fields, $num_svcs", 'addl_from' => 'LEFT JOIN part_pkg USING ( pkgpart )', } ); my $num_old_packages = scalar(@packages); @@ -200,7 +203,9 @@ sub get_packages { ); @packages = - grep { !exists($hide{$_->status}) or $_->get($hide{$_->status}) > $then } + grep { !exists($hide{$_->status}) or $_->get($hide{$_->status}) > $then + or $_->num_svcs #don't hide packages w/services + } @packages; } -- cgit v1.2.1 From 554a8168de9871b6085fe36ce5d86f3681421c64 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 14 Apr 2009 21:01:40 +0000 Subject: remove debugging --- httemplate/view/cust_main/packages.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 0da82500a..ed98ba903 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -76,7 +76,7 @@ Current packages Services -% $FS::cust_pkg::DEBUG = 2; +% #$FS::cust_pkg::DEBUG = 2; % foreach my $cust_pkg (@$packages) { % % if ( $bgcolor eq $bgcolor1 ) { -- cgit v1.2.1 From ba176b6005c1c09cfd00c57befe72ba9561b77f8 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 15 Apr 2009 05:52:09 +0000 Subject: s/GECOS/Real Name/ RT#3519 --- httemplate/view/svc_acct.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index e87a8ee9a..6a47ec767 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -214,7 +214,7 @@ Service #<% $svcnum %> % if ($svc_acct->finger ne '') { - GECOS + Real Name <% $svc_acct->finger %> % } -- cgit v1.2.1 From 9f5e5a6ef0aa20bafb200c0bfa9678bbccda127b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 15 Apr 2009 07:14:11 +0000 Subject: should fix view of unlinked phone numbers, RT#5171 --- httemplate/view/elements/svc_Common.html | 55 ++++++++++++++++++-------------- httemplate/view/svc_Common.html | 12 +++---- 2 files changed, 37 insertions(+), 30 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index a0b4e37b2..125fcd0b8 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -1,30 +1,40 @@ -% # options example... -% # -% # 'table' => 'svc_something' -% # -% # 'labels' => { -% # 'column' => 'Label', -% # }, -% # -% # listref - each item is a literal column name (or method) or (notyet) coderef -% # if not specified all columns (except for the primary key) will be viewable -% # 'fields' => [ -% # ] -% # -% # # defaults to "edit/$table.cgi?", will have svcnum appended -% # 'edit_url' => -% -% -% if ( $custnum ) { +<%doc> + +#Example: + + include( 'elements/svc_Common.html, + 'table' => 'svc_something' + + 'labels' => { + 'column' => 'Label', + }, + + #listref - each item is a literal column name (or method) or + # (notyet) coderef. if not specified all columns (except for the + #primary key) will be viewable + 'fields' => [ + ] + + # defaults to "edit/$table.cgi?", will have svcnum appended + 'edit_url' => + ) + + +% if ( $custnum ) { <% include("/elements/header.html","View $label: $value") %> <% include( '/elements/small_custview.html', $custnum, '', 1, "${p}view/cust_main.cgi") %>
+ % } else { + <% include("/elements/header.html","View $label: $value", menubar( + "Cancel this (unaudited) $label" => + "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" + )) %> - <% include("/elements/header.html","View $label: $value", menubar( - "Cancel this (unaudited) $label" => - "javascript:areyousure(\'${p}misc/cancel-unaudited.cgi?$svcnum\')" - )) %> % } - Service #<% $svcnum %> % my $url = $opt{'edit_url'} || $p. 'edit/'. $opt{'table'}. '.cgi?'; | Edit this <% $label %> @@ -130,7 +135,9 @@ my $svc_x = qsearchs({ ' LEFT JOIN cust_pkg USING ( pkgnum ) '. ' LEFT JOIN cust_main USING ( custnum ) ', 'hashref' => { 'svcnum' => $svcnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'View/link unlinked services' + ), }) or die "Unknown svcnum $svcnum in ". $opt{'table'}. " table\n"; my $cust_svc = $svc_x->cust_svc; diff --git a/httemplate/view/svc_Common.html b/httemplate/view/svc_Common.html index bb3a6dd33..defbee974 100644 --- a/httemplate/view/svc_Common.html +++ b/httemplate/view/svc_Common.html @@ -1,3 +1,9 @@ +<% include('elements/svc_Common.html', + 'table' => $table, + 'edit_url' => $p."edit/svc_Common.html?svcdb=$table;svcnum=", + %opt, + ) +%> <%init> # false laziness w/edit/svc_Common.html @@ -21,9 +27,3 @@ if ( UNIVERSAL::can("FS::$table", 'table_info') ) { } -<% include('elements/svc_Common.html', - 'table' => $table, - 'edit_url' => $p."edit/svc_Common.html?svcdb=$table;svcnum=", - %opt, - ) -%> -- cgit v1.2.1 From 39120f69d4372781aba0df58d06736be450009e1 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 9 May 2009 01:44:08 +0000 Subject: use service-def specific labels, at least for service pages that use {view,edit}/elements/svc_Common.html RT#4081 --- httemplate/view/elements/svc_Common.html | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/elements/svc_Common.html b/httemplate/view/elements/svc_Common.html index 125fcd0b8..852640e0c 100644 --- a/httemplate/view/elements/svc_Common.html +++ b/httemplate/view/elements/svc_Common.html @@ -145,6 +145,14 @@ my($label, $value, $svcdb) = $cust_svc->label; my $part_svc = $cust_svc->part_svc; + #false laziness w/edit/svc_Common.html + #override default labels with service-definition labels if applicable + my $labels = $opt{labels}; #not -> here + foreach my $field ( keys %$labels ) { + my $col = $part_svc->part_svc_column($field); + $labels->{$field} = $col->columnlabel if $col->columnlabel !~ /^\S*$/; + } + my $pkgnum = $cust_svc->pkgnum; my($cust_pkg, $custnum); -- cgit v1.2.1 From 7923b92cdd671e1b13c951af33c11b0ac25dd894 Mon Sep 17 00:00:00 2001 From: jeff Date: Thu, 14 May 2009 16:25:21 +0000 Subject: show geocode when taxproducts enabled --- httemplate/view/cust_main/billing.html | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index aea90e8b3..4b2425b33 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -164,6 +164,12 @@ Billing information Tax exempt <% $cust_main->tax ? 'yes' : 'no' %> +% if ( $conf->exists('enable_taxproducts') ) { + + Tax location + <% $cust_main->geocode('cch') %> + +% } Postal invoices -- cgit v1.2.1 From 98901e4ef499dfb983bbd0d467eca3a0534bc3e9 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 20 May 2009 15:27:17 +0000 Subject: add "manage device" link & config, RT#5438 --- httemplate/view/cust_main/packages.html | 1 + httemplate/view/cust_main/packages/services.html | 23 +++++++++++++++++------ 2 files changed, 18 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index ed98ba903..0c0526d42 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -148,6 +148,7 @@ my %conf_opt = ( #for services.html 'svc_external-skip_manual' => $conf->exists('svc_external-skip_manual'), 'legacy_link' => $conf->exists('legacy_link'), + 'svc_broadband-manage_link' => $conf->config('svc_broadband-manage_link'), ); #subroutines diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 1e473736b..37cd615eb 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -36,15 +36,24 @@ % ) % ) { ( <%svc_recharge_link($cust_svc)%> ) -% } +% } - + -% if ( $curuser->access_right('Unprovision customer service') ) { - ( <%svc_unprovision_link($cust_svc)%> ) -% } - +% my $manage_link = $opt{'svc_broadband-manage_link'}; +% if ( $manage_link && $part_svc->svcdb eq 'svc_broadband' ) { +% my $ip_addr = $cust_svc->svc_x->ip_addr; +% my $svc_manage_link = eval(qq("$manage_link")); + Manage Device ) + +% } + + +% if ( $curuser->access_right('Unprovision customer service') ) { + ( <%svc_unprovision_link($cust_svc)%> ) +% } + % } @@ -75,6 +84,8 @@ my $cust_pkg = $opt{'cust_pkg'}; my $part_pkg = $opt{'part_pkg'}; my $curuser = $FS::CurrentUser::CurrentUser; +my $conf = new FS::Conf; + sub svc_provision_link { my ($cust_pkg, $part_svc, $opt, $curuser) = @_; ( my $svc_nbsp = $part_svc->svc ) =~ s/\s+/ /g; -- cgit v1.2.1 From 0cbb171da2cf3c7059612c0f2fbcf4a8bb80ab58 Mon Sep 17 00:00:00 2001 From: rsiddall Date: Mon, 15 Jun 2009 19:41:29 +0000 Subject: Add domain registration operations to the View Domain screen, if the domain has an associated export supporting registration. Shows the domain status and allows registration, transfer, revocation, or renewal. Revocation almost never works since the registries impose very short windows after initial registration. Also updated the OpenSRS registration export to support the additional operations. --- httemplate/view/svc_domain.cgi | 62 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 62 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 36577d39c..1e93b9461 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -7,9 +7,38 @@ ) )) %> +<% include('/elements/error.html') %> + Service #<% $svcnum %>
Service: <% $part_svc->svc %>
Domain name: <% $domain %> +% if ($export) { +
Status: <% $status %> +% if ( $FS::CurrentUser::CurrentUser->access_right('Change customer service') ) { +% if ( defined($ops{'register'}) ) { + Register at <% $registrar->{'name'} %>  +% } +% if ( defined($ops{'transfer'}) ) { + Transfer to <% $registrar->{'name'} %>  +% } +% if ( defined($ops{'renew'}) ) { +
+ + + +   +
+% } +% if ( defined($ops{'revoke'}) ) { + Revoke +% } +% } +% } + % if ( $FS::CurrentUser::CurrentUser->access_right('Edit domain catchall') ) {
Catch all email (change): % } else { @@ -158,4 +187,37 @@ if ($svc_domain->catchall) { my $domain = $svc_domain->domain; +my $status = 'Unknown'; +my %ops = (); + +my @exports = $part_svc->part_export(); + +my $registrar; +my $export; + +# Find the first export that does domain registration +foreach (@exports) { + $export = $_ if $_->can('registrar'); +} +# If we have a domain registration export, get the registrar object +if ($export) { + $registrar = $export->registrar; + my $domstat = $export->get_status( $svc_domain ); + if (defined($domstat->{'message'})) { + $status = $domstat->{'message'}; + } elsif (defined($domstat->{'unregistered'})) { + $status = 'Not registered'; + $ops{'register'} = "Register"; + } elsif (defined($domstat->{'status'})) { + $status = $domstat->{'status'} . ' ' . $domstat->{'contact_email'} . ' ' . $domstat->{'last_update_time'}; + } elsif (defined($domstat->{'expdate'})) { + $status = "Expires " . $domstat->{'expdate'}; + $ops{'renew'} = "Renew"; + $ops{'revoke'} = "Revoke"; + } else { + $status = $domstat->{'reason'}; + $ops{'transfer'} = "Transfer"; + } +} + -- cgit v1.2.1 From c7d6edd92281d39e6eb59656a5b79faf8454973d Mon Sep 17 00:00:00 2001 From: rsiddall Date: Mon, 15 Jun 2009 21:41:33 +0000 Subject: Add a new access right for managing domain registration (registering, transferring, revoking, renewing, etc.). --- httemplate/view/svc_domain.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index 1e93b9461..b9a8de752 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -14,7 +14,7 @@ Service #<% $svcnum %>
Domain name: <% $domain %> % if ($export) {
Status: <% $status %> -% if ( $FS::CurrentUser::CurrentUser->access_right('Change customer service') ) { +% if ( $FS::CurrentUser::CurrentUser->access_right('Manage domain registration') ) { % if ( defined($ops{'register'}) ) { Register at <% $registrar->{'name'} %>  % } -- cgit v1.2.1 From 8588f3c0bfbcbeb58dd25a57b5ea375cec00279a Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 16 Jun 2009 03:29:26 +0000 Subject: basic customer view tabs, RT#5586 --- httemplate/view/cust_main.cgi | 104 +++++++++++++++++++++---- httemplate/view/cust_main/packages.html | 2 - httemplate/view/cust_main/payment_history.html | 2 - httemplate/view/cust_main/tickets.html | 3 - 4 files changed, 88 insertions(+), 23 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 2231d4148..00856a021 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -1,8 +1,19 @@ -<% include("/elements/header.html","Customer View: ". $cust_main->name ) %> +<% include('/elements/header.html', { + 'title' => "Customer View: ". $cust_main->name, + 'nobr' => 1, + }) +%> +
-% if ( $curuser->access_right('Edit customer') ) { - Edit this customer | -% } +<% include('/elements/menubar.html', + { 'newstyle' => 1, + 'selected' => $viewname{$view}, + 'url_base' => $cgi->url. "?custnum=$custnum;show=", + }, + %views, + ) +%> +
<% include('/elements/init_overlib.html') %> @@ -13,6 +24,12 @@ function areyousure(href, message) { } +% if ( $view eq 'basics' || $view eq 'jumbo' ) { + +% if ( $curuser->access_right('Edit customer') ) { + Edit this customer | +% } + % if ( $curuser->access_right('Cancel customer') % && $cust_main->ncancelled_pkgs % ) { @@ -74,10 +91,12 @@ function areyousure(href, message) { -% -%if ( $cust_main->comments =~ /[^\s\n\r]/ ) { -% +% } + +% if ( $view eq 'notes' || $view eq 'jumbo' ) { + +%if ( $cust_main->comments =~ /[^\s\n\r]/ ) {
Comments <% ntable("#cccccc") %><% ntable("#cccccc",2) %> @@ -87,12 +106,16 @@ Comments -% }

+% } + % my $notecount = scalar($cust_main->notes()); % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { -Notes
+% unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { + Notes
+% } + % if ( $curuser->access_right('Add customer note') && % ! $conf->exists('cust_main-disable_notes') % ) { @@ -115,24 +138,47 @@ Comments % } +% } -% if ( $conf->config('ticket_system') ) { +% if ( $view eq 'jumbo' ) { +

+ Tickets
+% } -

+% if ( $view eq 'tickets' || $view eq 'jumbo' ) { + +% if ( $conf->config('ticket_system') ) { <% include('cust_main/tickets.html', $cust_main ) %> % } +

+% } -

+% if ( $view eq 'jumbo' ) { #XXX enable me && $curuser->access_right('View customer packages') { + + Packages
+% } + +% if ( $view eq 'packages' || $view eq 'jumbo' ) { % #XXX enable me# if ( $curuser->access_right('View customer packages') { <% include('cust_main/packages.html', $cust_main ) %> % #} +% } + +% if ( $view eq 'jumbo' ) { +

+ Payment History
+% } + +% if ( $view eq 'payment_history' || $view eq 'jumbo' ) { + % if ( $conf->config('payby-default') ne 'HIDE' ) { <% include('cust_main/payment_history.html', $cust_main ) %> % } +% } <% include('/elements/footer.html') %> <%init> @@ -144,10 +190,16 @@ die "access denied" my $conf = new FS::Conf; -die "No customer specified (bad URL)!" unless $cgi->keywords; -my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array -$query =~ /^(\d+)$/; -my $custnum = $1; +my $custnum; +if ( $cgi->param('custnum') =~ /^(\d+)$/ ) { + $custnum = $1; +} else { + die "No customer specified (bad URL)!" unless $cgi->keywords; + my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array + $query =~ /^(\d+)$/; + $custnum = $1; +} + my $cust_main = qsearchs( { 'table' => 'cust_main', 'hashref' => { 'custnum' => $custnum }, @@ -155,4 +207,24 @@ my $cust_main = qsearchs( { }); die "Customer not found!" unless $cust_main; +#false laziness w/pref/pref.html +tie my %views, 'Tie::IxHash', + 'Basics' => 'basics', + 'Notes' => 'notes', #notes and files? +; +$views{'Tickets'} = 'tickets' + if $conf->config('ticket_system'); +$views{'Packages'} = 'packages'; +$views{'Payment History'} = 'payment_history' + unless $conf->config('payby-default' eq 'HIDE'); +#$views{'Change History'} = ''; +$views{'Jumbo'} = 'jumbo'; + +my %viewname = reverse %views; + + +my $view = $cgi->param('show') + || $curuser->option('default_customer_view') + || 'jumbo'; #'Basics' in 1.9.1? + diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 0c0526d42..428794b7d 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -1,5 +1,3 @@ -Packages
- % my $s = 0; % if ( $curuser->access_right('Order customer package') ) { <% $s++ ? ' | ' : '' %> diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 335ce2485..f2abe0eac 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -1,5 +1,3 @@ -

Payment History
- %# payment links % my $s = 0; diff --git a/httemplate/view/cust_main/tickets.html b/httemplate/view/cust_main/tickets.html index b5d581d50..167849c76 100644 --- a/httemplate/view/cust_main/tickets.html +++ b/httemplate/view/cust_main/tickets.html @@ -1,6 +1,3 @@ -Tickets -
- (View <% $openlabel %> tickets for this customer) (View resolved tickets for this customer)
-- cgit v1.2.1 From 3a02c437eadd9a39f7e56056ca987a4846650209 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 17 Jun 2009 02:39:09 +0000 Subject: finish up initial work on customer view tabs (ensure links back to customer view call include show=packages if default view isn't jumbo or packages already), RT#5586 --- httemplate/view/cust_main.cgi | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 00856a021..88fd03713 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -207,7 +207,7 @@ my $cust_main = qsearchs( { }); die "Customer not found!" unless $cust_main; -#false laziness w/pref/pref.html +#false laziness w/pref/pref.html and Conf.pm (cust_main-default_view) tie my %views, 'Tie::IxHash', 'Basics' => 'basics', 'Notes' => 'notes', #notes and files? @@ -222,9 +222,6 @@ $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; - -my $view = $cgi->param('show') - || $curuser->option('default_customer_view') - || 'jumbo'; #'Basics' in 1.9.1? +my $view = $cgi->param('show') || $curuser->default_customer_view; -- cgit v1.2.1 From 04a69f9d197efee6fa396bd35d04ae553e669978 Mon Sep 17 00:00:00 2001 From: jeff Date: Sun, 21 Jun 2009 15:21:32 +0000 Subject: CUSTOM packages/actual flag for custom packages #3988 --- httemplate/view/cust_main/packages/package.html | 2 +- httemplate/view/cust_main/packages/status.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 5edbb4d59..280a01682 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -6,7 +6,7 @@ ID ="cust_pkg<% $cust_pkg->pkgnum %>" ><% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg |h %> - - <% $part_pkg->comment |h %> + <% $part_pkg->custom_comment |h %> diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index af407b0df..141ed156d 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -244,7 +244,7 @@ sub pkg_status_row_changed { if ( $old ) { my $part_pkg = $old->part_pkg; my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '. - $part_pkg->pkg. ' - '. $part_pkg->comment; + $part_pkg->pkg_comment(nopartpkg => 1); $html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' ); } $html; -- cgit v1.2.1 From 73e382b838f031512684138fedb7d813684ddd28 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 22 Jun 2009 07:50:18 +0000 Subject: tax exemption by tax name, RT#5127 --- httemplate/view/cust_main/billing.html | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 4b2425b33..e02c04868 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -159,11 +159,18 @@ Billing information % } - +% my @exempt_groups = grep /\S/, $conf->config('tax-cust_exempt-groups'); - Tax exempt + Tax exempt<% @exempt_groups ? ' (all taxes)' : '' %> <% $cust_main->tax ? 'yes' : 'no' %> +% foreach my $exempt_group ( @exempt_groups ) { + + Tax exempt (<% $exempt_group %> taxes) + <% $cust_main->tax_exemption($exempt_group) ? 'yes' : 'no' %> + +% } + % if ( $conf->exists('enable_taxproducts') ) { Tax location -- cgit v1.2.1 From cc6072eff54dd197dacb089c248a8543b330cd1d Mon Sep 17 00:00:00 2001 From: rsiddall Date: Tue, 23 Jun 2009 20:33:10 +0000 Subject: Remove ability to renew domain registration for more than one year as we can't automatically bill for multi-year renewals at this time. --- httemplate/view/svc_domain.cgi | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_domain.cgi b/httemplate/view/svc_domain.cgi index b9a8de752..fc099d85c 100755 --- a/httemplate/view/svc_domain.cgi +++ b/httemplate/view/svc_domain.cgi @@ -22,16 +22,7 @@ Service #<% $svcnum %> Transfer to <% $registrar->{'name'} %>  % } % if ( defined($ops{'renew'}) ) { -
- - - -   -
+ Renew at <% $registrar->{'name'} %>  % } % if ( defined($ops{'revoke'}) ) { Revoke -- cgit v1.2.1 From 8449080168affaabc1102234502bcd4fa491d615 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Jun 2009 01:22:54 +0000 Subject: fix extra whitespace in IE --- httemplate/view/cust_main/one_time_charge_link.html | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/one_time_charge_link.html b/httemplate/view/cust_main/one_time_charge_link.html index 6ed70ee4c..f6bb43490 100644 --- a/httemplate/view/cust_main/one_time_charge_link.html +++ b/httemplate/view/cust_main/one_time_charge_link.html @@ -57,13 +57,7 @@ function taxoverridequickchargemagic() { - -
- - - - -
+
<% include('/elements/popup_link.html', { 'action' => $p.'edit/quick-charge.html?custnum='. $cust_main->custnum, -- cgit v1.2.1 From fa19c2c557f7abd72f94357373290b99dd3297bf Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 25 Jun 2009 01:28:53 +0000 Subject: tax adjustments, RT#5595 --- httemplate/view/cust_main/payment_history.html | 29 +++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index f2abe0eac..1711e1449 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -127,10 +127,33 @@ %# tax exemption link -% if ( $curuser->access_right('View customer tax exemptions') ) { - View tax exemptions +% my $view_exemptions = $curuser->access_right('View customer tax exemptions'); +% my $add_adjustment = ( $conf->exists('enable_tax_adjustments') +% && $curuser->access_right('Add customer tax adjustment') +% ); +% if ( $view_exemptions || $add_adjustment ) { + +% if ( $view_exemptions ) { + View tax exemptions + <% $add_adjustment ? '|' : '' %> +% } + +% if ( $add_adjustment ) { + <% include('/elements/popup_link.html', { + 'action' => $p.'edit/cust_tax_adjustment.html?custnum='. $cust_main->custnum, + 'label' => 'Add tax adjustment', + 'actionlabel' => 'Add tax adjustment', + #'color' => '#333399', + #'width' => 763, + 'height' => 200, + }) + %> + | + View tax adjustments +% } +
-% } +% } %# batched payment links -- cgit v1.2.1 From 665067cef48a5516e0bfb2dd79d99b8495e25ee5 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Jun 2009 01:42:56 +0000 Subject: phone devices (for netsapiens integration), RT#5226 --- httemplate/view/svc_phone.cgi | 73 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 73 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index f604daa47..3d4045b99 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -22,6 +22,74 @@ my $html_foot = sub { my $svc_phone = shift; + ### + # Devices + ### + + my $devices = ''; + + my $sth = dbh->prepare("SELECT COUNT(*) FROM part_device") #WHERE disabled = '' OR disabled IS NULL;"); + or die dbh->errstr; + $sth->execute or die $sth->errstr; + my $num_part_device = $sth->fetchrow_arrayref->[0]; + + my @phone_device = $svc_phone->phone_device; + if ( @phone_device || $num_part_device ) { + my $svcnum = $svc_phone->svcnum; + $devices .= + qq[Devices (Add device)
]; + if ( @phone_device ) { + + $devices .= qq! + + !; + + + $devices .= + include('/elements/table-grid.html'). + ''. + 'Type'. + 'MAC Addr'. + ''. + ''; + my $bgcolor1 = '#eeeeee'; + my $bgcolor2 = '#ffffff'; + my $bgcolor = ''; + + foreach my $phone_device ( @phone_device ) { + + if ( $bgcolor eq $bgcolor1 ) { + $bgcolor = $bgcolor2; + } else { + $bgcolor = $bgcolor1; + } + my $td = qq(); + + my $devicenum = $phone_device->devicenum; + + $devices .= ''. + $td. $phone_device->part_device->devicename. ''. + $td. $phone_device->mac_addr. ''. + "$td( ". + qq(edit | ). + qq(delete). + ' )'. + ''; + } + $devices .= '
'; + } + $devices .= '
'; + } + + ## + # CDR links + ## + tie my %what, 'Tie::IxHash', 'pending' => 'NULL', 'billed' => 'done', @@ -46,6 +114,11 @@ my $html_foot = sub { my @ilinks = ( qq(). 'View incoming CDRs' ); + ### + # concatenate & return + ### + + $devices. join(' | ', @links ). '
'. join(' | ', @ilinks). '
'; -- cgit v1.2.1 From 0376f47e1ec2ec9b8702a0e6c5146af9c66beb5e Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 30 Jun 2009 12:28:38 +0000 Subject: one-time charge "hold for later" / any package future start date, RT#5347 --- httemplate/view/cust_main/packages/status.html | 43 +++++++++++++++++--------- 1 file changed, 29 insertions(+), 14 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 141ed156d..6daff5031 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -10,18 +10,18 @@ <% pkg_status_row_colspan( ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', - 'align' => 'right', 'color' => 'ff0000', 'size' => '-2', + 'align'=>'right', 'color'=>'ff0000', 'size'=>'-2', 'colspan'=>$colspan, ) %> % unless ( $cust_pkg->get('setup') ) { - <% pkg_status_row_colspan('Never billed') %> + <% pkg_status_row_colspan('Never billed', '', 'colspan'=>$colspan, ) %> % } else { <% pkg_status_row( $cust_pkg, 'Setup', 'setup', %opt ) %> - <% pkg_status_row_changed( $cust_pkg, %opt ) %> + <% pkg_status_row_changed( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %> <% pkg_status_row_if( $cust_pkg, 'Suspended', 'susp', %opt, curuser=>$curuser ) %> @@ -36,17 +36,17 @@ <% pkg_status_row_colspan( ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', - 'align' => 'right', 'color' => 'FF9900', 'size' => '-2', + 'align'=>'right', 'color'=>'FF9900', 'size'=>'-2', 'colspan'=>$colspan, ) %> % unless ( $cust_pkg->get('setup') ) { - <% pkg_status_row_colspan('Never billed') %> + <% pkg_status_row_colspan('Never billed', '', 'colspan'=>$colspan ) %> % } else { <% pkg_status_row($cust_pkg, 'Setup', 'setup', %opt ) %> % } - <% pkg_status_row_changed( $cust_pkg, %opt ) %> + <% pkg_status_row_changed( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %> % # pkg_status_row($cust_pkg, 'Next bill', 'bill', %opt) <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', %opt, curuser=>$curuser ) %> @@ -70,7 +70,9 @@ % % unless ( $part_pkg->freq ) { - <% pkg_status_row_colspan('Not yet billed (one-time charge)') %> + <% pkg_status_row_colspan('Not yet billed (one-time charge)', '', 'colspan'=>$colspan, ) %> + + <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> > @@ -84,7 +86,9 @@ % } else { - <% pkg_status_row_colspan("Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')' ) %> + <% pkg_status_row_colspan("Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan ) %> + + <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> % } % @@ -92,7 +96,7 @@ % % unless ( $part_pkg->freq ) { - <% pkg_status_row_colspan('One-time charge') %> + <% pkg_status_row_colspan('One-time charge', '', 'colspan'=>$colspan, ) %> <% pkg_status_row($cust_pkg, 'Billed', 'setup', %opt) %> @@ -103,7 +107,7 @@ <% pkg_status_row_colspan( 'Overlimit', $billed_or_prepaid. ' '. myfreq($part_pkg), - 'color' => 'FFD000', + 'color'=>'FFD000', 'colspan'=>$colspan, ) %> @@ -111,7 +115,7 @@ <% pkg_status_row_colspan( 'Active', $billed_or_prepaid. ' '. myfreq($part_pkg), - 'color' => '00CC00', + 'color'=>'00CC00', 'colspan'=>$colspan, ) %> % } @@ -127,7 +131,7 @@ % $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend; % } - <% pkg_status_row_changed( $cust_pkg, %opt ) %> + <% pkg_status_row_changed( $cust_pkg, %opt, 'colspan'=>$colspan ) %> <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %> <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', %opt, curuser=>$curuser ) %> <% pkg_status_row_if($cust_pkg, 'Will automatically suspend by', 'autosuspend', %opt) %> @@ -238,21 +242,32 @@ sub pkg_status_row_if { sub pkg_status_row_changed { my( $cust_pkg, %opt ) = @_; + return '' unless $cust_pkg->change_date; - my $html = pkg_status_row( $cust_pkg, 'Package changed', 'change_date', %opt ); + + my $html = + pkg_status_row( $cust_pkg, 'Package changed', 'change_date', %opt ); + my $old = $cust_pkg->old_cust_pkg; if ( $old ) { my $part_pkg = $old->part_pkg; my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '. $part_pkg->pkg_comment(nopartpkg => 1); - $html .= pkg_status_row_colspan( $label, '', size=>'-1', align=>'right' ); + $html .= pkg_status_row_colspan( $label, '', + 'size' => '-1', + 'align' => 'right', + 'colspan' => $opt{'colspan'}, + ); } + $html; } sub pkg_status_row_colspan { my($title, $addl, %opt) = @_; + my $colspan = $opt{'colspan'}; + my $align = $opt{'align'} ? 'ALIGN="'. $opt{'align'}.'"' : ''; my $color = $opt{'color'} ? 'COLOR="#'.$opt{'color'}.'"' : ''; my $size = $opt{'size'} ? 'SIZE="'. $opt{'size'}. '"' : ''; -- cgit v1.2.1 From a67fd3bbfeec137ebf494e36eaa920145b8509a1 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 1 Jul 2009 10:28:49 +0000 Subject: start of settlement CDR processing, RT#5495 --- httemplate/view/cust_main/billing.html | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index e02c04868..049461dbd 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -216,6 +216,13 @@ Billing information % } +% if ( $show_term || $cust_main->cdr_termination_percentage ) { + + CDR termination settlement + <% $cust_main->cdr_termination_percentage %><% $cust_main->cdr_termination_percentage =~ /\d/ ? '%' : '' %> + +% } + <%once> @@ -230,4 +237,10 @@ my @invoicing_list = $cust_main->invoicing_list; my $conf = new FS::Conf; my $money_char = $conf->config('money_char') || '$'; +#false laziness w/edit/cust_main/billing.html +my $term_sql = "SELECT COUNT(*) FROM cust_pkg LEFT JOIN part_pkg USING ( pkgpart ) WHERE custnum = ? AND plan = 'cdr_termination' LIMIT 1"; +my $term_sth = dbh->prepare($term_sql) or die dbh->errstr; +$term_sth->execute($cust_main->custnum) or die $term_sth->errstr; +my $show_term = $term_sth->fetchrow_arrayref->[0]; + -- cgit v1.2.1 From d906eeadf9576cbdb0e337a774ab17327009ad45 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 6 Jul 2009 00:28:50 +0000 Subject: fix incoming CDR links wrt cdrbatch field --- httemplate/view/svc_phone.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_phone.cgi b/httemplate/view/svc_phone.cgi index 3d4045b99..09d5be483 100644 --- a/httemplate/view/svc_phone.cgi +++ b/httemplate/view/svc_phone.cgi @@ -111,7 +111,7 @@ my $html_foot = sub { "View $_ CDRs"; } keys(%what); - my @ilinks = ( qq(). + my @ilinks = ( qq(). 'View incoming CDRs' ); ### -- cgit v1.2.1 From 7e4c4494f0ca232a482fe94f78083fc250e2bd4b Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 7 Jul 2009 09:53:15 +0000 Subject: allow null svc_broadband.ip_addr --- httemplate/view/svc_broadband.cgi | 52 +++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 145d34188..0e9656b15 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -22,10 +22,14 @@ Description <%$description%> - - Router - <%$routernum%>: <%$routername%> - + +% if ( $router ) { + + Router + <%$router->routernum%>: <%$router->routername%> + +% } + Download Speed <%$speed_down%> @@ -34,18 +38,22 @@ Upload Speed <%$speed_up%> - - IP Address - <%$ip_addr%> - - - IP Netmask - <%$ip_netmask%> - - - IP Gateway - <%$ip_gateway%> - + +% if ( $ip_addr ) { + + IP Address + <%$ip_addr%> + + + IP Netmask + <%$addr_block->NetAddr->mask%> + + + IP Gateway + <%$addr_block->ip_gateway%> + +% } + MAC Address <%$mac_addr%> @@ -173,18 +181,14 @@ if ($pkgnum) { #eofalse my $addr_block = $svc_broadband->addr_block; -my $router = $addr_block->router; +my $router = $addr_block->router if $addr_block; -if (not $router) { die "Could not lookup router for svc_broadband (svcnum $svcnum)" }; +#if (not $router) { die "Could not lookup router for svc_broadband (svcnum $svcnum)" }; my ( - $routername, - $routernum, $speed_down, $speed_up, $ip_addr, - $ip_gateway, - $ip_netmask, $mac_addr, $latitude, $longitude, @@ -193,13 +197,9 @@ my ( $auth_key, $description, ) = ( - $router->getfield('routername'), - $router->getfield('routernum'), $svc_broadband->getfield('speed_down'), $svc_broadband->getfield('speed_up'), $svc_broadband->getfield('ip_addr'), - $addr_block->ip_gateway, - $addr_block->NetAddr->mask, $svc_broadband->mac_addr, $svc_broadband->latitude, $svc_broadband->longitude, -- cgit v1.2.1 From b0137008c06198cbb14f42804d33c31de5e3c6c2 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 13 Jul 2009 09:10:17 +0000 Subject: fix old-style agent-virt logo? --- httemplate/view/cust_bill-logo.cgi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill-logo.cgi b/httemplate/view/cust_bill-logo.cgi index 09ac9a717..ad2ff5430 100755 --- a/httemplate/view/cust_bill-logo.cgi +++ b/httemplate/view/cust_bill-logo.cgi @@ -10,7 +10,7 @@ my $conf = new FS::Conf; my $templatename; my $agentnum = ''; if ( $cgi->param('invnum') ) { - $templatename = $cgi->param('templatename'); + $templatename = $cgi->param('template') || $cgi->param('templatename'); my $cust_bill = qsearchs('cust_bill', { 'invnum' => $cgi->param('invnum') } ) or die 'unknown invnum'; $agentnum = $cust_bill->cust_main->agentnum; -- cgit v1.2.1 From 17451727f5f483394ca894a48e8fa3abe91d5a2b Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 22 Jul 2009 22:05:27 +0000 Subject: fix bombing out on new DateTime --- httemplate/view/cust_main/misc.html | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 060da87dd..91b304b5d 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -85,13 +85,15 @@ % if ( $conf->exists('cust_main-enable_birthdate') ) { -% my $dt = DateTime->from_epoch(epoch => $cust_main->birthdate, -% time_zone=>'floating', -% ); +% my $dt = $cust_main->birthdate ne '' +% ? DateTime->from_epoch( 'epoch' => $cust_main->birthdate, +% 'time_zone' =>'floating', +% ) +% : ''; Date of Birth - <% $cust_main->birthdate ne '' ? $dt->strftime($date_format) : '' %> + <% $dt ? $dt->strftime($date_format) : '' %> % } -- cgit v1.2.1 From f3717767d19f9da888e190f87a04dfa245d658b4 Mon Sep 17 00:00:00 2001 From: jeff Date: Mon, 27 Jul 2009 03:26:47 +0000 Subject: FCC from 477 improvements #4912 --- httemplate/view/cust_main/misc.html | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/misc.html b/httemplate/view/cust_main/misc.html index 91b304b5d..71e8d6973 100644 --- a/httemplate/view/cust_main/misc.html +++ b/httemplate/view/cust_main/misc.html @@ -98,6 +98,15 @@ % } +% if ( $conf->exists('cust_main-require_censustract') ) { + + + Census tract + <% $cust_main->censustract %> + + +% } + <%init> -- cgit v1.2.1 From b00657d2dd62614568501df47d1be4cbfa15eb48 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 27 Jul 2009 09:07:24 +0000 Subject: voided payment report, RT#5786 --- httemplate/view/cust_pay.html | 32 +++++++++++++++++++++++++------- httemplate/view/cust_pay_void.html | 1 + 2 files changed, 26 insertions(+), 7 deletions(-) create mode 100644 httemplate/view/cust_pay_void.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index c36d76904..a5c99ac55 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -1,12 +1,12 @@ % if ( $link eq 'popup' ) { - <% include('/elements/header-popup.html', "Payment Receipt" ) %> + <% include('/elements/header-popup.html', "$thing Receipt" ) %>
Print

% } elsif ( $link eq 'print' ) { - <% include('/elements/header-popup.html', "Payment Receipt" ) %> + <% include('/elements/header-popup.html', "$thing Receipt" ) %> % #it would be nice if the menubar could be hidden for print, but better to % # have it available than not, otherwise the user winds up at a dead end @@ -18,7 +18,7 @@ % } else { - <% include('/elements/header.html', "Payment Receipt", menubar( + <% include('/elements/header.html', "$thing Receipt", menubar( "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum", 'Print receipt' => $pr_link, )) @@ -48,6 +48,20 @@ <% time2str"%a %b %o, %Y %r", $cust_pay->_date %> +% if ( $void ) { + + + Void Date + <% time2str"%a %b %o, %Y %r", $cust_pay->void_date %> + + +%# +%# Void reason +%# <% $cust_pay->reason %> +%# + +% } + Amount <% $money_char. $cust_pay->paid %> @@ -112,16 +126,20 @@ if ( $cgi->param('link') =~ /^(\w+)$/ ) { $link = $1; } +my $void = $cgi->param('void') ? 1 : 0; +my $thing = $void ? 'Voided Payment' : 'Payment'; +my $table = $void ? 'cust_pay_void' : 'cust_pay'; + my $cust_pay = qsearchs({ - 'select' => 'cust_pay.*', - 'table' => 'cust_pay', + 'select' => "$table.*", + 'table' => $table, 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'paynum' => $paynum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }); -die "Payment #$paynum not found!" unless $cust_pay; +die "$thing #$paynum not found!" unless $cust_pay; -my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum"; +my $pr_link = "${p}view/cust_pay.html?link=print;paynum=$paynum;void=$void"; my $custnum = $cust_pay->custnum; my $display_custnum = $cust_pay->cust_main->display_custnum; diff --git a/httemplate/view/cust_pay_void.html b/httemplate/view/cust_pay_void.html new file mode 100644 index 000000000..8c22170d6 --- /dev/null +++ b/httemplate/view/cust_pay_void.html @@ -0,0 +1 @@ +<% include('cust_pay.html', @_, 'void' => 1 ) %> -- cgit v1.2.1 From e1b1693a656964c6db0b8a3fb85494014434dcb1 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 28 Jul 2009 21:17:45 +0000 Subject: adding a basic change history using history tables, RT#1005, RT#4357 --- httemplate/view/cust_main.cgi | 12 +- httemplate/view/cust_main/change_history.html | 302 ++++++++++++++++++++++++++ 2 files changed, 311 insertions(+), 3 deletions(-) create mode 100644 httemplate/view/cust_main/change_history.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 88fd03713..78bcb1fc1 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,6 +113,7 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { +
Notes
% } @@ -180,6 +181,10 @@ Comments % } +% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' + <% include('cust_main/change_history.html', $cust_main ) %> +% } + <% include('/elements/footer.html') %> <%init> @@ -213,11 +218,12 @@ tie my %views, 'Tie::IxHash', 'Notes' => 'notes', #notes and files? ; $views{'Tickets'} = 'tickets' - if $conf->config('ticket_system'); + if $conf->config('ticket_system'); $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' - unless $conf->config('payby-default' eq 'HIDE'); -#$views{'Change History'} = ''; + unless $conf->config('payby-default' eq 'HIDE'); +$views{'Change History'} = 'change_history' + if $curuser->access_right('View customer history'); $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html new file mode 100644 index 000000000..1700bc34b --- /dev/null +++ b/httemplate/view/cust_main/change_history.html @@ -0,0 +1,302 @@ +% if ( int( time - (keys %years)[0] * 31556736 ) > $start ) { + Show: +% my $chy = $cgi->param('change_history-years'); +% foreach my $y (keys %years) { +% if ( $y == $years ) { + <% $years{$y} %> +% } else { +% $cgi->param('change_history-years', $y); + <% $years{$y} %> +% } +% last if int( time - $y * 31556736 ) < $start; +% } +% $cgi->param('change_history-years', $chy); +% } + +<% include("/elements/table-grid.html") %> +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; + + + User + Date + Time + Item + Action + Description + + +% foreach my $item ( sort { $a->history_date <=> $b->history_date +% #|| table order +% || $a->historynum <=> $b->historynum +% } +% @history +% ) +% { +% +% my $history_other = ''; +% my $act = $item->history_action; +% if ( $act =~ /^replace/ ) { +% my $pkey = $item->primary_key; +% my $date = $item->history_date; +% $history_other = qsearchs({ +% 'table' => $item->table, +% 'hashref' => { $pkey => $item->$pkey(), +% 'history_action' => $replace_other{$act}, +% 'historynum' => { 'op' => $replace_dir{$act}, +% 'value' => $item->historynum +% }, +% }, +% 'extra_sql' => " +% AND history_date $replace_direq{$act} $date +% AND ($date $replace_op{$act} $fuzz) $replace_direq{$act} history_date +% ORDER BY historynum $replace_ord{$act} LIMIT 1 +% ", +% }); +% } +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } + + + +% my $otaker = $item->history_user; +% $otaker = 'auto billing' if $otaker eq 'fs_daily'; +% $otaker = 'customer self-service' if $otaker eq 'fs_selfservice'; +% $otaker = 'job queue' if $otaker eq 'fs_queue'; + <% $otaker %> + + +% my $d = time2str('%b %o, %Y', $item->history_date ); +% $d =~ s/ / /g; + <% $d %> + + +% my $t = time2str('%r', $item->history_date ); +% $t =~ s/ / /g; + <% $t %> + + +% my $label = $h_tables{$item->table}; +% $label = &{ $h_table_labelsub{$item->table} }( $item, $label ) +% if $h_table_labelsub{$item->table}; + <% $label %> + + + <% $action{$item->history_action} %> + + + <% join(', ', + map { my $value = ( $_ =~ /(^pay(info|cvv)|^ss|_password)$/ ) + ? 'N/A' + : $item->get($_); + $value = substr($value, 0, 77).'...' if length($value) > 80; + $value = encode_entities($value); + "$_:$value"; + } + grep { $history_other + ? ( $item->get($_) ne $history_other->get($_) ) + : ( $item->get($_) =~ /\S/ ) + } + grep { ! /^(history|custnum$)/i } + $item->fields + ) + %> + + + +% } + + +<%once> + +# length-switching + +tie my %years, 'Tie::IxHash', + .5 => '6 months', + 1 => '1 year', + 2 => '2 years', + 5 => '5 years', + 39 => 'all history', +; + +# labeling history rows + +my %action = ( + 'insert' => 'Insert', #'Create', + 'replace_old' => 'Change from', + 'replace_new' => 'Change to', + 'delete' => 'Remove', +); + +# finding the other replace row + +my %replace_other = ( + 'replace_new' => 'replace_old', + 'replace_old' => 'replace_new', +); +my %replace_dir = ( + 'replace_new' => '<', + 'replace_old' => '>', +); +my %replace_direq = ( + 'replace_new' => '<=', + 'replace_old' => '>=', +); +my %replace_op = ( + 'replace_new' => '-', + 'replace_old' => '+', +); +my %replace_ord = ( + 'replace_new' => 'DESC', + 'replace_old' => 'ASC', +); + +my $fuzz = 5; #seems like a lot + +# which tables to search and what to call them + +tie my %tables, 'Tie::IxHash', + 'cust_main' => 'Customer', + 'cust_main_invoice' => 'Invoice destination', + 'cust_pkg' => 'Package', + #? or just svc_* ? 'cust_svc' => + 'svc_acct' => 'Account', + 'radius_usergroup' => 'RADIUS group', + 'svc_domain' => 'Domain', + 'svc_www' => 'Hosting', + 'svc_forward' => 'Mail forward', + 'svc_broadband' => 'Broadband', + 'svc_external' => 'External service', + 'svc_phone' => 'Phone', + 'phone_device' => 'Phone device', + #? it gets provisioned anyway 'phone_avail' => 'Phone', +; + +my $svc_join = 'JOIN cust_svc USING ( svcnum ) JOIN cust_pkg USING ( pkgnum )'; + +my %table_join = ( + 'svc_acct' => $svc_join, + 'radius_usergroup' => $svc_join, + 'svc_domain' => $svc_join, + 'svc_www' => $svc_join, + 'svc_forward' => $svc_join, + 'svc_broadband' => $svc_join, + 'svc_external' => $svc_join, + 'svc_phone' => $svc_join, + 'phone_device' => $svc_join, +); + +my %h_tables = map { ( "h_$_" => $tables{$_} ) } keys %tables; + +my %pkgpart = (); +my $pkg_labelsub = sub { + my($item, $label) = @_; + $pkgpart{$item->pkgpart} ||= $item->part_pkg->pkg; + $label. ': '. encode_entities($pkgpart{$item->pkgpart}). ''; +}; + +my $svc_labelsub = sub { + my($item, $label) = @_; + $label. ': '. encode_entities($item->label). ''; +}; + +my %h_table_labelsub = ( + 'h_cust_pkg' => $pkg_labelsub, + 'h_svc_acct' => $svc_labelsub, + #'h_radius_usergroup' => + 'h_svc_domain' => $svc_labelsub, + 'h_svc_www' => $svc_labelsub, + 'h_svc_forward' => $svc_labelsub, + 'h_svc_broadband' => $svc_labelsub, + 'h_svc_external' => $svc_labelsub, + 'h_svc_phone' => $svc_labelsub, + #'h_phone_device' +); + +# cust_main +# cust_main_invoice + +# cust_pkg +# cust_pkg_option? +# cust_pkg_detail +# cust_pkg_reason? no + +#cust_svc +#cust_svc_option? +#svc_* +# svc_acct +# radius_usergroup +# acct_snarf? is this even used? +# svc_domain +# domain_record +# registrar +# svc_forward +# svc_www +# svc_broadband +# (virtual fields? eh... maybe when they're real) +# svc_external +# svc_phone +# phone_device +# phone_avail + +# future: + +# inventory_item (from services) +# pkg_referral? (changed?) + +#random others: + +# cust_location? +# cust_main-exemption?? (295.ca named tax exemptions) + + +<%init> + +my( $cust_main ) = @_; + +my $conf = new FS::Conf; + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access deined" + unless $curuser->access_right('View customer history'); + +# find out the beginning of this customer history, if possible +my $h_insert = qsearchs({ + 'table' => 'h_cust_main', + 'hashref' => { 'custnum' => $cust_main->custnum, + 'history_action' => 'insert', + }, + 'extra_sql' => 'ORDER BY historynum LIMIT 1', +}); +my $start = $h_insert ? $h_insert->history_date : 0; + +# retreive the history + +my @history = (); + +my $years = $conf->config('change_history-years') || .5; +if ( $cgi->param('change_history-years') =~ /^([\d\.]+)$/ ) { + $years = $1; +} +my $newer_than = int( time - $years * 31556736 ); #60*60*24*365.24 + +local($FS::Record::nowarn_classload) = 1; + +foreach my $table ( keys %tables ) { + my @items = qsearch({ + 'table' => "h_$table", + 'addl_from' => $table_join{$table}, + 'hashref' => { 'history_date' => { op=>'>=', value=>$newer_than }, }, + 'extra_sql' => ' AND custnum = '. $cust_main->custnum, + }); + push @history, @items; + +} + + -- cgit v1.2.1 From 50f5d60aef5ee82be33c978db6424372bfd7995b Mon Sep 17 00:00:00 2001 From: jeff Date: Tue, 28 Jul 2009 22:21:40 +0000 Subject: feature to email CSV of CDRs with invoices #5727 --- httemplate/view/cust_main/billing.html | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/billing.html b/httemplate/view/cust_main/billing.html index 049461dbd..c8d0c47cd 100644 --- a/httemplate/view/cust_main/billing.html +++ b/httemplate/view/cust_main/billing.html @@ -216,6 +216,13 @@ Billing information % } +% if ( $conf->exists('voip-cust_email_csv_cdr') ) { + + Email CDRs as CSV + <% $cust_main->email_csv_cdr ? 'yes' : 'no' %> + +% } + % if ( $show_term || $cust_main->cdr_termination_percentage ) { CDR termination settlement -- cgit v1.2.1 From 4396080ed2829ae0595f1fd777f39d090c9bcd7c Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Jul 2009 06:42:33 +0000 Subject: experimental package balances, RT#4339 --- httemplate/view/cust_bill.cgi | 1 + httemplate/view/cust_main/packages.html | 3 ++ httemplate/view/cust_main/packages/status.html | 43 +++++++++++++++------- httemplate/view/cust_main/payment_history.html | 13 ++++--- .../view/cust_main/payment_history/credit.html | 14 +++++-- .../view/cust_main/payment_history/payment.html | 14 +++++-- .../cust_main/payment_history/voided_payment.html | 5 +++ httemplate/view/cust_pay.html | 9 +++++ 8 files changed, 76 insertions(+), 26 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 450c74e61..2673e8239 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -6,6 +6,7 @@ % if ( $cust_bill->owed > 0 % && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) % && $FS::CurrentUser::CurrentUser->access_right('Post payment') +% && ! $conf->exists('pkg-balances') % ) % { % my $s = 0; diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 428794b7d..8fbefae50 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -138,6 +138,9 @@ my %conf_opt = ( #for status.html 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'), + #for status.html pkg-balances + 'pkg-balances' => $conf->exists('pkg-balances'), + 'money_char' => ( $conf->config('money_char') || '$' ), #for location.html 'countrydefault' => $countrydefault, diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 6daff5031..f3b2faaf4 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -8,15 +8,16 @@ <% pkg_status_row($cust_pkg, 'Cancelled', 'cancel', 'color'=>'FF0000', %opt ) %> - <% pkg_status_row_colspan( + <% pkg_status_row_colspan( $cust_pkg, ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', 'align'=>'right', 'color'=>'ff0000', 'size'=>'-2', 'colspan'=>$colspan, + %opt ) %> % unless ( $cust_pkg->get('setup') ) { - <% pkg_status_row_colspan('Never billed', '', 'colspan'=>$colspan, ) %> + <% pkg_status_row_colspan( $cust_pkg, 'Never billed', '', 'colspan'=>$colspan, %opt, ) %> % } else { @@ -34,14 +35,15 @@ <% pkg_status_row( $cust_pkg, 'Suspended', 'susp', 'color'=>'FF9900', %opt ) %> - <% pkg_status_row_colspan( + <% pkg_status_row_colspan( $cust_pkg, ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', 'align'=>'right', 'color'=>'FF9900', 'size'=>'-2', 'colspan'=>$colspan, + %opt, ) %> % unless ( $cust_pkg->get('setup') ) { - <% pkg_status_row_colspan('Never billed', '', 'colspan'=>$colspan ) %> + <% pkg_status_row_colspan( $cust_pkg, 'Never billed', '', 'colspan'=>$colspan, %opt ) %> % } else { <% pkg_status_row($cust_pkg, 'Setup', 'setup', %opt ) %> % } @@ -70,7 +72,7 @@ % % unless ( $part_pkg->freq ) { - <% pkg_status_row_colspan('Not yet billed (one-time charge)', '', 'colspan'=>$colspan, ) %> + <% pkg_status_row_colspan( $cust_pkg, 'Not yet billed (one-time charge)', '', 'colspan'=>$colspan, %opt ) %> <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> @@ -86,7 +88,7 @@ % } else { - <% pkg_status_row_colspan("Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan ) %> + <% pkg_status_row_colspan($cust_pkg, "Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')', '', 'colspan'=>$colspan, %opt ) %> <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> @@ -96,7 +98,7 @@ % % unless ( $part_pkg->freq ) { - <% pkg_status_row_colspan('One-time charge', '', 'colspan'=>$colspan, ) %> + <% pkg_status_row_colspan($cust_pkg, 'One-time charge', '', 'colspan'=>$colspan, %opt ) %> <% pkg_status_row($cust_pkg, 'Billed', 'setup', %opt) %> @@ -104,18 +106,20 @@ % % if (scalar($cust_pkg->overlimit)) { - <% pkg_status_row_colspan( + <% pkg_status_row_colspan( $cust_pkg, 'Overlimit', $billed_or_prepaid. ' '. myfreq($part_pkg), 'color'=>'FFD000', 'colspan'=>$colspan, + %opt ) %> % } else { - <% pkg_status_row_colspan( + <% pkg_status_row_colspan( $cust_pkg, 'Active', $billed_or_prepaid. ' '. myfreq($part_pkg), 'color'=>'00CC00', 'colspan'=>$colspan, + %opt ) %> % } @@ -169,7 +173,6 @@ - <%init> my %opt = @_; @@ -218,8 +221,15 @@ sub pkg_status_row { $html .= qq() if length($color); $html .= qq($title ); $html .= qq() if length($color); + + if ( $opt{'pkg_balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge + $html .= ' (Balance: '. $opt{'money_char'}. + $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum). + ')'; + } + $html .= qq(); - $html .= pkg_datestr($cust_pkg, $field, %opt).''; + $html .= pkg_datestr($cust_pkg, $field, %opt). ''; $html; } @@ -253,7 +263,7 @@ sub pkg_status_row_changed { my $part_pkg = $old->part_pkg; my $label = 'Changed from '. $cust_pkg->change_pkgnum. ': '. $part_pkg->pkg_comment(nopartpkg => 1); - $html .= pkg_status_row_colspan( $label, '', + $html .= pkg_status_row_colspan( $cust_pkg, $label, '', 'size' => '-1', 'align' => 'right', 'colspan' => $opt{'colspan'}, @@ -264,7 +274,7 @@ sub pkg_status_row_changed { } sub pkg_status_row_colspan { - my($title, $addl, %opt) = @_; + my($cust_pkg, $title, $addl, %opt) = @_; my $colspan = $opt{'colspan'}; @@ -279,6 +289,13 @@ sub pkg_status_row_colspan { $html .= qq() if $color && !$size; $html .= qq() if length($color) || $size; $html .= ", $addl" if length($addl); + + if ( $opt{'pkg-balances'} && ! $cust_pkg->{_printed_balance}++ ) { #kludge + $html .= ' (Balance: '. $opt{'money_char'}. + $cust_pkg->cust_main->balance_pkgnum($cust_pkg->pkgnum). + ')'; + } + $html .= qq(); $html; diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 1711e1449..8adc95426 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -374,13 +374,16 @@ my %status = ( #get payment history my @history = (); -my %opt = +my %opt = ( ( map { $_ => scalar($conf->config($_)) } qw( card_refund-days ) ), ( map { $_ => $conf->exists($_) } - qw( deletepayments deleterefunds ) - ); + qw( deletepayments deleterefunds pkg-balances ) + ) +); + +warn Dumper(\%opt); #invoices foreach my $cust_bill ($cust_main->cust_bill) { @@ -405,7 +408,7 @@ foreach my $cust_pay ($cust_main->cust_pay) { foreach my $cust_pay_void ($cust_main->cust_pay_void) { push @history, { 'date' => $cust_pay_void->_date, - 'desc' => include('payment_history/voided_payment.html', $cust_pay_void), + 'desc' => include('payment_history/voided_payment.html', $cust_pay_void, %opt ), 'void_payment' => $cust_pay_void->paid, }; @@ -415,7 +418,7 @@ foreach my $cust_pay_void ($cust_main->cust_pay_void) { foreach my $cust_credit ($cust_main->cust_credit) { push @history, { 'date' => $cust_credit->_date, - 'desc' => include('payment_history/credit.html', $cust_credit), + 'desc' => include('payment_history/credit.html', $cust_credit, %opt ), 'credit' => $cust_credit->amount, }; diff --git a/httemplate/view/cust_main/payment_history/credit.html b/httemplate/view/cust_main/payment_history/credit.html index 2deb27564..058c6f536 100644 --- a/httemplate/view/cust_main/payment_history/credit.html +++ b/httemplate/view/cust_main/payment_history/credit.html @@ -9,7 +9,13 @@ my $curuser = $FS::CurrentUser::CurrentUser; my @cust_credit_bill = $cust_credit->cust_credit_bill; my @cust_credit_refund = $cust_credit->cust_credit_refund; -my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); +my $desc = ''; +if ( $opt{'pkg-balances'} && $cust_credit->pkgnum ) { + my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_credit->pkgnum } ); + $desc .= ' for '. $cust_pkg->pkg_label_long; +} + +my( $pre, $post, $apply, $ext ) = ( '', '', '', '' ); if ( scalar(@cust_credit_bill) == 0 && scalar(@cust_credit_refund) == 0 ) { #completely unapplied @@ -45,15 +51,15 @@ if ( scalar(@cust_credit_bill) == 0 && scalar(@cust_credit_refund) == 0 && $cust_credit->credited == 0 ) { #applied to one invoice, the usual situation - $desc = ' '. $cust_credit_bill[0]->applied_to_invoice; + $desc .= ' '. $cust_credit_bill[0]->applied_to_invoice; } elsif ( scalar(@cust_credit_bill) == 0 && scalar(@cust_credit_refund) == 1 && $cust_credit->credited == 0 ) { #applied to one refund - $desc = ' refunded on '. time2str("%D", $cust_credit_refund[0]->_date); + $desc .= ' refunded on '. time2str("%D", $cust_credit_refund[0]->_date); } else { #complicated - $desc = '
'; + $desc .= '
'; foreach my $app ( sort { $a->_date <=> $b->_date } ( @cust_credit_bill, @cust_credit_refund ) ) { if ( $app->isa('FS::cust_credit_bill') ) { diff --git a/httemplate/view/cust_main/payment_history/payment.html b/httemplate/view/cust_main/payment_history/payment.html index 2e24b1785..a4a349bb8 100644 --- a/httemplate/view/cust_main/payment_history/payment.html +++ b/httemplate/view/cust_main/payment_history/payment.html @@ -32,7 +32,13 @@ $payby =~ s/^MCRD$/Manual credit card/; $payby =~ s/^BILL$//; my $info = $payby ? "($payby$payinfo)" : ''; -my( $pre, $post, $desc, $apply, $ext ) = ( '', '', '', '', '' ); +my $desc = ''; +if ( $opt{'pkg-balances'} && $cust_pay->pkgnum ) { + my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } ); + $desc .= ' for '. $cust_pkg->pkg_label_long; +} + +my( $pre, $post, $apply, $ext ) = ( '', '', '', '' ); if ( scalar(@cust_bill_pay) == 0 && scalar(@cust_pay_refund) == 0 ) { #completely unapplied @@ -68,15 +74,15 @@ if ( scalar(@cust_bill_pay) == 0 && scalar(@cust_pay_refund) == 0 && $cust_pay->unapplied == 0 ) { #applied to one invoice, the usual situation - $desc = ' '. $cust_bill_pay[0]->applied_to_invoice; + $desc .= ' '. $cust_bill_pay[0]->applied_to_invoice; } elsif ( scalar(@cust_bill_pay) == 0 && scalar(@cust_pay_refund) == 1 && $cust_pay->unapplied == 0 ) { #applied to one refund - $desc = ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date); + $desc .= ' refunded on '. time2str("%D", $cust_pay_refund[0]->_date); } else { #complicated - $desc = '
'; + $desc .= '
'; foreach my $app ( sort { $a->_date <=> $b->_date } ( @cust_bill_pay, @cust_pay_refund ) ) { if ( $app->isa('FS::cust_bill_pay') ) { diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 9cbc47b66..08469dbe9 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -18,6 +18,11 @@ $payby =~ s/^BILL$//; $payby =~ s/^(CARD|COMP)$/$1 /; my $info = $payby ? " ($payby$payinfo)" : ''; +if ( $opt{'pkg-balances'} && $cust_pay_void->pkgnum ) { + my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay_void->pkgnum } ); + $info .= ' for '. $cust_pkg->pkg_label_long; +} + my $unvoid = ''; if ( $cust_pay_void->closed !~ /^Y/i && $curuser->access_right('Unvoid') diff --git a/httemplate/view/cust_pay.html b/httemplate/view/cust_pay.html index a5c99ac55..2f23d9e14 100644 --- a/httemplate/view/cust_pay.html +++ b/httemplate/view/cust_pay.html @@ -93,6 +93,15 @@ % } +% if ( $conf->exists('pkg-balances') && $cust_pay->pkgnum ) { +% my $cust_pkg = qsearchs('cust_pkg', { 'pkgnum' => $cust_pay->pkgnum } ); + + For package + <% $cust_pkg->pkg_label_long %> + + +% } + % if ( $link eq 'print' ) { -- cgit v1.2.1 From da635762c054395a44145362f1ddd2ccdbb87416 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Jul 2009 06:52:16 +0000 Subject: didn't mean to leave a Dump(er) there --- httemplate/view/cust_main/payment_history.html | 2 -- 1 file changed, 2 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 8adc95426..24af5c9a5 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -383,8 +383,6 @@ my %opt = ( ) ); -warn Dumper(\%opt); - #invoices foreach my $cust_bill ($cust_main->cust_bill) { push @history, { -- cgit v1.2.1 From 32e1fac180b972b037d36f4496566eaf7c6079c6 Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 30 Jul 2009 07:39:17 +0000 Subject: small fix to change history to not error out with svc_acct services, RT#1005 --- httemplate/view/cust_main/change_history.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/change_history.html b/httemplate/view/cust_main/change_history.html index 1700bc34b..53a79f47f 100644 --- a/httemplate/view/cust_main/change_history.html +++ b/httemplate/view/cust_main/change_history.html @@ -202,7 +202,7 @@ my $pkg_labelsub = sub { my $svc_labelsub = sub { my($item, $label) = @_; - $label. ': '. encode_entities($item->label). ''; + $label. ': '. encode_entities($item->label($item->history_date)). ''; }; my %h_table_labelsub = ( -- cgit v1.2.1 From 958afb8d05de67e12df258b57bedcf85028b6253 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 7 Aug 2009 00:39:14 +0000 Subject: don't start recurring billing when a start date hasn't been reached yet either... and since that works, add the start date to new package order, RT#5347 --- httemplate/view/cust_main/packages.html | 1 + 1 file changed, 1 insertion(+) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 8fbefae50..16adc8c5f 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -9,6 +9,7 @@ 'cust_main' => $cust_main, 'closetext' => 'Close', 'width' => 763, + 'height' => 350, ) %> % } -- cgit v1.2.1 From 283ea2b5137ae3ec36882b492e6de024b0ce6027 Mon Sep 17 00:00:00 2001 From: mark Date: Sun, 9 Aug 2009 09:05:38 +0000 Subject: Add cust_attachment stuff --- httemplate/view/attachment.html | 16 ++++ httemplate/view/cust_main.cgi | 28 ++++-- httemplate/view/cust_main/attachments.html | 133 +++++++++++++++++++++++++++++ 3 files changed, 168 insertions(+), 9 deletions(-) create mode 100644 httemplate/view/attachment.html create mode 100755 httemplate/view/cust_main/attachments.html (limited to 'httemplate/view') diff --git a/httemplate/view/attachment.html b/httemplate/view/attachment.html new file mode 100644 index 000000000..c85b1375f --- /dev/null +++ b/httemplate/view/attachment.html @@ -0,0 +1,16 @@ +<%init> +my ($query) = $cgi->keywords; +$query =~ /^(\d+)$/; +my $attachnum = $1 or die 'Invalid attachment number'; +$FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'access denied'; + +my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die 'Attachment not found: $attachnum'; + +$m->clear_buffer; +$r->content_type($attach->mime_type || 'text/plain'); +$r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename); + +binmode STDOUT; +print STDOUT $attach->body; + + diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 78bcb1fc1..da1a56a96 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,7 +113,6 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { -
Notes
% } @@ -138,6 +137,22 @@ Comments <% include('cust_main/notes.html', 'custnum' => $cust_main->custnum ) %> % } +
+ +% if(! $conf->config('disable_cust_attachment') +% and $curuser->access_right('Add attachment')) { +<% include( '/elements/popup_link-cust_main.html', + 'label' => 'Attach file', + 'action' => $p.'edit/cust_main_attach.cgi', + 'actionlabel' => 'Upload file', + 'cust_main' => $cust_main, + 'width' => 616, + 'height' => 408, + ) +%> +% } +<% include('cust_main/attachments.html', 'custnum' => $cust_main->custnum ) %> +
% } @@ -181,10 +196,6 @@ Comments % } -% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' - <% include('cust_main/change_history.html', $cust_main ) %> -% } - <% include('/elements/footer.html') %> <%init> @@ -218,12 +229,11 @@ tie my %views, 'Tie::IxHash', 'Notes' => 'notes', #notes and files? ; $views{'Tickets'} = 'tickets' - if $conf->config('ticket_system'); + if $conf->config('ticket_system'); $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' - unless $conf->config('payby-default' eq 'HIDE'); -$views{'Change History'} = 'change_history' - if $curuser->access_right('View customer history'); + unless $conf->config('payby-default' eq 'HIDE'); +#$views{'Change History'} = ''; $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; diff --git a/httemplate/view/cust_main/attachments.html b/httemplate/view/cust_main/attachments.html new file mode 100755 index 000000000..e25814ff5 --- /dev/null +++ b/httemplate/view/cust_main/attachments.html @@ -0,0 +1,133 @@ +% if ( scalar(@attachments) ) { + + <% include('/elements/init_overlib.html') %> + + <% include("/elements/table-grid.html") %> + + + Date +% if ( $conf->exists('cust_main_note-display_times') ) { + Time +% } + Person + Filename + Type + Size + + + +% my $bgcolor1 = '#eeeeee'; +% my $bgcolor2 = '#ffffff'; +% my $bgcolor = ''; +% +% foreach my $attach ((grep { $_->disabled } @attachments), +% (grep { ! $_->disabled } @attachments)) { +% +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; +% } +% +% my $pop = popurl(3); +% my $attachnum = $attach->attachnum; +% my $edit = ''; +% my $download = ''; +% if($attach->disabled) { +% my $onclick = include('/elements/popup_link_onclick.html', +% 'action' => popurl(2). +% 'edit/process/cust_main_attach.cgi'. +% "?custnum=$custnum;". +% "attachnum=$attachnum;". +% "undelete=1", +% 'actionlabel' => 'Undelete attachment', +% 'width' => 616, +% 'height' => 408, +% 'frame' => 'top', +% ); +% my $clickjs = qq!onclick="$onclick"!; +% if($curuser->access_right('Edit attachment')) { +% $edit = qq! (undelete)!; +% } +% } +% else { +% my $onclick = include( '/elements/popup_link_onclick.html', +% 'action' => popurl(2). +% 'edit/cust_main_attach.cgi'. +% "?custnum=$custnum". +% ";attachnum=$attachnum", +% 'actionlabel' => 'Edit customer note', +% 'width' => 616, +% 'height' => 408, +% 'frame' => 'top', +% ); +% my $clickjs = qq!onclick="$onclick"!; +% +% if ($curuser->access_right('Edit attachment') ) { +% $edit = qq! (edit)!; +% } +% if ($curuser->access_right('Download attachment') ) { +% $download = qq! (download)!; +% } +% } + + + <% note_datestr($attach,$conf,$bgcolor) %> + +  <% $attach->otaker%> + + +  <% $attach->filename %> + + +  <% $attach->mime_type %> + + +  <% size_units( $attach->size ) %> + + +  <% $edit %> +  <% $download %> + + <% $attach->disabled ? '' : '' %> + + +% } #end display notes + + + +% } +<%init> + +my $conf = new FS::Conf; +my $curuser = $FS::CurrentUser::CurrentUser; + +my(%opt) = @_; + +my $custnum = $opt{'custnum'}; + +my $cust_main = qsearchs('cust_main', {'custnum' => $custnum} ); +die "Customer not found!" unless $cust_main; + +my (@attachments) = qsearch('cust_attachment', {'custnum' => $custnum}); + +#subroutines + +sub note_datestr { + my($note, $conf, $bgcolor) = @_ or return ''; + my $td = qq{}; + my $format = "$td%b %o, %Y"; + $format .= "$td%l:%M%P" + if $conf->exists('cust_main_note-display_times'); + ( my $strip = time2str($format, $note->_date) ) =~ s/ (\d)/$1/g; + $strip; +} + +sub size_units { + my $bytes = shift; + return $bytes if $bytes < 1024; + return int($bytes / 1024)."K" if $bytes < 1048576; + return int($bytes / 1048576)."M"; +} + + -- cgit v1.2.1 From ae898cc8e6de40fbecb30c973f91cd955434b159 Mon Sep 17 00:00:00 2001 From: mark Date: Mon, 10 Aug 2009 23:04:57 +0000 Subject: Improve handling of deleted attachments --- httemplate/view/attachment.html | 6 +- httemplate/view/cust_main.cgi | 12 +++- httemplate/view/cust_main/attachments.html | 90 ++++++++++++++++++------------ 3 files changed, 68 insertions(+), 40 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/attachment.html b/httemplate/view/attachment.html index c85b1375f..5fc053967 100644 --- a/httemplate/view/attachment.html +++ b/httemplate/view/attachment.html @@ -1,16 +1,16 @@ +<% $attach->body %> <%init> my ($query) = $cgi->keywords; $query =~ /^(\d+)$/; my $attachnum = $1 or die 'Invalid attachment number'; $FS::CurrentUser::CurrentUser->access_right('Download attachment') or die 'access denied'; -my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die 'Attachment not found: $attachnum'; +my $attach = qsearchs('cust_attachment', { attachnum => $attachnum }) or die "Attachment not found: $attachnum"; +die 'access denied' if $attach->disabled; $m->clear_buffer; $r->content_type($attach->mime_type || 'text/plain'); $r->headers_out->add('Content-Disposition' => 'attachment;filename=' . $attach->filename); -binmode STDOUT; -print STDOUT $attach->body; diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index da1a56a96..bbdfe5166 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -108,7 +108,7 @@ Comments

% } - + % my $notecount = scalar($cust_main->notes()); % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { @@ -152,6 +152,16 @@ Comments %> % } <% include('cust_main/attachments.html', 'custnum' => $cust_main->custnum ) %> +% if($cgi->param('show_deleted')) { +">(Show active attachments) +% } +% elsif($curuser->access_right('View deleted attachments')) { +">(Show deleted attachments) +% }
% } diff --git a/httemplate/view/cust_main/attachments.html b/httemplate/view/cust_main/attachments.html index e25814ff5..53635fd62 100755 --- a/httemplate/view/cust_main/attachments.html +++ b/httemplate/view/cust_main/attachments.html @@ -19,9 +19,19 @@ % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; % my $bgcolor = ''; +% if($cgi->param('show_deleted')) { +% if ($curuser->access_right('View deleted attachments')) { +% @attachments = grep { $_->disabled } @attachments; +% } +% else { +% @attachments = (); +% } +% } +% else { +% @attachments = grep { not $_->disabled } @attachments; +% } % -% foreach my $attach ((grep { $_->disabled } @attachments), -% (grep { ! $_->disabled } @attachments)) { +% foreach my $attach (@attachments) { % % if ( $bgcolor eq $bgcolor1 ) { % $bgcolor = $bgcolor2; @@ -32,42 +42,38 @@ % my $pop = popurl(3); % my $attachnum = $attach->attachnum; % my $edit = ''; -% my $download = ''; -% if($attach->disabled) { -% my $onclick = include('/elements/popup_link_onclick.html', -% 'action' => popurl(2). -% 'edit/process/cust_main_attach.cgi'. -% "?custnum=$custnum;". -% "attachnum=$attachnum;". -% "undelete=1", -% 'actionlabel' => 'Undelete attachment', -% 'width' => 616, -% 'height' => 408, -% 'frame' => 'top', -% ); -% my $clickjs = qq!onclick="$onclick"!; -% if($curuser->access_right('Edit attachment')) { -% $edit = qq! (undelete)!; +% if($attach->disabled) { # then you can undelete it or purge it. +% if ($curuser->access_right('Undelete attachment')) { +% my $clickjs = popup('edit/process/cust_main_attach.cgi?'. +% "custnum=$custnum;attachnum=$attachnum;". +% "undelete=1", +% 'Undelete attachment'); +% $edit .= qq!  (undelete)!; +% } +% if ($curuser->access_right('Purge attachment')) { +% my $clickjs = popup('edit/process/cust_main_attach.cgi?'. +% "custnum=$custnum;attachnum=$attachnum;". +% "purge=1", +% 'Purge attachment'); +% $edit .= qq!  (purge)!; % } % } -% else { -% my $onclick = include( '/elements/popup_link_onclick.html', -% 'action' => popurl(2). -% 'edit/cust_main_attach.cgi'. -% "?custnum=$custnum". -% ";attachnum=$attachnum", -% 'actionlabel' => 'Edit customer note', -% 'width' => 616, -% 'height' => 408, -% 'frame' => 'top', -% ); -% my $clickjs = qq!onclick="$onclick"!; -% +% else { # you can download or edit it % if ($curuser->access_right('Edit attachment') ) { -% $edit = qq! (edit)!; +% my $clickjs = popup('edit/cust_main_attach.cgi?'. +% "custnum=$custnum;attachnum=$attachnum", +% 'Edit attachment properties'); +% $edit .= qq!  (edit)!; +% } +% if($curuser->access_right('Delete attachment') ) { +% my $clickjs = popup('edit/process/cust_main_attach.cgi?'. +% "custnum=$custnum;attachnum=$attachnum;". +% "delete=1", +% 'Delete attachment'); +% $edit .= qq!  (delete)!; % } % if ($curuser->access_right('Download attachment') ) { -% $download = qq! (download)!; +% $edit .= qq!  (download)!; % } % } @@ -86,10 +92,8 @@  <% size_units( $attach->size ) %> -  <% $edit %> -  <% $download %> + <% $edit %> - <% $attach->disabled ? '' : '' %> % } #end display notes @@ -130,4 +134,18 @@ sub size_units { return int($bytes / 1048576)."M"; } +sub popup { + my ($url, $label) = @_; + my $onclick = + include('/elements/popup_link_onclick.html', + 'action' => popurl(2).$url, + 'actionlabel' => $label, + 'width' => 616, + 'height' => 408, + 'frame' => 'top', + ); + return qq!onclick="$onclick"!; +} + + -- cgit v1.2.1 From 6d406c07de8348a0a0e5ec1e8f2a3d8ffe5309cd Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 13 Aug 2009 09:25:02 +0000 Subject: fix reverted changes. grr. RT#4964 --- httemplate/view/cust_main.cgi | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index bbdfe5166..3e5a8cee3 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -113,6 +113,7 @@ Comments % if ( ! $conf->exists('cust_main-disable_notes') || $notecount) { % unless ( $view eq 'notes' && $cust_main->comments !~ /[^\s\n\r]/ ) { +
Notes
% } @@ -206,6 +207,10 @@ Comments % } +% if ( $view eq 'change_history' ) { # || $view eq 'jumbo' +<% include('cust_main/change_history.html', $cust_main ) %> +% } + <% include('/elements/footer.html') %> <%init> @@ -243,7 +248,8 @@ $views{'Tickets'} = 'tickets' $views{'Packages'} = 'packages'; $views{'Payment History'} = 'payment_history' unless $conf->config('payby-default' eq 'HIDE'); -#$views{'Change History'} = ''; +$views{'Change History'} = 'change_history' + if $curuser->access_right('View customer history'); $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; -- cgit v1.2.1 From 5c35f5323f1cdcf7eabe6632d0352ea417d3047e Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Aug 2009 04:03:35 +0000 Subject: Emailing statements of accounts, RT#4860 --- httemplate/view/cust_main/payment_history.html | 9 +++ .../view/cust_main/payment_history/statement.html | 34 ++++++++++ httemplate/view/cust_statement.html | 75 ++++++++++++++++++++++ 3 files changed, 118 insertions(+) create mode 100644 httemplate/view/cust_main/payment_history/statement.html create mode 100755 httemplate/view/cust_statement.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 24af5c9a5..0050daf9d 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -392,6 +392,15 @@ foreach my $cust_bill ($cust_main->cust_bill) { }; } +#statements +foreach my $cust_statement ($cust_main->cust_statement) { + push @history, { + 'date' => $cust_statement->_date, + 'desc' => include('payment_history/statement.html', $cust_statement, %opt ), + #'charge' => $cust_bill->charged, + }; +} + #payments (some false laziness w/credits) foreach my $cust_pay ($cust_main->cust_pay) { push @history, { diff --git a/httemplate/view/cust_main/payment_history/statement.html b/httemplate/view/cust_main/payment_history/statement.html new file mode 100644 index 000000000..dedec9bda --- /dev/null +++ b/httemplate/view/cust_main/payment_history/statement.html @@ -0,0 +1,34 @@ +<% $link %><% $pre %>Statement #<% $statementnum %> +%# (Balance $ <% $cust_statement->owed %>) +<% $post %><% $link ? '' : '' %><% $events %> +<%init> + +my( $cust_statement, %opt ) = @_; + +my $curuser = $FS::CurrentUser::CurrentUser; + +my($pre, $post) = ('', ''); +#if ( $cust_statement->owed > 0 ) { +# $pre = 'Open '; +# $post = ''; +#} + +my $statementnum = $cust_statement->statementnum; + +my $link = $curuser->access_right('View invoices') + ? qq!! + : ''; + +my $events = ''; + +#if ( $cust_statement->num_cust_event +# && ( $curuser->access_right('Billing event reports') +# || $curuser->access_right('View customer billing events') +# ) +# ) { +# $events = +# qq!
( View statement events )'; +#} + + diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html new file mode 100755 index 000000000..ec4ee9ebd --- /dev/null +++ b/httemplate/view/cust_statement.html @@ -0,0 +1,75 @@ +<% include("/elements/header.html",'Statement View', menubar( + "View this customer (#$display_custnum)" => "${p}view/cust_main.cgi?$custnum", +)) %> + +% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { + + Re-print this statement + +% if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { + | Re-email this statement +% } + +% if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { + | Re-fax this statement +% } + +

+ +% } + + +% if ( $conf->exists('invoice_latex') ) { + + View typeset statement +

+% } + +% #if ( $cust_statement->num_cust_event ) { +% if ( 0 ) { +( View statement events )

+% } + +% if ( $conf->exists('invoice_html') ) { + + <% join('', $cust_statement->print_html('', $templatename) ) %> +% } else { + +
<% join('', $cust_statement->print_text('', $templatename) ) %>
+% } + +<% include('/elements/footer.html') %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + +#untaint statement +my($query) = $cgi->keywords; +$query =~ /^((.+)-)?(\d+)$/; +my $templatename = $2; +my $statementnum = $3; + +my $conf = new FS::Conf; + +my @payby = grep /\w/, $conf->config('payby'); +#@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH WEST COMP )) +@payby = (qw( CARD DCRD CHEK DCHK LECB BILL CASH COMP )) + unless @payby; +my %payby = map { $_=>1 } @payby; + +my $cust_statement = qsearchs({ + 'select' => 'cust_statement.*', + 'table' => 'cust_statement', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'statementnum' => $statementnum }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +}); +die "Statement #$statementnum not found!" unless $cust_statement; + +my $custnum = $cust_statement->custnum; +my $display_custnum = $cust_statement->cust_main->display_custnum; + +my $link = $templatename ? "$templatename-$statementnum" : $statementnum; + + -- cgit v1.2.1 From 1e34f4a5d142bd58f5918219db0931e81ad0418e Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 20 Aug 2009 09:47:05 +0000 Subject: email statements, RT#4860 --- httemplate/view/cust_statement-pdf.cgi | 28 ++++++++++++++++++++++++++++ httemplate/view/cust_statement.html | 13 ++++++++----- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100755 httemplate/view/cust_statement-pdf.cgi (limited to 'httemplate/view') diff --git a/httemplate/view/cust_statement-pdf.cgi b/httemplate/view/cust_statement-pdf.cgi new file mode 100755 index 000000000..a1739e04c --- /dev/null +++ b/httemplate/view/cust_statement-pdf.cgi @@ -0,0 +1,28 @@ +<% $pdf %> +<%init> + +die "access denied" + unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + +#untaint statementnum +my($query) = $cgi->keywords; +$query =~ /^((.+)-)?(\d+)(.pdf)?$/; +my $templatename = $2 || 'statement'; #XXX configure... via event?? eh.. +my $statementnum = $3; + +my $cust_statement = qsearchs({ + 'select' => 'cust_statement.*', + 'table' => 'cust_statement', + 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', + 'hashref' => { 'statementnum' => $statementnum }, + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, +}); +die "Statement #$statementnum not found!" unless $cust_statement; + +my $pdf = $cust_statement->print_pdf( '', $templatename); + +http_header('Content-Type' => 'application/pdf' ); +http_header('Content-Length' => length($pdf) ); +http_header('Cache-control' => 'max-age=60' ); + + diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index ec4ee9ebd..b078c9d07 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -4,13 +4,15 @@ % if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { - Re-print this statement +%# Re-print this statement % if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { - | Re-email this statement +%# | + Re-email this statement % } -% if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { +% if ( 0 ) { +% #if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { | Re-fax this statement % } @@ -19,7 +21,8 @@ % } -% if ( $conf->exists('invoice_latex') ) { +% #if ( $conf->exists('invoice_latex') ) { +% if ( 0 ) { #broken??? View typeset statement

@@ -47,7 +50,7 @@ die "access denied" #untaint statement my($query) = $cgi->keywords; $query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; +my $templatename = $2 || 'statement'; #XXX configure... via event?? eh.. my $statementnum = $3; my $conf = new FS::Conf; -- cgit v1.2.1 From 4e70896aa834fe3cdd6c5dba9b0a186c572e1886 Mon Sep 17 00:00:00 2001 From: ivan Date: Sat, 22 Aug 2009 00:31:52 +0000 Subject: better label --- httemplate/view/cust_main/packages/status.html | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index f3b2faaf4..6667a554d 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -74,7 +74,13 @@ <% pkg_status_row_colspan( $cust_pkg, 'Not yet billed (one-time charge)', '', 'colspan'=>$colspan, %opt ) %> - <% pkg_status_row_if($cust_pkg, 'Start billing', 'start_date', %opt) %> + <% pkg_status_row_if( + $cust_pkg, + ( $part_pkg->freq ? 'Start billing' : 'Bill on' ), + 'start_date', + %opt + ) + %> > -- cgit v1.2.1 From 9ecb64360568b205334ae23e1051249cb56491b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 14 Sep 2009 23:52:01 +0000 Subject: ping tool, RT#5845 --- httemplate/view/cust_main/packages/services.html | 9 +++++++-- httemplate/view/svc_broadband.cgi | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/services.html b/httemplate/view/cust_main/packages/services.html index 37cd615eb..0fe7931d8 100644 --- a/httemplate/view/cust_main/packages/services.html +++ b/httemplate/view/cust_main/packages/services.html @@ -41,15 +41,20 @@ +% my $ip_addr = $cust_svc->svc_x->ip_addr; + +% if ( $part_svc->svcdb eq 'svc_broadband' ) { + ( <% include('/elements/popup_link-ping.html', 'ip'=> $ip_addr ) %> ) + +% } + % my $manage_link = $opt{'svc_broadband-manage_link'}; % if ( $manage_link && $part_svc->svcdb eq 'svc_broadband' ) { -% my $ip_addr = $cust_svc->svc_x->ip_addr; % my $svc_manage_link = eval(qq("$manage_link")); Manage Device ) % } - % if ( $curuser->access_right('Unprovision customer service') ) { ( <%svc_unprovision_link($cust_svc)%> ) % } diff --git a/httemplate/view/svc_broadband.cgi b/httemplate/view/svc_broadband.cgi index 0e9656b15..1463925b4 100644 --- a/httemplate/view/svc_broadband.cgi +++ b/httemplate/view/svc_broadband.cgi @@ -8,7 +8,9 @@ )) %> -Edit this information +<% include('/elements/init_overlib.html') %> + +Edit this information
<%ntable("#cccccc")%> @@ -42,7 +44,10 @@ % if ( $ip_addr ) { IP Address - <%$ip_addr%> + + <%$ip_addr%> + (<% include('/elements/popup_link-ping.html', 'ip'=>$ip_addr ) %>) + IP Netmask -- cgit v1.2.1 From 3de7395677b966be0bc1d44bc0b912ebb58564ec Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 18 Sep 2009 01:03:05 +0000 Subject: fix one-time charge inadvertantly checking the "tax exempt" checkbox when the tax product popup is swapped in and out, RT#6095 --- httemplate/view/cust_main/one_time_charge_link.html | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/one_time_charge_link.html b/httemplate/view/cust_main/one_time_charge_link.html index f6bb43490..4ce8a28a3 100644 --- a/httemplate/view/cust_main/one_time_charge_link.html +++ b/httemplate/view/cust_main/one_time_charge_link.html @@ -1,9 +1,11 @@ + + Delete this invoice +

+ +% } % if ( $cust_bill->owed > 0 % && scalar( grep $payby{$_}, qw(BILL CASH WEST MCRD) ) -% && $FS::CurrentUser::CurrentUser->access_right('Post payment') +% && $curuser->access_right('Post payment') % && ! $conf->exists('pkg-balances') % ) % { @@ -37,8 +58,7 @@ % } - -% if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { +% if ( $curuser->access_right('Resend invoices') ) { Re-print this invoice @@ -54,10 +74,9 @@ % } - % if ( $conf->exists('invoice_latex') ) { - View typeset invoice + View typeset invoice PDF

% } @@ -83,8 +102,10 @@ <% include('/elements/footer.html') %> <%init> +my $curuser = $FS::CurrentUser::CurrentUser; + die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); + unless $curuser->access_right('View invoices'); #untaint invnum my($query) = $cgi->keywords; @@ -105,7 +126,7 @@ my $cust_bill = qsearchs({ 'table' => 'cust_bill', 'addl_from' => 'LEFT JOIN cust_main USING ( custnum )', 'hashref' => { 'invnum' => $invnum }, - 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, + 'extra_sql' => ' AND '. $curuser->agentnums_sql, }); die "Invoice #$invnum not found!" unless $cust_bill; @@ -117,5 +138,3 @@ my $display_custnum = $cust_bill->cust_main->display_custnum; my $link = $templatename ? "$templatename-$invnum" : $invnum; - - diff --git a/httemplate/view/cust_main/payment_history.html b/httemplate/view/cust_main/payment_history.html index 0050daf9d..2ac3f2633 100644 --- a/httemplate/view/cust_main/payment_history.html +++ b/httemplate/view/cust_main/payment_history.html @@ -379,7 +379,7 @@ my %opt = ( qw( card_refund-days ) ), ( map { $_ => $conf->exists($_) } - qw( deletepayments deleterefunds pkg-balances ) + qw( deleteinvoices deletepayments deleterefunds pkg-balances ) ) ); diff --git a/httemplate/view/cust_main/payment_history/invoice.html b/httemplate/view/cust_main/payment_history/invoice.html index 39c67396e..c0d32df4d 100644 --- a/httemplate/view/cust_main/payment_history/invoice.html +++ b/httemplate/view/cust_main/payment_history/invoice.html @@ -1,9 +1,11 @@ -<% $link %><% $pre %>Invoice #<% $invnum %> -(Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '' : '' %><% $events %> +<% $link %><% $pre %>Invoice #<% $cust_bill->display_invnum %> +(Balance $ <% $cust_bill->owed %>)<% $post %><% $link ? '' : '' %><% $delete %><% $events %> <%init> my( $cust_bill, %opt ) = @_; +my $conf = new FS::Conf; + my $curuser = $FS::CurrentUser::CurrentUser; my($pre, $post) = ('', ''); @@ -18,6 +20,15 @@ my $link = $curuser->access_right('View invoices') ? qq!! : ''; +my $delete = ''; +if ( $opt{'deleteinvoices'} && $curuser->access_right('Delete invoices') ) { + $delete = qq! (delete)!; +} + my $events = ''; #1.9 if ( $cust_bill->num_cust_event @@ -26,8 +37,8 @@ if ( $cust_bill->num_cust_event ) ) { $events = - qq!
( View invoice events )'; + qq!
( View invoice events )'; } # -- cgit v1.2.1 From 7f46c75d39e2c888686f3d438604e7556ea00c26 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 5 Oct 2009 16:57:27 +0000 Subject: doh, fix error viewing voided payments, RT#6382 --- httemplate/view/cust_main/payment_history/voided_payment.html | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/payment_history/voided_payment.html b/httemplate/view/cust_main/payment_history/voided_payment.html index 4438613a5..610372721 100644 --- a/httemplate/view/cust_main/payment_history/voided_payment.html +++ b/httemplate/view/cust_main/payment_history/voided_payment.html @@ -11,12 +11,12 @@ my $payby = $cust_pay_void->payby; my $payinfo; if ( $payby eq 'CARD' ) { - $payinfo = $cust_pay->paymask; + $payinfo = $cust_pay_void->paymask; } elsif ( $payby eq 'CHEK' ) { - my( $account, $aba ) = split('@', $cust_pay->paymask ); + my( $account, $aba ) = split('@', $cust_pay_void->paymask ); $payinfo = "ABA $aba, Acct #$account"; } else { - $payinfo = $cust_pay->payinfo; + $payinfo = $cust_pay_void->payinfo; } $payby =~ s/^BILL$/Check #/ if $payinfo; -- cgit v1.2.1 From 06187016fd78ba41fb82846b9e8d461405f316b6 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Oct 2009 23:44:26 +0000 Subject: naming follow-up notices from the event rather than creting a slew of separate templates, RT#5217 --- httemplate/view/cust_bill-pdf.cgi | 22 +++++++++++++++++----- httemplate/view/cust_bill-ps.cgi | 21 ++++++++++++++++----- httemplate/view/cust_bill.cgi | 37 ++++++++++++++++++++++++------------- httemplate/view/cust_statement.html | 9 +++++---- 4 files changed, 62 insertions(+), 27 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_bill-pdf.cgi b/httemplate/view/cust_bill-pdf.cgi index f09e1b74d..51e47e00d 100755 --- a/httemplate/view/cust_bill-pdf.cgi +++ b/httemplate/view/cust_bill-pdf.cgi @@ -4,11 +4,23 @@ die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); -#untaint invnum +my( $invnum, $template, $notice_name ); my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)(.pdf)?$/; -my $templatename = $2; -my $invnum = $3; +if ( $query =~ /^((.+)-)?(\d+)(.pdf)?$/ ) { + $template = $2; + $invnum = $3; + $notice_name = 'Invoice'; +} else { + $invnum = $cgi->param('invnum'); + $invnum =~ s/\.pdf//i; + $template = $cgi->param('template'); + $notice_name = ( $cgi->param('notice_name') || 'Invoice' ); +} + +my %opt = ( + 'template' => $template, + 'notice_name' => $notice_name, +); my $cust_bill = qsearchs({ 'select' => 'cust_bill.*', @@ -19,7 +31,7 @@ my $cust_bill = qsearchs({ }); die "Invoice #$invnum not found!" unless $cust_bill; -my $pdf = $cust_bill->print_pdf( '', $templatename); +my $pdf = $cust_bill->print_pdf(\%opt); http_header('Content-Type' => 'application/pdf' ); http_header('Content-Length' => length($pdf) ); diff --git a/httemplate/view/cust_bill-ps.cgi b/httemplate/view/cust_bill-ps.cgi index 5313dbf02..881491f69 100755 --- a/httemplate/view/cust_bill-ps.cgi +++ b/httemplate/view/cust_bill-ps.cgi @@ -1,14 +1,25 @@ -<% $cust_bill->print_ps( '', $templatename) %> +<% $cust_bill->print_ps(\%opt) %> <%init> die "access denied" unless $FS::CurrentUser::CurrentUser->access_right('View invoices'); -#untaint invnum +my( $invnum, $template, $notice_name ); my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; -my $invnum = $3; +if ( $query =~ /^((.+)-)?(\d+)(.pdf)?$/ ) { + $template = $2; + $invnum = $3; + $notice_name = 'Invoice'; +} else { + $invnum = $cgi->param('invnum'); + $template = $cgi->param('template'); + $notice_name = ( $cgi->param('notice_name') || 'Invoice' ); +} + +my %opt = ( + 'template' => $template, + 'notice_name' => $notice_name, +); my $cust_bill = qsearchs({ 'select' => 'cust_bill.*', diff --git a/httemplate/view/cust_bill.cgi b/httemplate/view/cust_bill.cgi index 5540221d9..ce8d96a95 100755 --- a/httemplate/view/cust_bill.cgi +++ b/httemplate/view/cust_bill.cgi @@ -60,14 +60,14 @@ % if ( $curuser->access_right('Resend invoices') ) { - Re-print this invoice + Re-print this invoice % if ( grep { $_ ne 'POST' } $cust_bill->cust_main->invoicing_list ) { - | Re-email this invoice + | Re-email this invoice % } % if ( $conf->exists('hylafax') && length($cust_bill->cust_main->fax) ) { - | Re-fax this invoice + | Re-fax this invoice % }

@@ -76,7 +76,7 @@ % if ( $conf->exists('invoice_latex') ) { - View typeset invoice PDF + View typeset invoice PDF

% } @@ -92,11 +92,9 @@ <% $br ? '

' : '' %> % if ( $conf->exists('invoice_html') ) { - - <% join('', $cust_bill->print_html('', $templatename) ) %> + <% join('', $cust_bill->print_html(\%opt) ) %> % } else { - -
<% join('', $cust_bill->print_text('', $templatename) ) %>
+
<% join('', $cust_bill->print_text(\%opt) ) %>
% } <% include('/elements/footer.html') %> @@ -107,11 +105,22 @@ my $curuser = $FS::CurrentUser::CurrentUser; die "access denied" unless $curuser->access_right('View invoices'); -#untaint invnum +my( $invnum, $template, $notice_name ); my($query) = $cgi->keywords; -$query =~ /^((.+)-)?(\d+)$/; -my $templatename = $2; -my $invnum = $3; +if ( $query =~ /^((.+)-)?(\d+)$/ ) { + $template = $2; + $invnum = $3; + $notice_name = 'Invoice'; +} else { + $invnum = $cgi->param('invnum'); + $template = $cgi->param('template'); + $notice_name = $cgi->param('notice_name'); +} + +my %opt = ( + 'template' => $template, + 'notice_name' => $notice_name, +); my $conf = new FS::Conf; @@ -135,6 +144,8 @@ my $display_custnum = $cust_bill->cust_main->display_custnum; #my $printed = $cust_bill->printed; -my $link = $templatename ? "$templatename-$invnum" : $invnum; +my $link = "invnum=$invnum"; +$link .= ';template='. uri_escape($template) if $template; +$link .= ';notice_name='. $notice_name if $notice_name; diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index b078c9d07..74c80d3bc 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -4,16 +4,16 @@ % if ( $FS::CurrentUser::CurrentUser->access_right('Resend invoices') ) { -%# Re-print this statement +%# Re-print this statement % if ( grep { $_ ne 'POST' } $cust_statement->cust_main->invoicing_list ) { %# | - Re-email this statement + Re-email this statement % } % if ( 0 ) { % #if ( $conf->exists('hylafax') && length($cust_statement->cust_main->fax) ) { - | Re-fax this statement + | Re-fax this statement % }

@@ -73,6 +73,7 @@ die "Statement #$statementnum not found!" unless $cust_statement; my $custnum = $cust_statement->custnum; my $display_custnum = $cust_statement->cust_main->display_custnum; -my $link = $templatename ? "$templatename-$statementnum" : $statementnum; +my $link = "statementnum=$statementnum"; +$link .= ';template='. uri_escape($templatename) if $templatename; -- cgit v1.2.1 From eae101004801019c942e9dfccbea50a8165f5d6d Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 7 Oct 2009 23:51:33 +0000 Subject: naming follow-up notices from the event rather than creting a slew of separate templates, RT#5217 --- httemplate/view/cust_statement.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_statement.html b/httemplate/view/cust_statement.html index 74c80d3bc..3e1345ed5 100755 --- a/httemplate/view/cust_statement.html +++ b/httemplate/view/cust_statement.html @@ -24,7 +24,7 @@ % #if ( $conf->exists('invoice_latex') ) { % if ( 0 ) { #broken??? - View typeset statement + View typeset statement

% } -- cgit v1.2.1 From 3e13bcbded0bf2ce65d8fac4670ee18ecb9e371b Mon Sep 17 00:00:00 2001 From: ivan Date: Thu, 8 Oct 2009 08:28:37 +0000 Subject: fix "show old packages" accidentally hiding cancelled packages, RT#5276 --- httemplate/view/cust_main/packages.html | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 16adc8c5f..17a06911a 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -39,15 +39,14 @@ Current packages % ) % ) % { +% my $prev = $cgi->param('showcancelledpackages'); % $cgi->param('showcancelledpackages', 1); -% - ( show +% $cgi->param('showcancelledpackages', $prev); % } else { % $cgi->param('showcancelledpackages', 0); -% - ( hide +% $cgi->param('showcancelledpackages', 1); % } cancelled packages ) -- cgit v1.2.1