X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=httemplate%2Fview%2Fcust_main%2Fpackages.html;h=5fde2f39229fe3867f56d8050504d391f18dc668;hp=5f1db4ab640d0b12c169100faf6619df6004cf5f;hb=2b8ffc98529637ffddfe7cbf6b4f9b8deb90f0fa;hpb=619b9c20b1c2c76d439284bd6d023e5d5d9dbc7d diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html index 5f1db4ab6..5fde2f392 100755 --- a/httemplate/view/cust_main/packages.html +++ b/httemplate/view/cust_main/packages.html @@ -123,7 +123,6 @@ Current packages % } % if ( @$packages ) { - <% include('/elements/table-grid.html') %> % my $bgcolor1 = '#eeeeee'; % my $bgcolor2 = '#ffffff'; @@ -132,444 +131,40 @@ Current packages Package Status + Location Services -%foreach my $cust_pkg (@$packages) { -% -% my $part_pkg = $cust_pkg->part_pkg; +% foreach my $cust_pkg (@$packages) { % -% if ( $bgcolor eq $bgcolor1 ) { -% $bgcolor = $bgcolor2; -% } else { -% $bgcolor = $bgcolor1; -% } - - - - - - - - - - - -% if ( $cust_pkg->quantity > 1 ) { - - - +% if ( $bgcolor eq $bgcolor1 ) { +% $bgcolor = $bgcolor2; +% } else { +% $bgcolor = $bgcolor1; % } - - - - - -% my $editi = $curuser->access_right('Edit customer package invoice details'); -% my $editc = $curuser->access_right('Edit customer package comments'); % -% if ( $cust_pkg->cust_pkg_detail('I') || $cust_pkg->cust_pkg_detail('C') -% || $editi || $editc ) { -% -% my $editlink = $p. 'edit/cust_pkg_detail?pkgnum='. $cust_pkg->pkgnum. -% ';detailtype='; - - - -% if ( $cust_pkg->cust_pkg_detail('I') ) { - - - -% foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('I') ) { - - - -% } -
- <% $curuser->option('show_pkgnum') ? $cust_pkg->pkgnum.': ' : '' %><% $part_pkg->pkg %> - - - <% $part_pkg->comment %> -
-       Quantity: - <% $cust_pkg->quantity %> -
- - - -% unless ( $cust_pkg->get('cancel') ) { -% my $br = 0; -% if ( $curuser->access_right('Change customer package') ) { $br=1; - - ( <%pkg_change_link($cust_pkg)%> ) -% } -% if ( $curuser->access_right('Edit customer package dates') ) { $br=1; - - ( <%pkg_dates_link($cust_pkg)%> ) -% } -% if ( $curuser->access_right('Customize customer package') ) { $br=1; - - ( <%pkg_customize_link($cust_pkg,$cust_main->custnum)%> ) -% } - <% $br ? '
' : '' %> -% } - -% if ( $cust_pkg->num_cust_event -% && ( $curuser->access_right('Billing event reports') -% || $curuser->access_right('View customer billing events') -% ) -% ) { - ( <%pkg_event_link($cust_pkg)%> ) -% } - -
- -
- <% include('/elements/table-grid.html') %> -
- - Invoice details -% if ( $editi && ! $cust_pkg->get('cancel') ) { - (<% include('/elements/popup_link.html', { - 'action' => $editlink. 'I', - 'label' => 'edit', - 'actionlabel' => 'Edit invoice details', - 'color' => '#333399', - 'width' => 763, - }) - %>) -% } - -
 - <% $cust_pkg_detail->detail |h %>
- -% } else { - -% if ( $editi && ! $cust_pkg->get('cancel') ) { - - ( <% include('/elements/popup_link.html', { - 'action' => $editlink. 'I', - 'label' => 'Add invoice details', - 'actionlabel' => 'Add invoice details', - 'color' => '#333399', - 'width' => 763, - }) - %> ) - -% } - -% } - -% if ( $cust_pkg->cust_pkg_detail('C') ) { - - <% include('/elements/table-grid.html') %> - - - - Comments -% if ( $editc ) { - (<% include('/elements/popup_link.html', { - 'action' => $editlink. 'C', - 'label' => 'edit', - 'actionlabel' => 'Edit comments', - 'color' => '#333399', - 'width' => 763, - }) - %>) -% } - - - -% foreach my $cust_pkg_detail ( $cust_pkg->cust_pkg_detail('C') ) { - -  - <% $cust_pkg_detail->detail |h %> - -% } - - -% } else { - -% if ( $editc ) { - - ( <% include('/elements/popup_link.html', { - 'action' => $editlink. 'C', - 'label' => 'Add comments', - 'actionlabel' => 'Add comments', - 'color' => '#333399', - 'width' => 763, - }) - %> ) - -% } - -% } - - -% } - - - - - - - -% -% sub myfreq { -% my $part_pkg = shift; -% my $freq = $part_pkg->freq_pretty; -% $freq =~ s/ / /g; -% $freq; -% } -% -% #this should use cust_pkg->status and cust_pkg->statuscolor eventually -% #my $colspan = $conf->exists('cust_pkg-display_times') ? 8 : 4; -% #my $width = $conf->exists('cust_pkg-display_times') ? '38%' : '56%'; -% -% #false laziness w/edit/REAL_cust_pkg.cgi -% my( $billed_or_prepaid, $last_bill_or_renewed, $next_bill_or_prepaid_until ); -% unless ( $part_pkg->is_prepaid ) { -% $billed_or_prepaid = 'billed'; -% $last_bill_or_renewed = 'Last bill'; -% $next_bill_or_prepaid_until = 'Next bill'; -% } else { -% $billed_or_prepaid = 'prepaid'; -% $last_bill_or_renewed = 'Renewed'; -% $next_bill_or_prepaid_until = 'Prepaid until'; -% } -% -% -% if ( $cust_pkg->get('cancel') ) { #status: cancelled -% my $cpr = $cust_pkg->last_cust_pkg_reason('cancel'); - - <% pkg_status_row($cust_pkg, 'Cancelled', 'cancel', 'color'=>'FF0000', conf=>$conf ) %> - - <% pkg_status_row_colspan( - ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', - 'align' => 'right', 'color' => 'ff0000', 'size' => '-2', - ) - %> - -% unless ( $cust_pkg->get('setup') ) { - - <% pkg_status_row_colspan('Never billed') %> - -% } else { - - <% pkg_status_row( $cust_pkg, 'Setup', 'setup', conf=>$conf ) %> - <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %> - <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %> - <% pkg_status_row_if( $cust_pkg, 'Suspended', 'susp', conf=>$conf, curuser=>$curuser ) %> - -% } -% -% } else { -% -% if ( $cust_pkg->get('susp') ) { #status: suspended -% my $cpr = $cust_pkg->last_cust_pkg_reason('susp'); - - <% pkg_status_row( $cust_pkg, 'Suspended', 'susp', 'color'=>'FF9900', conf=>$conf ) %> - - <% pkg_status_row_colspan( - ( $cpr ? $cpr->reasontext. ' by '. $cpr->otaker : '' ), '', - 'align' => 'right', 'color' => 'FF9900', 'size' => '-2', - ) - %> - -% unless ( $cust_pkg->get('setup') ) { - <% pkg_status_row_colspan('Never billed') %> -% } else { - <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf ) %> -% } - - <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %> - <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %> -% # pkg_status_row($cust_pkg, 'Next bill', 'bill', conf=>$conf) - <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf, curuser=>$curuser ) %> +% my %iopt = ( +% 'bgcolor' => $bgcolor, +% 'cust_pkg' => $cust_pkg, +% 'part_pkg' => $cust_pkg->part_pkg, +% ); + - + <% include('packages/package.html', %iopt) %> + <% include('packages/status.html', %iopt) %> + <% include('packages/location.html', %iopt) %> + <% include('packages/services.html', %iopt) %> -% } else { #status: active -% -% unless ( $cust_pkg->get('setup') ) { #not setup -% -% unless ( $part_pkg->freq ) { - - <% pkg_status_row_colspan('Not yet billed (one-time charge)') %> - - - - - -% } else { - - <% pkg_status_row_colspan("Not yet billed ($billed_or_prepaid ". myfreq($part_pkg). ')' ) %> - -% } -% -% } else { #setup -% -% unless ( $part_pkg->freq ) { - - <% pkg_status_row_colspan('One-time charge') %> - - <% pkg_status_row($cust_pkg, 'Billed', 'setup', conf=>$conf) %> - -% } else { -% -% if (scalar($cust_pkg->overlimit)) { - - <% pkg_status_row_colspan( - 'Overlimit', - $billed_or_prepaid. ' '. myfreq($part_pkg), - 'color' => 'FFD000', - ) - %> - -% } else { - <% pkg_status_row_colspan( - 'Active', - $billed_or_prepaid. ' '. myfreq($part_pkg), - 'color' => '00CC00', - ) - %> -% } - - <% pkg_status_row($cust_pkg, 'Setup', 'setup', conf=>$conf) %> - -% } -% -% } -% my $autosuspend = pkg_autosuspend_time( $cust_pkg ); -% $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend; - - <% pkg_status_row_changed( $cust_pkg, conf=>$conf ) %> - <% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', conf=>$conf, curuser=>$curuser ) %> - <% pkg_status_row_if( $cust_pkg, $next_bill_or_prepaid_until, 'bill', conf=>$conf, curuser=>$curuser ) %> - <% pkg_status_row_if($cust_pkg, 'Will automatically suspend by', 'autosuspend', conf=>$conf) %> - <% pkg_status_row_if( $cust_pkg, 'Will suspend on', 'adjourn', conf=>$conf, curuser=>$curuser ) %> - <% pkg_status_row_if( $cust_pkg, 'Expires', 'expire', conf=>$conf, curuser=>$curuser ) %> - -% if ( $part_pkg->freq ) { - - - - -% } -% -% } -% } - -
> - -% if ( $curuser->access_right('Unsuspend customer package') ) { - ( <% pkg_unsuspend_link($cust_pkg) %> ) -% } -% if ( $curuser->access_right('Cancel customer package immediately') ) { - ( <% pkg_cancel_link($cust_pkg) %> ) -% } - -
> - -% if ( $curuser->access_right('Cancel customer package immediately') ) { - ( <% pkg_cancel_link($cust_pkg) %> ) -% } - -
> - -% if ( $curuser->access_right('Suspend customer package') ) { - ( <% pkg_suspend_link($cust_pkg) %> ) -% } -% if ( $curuser->access_right('Suspend customer package later') ) { - ( <% pkg_adjourn_link($cust_pkg) %> ) -% } -% if ( $curuser->access_right('Delay suspension events') ) { - ( <% pkg_delay_link($cust_pkg) %> ) -% } -% if ( $curuser->access_right('Cancel customer package immediately') ) { - ( <% pkg_cancel_link($cust_pkg) %> ) -% } -% if ( $curuser->access_right('Cancel customer package later') ) { - ( <% pkg_expire_link($cust_pkg) %> ) -% } - - -
- - - - - -% #foreach my $svcpart (sort {$a->{svcpart} <=> $b->{svcpart}} @{$pkg->{svcparts}}) { -% foreach my $part_svc ( $cust_pkg->part_svc ) { - -% #foreach my $service (@{$svcpart->{services}}) { -% foreach my $cust_svc ( @{ $part_svc->cust_pkg_svc } ) { - - - - - - - - - - - - - - - - -% } - -% if ( ! $cust_pkg->get('cancel') -% && $curuser->access_right('Provision customer service') -% && $part_svc->num_avail -% ) { - - - - - -% } - -% } - -
<% FS::UI::Web::svc_link($m, $part_svc, $cust_svc) %><% FS::UI::Web::svc_label_link($m, $part_svc, $cust_svc) %><% FS::UI::Web::svc_export_links($m, $part_svc, $cust_svc) %>
- - <% $cust_svc->overlimit ? "Overlimit: ". time2str('%b %o %Y' . ($conf->exists('cust_pkg-display_times') ? ' %l:%M %P' : ''), $cust_svc->overlimit) : '' %> -
- -% if ( $curuser->access_right('Recharge customer service') -% && $part_svc->svcdb eq 'svc_acct' -% && ( $cust_svc->svc_x->seconds ne '' -% || $cust_svc->svc_x->upbytes ne '' -% || $cust_svc->svc_x->downbytes ne '' -% || $cust_svc->svc_x->totalbytes ne '' -% ) -% ) { - ( <%svc_recharge_link($cust_svc)%> ) -% } - - -% if ( $curuser->access_right('Unprovision customer service') ) { - ( <%svc_unprovision_link($cust_svc)%> ) -% } -
- <% svc_provision_link($cust_pkg, $part_svc, $conf, $curuser) %> -
- -% } #end display packages -% - +% } -% } else { +% } else {
% } + % if ( $cgi->param('fragment') =~ /^cust_pkg(\d+)$/ ) {